/* Layout: one column on phones (capture card, sticky tabs, board); the
   board widens into a 4-up category grid and two-column lists on desktop. */
:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #e9edf3;
  --ink: #141b26;
  --muted: #586376;
  --line: #d6dce6;
  --accent: #2747c9;
  --accent-soft: #e3e8fb;
  --accent-ink: #ffffff;
  --rec: #d33a3a;
  --rec-soft: #fbe5e5;
  --danger: #b42318;
  --focus: #2747c9;
  --shadow: 0 1px 2px rgb(20 27 38 / 6%), 0 6px 20px rgb(20 27 38 / 6%);

  /* Thought kinds, in display order (validated categorical set). */
  --k-idea: #eda100;
  --k-todo: #2a78d6;
  --k-goal: #008300;
  --k-feeling: #e87ba4;
  --k-question: #6250d6;
  --k-worry: #e34948;
  --k-gratitude: #1baf7a;
  --k-observation: #eb6834;

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --radius: 14px;
  --radius-sm: 9px;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b;
    --surface: #171e28;
    --surface-2: #202935;
    --ink: #e8edf4;
    --muted: #9aa6b8;
    --line: #2b3545;
    --accent: #93a8ff;
    --accent-soft: #1f2a4d;
    --accent-ink: #0f141b;
    --rec: #ff6b6b;
    --rec-soft: #3a1f24;
    --danger: #ff8a80;
    --focus: #93a8ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    --k-idea: #c98500;
    --k-todo: #3987e5;
    --k-goal: #008300;
    --k-feeling: #d55181;
    --k-question: #9085e9;
    --k-worry: #e66767;
    --k-gratitude: #199e70;
    --k-observation: #d95926;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b;
  --surface: #171e28;
  --surface-2: #202935;
  --ink: #e8edf4;
  --muted: #9aa6b8;
  --line: #2b3545;
  --accent: #93a8ff;
  --accent-soft: #1f2a4d;
  --accent-ink: #0f141b;
  --rec: #ff6b6b;
  --rec-soft: #3a1f24;
  --danger: #ff8a80;
  --focus: #93a8ff;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  --k-idea: #c98500;
  --k-todo: #3987e5;
  --k-goal: #008300;
  --k-feeling: #d55181;
  --k-question: #9085e9;
  --k-worry: #e66767;
  --k-gratitude: #199e70;
  --k-observation: #d95926;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
svg { flex: none; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 12px; }

/* ---- Top bar ------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px var(--gutter) 6px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.brand-mark { width: 28px; height: 28px; fill: var(--accent); }
.brand h1 { font-size: var(--step-2); font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.engine-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 11px;
  font-size: var(--step--1); color: var(--muted);
  flex: none; white-space: nowrap;
}
.engine-pill span:last-child { overflow: hidden; text-overflow: ellipsis; }
.engine-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.engine-pill[data-engine="ai"] .engine-dot { background: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 8px var(--gutter) 64px; display: grid; gap: 16px; }

/* ---- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 0.9375rem; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.btn-primary:disabled { background: var(--surface-2); border-color: var(--line); color: var(--muted); opacity: 1; }
.btn-ghost { background: transparent; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); font-weight: 400; min-height: 36px; padding: 0 10px; }
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }
.btn-danger { color: var(--danger); background: transparent; border-color: var(--line); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-btn { cursor: pointer; }

/* ---- Capture card ---------------------------------------------------- */
.capture {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow);
}
.capture-record { display: flex; align-items: center; gap: 16px; }
.rec-btn {
  position: relative; flex: none;
  width: 84px; height: 84px; border-radius: 50%;
  border: 0; background: var(--rec); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgb(211 58 58 / 28%);
  transition: transform 0.15s ease;
}
.rec-btn:active { transform: scale(0.96); }
.rec-btn:disabled { opacity: 0.6; cursor: progress; }
.rec-icon { width: 34px; height: 34px; fill: currentColor; position: relative; }
.rec-icon-stop { display: none; }
.rec-ring { position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--rec); opacity: 0; }
.recording .rec-icon-mic { display: none; }
.recording .rec-icon-stop { display: block; }
.recording .rec-ring { animation: ring 1.6s ease-out infinite; }
@keyframes ring { 0% { transform: scale(0.92); opacity: 0.7; } 100% { transform: scale(1.18); opacity: 0; } }
.rec-side { min-width: 0; flex: 1; display: grid; gap: 4px; }
.rec-title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.rec-sub { color: var(--muted); font-size: 0.9375rem; }
.rec-meter { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.rec-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: var(--step-1); color: var(--rec); min-width: 3.2em; }
#wave { flex: 1; min-width: 0; height: 40px; width: 100%; }

.live { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; max-height: 40vh; overflow: auto; }
.live-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.live-interim { color: var(--muted); }

.dictate { display: grid; gap: 8px; }
.dictate-label { font-weight: 700; font-size: 0.9375rem; }
.dictate-hint { color: var(--muted); font-size: 0.9375rem; display: flex; gap: 8px; align-items: center; }
textarea {
  width: 100%; resize: vertical; min-height: 84px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; line-height: 1.5;
}
textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.capture-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.capture.no-mic .capture-record { display: none; }
.capture.no-mic textarea { min-height: 120px; }

.jobs { display: grid; gap: 8px; }
.jobs:empty { display: none; }
.job { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.9375rem; }
.job-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.job-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.job-status { color: var(--muted); margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.job.error .job-status { color: var(--danger); white-space: normal; }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }
.bar.indeterminate > i { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* ---- Tabs ------------------------------------------------------------ */
.tabs {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; gap: 4px; padding: 6px; margin: 0 calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tab {
  flex: 1; min-height: 42px; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.tab-count { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

.example-banner { font-size: 0.9375rem; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.view { display: grid; gap: 16px; }

/* ---- Kind grid ------------------------------------------------------- */
.kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kind-tile {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 12px; min-height: 56px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); text-align: left;
}
.kind-tile:hover { border-color: var(--muted); }
.kind-tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kind-tile .swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--kc); }
.kind-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind-count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.kind-tile.bump .kind-count { animation: bump 0.6s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--ink); } 100% { transform: scale(1); } }
.kind-all { grid-column: 1 / -1; }

[data-kind="idea"] { --kc: var(--k-idea); }
[data-kind="todo"] { --kc: var(--k-todo); }
[data-kind="goal"] { --kc: var(--k-goal); }
[data-kind="feeling"] { --kc: var(--k-feeling); }
[data-kind="question"] { --kc: var(--k-question); }
[data-kind="worry"] { --kc: var(--k-worry); }
[data-kind="gratitude"] { --kc: var(--k-gratitude); }
[data-kind="observation"] { --kc: var(--k-observation); }
[data-kind="all"] { --kc: var(--ink); }

.filters { display: grid; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.search svg { width: 18px; height: 18px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 44px; outline: none; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.topic-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.topic-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: 0.875rem; font-weight: 700;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-count { font-family: var(--font-mono); font-weight: 400; margin-left: 4px; }

/* ---- Thoughts -------------------------------------------------------- */
.thought-list { display: grid; gap: 22px; }
.group-head { display: flex; align-items: baseline; gap: 10px; padding: 0 2px 8px; }
.group-head h2 { font-size: var(--step-1); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.group-head h2::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--kc); }
.group-head .count { font-family: var(--font-mono); color: var(--muted); font-size: var(--step--1); }
.group-head .blurb { color: var(--muted); font-size: var(--step--1); margin-left: auto; text-align: right; }
.cards { display: grid; gap: 8px; }

.thought {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px 10px;
}
.thought-mark { grid-row: 1 / span 2; padding-top: 3px; }
.dot { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--kc); margin-top: 5px; }
.check {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--kc);
  display: grid; place-items: center; background: transparent; cursor: pointer;
}
.check:checked { background: var(--kc); }
.check:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--surface); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.thought-text { overflow-wrap: anywhere; font-size: 1.0625rem; }
.thought.done .thought-text { text-decoration: line-through; color: var(--muted); }
.thought-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--step--1); color: var(--muted); }
.meta-kind { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.6875rem; color: var(--ink); }
.meta-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.tag-due { border-color: var(--kc); color: var(--ink); }
.tag-example { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.thought-actions { margin-left: auto; display: flex; gap: 2px; }
.mini {
  border: 0; background: transparent; color: var(--muted); border-radius: 8px;
  min-height: 32px; padding: 0 8px; font-size: var(--step--1); font-weight: 700;
}
.mini:hover { background: var(--surface-2); color: var(--ink); }
.move-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.move-row .chip { display: inline-flex; align-items: center; gap: 6px; }
.move-row .chip::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--kc); }
.move-row .chip[aria-current="true"] { border-color: var(--ink); color: var(--ink); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: var(--step-1); margin-bottom: 4px; }

/* ---- Notes ----------------------------------------------------------- */
.note-list { display: grid; gap: 10px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.note > summary {
  list-style: none; cursor: pointer; padding: 14px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px;
}
.note > summary::-webkit-details-marker { display: none; }
.note-title { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); overflow-wrap: anywhere; }
.note-when { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.note-sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: var(--step--1); color: var(--muted); }
.kind-dots { display: inline-flex; gap: 3px; align-items: center; }
.kind-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--kc); }
.mood { border-radius: 999px; padding: 1px 8px; border: 1px solid var(--line); color: var(--ink); }
.note-body { padding: 0 14px 14px; display: grid; gap: 12px; }
.note-body audio { width: 100%; }
.note-body textarea { min-height: 120px; }
.note-thoughts { display: grid; gap: 6px; }
.note-thoughts li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.note-thoughts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note-thoughts .dot { margin-top: 7px; }

/* ---- Patterns -------------------------------------------------------- */
.range { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: var(--step-3); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { color: var(--muted); font-size: var(--step--1); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; min-width: 0; }
.panel h3 { font-size: var(--step-1); font-weight: 700; }
.panel-grid { display: grid; gap: 16px; }
.bars { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 2.5rem; align-items: center; gap: 10px; min-height: 30px; border-radius: 6px; padding: 0 4px; }
.bars li:hover { background: var(--surface-2); }
.bars .label { font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 10px; position: relative; }
.bars .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--kc); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars .val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); font-size: 0.9375rem; }
.topic-list { display: flex; flex-wrap: wrap; gap: 6px; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; overflow-wrap: anywhere; }
.reflection { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.reflection:empty { display: none; }

/* ---- Settings sheet ------------------------------------------------- */
.sheet {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  width: min(560px, 100%); max-width: 100%; max-height: 100%;
  margin: auto auto 0;
}
.sheet::backdrop { background: rgb(10 14 20 / 45%); }
.sheet-inner {
  background: var(--surface); border-radius: 20px 20px 0 0; border: 1px solid var(--line);
  padding: 16px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 14px; max-height: 88vh; overflow: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: var(--step-2); font-weight: 800; }
.group { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }
.group + .group { padding-top: 10px; }
.group legend { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); padding: 0; margin-bottom: 4px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 0.9375rem; }
.field small, .row-toggle small { color: var(--muted); font-size: var(--step--1); display: block; }
.field input, .field select {
  min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px; width: 100%;
}
.row-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.row-toggle span { min-width: 0; }
.row-toggle input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background 0.2s; margin: 0; }
.row-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform 0.2s; }
.row-toggle input:checked { background: var(--accent); }
.row-toggle input:checked::after { transform: translateX(18px); }
.row-toggle input:disabled { opacity: 0.5; }
.danger { display: grid; gap: 8px; }
.confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-radius: 10px; background: var(--rec-soft); font-size: 0.9375rem; }

/* ---- Toast ----------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--bg);
  border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px); font-size: 0.9375rem;
}
.toast-action { border: 0; background: transparent; color: var(--bg); font-weight: 700; text-decoration: underline; padding: 4px; }

/* ---- Playback ------------------------------------------------------- */
.play-at {
  display: inline-flex; align-items: center; gap: 3px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 1px 8px 1px 5px; min-height: 26px;
  font-family: var(--font-mono); font-size: var(--step--1); font-variant-numeric: tabular-nums;
}
.play-at svg { width: 14px; height: 14px; color: var(--accent); }
.play-at:hover { border-color: var(--accent); }
.play-note { justify-self: start; }
.play-note svg { color: var(--accent); }
.note-thoughts li .play-at { vertical-align: 1px; }
.note-section {
  margin: 6px 0 0; font-family: var(--font-mono); font-size: var(--step--1); font-weight: 500;
  color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.job-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.job-actions .btn { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.field-status { color: var(--ink) !important; }
.sub-fields { display: grid; gap: 12px; padding-left: 12px; border-left: 2px solid var(--line); }
.field-status:empty { display: none !important; }

.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; gap: 6px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgb(20 27 38 / 10%);
}
.player-btn {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 0; background: transparent; color: var(--ink);
}
.player-btn svg { width: 22px; height: 22px; }
.player-btn:hover { background: var(--surface-2); }
.player-main { width: 46px; height: 46px; background: var(--accent); color: var(--accent-ink); }
.player-main:hover { background: var(--accent); filter: brightness(1.08); }
.player .icon-pause { display: none; }
.player.playing .icon-pause { display: block; }
.player.playing .icon-play { display: none; }
.player-info { flex: 1; min-width: 0; display: grid; margin-left: 6px; }
.player-title { font-weight: 700; font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-time { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
body.has-player .wrap { padding-bottom: 120px; }
.player:not([hidden]) ~ .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* ---- Wider screens --------------------------------------------------- */
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .kind-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .capture { padding: 22px; }
  .rec-btn { width: 96px; height: 96px; }
  .panel-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .sheet { margin: auto; }
  .sheet-inner { border-radius: 20px; padding-bottom: 20px; }
}
@media (min-width: 1000px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
