/* Pomodoro — flat, soft color timer */
/* colour tokens live in theme.css (loaded before this file) */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.4;
  color: var(--on);
  background-color: var(--bg);
  transition: background-color .5s ease-in-out;
  -webkit-font-smoothing: antialiased;
}

svg { display: block; }
button { font: inherit; color: inherit; }
p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  background: var(--on); color: var(--bg); padding: 8px 14px; border-radius: 4px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--on); outline-offset: 2px; border-radius: 4px; }
kbd { font-family: inherit; font-size: .9em; padding: 0 5px; border-radius: 3px; background: rgb(var(--on-rgb) / .16); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 12px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--on); text-decoration: none;
  font-family: var(--font); font-weight: 700; font-size: 20px;
  min-height: 40px;
}
.brand-mark { width: 22px; height: 22px; color: var(--on); }

.topnav { display: flex; gap: 10px; align-items: center; }
.hbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 34px; min-width: 70px; padding: 0 12px;
  background: var(--white-20); border: 0; border-radius: 4px;
  color: var(--on); font-size: 13px; text-decoration: none;
  cursor: pointer; opacity: .9;
  transition: opacity .15s, transform .1s;
}
.hbtn:hover { opacity: 1; }
.hbtn[hidden] { display: none; }
.hbtn:active { transform: translateY(2px); }
.hbtn[aria-current="page"] { background: rgb(var(--on-rgb) / .32); opacity: 1; }
.hbtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* header line doubles as a progress bar */
.line { height: 1px; background: rgb(var(--shade-rgb) / .1); margin-bottom: 40px; }
.line-fill {
  display: block; height: 3px; width: 0; transform: translateY(-1px);
  background: var(--on); border-radius: 100px;
  transition: width 1s linear;
}
.line-fill.no-anim { transition: none; }

.main { max-width: 480px; margin: 0 auto; padding-bottom: 60px; }

/* ---------- timer card ---------- */
.card {
  background: var(--card);
  border-radius: 6px;
  padding: 20px 0 30px;
  text-align: center;
}
.modes { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; padding: 0 8px; }
.mode {
  border: 0; background: none; cursor: pointer;
  padding: 2px 12px; min-height: 28px;
  border-radius: 4px;
  color: var(--on); font-size: 16px;
  transition: background-color .15s;
}
.mode:hover { background: rgb(var(--shade-rgb) / .06); }
.mode[aria-selected="true"] { background: rgb(var(--shade-rgb) / .15); font-weight: 700; }

.clock {
  display: block;
  margin-top: 20px;
  font-family: var(--font);
  font-size: clamp(80px, 25vw, 120px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.controls { position: relative; display: flex; justify-content: center; margin-top: 20px; }
.start {
  width: 200px; height: 55px;
  border: 0; border-radius: 4px;
  background: var(--on); color: var(--bg);
  font-family: var(--font); font-size: 22px; font-weight: 700; text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--on-press) 0 6px 0;
  transition: color .5s ease-in-out, box-shadow .1s, transform .1s;
}
.start.is-down { transform: translateY(6px); box-shadow: none; }
.skip {
  position: absolute; left: calc(50% + 116px); top: 50%; transform: translateY(-40%);
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--on); opacity: .9;
}
.skip:hover { opacity: 1; }
.skip svg { width: 26px; height: 26px; fill: currentColor; }
.skip[hidden] { display: none; }

/* counter */
.counter { text-align: center; margin: 20px 0 20px; }
.count { color: rgb(var(--on-rgb) / .6); font-size: 16px; }
.message { font-size: 18px; margin-top: 4px; overflow-wrap: anywhere; }

/* ---------- tasks ---------- */
.tasks-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 20px;
  border-bottom: 2px solid rgb(var(--on-rgb) / .6);
}
.tasks-head h2 { margin: 0; font-family: var(--font); font-size: 18px; }
.menu-wrap { position: relative; }
.kebab {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--white-20); border: 0; border-radius: 4px; cursor: pointer; opacity: .9;
}
.kebab:hover { opacity: 1; }
.kebab svg { width: 18px; height: 18px; fill: var(--on); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5;
  min-width: 200px; padding: 4px 0;
  background: var(--surface); border-radius: 6px;
  box-shadow: 0 10px 20px rgb(var(--shade-rgb) / .15), 0 3px 6px rgb(var(--shade-rgb) / .1);
}
.menu[hidden] { display: none; }
.menu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px; background: none; border: 0; cursor: pointer;
  color: var(--on); font-size: 14px; text-align: left;
}
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline: none; }
.menu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task-list:not(:empty) { margin-bottom: 12px; }
.task {
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 0 10px 0 12px;
  background: rgb(var(--on-rgb) / .12); color: var(--on);
  border-radius: 4px; border-left: 6px solid transparent;
  box-shadow: rgb(var(--shade-rgb) / .1) 0 2px 2px;
  transition: border-color .15s;
}
.task:hover { border-left-color: rgb(var(--on-rgb) / .4); }
.task.active { border-left-color: var(--ink-strong); }
.task-check {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.task-check svg { width: 24px; height: 24px; }
.task-check circle { fill: rgb(var(--on-rgb) / .28); transition: fill .15s; }
.task-check:hover circle { fill: rgb(var(--on-rgb) / .45); }
.task.done .task-check circle { fill: var(--on); }
.task.done .task-check path { stroke: var(--bg); }
.task-text {
  flex: 1; min-width: 0; min-height: 44px; text-align: left;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink); font-weight: 700; font-size: 16px;
  overflow-wrap: anywhere;
}
.task.done .task-text { text-decoration: line-through; color: var(--muted); }
.task-del {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer; color: var(--muted);
}
.task-del:hover { color: var(--ink); border-color: var(--line-light); }
.task-del svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.task-form { background: var(--surface); border-radius: 8px; overflow: hidden; box-shadow: rgb(var(--shade-rgb) / .15) 0 10px 20px, rgb(var(--shade-rgb) / .1) 0 3px 6px; }
.task-form[hidden] { display: none; }
.task-form-body { padding: 26px 20px 30px; }
.task-form input {
  width: 100%; border: 0; padding: 4px 0; background: none;
  color: var(--ink); font-family: var(--font-ui); font-size: 22px; font-weight: 700;
}
.task-form input::placeholder { color: rgb(var(--on-rgb) / .45); font-style: italic; font-weight: 700; }
.task-form input:focus { outline: none; }
.task-form-foot { display: flex; justify-content: flex-end; gap: 14px; padding: 14px 20px; background: var(--band); }

.add-task {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 64px;
  background: rgb(var(--shade-rgb) / .1);
  border: 2px dashed rgb(var(--on-rgb) / .4); border-radius: 8px;
  color: var(--on); font-family: var(--font); font-size: 16px; font-weight: 700;
  cursor: pointer; opacity: .8;
  transition: opacity .15s;
}
.add-task:hover { opacity: 1; }
.add-task[hidden] { display: none; }
.add-task svg { width: 20px; height: 20px; }

/* ---------- buttons on tinted surfaces ---------- */
.btn-dark, .btn-text, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border-radius: 4px; font-size: 14px; font-weight: 700;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: opacity .15s, background-color .15s, transform .1s;
}
.btn-dark { background: var(--primary); color: var(--on); border: 2px solid transparent; box-shadow: rgb(var(--shade-rgb) / .25) 0 2px 3px; }
.btn-dark:hover { background: color-mix(in srgb, var(--primary) 85%, var(--on)); }
.btn-text { background: none; border: 0; color: var(--muted); }
.btn-text:hover { color: var(--on); }
.btn { background: rgb(var(--on-rgb) / .1); color: var(--on); border: 1px solid var(--line-light); box-shadow: rgb(var(--shade-rgb) / .12) 0 2px 0; }
.btn:hover { background: rgb(var(--on-rgb) / .18); }
.btn-default { background: var(--primary); color: var(--on); border-color: transparent; }
.btn-default:hover { background: color-mix(in srgb, var(--primary) 85%, var(--on)); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(255, 120, 100, .16); border-color: rgba(255, 196, 184, .5); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
:is(.btn-dark, .btn):active { transform: translateY(1px); }
:is(.btn-dark, .btn)[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
:is(.btn-dark, .btn).loading { cursor: progress; opacity: .7; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.spinner {
  display: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modals ---------- */
.modal {
  width: min(100% - 24px, 400px);
  padding: 0; border: 0; border-radius: 8px;
  background: var(--surface); color: var(--ink);
  box-shadow: rgb(var(--shade-rgb) / .35) 0 16px 40px, rgb(var(--shade-rgb) / .2) 0 3px 8px;
  overflow: hidden;
}
.modal::backdrop { background: rgb(var(--shade-rgb) / .45); }
.modal[open] { animation: modal-in .2s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(-10px); } }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 10px 10px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; color: var(--muted); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.modal-body { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.modal-sub { color: var(--muted); font-size: 14px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 20px; background: var(--band); }
.modal-section { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-section:first-of-type { border-top: 0; padding-top: 0; }
.modal-section > .btn { align-self: flex-start; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  background: none; border: 0; border-radius: 4px;
  cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--on); background: var(--hover); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { color: var(--ink); font-size: 14px; font-weight: 700; }
.field input {
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 6px; background: var(--field);
  color: var(--on); font-size: 16px;
  transition: box-shadow .15s, background-color .15s;
}
.field input:focus { outline: none; background: var(--field-focus); box-shadow: 0 0 0 2px var(--focus); }
.field input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--warn); background: rgba(255, 220, 143, .12); }
.field ::placeholder { color: rgb(var(--on-rgb) / .45); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.pw-toggle[aria-pressed="true"] { color: var(--ink); }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.form-error { min-height: 1.3em; color: var(--warn); font-size: 14px; }
.form-error:empty { min-height: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--ink-strong); cursor: pointer; }
.check input:disabled, .check input:disabled + span { cursor: not-allowed; opacity: .5; }
.check span { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; line-height: 1.3; }

/* ---------- signed-in pages ---------- */
.page { max-width: 620px; margin: 0 auto; padding-bottom: 60px; display: flex; flex-direction: column; gap: 16px; }
.home-tabs { justify-content: flex-start; padding: 0; }
.panel {
  display: flex; align-items: center; justify-content: center;
  min-height: 360px; padding: 32px 20px;
  background: var(--card); border-radius: 8px;
  color: var(--on);
}
.panel[hidden] { display: none; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; max-width: 320px; }
.empty-icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px;
  border-radius: 50%; background: rgb(var(--shade-rgb) / .1); border: 2px dashed rgb(var(--on-rgb) / .35);
}
.empty-icon svg { width: 28px; height: 28px; fill: none; stroke: rgb(var(--on-rgb) / .85); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty-title { font-family: var(--font); font-weight: 700; font-size: 18px; }
.empty-sub { color: rgb(var(--on-rgb) / .75); font-size: 15px; }
.page-title { margin: 0; font-family: var(--font); font-size: 22px; }

.group {
  background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 20px;
  box-shadow: rgb(var(--shade-rgb) / .25) 0 10px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.group[hidden] { display: none; }
.group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.group-head h2 { margin: 0; color: var(--muted); font-size: 15px; text-transform: uppercase; letter-spacing: .02em; }
.group-head p { margin-top: 4px; }
.muted { color: var(--muted); font-size: 15px; }
.muted strong { color: var(--ink); }
.sub-title { margin: 0; font-size: 15px; color: var(--ink); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > .btn { align-self: flex-start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: rgb(var(--on-rgb) / .18); color: var(--on);
}
.badge[hidden] { display: none; }
.badge-quiet { background: rgb(var(--shade-rgb) / .22); color: var(--muted); }
.badge-warn { background: rgba(255, 220, 143, .2); color: var(--warn); }

.user-list { list-style: none; margin: 0; padding: 0; }
.user-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.user-row:first-child { border-top: 0; padding-top: 0; }
.user-row.is-disabled .avatar, .user-row.is-disabled .user-meta { opacity: .5; }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); color: var(--on); font-weight: 700; font-size: 14px;
  transition: background-color .5s;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub { color: var(--muted); font-size: 13px; }
.user-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.danger-row { display: flex; gap: 8px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  max-width: calc(100% - 32px);
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 6px;
  background: var(--primary); color: var(--on); font-size: 14px; font-weight: 700;
  box-shadow: 0 10px 24px rgb(var(--shade-rgb) / .3);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- board (/home) ---------- */
.container-wide { max-width: 1280px; padding: 0 24px; }
.board { padding-bottom: 60px; display: flex; flex-direction: column; gap: 16px; }
.board-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.home-tabs { flex-wrap: wrap; }
.board-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tab-count:not(:empty) {
  display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px;
  border-radius: 10px; background: rgb(var(--on-rgb) / .22);
  font-size: 12px; font-weight: 700; line-height: 18px; text-align: center;
}
.round-btn {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  transition: transform .1s, box-shadow .1s, color .5s, background-color .15s;
}
.round-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.round-btn:focus-visible { outline: 3px solid var(--on); outline-offset: 3px; }
.add-note-btn { background: var(--on); color: var(--bg); box-shadow: var(--on-press) 0 4px 0, 0 8px 18px -6px rgb(var(--shade-rgb) / .35); }
.add-note-btn:hover { transform: translateY(-1px); }
.add-note-btn:active { transform: translateY(4px); box-shadow: none; }
.round-btn-ghost { width: 44px; height: 44px; background: rgb(var(--on-rgb) / .14); color: var(--on); }
.round-btn-ghost svg { width: 20px; height: 20px; stroke-width: 2.2; }
.round-btn-ghost:hover { background: rgb(var(--on-rgb) / .24); }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.filter-fields { display: contents; }
.filter-search { position: relative; flex: 1 1 220px; }
.filter-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: rgb(var(--on-rgb) / .8); stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
.filter-search input, .filter-select select {
  width: 100%; min-height: 40px; border: 0; border-radius: 6px;
  background: rgb(var(--shade-rgb) / .14); color: var(--on); font: inherit; font-size: 15px;
}
.filter-search input { padding: 0 12px 0 38px; }
.filter-search input::placeholder { color: rgb(var(--on-rgb) / .7); }
.filter-select { display: flex; flex-direction: column; gap: 3px; flex: 0 1 150px; min-width: 120px; }
.filter-select > span { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-select select { padding: 0 10px; cursor: pointer; }
.filter-select.is-set select { background: rgb(var(--on-rgb) / .26); }
.filter-search input:focus, .filter-select select:focus { outline: 2px solid var(--on); outline-offset: 1px; }
.filter-clear {
  min-height: 40px; padding: 0 12px; border: 0; border-radius: 6px; cursor: pointer;
  background: none; color: var(--on); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}

.notes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 30px 26px; padding: 14px 4px 8px;
}

/* sticky notes; colour comes from the board's "card colour" choice column */
.note {
  --paper: #fff59d; --ink-note: #3d3519; --tilt: -1deg;
  --shadow: 0 1px 1px rgb(var(--shade-rgb) / .1), 0 12px 18px -10px rgb(var(--shade-rgb) / .45), inset 0 -18px 22px -18px rgb(var(--shade-rgb) / .12);
  position: relative; isolation: isolate; display: flex;
  min-height: 210px;
  border-radius: 2px 2px 3px 18px / 2px 2px 3px 6px;
  background: linear-gradient(180deg, rgb(var(--shade-rgb) / .05), rgb(var(--shade-rgb) / 0) 34px), var(--paper);
  color: var(--ink-note);
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt));
  transition: transform .18s var(--ease);
}
.note:nth-child(3n+2) { --tilt: .8deg; }
.note:nth-child(3n) { --tilt: -.4deg; }
.note:nth-child(5n+4) { --tilt: 1.3deg; }
.note::before { /* tape */
  content: ""; position: absolute; top: -10px; left: 50%; width: 84px; height: 24px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgb(var(--on-rgb) / .45); border: 1px solid rgb(var(--on-rgb) / .35);
  box-shadow: 0 1px 2px rgb(var(--shade-rgb) / .12);
}
/* The lifted shadow is painted once on ::after and fades in. Hover then animates only transform and
   opacity, which the compositor runs with no repaint per frame. A box-shadow transition repaints each
   frame, and a scroll moves the pointer across many notes. */
.note::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  box-shadow: 0 20px 26px -12px rgb(var(--shade-rgb) / .5);
  opacity: 0; transition: opacity .18s var(--ease);
}
.note:hover, .note:focus-within {
  transform: rotate(0deg) translateY(-4px) scale(1.02);
  z-index: 1;
}
.note:hover::after, .note:focus-within::after { opacity: 1; }
.note-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 26px 18px 14px; border: 0; border-radius: inherit;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.note-open:focus-visible { outline: 3px solid var(--on); outline-offset: 4px; }
.note-mark {
  position: absolute; top: 6px; right: 6px; z-index: 1;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 2px solid color-mix(in srgb, var(--ink-note) 40%, transparent); border-radius: 50%;
  background: rgb(var(--on-rgb) / .35); color: transparent; cursor: pointer;
  opacity: 0; transition: opacity .15s, background-color .15s, color .15s;
}
.note-mark svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.note:hover .note-mark, .note:focus-within .note-mark, .note-mark[aria-pressed="true"] { opacity: 1; }
.note-mark:hover { color: color-mix(in srgb, var(--ink-note) 55%, transparent); }
.note-mark:focus-visible { outline: 3px solid var(--on); outline-offset: 2px; }
.note-mark[aria-pressed="true"] { background: var(--ink-note); border-color: var(--ink-note); color: var(--paper); }
.note.is-marked { box-shadow: 0 0 0 4px var(--on), var(--shadow); }
[data-color="yellow"] { --paper: #fff59d; --ink-note: #3d3519; --accent: #f2d94e; }
[data-color="green"] { --paper: #ccebb0; --ink-note: #233d14; --accent: #8cc964; }
[data-color="orange"] { --paper: #ffd8a8; --ink-note: #4a2e0c; --accent: #f0a24b; }
[data-color="pink"] { --paper: #f8c7d6; --ink-note: #4d1a2b; --accent: #e58aa6; }
[data-color="purple"] { --paper: #e3d4f5; --ink-note: #33224d; --accent: #a98bd6; }
[data-color="blue"] { --paper: #cfe5f7; --ink-note: #15324a; --accent: #6fa8d6; }
[data-color="grey"] { --paper: #e2e4e6; --ink-note: #3a3f44; --accent: #b6bbc0; }
.note.is-archived { --paper: #e2e4e6; --ink-note: #4a4f54; opacity: .85; }
.note-item {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-family: "Segoe Print", "Bradley Hand", "Marker Felt", "Comic Sans MS", cursive;
  font-size: 17px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere;
}
.note-desc {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; line-height: 1.45; opacity: .85; overflow-wrap: anywhere; white-space: pre-line;
}
.note-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.note-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.note-tag {
  max-width: 100%; padding: 1px 7px; border-radius: 3px; background: rgb(var(--shade-rgb) / .08);
  font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.note-status { background: rgb(var(--shade-rgb) / .14); }
.note-tag.is-overdue { background: rgba(160, 30, 30, .16); color: #7a1414; }
.note-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12px; opacity: .8; white-space: nowrap; }
.note-comments { display: inline-flex; align-items: center; gap: 3px; }
.note-comments svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }

.empty-action {
  margin-top: 10px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 4px; cursor: pointer;
  background: rgb(var(--on-rgb) / .2); color: var(--on); font-weight: 700; box-shadow: rgb(var(--shade-rgb) / .15) 0 3px 0;
}
.empty-action:active { transform: translateY(3px); box-shadow: none; }

/* note dialog */
.modal-wide { width: min(100% - 24px, 1000px); max-height: calc(100dvh - 32px); }
.modal-wide form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.note-head { --accent: #f2d94e; border-top: 6px solid var(--accent); }
.note-head h2 { text-transform: none; color: var(--ink); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); overflow: auto; }
.modal-wide.is-new .note-layout { grid-template-columns: 1fr; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 12px; }
.field-grid .field-wide { grid-column: 1 / -1; }
.field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 0; border-radius: 6px; background: var(--field);
  color: var(--on); font: inherit; font-size: 15px;
}
.field textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.field select { min-height: 44px; cursor: pointer; }
.field textarea:focus, .field select:focus { outline: none; background: var(--field-focus); box-shadow: 0 0 0 2px var(--focus); }
.field .countdown { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.archived-banner { margin: 0; padding: 10px 12px; border-radius: 6px; background: rgb(var(--on-rgb) / .1); color: var(--on); font-size: 14px; }
.note-foot-bar .spacer, .modal-foot .spacer { flex: 1; }
.btn-text-danger { color: var(--danger); padding-left: 0; }
.btn-text-danger:hover { color: var(--on); }

.log-title { margin: 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.btn-sm-dark { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* column editor */
.ld-body { overflow: auto; }
.ld-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.ld-cols-head { display: flex; flex-direction: column; gap: 4px; }
.ld-cols { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ld-col { border: 1px solid var(--line); border-radius: 8px; background: rgb(var(--on-rgb) / .04); }
.ld-col.is-new { border-color: rgb(var(--on-rgb) / .4); background: rgb(var(--on-rgb) / .1); }
.ld-col-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; }
.ld-move { display: flex; flex-direction: column; }
.ld-move .icon-btn { width: 28px; height: 22px; }
.ld-move .icon-btn svg { width: 14px; height: 14px; }
.ld-move .icon-btn[disabled] { opacity: .3; cursor: default; background: none; }
.ld-col input[type="text"], .ld-col select, .ld-opt input[type="text"], .ld-opt select {
  min-height: 38px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--field);
  color: var(--on); font: inherit; font-size: 14.5px;
}
.ld-col input[type="text"]:focus, .ld-col select:focus { outline: none; box-shadow: 0 0 0 2px var(--focus); }
.ld-col ::placeholder { color: rgb(var(--on-rgb) / .45); }
.ld-label { flex: 1 1 160px; min-width: 0; font-weight: 700; }
.ld-extras { flex: 0 1 400px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.ld-type { flex: 0 0 140px; cursor: pointer; }
.ld-type[disabled] { cursor: default; color: var(--muted); }
.ld-check { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; color: var(--ink); font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.ld-check input { width: 16px; height: 16px; accent-color: var(--ink-strong); cursor: pointer; }
.ld-check.is-off { color: rgb(var(--on-rgb) / .35); cursor: default; }
.ld-opts-toggle { min-height: 38px; padding: 0 10px; border: 1px solid var(--line-light); border-radius: 6px; background: rgb(var(--on-rgb) / .08); color: var(--on); font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.ld-opts-toggle[aria-expanded="true"] { background: rgb(var(--on-rgb) / .18); }
.ld-role { padding: 1px 7px; border-radius: 3px; background: rgb(var(--on-rgb) / .14); color: var(--on); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ld-col .ld-remove { margin-left: auto; }
.ld-options { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px 48px; border-top: 1px dashed var(--line); }
.ld-opt { display: flex; align-items: center; gap: 8px; }
.ld-opt input[type="text"] { flex: 1 1 auto; min-width: 0; }
.ld-opt select { flex: 0 0 120px; }
.ld-swatch { flex: none; width: 18px; height: 18px; border-radius: 4px; background: var(--paper, var(--on)); border: 1px solid rgb(var(--shade-rgb) / .12); }
.ld-swatch:not([data-color]) { background: none; border: 1px dashed rgb(var(--on-rgb) / .4); }
.ld-options .btn-text { align-self: flex-start; padding-left: 0; }
.btn-outline {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 2px dashed rgb(var(--on-rgb) / .3); border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-outline:hover { border-color: rgb(var(--on-rgb) / .6); color: var(--on); }
.btn-outline svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.ld-removed { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.ld-removed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ld-removed-list li { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 6px; background: rgb(var(--on-rgb) / .1); color: var(--muted); font-size: 14px; }

/* view toggle */
.view-toggle { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: rgb(var(--shade-rgb) / .15); }
.view-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px;
  border: 0; border-radius: 6px; background: none; color: var(--muted);
  font-size: 14px; font-weight: 700; cursor: pointer; transition: background-color .15s, color .15s;
}
.view-btn:hover { color: var(--on); background: var(--hover); }
.view-btn[aria-pressed="true"] { background: rgb(var(--on-rgb) / .22); color: var(--on); }
.view-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* marks bar: it floats at the bottom, out of the page flow, so a mark never moves the board */
.marks-bar {
  position: fixed; left: 50%; bottom: 20px; z-index: 15; translate: -50% 0;
  width: max-content; max-width: calc(100% - 32px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px;
  padding: 8px 10px 8px 16px; border-radius: 18px;
  background: var(--surface); color: var(--on); font-size: 14px;
  box-shadow: 0 16px 40px rgb(var(--shade-rgb) / .35), 0 0 0 1px rgb(var(--on-rgb) / .08);
  animation: marks-in .22s var(--ease);
}
@keyframes marks-in { from { opacity: 0; translate: -50% 12px; } }
.has-marks .board { padding-bottom: 120px; }   /* the last notes can scroll clear of the bar */
.has-marks .toast { bottom: 84px; }            /* a toast shows above the bar */
.marks-count { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.mark-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--on); box-shadow: 0 0 0 3px rgb(var(--on-rgb) / .3); }
.chip-btn {
  min-height: 32px; padding: 0 12px; border: 1px solid rgb(var(--on-rgb) / .3); border-radius: 16px;
  background: none; color: var(--on); font-size: 13px; font-weight: 700; cursor: pointer;
}
.chip-btn:hover { background: var(--hover); }
.chip-btn[aria-pressed="true"] { background: rgb(var(--on-rgb) / .26); border-color: transparent; }
.marks-tip { margin-left: 4px; color: var(--muted); font-size: 12.5px; }
.marks-tip kbd { color: var(--on); }

/* multi-select filter dropdown */
.ms-button {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; min-height: 40px; padding: 0 8px 0 10px;
  border: 0; border-radius: 6px; background: rgb(var(--shade-rgb) / .14);
  color: var(--on); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.ms-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-button svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ms-button[aria-expanded="true"] svg { transform: rotate(180deg); }
.filter-select.is-set .ms-button { background: rgb(var(--on-rgb) / .26); }
.ms-button:focus-visible { outline: 2px solid var(--on); outline-offset: 1px; }
.ms-pop {
  position: fixed; inset: auto; margin: 0; padding: 6px;
  border: 0; border-radius: 8px; background: var(--surface); color: var(--on);
  box-shadow: 0 16px 40px rgb(var(--shade-rgb) / .35), 0 0 0 1px rgb(var(--on-rgb) / .08);
  flex-direction: column; gap: 4px; overflow: hidden;
}
.ms-pop:popover-open { display: flex; }
.ms-search {
  flex: none; min-height: 36px; margin: 2px 2px 4px; padding: 0 10px;
  border: 0; border-radius: 6px; background: var(--field); color: var(--on); font: inherit; font-size: 14px;
}
.ms-search::placeholder { color: rgb(var(--on-rgb) / .5); }
.ms-search:focus { outline: none; box-shadow: 0 0 0 2px var(--focus); }
.ms-list { display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.ms-opt { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 6px 0 8px; border-radius: 6px; cursor: pointer; font-size: 14.5px; }
.ms-opt:hover, .ms-opt:focus-within { background: var(--hover); }
.ms-opt input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--on); cursor: pointer; }
.ms-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-swatch { flex: none; width: 12px; height: 12px; border-radius: 3px; border: 1px dashed rgb(var(--on-rgb) / .35); }
.ms-swatch[data-color] { background: var(--paper); border: 0; }
.ms-only {
  flex: none; padding: 2px 8px; border: 0; border-radius: 4px; background: rgb(var(--on-rgb) / .14);
  color: var(--on); font-size: 12px; font-weight: 700; cursor: pointer; opacity: 0;
}
.ms-opt:hover .ms-only, .ms-only:focus-visible { opacity: 1; }
.ms-foot { flex: none; display: flex; justify-content: space-between; gap: 8px; padding: 6px 2px 0; border-top: 1px solid var(--line); }
.ms-clear, .ms-done { min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.ms-clear:hover:not(:disabled) { color: var(--on); }
.ms-clear:disabled { opacity: .4; cursor: default; }
.ms-done { background: rgb(var(--on-rgb) / .14); color: var(--on); }

/* list view */
.list-wrap {
  overflow: auto; max-height: calc(100dvh - 240px); min-height: 260px;
  border-radius: 8px; background: color-mix(in srgb, var(--bg) 86%, var(--deep));
  box-shadow: inset 0 0 0 1px rgb(var(--on-rgb) / .08);
}
.note-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.note-table th, .note-table td {
  padding: 9px 12px; text-align: left; vertical-align: top; white-space: nowrap;
  border-bottom: 1px solid rgb(var(--on-rgb) / .08);
}
.note-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: color-mix(in srgb, var(--bg) 66%, var(--deep)); color: rgb(var(--on-rgb) / .82);
  font-size: 12.5px; font-weight: 700; vertical-align: middle;
}
.th-sort {
  display: inline-flex; align-items: center; gap: 5px; margin: -4px -6px; padding: 4px 6px;
  border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; cursor: pointer; white-space: nowrap;
}
.th-sort:hover { background: var(--hover); color: var(--on); }
.th-arrow { font-size: 9px; }
.row { --row-bg: color-mix(in srgb, var(--bg) 86%, var(--deep)); cursor: pointer; }
.row td { background: var(--row-bg); transition: background-color .12s; }
.row:hover { --row-bg: color-mix(in srgb, var(--bg) 94%, var(--on)); }
.row.is-marked { --row-bg: color-mix(in srgb, var(--bg) 88%, var(--on)); }
.row.is-marked .col-mark { box-shadow: inset 4px 0 0 var(--on); }
.row[data-color]:not(.is-marked) .col-mark { box-shadow: inset 4px 0 0 var(--paper); }
.row.is-archived td { color: rgb(var(--on-rgb) / .6); }
.note-table .col-mark { position: sticky; left: 0; z-index: 1; width: 44px; min-width: 44px; max-width: 44px; padding: 9px 0 9px 4px; text-align: center; }
.note-table .col-title {
  position: sticky; left: 44px; z-index: 1; min-width: 220px; max-width: 340px; white-space: normal;
  box-shadow: 1px 0 0 rgb(var(--on-rgb) / .1);
}
.note-table thead .col-mark, .note-table thead .col-title { z-index: 3; }
.row-mark { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--on); cursor: pointer; }
.row-open { padding: 0; border: 0; background: none; color: var(--on); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.row-open:focus-visible { outline: 2px solid var(--on); outline-offset: 3px; }
.row-flag { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 3px; background: rgb(var(--on-rgb) / .14); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.note-table .col-long { min-width: 240px; max-width: 380px; white-space: normal; }
.cell-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.cell-chip { display: inline-block; padding: 1px 8px; border-radius: 4px; background: rgb(var(--on-rgb) / .14); font-size: 12.5px; font-weight: 700; }
.cell-chip[data-color] { background: var(--paper); color: var(--ink-note); }
.cell-chip:not([data-color]) { padding: 0; background: none; font-size: inherit; font-weight: 400; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; }
.cell-sub.is-overdue { color: var(--warn); font-weight: 700; }
.col-updated .note-comments { margin-top: 2px; color: var(--muted); font-size: 12px; }

/* right-click menu */
.ctx {
  position: fixed; inset: auto; margin: 0; min-width: 210px; max-width: 300px; padding: 6px;
  border: 0; border-radius: 8px; background: var(--surface); color: var(--on);
  box-shadow: 0 16px 40px rgb(var(--shade-rgb) / .4), 0 0 0 1px rgb(var(--on-rgb) / .1);
  font-family: var(--font-ui); font-size: 14px;
}
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px 0 6px;
  border: 0; border-radius: 5px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.ctx-item:hover:not(:disabled), .ctx-item:focus { background: rgb(var(--on-rgb) / .14); outline: none; }
.ctx-item:disabled { opacity: .4; cursor: default; }
.ctx-item.is-danger { color: var(--danger); }
.ctx-tick { flex: none; width: 16px; font-size: 13px; text-align: center; }
.ctx-swatch { height: 16px; display: inline-grid; place-items: center; border-radius: 3px; background: var(--paper); color: var(--ink-note); font-size: 11px; font-weight: 700; }
.ctx-swatch[data-color="none"] { background: none; border: 1px dashed rgb(var(--on-rgb) / .4); color: var(--on); }
.ctx-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx kbd { padding: 0; background: none; color: var(--muted); font-size: 12px; }
.ctx-sep { height: 1px; margin: 5px 4px; background: var(--line); }
.ctx-heading { padding: 6px 10px 2px 32px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- responsive / touch / motion ---------- */
@media (max-width: 820px) {
  .note-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container-wide { padding: 0 12px; }
  .filter-select { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .ld-options { padding-left: 12px; }
  .note-foot-bar { gap: 2px; padding: 12px 14px; }
  .note-foot-bar .btn-text { padding: 0 8px; }
  .ld-type { flex: 1 1 120px; }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .note { min-height: 180px; }
  .note-open { padding: 22px 12px 10px; }
  .view-btn span, .marks-tip { display: none; }
  .board-actions { width: 100%; justify-content: flex-end; }
  .note-item { font-size: 15px; }
  .note-desc { -webkit-line-clamp: 3; font-size: 13px; }
  .topnav { gap: 6px; }
  .hbtn { min-width: 0; padding: 0 9px; }
  .hbtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hbtn svg { width: 18px; height: 18px; }
  .line { margin-bottom: 24px; }
  .skip { left: auto; right: 8px; }
  .grid-2 { grid-template-columns: 1fr; }
  .group-head { flex-direction: column; }
  .user-row { grid-template-columns: auto 1fr auto; }
  .user-badges { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .user-row .btn-sm { grid-column: 3; grid-row: 1 / span 2; }
}
@media (hover: none) {
  .note-mark { opacity: .85; }
  .ms-only { opacity: 1; }
  .hbtn, .kebab, .mode, .btn, .btn-dark, .btn-text { min-height: 44px; }
  .kebab { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .note { transform: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- settings: team and audit log ---------- */
.page-settings { max-width: 760px; }
.avatar { overflow: hidden; flex: none; }
.avatar.has-photo { background: var(--deep); }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-xl { width: 76px; height: 76px; font-size: 26px; }
.buddy-photo { display: flex; align-items: center; gap: 16px; }
.buddy-photo-actions { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.buddy-photo-actions label.btn { cursor: pointer; }
.buddy-photo-actions:has(input:focus-visible) label.btn { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Photo crop dialog (Cropper.js): a round window on a deep stage, the rest dimmed */
.modal-crop { width: min(100% - 24px, 440px); }
/* The rest of the dialog is about 270 px, and the browser caps a modal at the viewport less 38 px. */
.crop-stage { width: 100%; aspect-ratio: 1; max-height: max(180px, min(56dvh, 100dvh - 330px)); border-radius: 6px; overflow: hidden; background: var(--deep); touch-action: none; }
.crop-stage:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.crop-stage img { display: block; max-width: 100%; }
.crop-stage .cropper-modal { background: var(--deep); opacity: .62; }
.crop-stage .cropper-view-box, .crop-stage .cropper-face { border-radius: 50%; }
.crop-stage .cropper-view-box { outline: 0; box-shadow: 0 0 0 2px rgb(var(--on-rgb) / .9); }
.crop-stage .cropper-face { background: transparent; }
.crop-tools { display: flex; align-items: center; gap: 4px; }
.crop-tools input[type="range"] { flex: 1; min-width: 0; margin: 0 4px; accent-color: var(--on); cursor: pointer; }
.crop-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--line); }
#show-former { align-self: flex-start; }

.journal-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.journal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.j-entry { display: flex; flex-direction: column; gap: 4px; padding: 11px 0; border-top: 1px solid var(--line); }
.j-entry:first-child { border-top: 0; padding-top: 2px; }
.j-head { margin: 0; color: var(--ink); font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.j-head strong { color: var(--ink-strong); }
.j-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; color: var(--muted); font-size: 12.5px; }
.j-label { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.j-time { margin-left: auto; white-space: nowrap; }
.j-entry details summary { width: fit-content; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.j-entry details summary:hover { color: var(--ink); }
.j-detail { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 10px 12px; border-radius: 8px; background: var(--band); }
.j-changes { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
.j-changes dt { color: var(--muted); font-weight: 700; }
.j-changes dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.j-from { color: var(--muted); text-decoration: line-through; text-decoration-color: rgb(var(--on-rgb) / .35); }
.j-to { color: var(--ink); }
.j-body { margin: 0; font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .journal-filters { grid-template-columns: 1fr 1fr; }
  .journal-filters .field:first-child { grid-column: 1 / -1; }
  .j-time { margin-left: 0; }
}

/* ---------- settings: tabs ---------- */
.page-settings { max-width: 880px; }
.settings-tabs { gap: 6px; }
.settings-tabs .mode { min-height: 36px; padding: 4px 16px; font-size: 15px; }
.settings-tabs .mode:focus-visible { outline: 2px solid var(--on); outline-offset: 2px; }
.group:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---------- Settings > API tokens ---------- */
.token-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.token-new { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 18px; padding: 14px 16px; border-radius: 10px; background: rgb(var(--shade-rgb) / .35); }
.token-warn { margin: 0; color: var(--ink); font-size: 14px; }
.token-key-row { display: flex; gap: 8px; align-items: center; }
.token-key, .token-example {
  flex: 1; min-width: 0; margin: 0; padding: 8px 10px; border-radius: 8px; background: rgb(var(--shade-rgb) / .5);
  color: var(--ink-strong); font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; user-select: all;
}
.token-new a, .muted code { color: var(--ink-strong); }
@media (max-width: 640px) { .token-grid { grid-template-columns: 1fr; } }

/* ---------- /home: trash and note history ---------- */
.trash-list .user-row { align-items: center; }
.rev-entry .j-head .rev-seq { display: inline-block; min-width: 2.4em; margin-right: 6px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.rev-entry .rev-actions { display: flex; gap: 8px; margin-top: 2px; }
.rev-current { color: var(--muted); font-size: 12.5px; }
.toast.show.has-action { pointer-events: auto; }
.toast .toast-action {
  margin-left: 12px; padding: 2px 10px; border: 1px solid currentColor; border-radius: 999px; background: transparent;
  color: inherit; font: inherit; font-weight: 700; cursor: pointer;
}
