/* LifeOS — "a notebook at night".
   Ink-blue ground, bone text, one cool verdigris accent. What he said is set
   in a serif; what a model inferred is set apart in pale moonlight, so the
   two are never confused (CLAUDE.md rule 4). */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-normal.woff2") format("woff2");
  font-weight: 300 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 300 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-normal.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  /* Ground: four inks, from the page to the highest surface */
  --ink-0: #0b0e13;
  --ink-1: #10141b;
  --ink-2: #161b24;
  --ink-3: #1d2330;
  --ink-glass: rgba(11, 14, 19, 0.85);   /* bars that blur what scrolls under them */
  --ink-veil: rgba(11, 14, 19, 0.6);     /* quiet panels over the page */
  --scrim: rgba(5, 7, 10, 0.66);         /* behind a dialog */
  --panel: rgba(22, 27, 36, 0.7);        /* fields and the composer */
  --panel-hover: rgba(22, 27, 36, 0.6);  /* a row under the pointer */
  --card: rgba(16, 20, 27, 0.7);         /* cards on the page */

  /* Bone: his words and the interface's text. Faint is 4.5:1 or better on every ink above. */
  --bone: #ece7dc;
  --bone-dim: #b3ada1;
  --bone-faint: #8a867b;
  --line: rgba(236, 231, 220, 0.08);       /* dividers */
  --line-card: rgba(236, 231, 220, 0.1);   /* the edge of a card */
  --line-strong: rgba(236, 231, 220, 0.16);

  /* Sea: the one accent */
  --sea: #86cdb9;
  --sea-deep: #1f4a42;
  --sea-glow: rgba(134, 205, 185, 0.22);
  --sea-line-soft: rgba(134, 205, 185, 0.3);  /* a tinted edge at rest */
  --sea-line: rgba(134, 205, 185, 0.35);      /* an edge that is hovered or chosen */
  --sea-ring: rgba(134, 205, 185, 0.5);       /* a field in focus, a live recording */
  --sea-wash: rgba(134, 205, 185, 0.06);

  /* Moon: what a model inferred, never what he said */
  --moon: #aebbd3;
  --moon-wash: rgba(174, 187, 211, 0.06);
  --moon-line: rgba(174, 187, 211, 0.18);
  --moon-line-strong: rgba(174, 187, 211, 0.3);

  --rose: #e39a9a;         /* errors only */
  --rose-line: rgba(227, 154, 154, 0.4);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Avenir Next", "Segoe UI", sans-serif;

  /* Type scale. 11px is the floor for anything read. */
  --fs-2xs: 11px;   /* tracked caps labels, counts */
  --fs-xs: 12px;    /* meta lines, timestamps */
  --fs-sm: 13px;    /* secondary text, small controls */
  --fs-md: 14px;    /* controls, rows */
  --fs-base: 15px;  /* body */
  --fs-lg: 16px;    /* inputs (no iOS zoom), serif body */
  --fs-xl: 17px;    /* his words in a list or a card */
  --fs-2xl: 18px;   /* a lead line */
  --fs-h3: 20px;
  --fs-h2: 24px;
  --fs-h1: 30px;
  --fs-headline: clamp(1.6rem, 4.5vw, 2.3rem);   /* a capture's, an item's title */
  --fs-title: clamp(1.9rem, 4.6vw, 2.35rem);     /* a Map page's title */
  --fs-display: clamp(2.1rem, 7vw, 3.6rem);      /* the front door */

  /* Radii: small controls, cards and fields, sheets, pills */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --pill: 99px;

  --rail: 248px;
  --tabbar: 64px;
  --tap: 44px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
  caret-color: var(--sea);
  accent-color: var(--sea);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--bone);
  font: 400 var(--fs-base)/1.5 var(--sans);
  font-feature-settings: "ss01", "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 1.5px solid var(--sea); outline-offset: 3px; }
a { text-underline-offset: .2em; text-decoration-thickness: 1px; }
input, textarea { caret-color: var(--sea); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--sea); }
/* Scroll containers: thin, ink-toned. Chromium and Firefox take the standard
   properties; the pseudo-elements are for older Safari. */
* { scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: var(--pill); border: 2px solid transparent; background-clip: content-box; }
@media (hover: hover) { ::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: content-box; } }
/* Times, durations, counts and amounts line up in columns */
time, .entry-time, .when, .w, .byline, .q-top, .q-row-top, .q-row-when, .q-pos, .m-when, .m-e-meta, .m-claim-m, .m-it-m, .m-card-m,
.m-pcard-m, .m-hub-m, .m-person-m, .m-pl-c, .m-row-c, .m-amt, .m-net b, .m-kv dd, .m-due, .step-at, .voice-secs, .answer-meta,
.provenance, .msg-meta, .detail-top, .nav-badge, .picker-opt b, .m-pick a b, .nav-sub .sub b, .q-chip time, .q-hist-head, .q-step small,
.dict-n, .dict-lang, .m-tab i, .m-seg a small, .task-where, .session-last, .outbox-line { font-variant-numeric: tabular-nums; }
::selection { background: var(--sea-deep); color: var(--bone); }

/* Atmosphere: a faint tide of light plus paper grain. */
.atmosphere {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(134, 205, 185, 0.07), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(174, 187, 211, 0.05), transparent 60%);
}
.atmosphere::after {
  content: ""; position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.045; mix-blend-mode: overlay;
}

/* ------------------------------------------------------------------ layout */
/* No z-index here: the phone detail sheet must be able to rise above the tab bar. */
main {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
.view { display: none; flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.view.active { display: block; }
/* minmax(0, 1fr): pin the row to the view's height so each pane scrolls on
   its own; an auto row grows with the content and nothing scrolls at all. */
.view-recent.active { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); overflow: hidden; }

/* Navigation — phone: bottom tab bar */
.nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding: 0 max(12px, env(safe-area-inset-left)) env(safe-area-inset-bottom);
  display: flex; align-items: stretch;
  background: var(--ink-glass);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--line);
}
.brand, .nav-top { display: none; }
.nav-links { flex: 4; display: flex; }  /* four links + Settings = the five places, equal slots */
.nav-links a small { display: none; }   /* the rail's subtitles: wide screens only */
.nav-links a, .nav-settings {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--bone-faint); background: none; border: 0; padding: 0;
  font-size: var(--fs-2xs); letter-spacing: .04em; transition: color .25s var(--ease);
}
.nav-links svg, .nav-settings svg { width: 22px; height: 22px; }
.nav-links a.active { color: var(--bone); }
.nav-links a.active svg, .nav-settings.active svg { color: var(--sea); }
.nav-settings.active { color: var(--bone); }
.nav-sub, .nav-collapse { display: none; }   /* wide screens only */
/* Five tabs on a phone: the long labels go short */
@media (max-width: 959px) {
  .nav-links span[data-short] { font-size: 0; }
  .nav-links span[data-short]::after { content: attr(data-short); font-size: var(--fs-2xs); }
}
@media (max-width: 559px) { .q-actions [data-talk] { display: none; } }  /* the composer is right there */

/* Wide screens: a quiet rail on the left */
@media (min-width: 960px) {
  main { margin-left: var(--rail); padding-bottom: 0; }
  .nav {
    top: 0; right: auto; width: var(--rail); height: auto;
    flex-direction: column; align-items: stretch;
    padding: 32px 18px 24px; border-top: 0; border-right: 1px solid var(--line);
    background: var(--ink-veil); overflow: hidden; white-space: nowrap;
  }
  /* The sidebar toggle, top left, in the same spot open or folded; the brand beside it */
  .nav-top { display: flex; align-items: center; gap: 8px; min-height: 32px; margin: -8px 0 28px; }
  .brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
  .brand-mark {
    width: 22px; height: 22px; border-radius: 50%;
    border: 1.5px solid var(--sea); position: relative;
    box-shadow: 0 0 18px var(--sea-glow);
  }
  .brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--sea); }
  .brand-name { font: 400 var(--fs-h3)/1 var(--serif); letter-spacing: .01em; }
  .brand-name em { color: var(--bone-dim); }
  .nav-links { flex: 0; flex-direction: column; gap: 2px; }
  .nav-links a, .nav-settings {
    flex: 0; flex-direction: row; justify-content: flex-start; gap: 14px;
    padding: 11px 12px; border-radius: var(--radius-sm); font-size: var(--fs-md); letter-spacing: .01em;
  }
  @media (hover: hover) { .nav-links a:hover, .nav-settings:hover { color: var(--bone); background: var(--ink-2); } }
  .nav-links a.active, .nav-settings.active { background: var(--ink-2); }
  .nav-links svg, .nav-settings svg { width: 20px; height: 20px; }
  .nav-settings { margin-top: auto; }
  /* Each entry says what it is for, under its name */
  .nav-links a { align-items: flex-start; }
  .nav-links a svg { margin-top: 1px; }
  .nav-links a > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
  .nav-links a small {
    display: block; margin-top: 1px; font-size: var(--fs-xs); line-height: 1.3; letter-spacing: 0;
    color: var(--bone-faint); white-space: normal;
  }
  .nav-links a.active small { color: var(--bone-dim); }
  .nav-badge { align-self: center; }

  /* The queues' sections, under Queues while it's open */
  .nav-links { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
  body:not(.rail-collapsed) .nav-links a.active[data-sub]:not(.folded) + .nav-sub { display: flex; }
  .nav-sub {
    flex-direction: column; gap: 1px;
    margin: 4px 0 10px 21px; padding-left: 10px; border-left: 1px solid var(--line);
    animation: rise .35s var(--ease) both;
  }
  .nav-sub .sub {
    display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
    border: 0; background: none; color: var(--bone-faint);
    padding: 6px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm);
    transition: color .2s var(--ease), background .2s var(--ease);
  }
  .nav-sub .sub span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-sub .sub b { font-weight: 400; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; color: var(--bone-faint); }
  @media (hover: hover) { .nav-sub .sub:hover { color: var(--bone); background: var(--ink-2); } }
  .nav-sub .sub.on { color: var(--bone); background: var(--ink-2); }
  .nav-sub .sub.on b { color: var(--sea); }
  .nav-sub hr { width: 100%; height: 1px; margin: 6px 0; border: 0; background: var(--line); }
  /* The rail lists them, so the picker above the list goes */
  .view-library .lib-tools { padding-bottom: 12px; }
  body:not(.rail-collapsed):not(.queues-folded) .view-queues .q-picker { display: none; }
  .nav-sub .sub-head { margin: 10px 10px 3px; font-size: var(--fs-2xs); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-faint); opacity: .75; }
  .nav-sub .sub-head:first-child { margin-top: 2px; }
  /* "How it decides": the policy and what it learned, under the queues */
  .nav-sub .sub.dim span { opacity: .5; }
  .nav-sub .sub-head { white-space: normal; }
  .nav-sub .sub-wait { margin: 2px 10px 6px; font-size: var(--fs-sm); color: var(--bone-faint); }
  .nav-sub .sub-foot { margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-style: italic; font-family: var(--serif); font-size: var(--fs-md); }

  /* Folding the rail */
  .nav, main { transition: width .28s var(--ease), margin-left .28s var(--ease), padding .28s var(--ease); }
  .nav-collapse {
    flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
    border: 0; border-radius: var(--radius-sm); background: none; color: var(--bone-faint);
  }
  @media (hover: hover) { .nav-collapse:hover { color: var(--bone); background: var(--ink-2); } }
  .nav-collapse svg { width: 20px; height: 20px; }
  .rail-collapsed { --rail: 68px; }
  .rail-collapsed .nav { padding-left: 10px; padding-right: 10px; }
  .rail-collapsed .nav-collapse { margin-left: 8px; }     /* 18px from the edge, as when it's open */
  .rail-collapsed .brand,
  .rail-collapsed .nav-links > a span, .rail-collapsed .nav-settings span { display: none; }
  .rail-collapsed .nav-links a, .rail-collapsed .nav-settings { justify-content: center; padding-left: 0; padding-right: 0; }
}

/* ----------------------------------------------------------------- capture */
.capture-inner {
  min-height: 100%;
  max-width: 620px; margin: 0 auto;
  padding: clamp(28px, 7vh, 88px) 24px 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.dateline {
  margin: 0 0 14px; color: var(--bone-faint);
  font-size: var(--fs-md); letter-spacing: .02em;   /* today's date, set like a notebook's: not a label */
}
.prompt {
  margin: 0; font: 300 var(--fs-display)/1.05 var(--serif);
  letter-spacing: -0.015em; font-variation-settings: "opsz" 72;
}
.prompt em { font-style: italic; color: var(--sea); }

.recorder { margin: clamp(36px, 7vh, 64px) 0 clamp(28px, 5vh, 44px); }
.orb {
  --size: clamp(118px, 30vw, 148px);
  position: relative; width: var(--size); height: var(--size);
  border: 0; border-radius: 50%; background: transparent; padding: 0;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 50% 38%, var(--ink-3), var(--ink-1) 70%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 18px 50px -18px rgba(0,0,0,.8);
  transition: border-color .4s var(--ease), box-shadow .4s var(--ease), transform .4s var(--ease);
}
.orb-ring::before {
  content: ""; position: absolute; inset: 14%; border-radius: 50%;
  border: 1px dashed var(--line);
}
.orb-core {
  position: relative; z-index: 2; width: 16px; height: 16px; border-radius: 50%;
  background: var(--sea); box-shadow: 0 0 0 6px var(--sea-glow), 0 0 30px var(--sea-glow);
  transition: border-radius .35s var(--ease), width .35s var(--ease), height .35s var(--ease), background .35s;
}
/* Drawn past the orb: it must never take a tap meant for Pause below it. */
.orb-wave { position: absolute; inset: -30%; width: 160%; height: 160%; z-index: 1; opacity: 0; transition: opacity .4s; pointer-events: none; }
@media (hover: hover) { .orb:hover .orb-ring { border-color: var(--sea-line); } }
.orb:active .orb-ring { transform: scale(.98); }
.orb.recording .orb-ring { border-color: var(--sea-ring); box-shadow: 0 0 0 1px rgba(134,205,185,.12), 0 0 60px -6px var(--sea-glow); }
.orb.recording .orb-core { width: 20px; height: 20px; border-radius: var(--radius-xs); background: var(--bone); box-shadow: none; }
.orb.recording .orb-wave { opacity: 1; }
.orb-caption {
  margin: 0; color: var(--bone-faint); font-size: var(--fs-sm); letter-spacing: .04em;
  font-variant-numeric: tabular-nums; min-height: 1.5em;
}
.orb.recording ~ .orb-under .orb-caption { color: var(--bone); letter-spacing: .12em; }
.orb.paused ~ .orb-under .orb-caption { color: var(--bone-dim); letter-spacing: .08em; }
/* Paused: a play glyph in a dashed ring; tapping resumes. */
.orb-play { position: relative; z-index: 2; width: 30px; height: 30px; color: var(--sea); display: none; }
.orb.paused .orb-play { display: block; }
.orb.paused .orb-core { display: none; }
.orb.paused .orb-ring { border: 1px dashed var(--sea); }
.orb.paused .orb-ring::before { border-color: rgba(134, 205, 185, 0.18); }
.orb-under { position: relative; z-index: 3; margin: 18px 0 0; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 34px; }
.orb-under .orb-caption { margin: 0; }
/* The other ways to capture, under the orb: one round button each. */
.capture-kinds { display: flex; justify-content: center; gap: 22px; margin: calc(-1 * clamp(8px, 2vh, 20px)) 0 clamp(24px, 4vh, 36px); }
.kind-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.kind-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-strong); color: var(--bone-dim);
  background: radial-gradient(circle at 50% 38%, var(--ink-3), var(--ink-1) 70%);
  transition: border-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.kind-icon svg { width: 26px; height: 26px; }
.kind-btn:focus-within .kind-icon { border-color: var(--sea-line); color: var(--sea); }
@media (hover: hover) { .kind-btn:hover .kind-icon { border-color: var(--sea-line); color: var(--sea); } }
.kind-btn:active .kind-icon { transform: scale(.96); }
.kind-label { color: var(--bone-faint); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; }
.round-btn {
  width: 34px; height: 34px; border-radius: 50%; padding: 0;
  background: var(--ink-2); border: 1px solid var(--ink-3); color: var(--bone);
  display: grid; place-items: center; transition: transform .2s var(--ease), border-color .2s;
}
.round-btn svg { width: 14px; height: 14px; }
@media (hover: hover) { .round-btn:hover { border-color: var(--line-strong); } }
.round-btn:active { transform: scale(.94); }
.orb-hint { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--bone-faint); }

/* This session's captures, newest first. */
.session { width: 100%; max-width: 440px; margin: 0 0 clamp(20px, 4vh, 32px); text-align: left; }
.session:empty { display: none; }
.session-row {
  display: grid; grid-template-columns: 16px auto 1fr auto 14px; align-items: center; gap: 12px;
  padding: 9px 4px; border-bottom: 1px solid var(--ink-3);
  color: var(--bone); font-size: var(--fs-md); font-variant-numeric: tabular-nums;
}
@media (hover: hover) { a.session-row:hover { background: rgba(236, 231, 220, 0.03); } }
.session-row .kind svg, .session-row .go svg { width: 14px; height: 14px; color: var(--bone-faint); display: block; }
.session-row .dur { color: var(--bone-dim); }
.session-row .stage { display: inline-flex; align-items: center; gap: 6px; color: var(--bone-dim); }
.session-row .stage::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: breathe 1.8s var(--ease) infinite; }
.session-row .stage.ok { color: var(--sea); }
.session-row .stage.bad { color: var(--rose); }
.session-row .stage.ok::before, .session-row .stage.bad::before, .session-row .stage.still::before { animation: none; }
.session-row .stage.done::before { width: 13px; height: 13px; border-radius: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5.5 12.5 10 17l8.5-9.5'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5.5 12.5 10 17l8.5-9.5'/></svg>") center / contain no-repeat; }
.session-last { margin: 0; text-align: center; font-size: var(--fs-xs); color: var(--bone-faint); }

.composer {
  width: 100%; display: flex; align-items: flex-end; gap: 8px;
  padding: 7px 7px 7px 18px; border-radius: var(--radius-lg);
  background: var(--panel); border: 1px solid var(--line);
  transition: border-color .25s, box-shadow .25s;
}
.composer:focus-within { border-color: var(--sea-line); box-shadow: 0 0 0 4px rgba(134, 205, 185, 0.06); }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: 0; background: transparent;
  padding: 9px 0; max-height: 40vh; line-height: 1.45; font-size: var(--fs-lg);
}
.composer textarea::placeholder { color: var(--bone-faint); font-family: var(--serif); font-style: italic; font-size: var(--fs-xl); }
.send, .mic {
  flex: 0 0 38px; height: 38px; border-radius: 50%; border: 0;
  display: grid; place-items: center; transition: transform .2s var(--ease), background .2s, opacity .2s;
}
.send { background: var(--sea); color: var(--ink-0); }
.send svg { width: 18px; height: 18px; stroke-width: 2; }
.send:disabled { opacity: .35; cursor: default; }
.send:not(:disabled):active, .mic:active { transform: scale(.94); }
.mic { background: var(--ink-3); color: var(--bone-dim); }
.mic svg { width: 18px; height: 18px; }
.mic.recording { background: var(--bone); color: var(--ink-0); }

/* Recent, folded under the composer */
.recent-fold .history-link { display: block; text-align: center; padding: 12px 0; font-size: var(--fs-md); color: var(--sea); }
.recent-fold { width: 100%; max-width: 560px; margin-top: clamp(24px, 5vh, 40px); text-align: left; }
.recent-fold > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 12px; color: var(--bone-faint);
  font-size: var(--fs-2xs); letter-spacing: .2em; text-transform: uppercase;
  transition: color .2s var(--ease);
}
.recent-fold > summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .recent-fold > summary:hover { color: var(--bone-dim); } }
.recent-fold > summary svg { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.recent-fold[open] > summary svg { transform: rotate(180deg); }
.recent-fold .recent-list { padding: 0 0 20px; }
.recent-fold .day-label:first-child { margin-top: 6px; }

.outbox-line {
  margin: 22px 0 0; font-size: var(--fs-sm); color: var(--bone-dim);
  display: inline-flex; align-items: center; gap: 8px;
}
.outbox-line::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--moon); animation: breathe 1.8s var(--ease) infinite; }

/* Staggered arrival */
.view.active .capture-inner > * { animation: rise .7s var(--ease) both; }
.view.active .capture-inner > :nth-child(2) { animation-delay: .06s; }
.view.active .capture-inner > :nth-child(3) { animation-delay: .14s; }
.view.active .capture-inner > :nth-child(4) { animation-delay: .22s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ------------------------------------------------------------------ recent */
.pane-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 26px 22px 14px;
}
.pane-head h2 { margin: 0; font: 400 var(--fs-h1)/1 var(--serif); letter-spacing: -0.01em; }
.ghost-icon {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--bone-dim); display: grid; place-items: center;
}
.ghost-icon svg { width: 17px; height: 17px; }
@media (hover: hover) { .ghost-icon:hover { color: var(--bone); border-color: var(--line-strong); } }
.ghost-icon.spinning svg { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.recent-list-pane { overflow-y: auto; height: 100%; -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) and (max-width: 959px) {
  .recent-list-pane > * { max-width: 760px; margin-left: auto; margin-right: auto; }
}
.recent-list { padding: 0 10px 30px; }
.day-label {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 12px 6px; color: var(--bone-faint);
  font-size: var(--fs-2xs); letter-spacing: .2em; text-transform: uppercase;
}
.day-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.entry {
  display: grid; grid-template-columns: minmax(56px, auto) 1fr; gap: 4px 14px;
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 14px 12px; border-radius: var(--radius); position: relative;
  transition: background .2s var(--ease);
  animation: rise .5s var(--ease) both;
}
@media (hover: hover) { .entry:hover { background: var(--panel-hover); } }
.entry.selected { background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--sea-line-soft); }
.entry-time { grid-row: span 3; white-space: nowrap; color: var(--bone-faint); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; padding-top: 3px; }
.entry-time .kind { display: block; margin-top: 6px; color: var(--bone-faint); }
.entry-time .kind svg { width: 15px; height: 15px; }
.entry-title { font: 400 var(--fs-xl)/1.3 var(--serif); color: var(--bone); letter-spacing: -0.005em; }
.entry-excerpt {
  color: var(--bone-dim); font-size: var(--fs-md); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.entry-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; color: var(--bone-faint); font-size: var(--fs-xs); }
.entry-meta .thread { color: var(--sea); }
.status-dot { display: inline-flex; align-items: center; gap: 6px; }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sea); }
.status-dot.working::before { background: var(--moon); animation: breathe 1.6s infinite; }

.empty, .error-line { padding: 40px 22px; color: var(--bone-faint); font-family: var(--serif); font-style: italic; font-size: var(--fs-xl); }
.error-line { color: var(--rose); font-style: normal; font-family: var(--sans); font-size: var(--fs-md); }

/* Detail: a full-screen sheet on phones, a pane on wide screens. */
.detail-pane {
  position: fixed; z-index: 30; inset: calc(var(--crumb-h, 0px) + env(safe-area-inset-top)) 0 0 0;
  background: var(--ink-0);
  transform: translateX(104%); transition: transform .42s var(--ease);
  display: flex; flex-direction: column;
}
.detail-pane.open { transform: none; box-shadow: -30px 0 60px rgba(0,0,0,.5); }
.detail-empty { display: none; }
.serif-quiet { font: italic 400 var(--fs-2xl)/1.6 var(--serif); color: var(--bone-faint); text-align: center; }

@media (min-width: 960px) {
  .view-recent.active { grid-template-columns: minmax(320px, 400px) 1fr; }
  .recent-list-pane { border-right: 1px solid var(--line); }
  .detail-pane { position: relative; inset: auto; z-index: auto; transform: none; transition: none; background: transparent; padding-top: 0; height: 100%; }
  .detail-pane, .detail-pane.open { box-shadow: none; }
  .detail-empty { display: grid; place-items: center; height: 100%; padding: 40px; }
  .detail-top .detail-back { display: none; }
}

.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.detail-inner { max-width: 720px; margin: 0 auto; padding: 8px 24px 40px; }
.detail-top {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 6px; color: var(--bone-faint); font-size: var(--fs-sm);
}
.detail-back {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none;
  color: var(--bone-dim); padding: 6px 8px 6px 2px; font-size: var(--fs-md);
}
.detail-back svg { width: 20px; height: 20px; }
.detail-top .when { margin-left: auto; font-variant-numeric: tabular-nums; }
@media (min-width: 960px) { .detail-top { padding: 30px 24px 0; max-width: 720px; margin: 0 auto; width: 100%; } }

.headline { margin: 14px 0 6px; font: 400 var(--fs-headline)/1.18 var(--serif); letter-spacing: -0.015em; }
.byline { margin: 0 0 24px; color: var(--bone-faint); font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: 4px 14px; }

.section { margin: 34px 0 0; animation: rise .55s var(--ease) both; }
.section:nth-of-type(2) { animation-delay: .05s; }
.section:nth-of-type(3) { animation-delay: .1s; }
.section:nth-of-type(4) { animation-delay: .15s; }
.label {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
  font-size: var(--fs-2xs); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-faint);
}
.label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.label .tag-inferred { letter-spacing: .06em; text-transform: none; font-family: var(--serif); font-style: italic; font-size: var(--fs-sm); color: var(--moon); }

/* What he said */
.said {
  position: relative; margin: 0; padding-left: 18px; border-left: 1px solid var(--line-strong);
  font: 400 var(--fs-xl)/1.7 var(--serif); color: var(--bone); white-space: pre-wrap; overflow-wrap: anywhere;
}
.said.clamped { max-height: 17em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.link-btn { margin-top: 10px; border: 0; background: none; color: var(--sea); font-size: var(--fs-sm); padding: 4px 0; }

/* What the system made of it */
.filed { list-style: none; margin: 0; padding: 0; }
.filed li { border-top: 1px solid var(--line); }
.filed li:last-child { border-bottom: 1px solid var(--line); }
.filed summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: baseline;
  padding: 13px 2px;
}
.filed summary::-webkit-details-marker { display: none; }
.type-tag { font-size: var(--fs-2xs); letter-spacing: .14em; text-transform: uppercase; color: var(--sea); white-space: nowrap; }
.filed .title { font: 400 var(--fs-lg)/1.35 var(--serif); }
.conf { display: inline-flex; gap: 3px; align-items: center; }
.conf i { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.conf i.on { background: var(--bone-dim); }
.filed .body { padding: 0 2px 16px 106px; color: var(--bone-dim); font-size: var(--fs-md); line-height: 1.6; }
.filed .body .dest { display: block; margin-top: 8px; color: var(--bone-faint); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.filed .body blockquote { margin: 8px 0 0; font: italic 400 var(--fs-lg)/1.5 var(--serif); color: var(--bone); }
@media (max-width: 560px) {
  .filed summary { grid-template-columns: 1fr auto; }
  .filed summary .type-tag { grid-column: 1 / -1; margin-bottom: -8px; }
  .filed .body { padding-left: 2px; }
}
.loops { margin: 16px 0 0; padding: 0; list-style: none; }
.loops li { position: relative; padding: 6px 0 6px 22px; color: var(--bone-dim); font-size: var(--fs-md); }
.loops li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--bone-faint); }

/* Model inference: always visibly the model's, never his */
.inferred {
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--moon-wash); border: 1px solid var(--moon-line);
  color: var(--moon); font: 400 var(--fs-lg)/1.6 var(--serif);
}
.inferred p { margin: 0 0 10px; }
.inferred p:last-child { margin: 0; }
.facets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-family: var(--sans); }
.facet { font-size: var(--fs-xs); padding: 4px 10px; border-radius: var(--pill); border: 1px solid var(--moon-line); color: var(--moon); }
.facet b { font-weight: 500; color: var(--bone-dim); margin-right: 4px; }
.emotions { margin: 14px 0 0; padding: 0; list-style: none; font-family: var(--sans); font-size: var(--fs-md); }
.emotions li { padding: 5px 0; color: var(--moon); }
.emotions li q { font-family: var(--serif); font-style: italic; color: var(--bone-dim); }
.provenance { margin-top: 14px; font: var(--fs-xs) var(--sans); color: var(--bone-faint); }

/* Thread */
.thread { display: flex; flex-direction: column; gap: 18px; }
.msg-you { font: 400 var(--fs-xl)/1.65 var(--serif); color: var(--bone); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { display: block; margin-bottom: 4px; font: var(--fs-xs) var(--sans); color: var(--bone-faint); letter-spacing: .02em; }
.msg-reply {
  margin-left: clamp(0px, 4vw, 28px); padding: 12px 16px; border: 1px solid var(--moon-line); border-radius: var(--radius);
  background: var(--moon-wash);
  color: var(--moon); font: 400 var(--fs-lg)/1.65 var(--serif);
}
.msg-reply .md p { margin: 0 0 10px; }
.msg-reply .md p:last-child { margin-bottom: 0; }
.msg-reply.error { border-color: var(--rose-line); background: none; color: var(--rose); font: var(--fs-md) var(--sans); }
.pending-dots { display: inline-flex; gap: 5px; padding: 6px 0; }
.pending-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--moon); animation: breathe 1.4s infinite; }
.pending-dots i:nth-child(2) { animation-delay: .2s; }
.pending-dots i:nth-child(3) { animation-delay: .4s; }
.sending { opacity: .6; }

.detail-composer {
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--ink-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.detail-composer .composer { max-width: 720px; margin: 0 auto; }
.detail-composer .rec-live { display: none; flex: 1; align-items: center; gap: 10px; padding: 9px 0; color: var(--bone); font-variant-numeric: tabular-nums; }
.detail-composer.recording .rec-live { display: flex; }
.detail-composer.recording textarea { display: none; }
.rec-live canvas { flex: 1; height: 24px; min-width: 0; }

/* Markdown answers */
.md h4 { margin: 18px 0 6px; font: 500 var(--fs-lg)/1.3 var(--serif); color: var(--bone); }
.md h4:first-child { margin-top: 0; }
.md ul, .md ol { margin: 6px 0 12px; padding-left: 20px; }
.md li { margin: 3px 0; }
.md cite { font-style: italic; color: var(--bone); }
.md code { font-size: .88em; padding: 1px 5px; border-radius: var(--radius-xs); background: var(--ink-3); color: var(--bone-dim); }
.md strong { color: var(--bone); font-weight: 500; }

/* -------------------------------------------------------------------- team */
.view-team { padding-bottom: 40px; }
.team-head { flex-direction: column; align-items: flex-start; gap: 8px; max-width: 980px; margin: 0 auto; }
.lede { margin: 0; color: var(--bone-faint); font-size: var(--fs-md); }
.team-grid {
  max-width: 980px; margin: 0 auto; padding: 8px 18px 30px;
  display: grid; grid-template-columns: 1fr; gap: 12px;
}
@media (min-width: 700px) { .team-grid { grid-template-columns: 1fr 1fr; } }
.advisor {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  padding: 22px 22px 20px; transition: border-color .3s, background .3s; animation: rise .5s var(--ease) both;
}
.advisor:nth-child(2) { animation-delay: .05s; } .advisor:nth-child(3) { animation-delay: .1s; } .advisor:nth-child(4) { animation-delay: .15s; }
.advisor.open { grid-column: 1 / -1; border-color: var(--sea-line-soft); background: var(--ink-1); }
.advisor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: 100%; border: 0; background: none; text-align: left; padding: 0; }
.advisor-name { font: italic 400 var(--fs-h1)/1.1 var(--serif); text-transform: capitalize; }
.advisor-role { margin-top: 6px; color: var(--bone-dim); font-size: var(--fs-md); }
.advisor-cadence { color: var(--bone-faint); font-size: var(--fs-2xs); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; padding-top: 8px; }
.advisor-body { display: none; margin-top: 18px; }
.advisor.open .advisor-body { display: block; }
.advisor .composer textarea { font-size: var(--fs-lg); }
.answer { margin-top: 18px; }
.answer .inferred { font-size: var(--fs-lg); }
.answer-meta { margin-top: 10px; font-size: var(--fs-xs); color: var(--bone-faint); }

/* ------------------------------------------------------------------ dialog */
.sheet {
  width: min(460px, 100vw); max-width: 100vw; margin: auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: 0;
  background: var(--ink-1); color: var(--bone);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.8);
}
.sheet::backdrop { background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet form { padding: 26px 24px 22px; }
.sheet-head h2 { margin: 0 0 4px; font: 400 var(--fs-h1)/1.1 var(--serif); }
.sheet-head { margin-bottom: 22px; }
.sheet label { display: block; margin-bottom: 16px; font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--bone-faint); }
.sheet label .scope { letter-spacing: .04em; text-transform: none; color: var(--bone-faint); font-size: var(--fs-2xs); margin-left: 6px; }
.sheet input, .sheet select {
  display: block; width: 100%; margin-top: 7px; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-0);
  font-size: var(--fs-lg); letter-spacing: 0; text-transform: none; color: var(--bone);
  -webkit-appearance: none; appearance: none;
}
.sheet select { background-image: linear-gradient(45deg, transparent 50%, var(--bone-faint) 50%), linear-gradient(135deg, var(--bone-faint) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.sheet input:focus, .sheet select:focus { outline: 0; border-color: var(--sea-ring); }
.sheet small { display: block; margin-top: 7px; font-size: var(--fs-xs); letter-spacing: 0; text-transform: none; color: var(--bone-faint); line-height: 1.45; }
.conn { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-0); }
.conn-head { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--bone-faint); }
.conn-head .link-btn { margin: 0; letter-spacing: 0; text-transform: none; }
.conn ul { list-style: none; margin: 8px 0 0; padding: 0; font-size: var(--fs-md); }
.conn li { display: flex; gap: 10px; padding: 4px 0; color: var(--bone-dim); }
.conn li b { width: 14px; flex: 0 0 14px; font-weight: 600; }
.conn li b svg, .step-mark svg { display: block; width: 14px; height: 14px; stroke-width: 2.2; }
.step-mark svg { width: 12px; height: 12px; }
.conn li.ok b { color: var(--sea); }
.conn li.bad b { color: var(--rose); }
.conn li.wait b { color: var(--moon); }
.conn li span small { color: var(--bone-faint); }
.pair { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-0); }
.pair .link-btn { margin: 0; }
.pair-qr { margin: 14px auto 10px; width: min(240px, 70vw); }
.pair-qr img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); image-rendering: pixelated; }
.pair p { margin: 0; text-align: center; font-size: var(--fs-md); color: var(--bone-dim); }
.pair-actions { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; }
.pair-actions .btn-quiet { border: 1px solid var(--line-strong); padding: 8px 16px; }
.pair small { display: block; margin-top: 8px; font-size: var(--fs-xs); color: var(--bone-faint); text-align: center; line-height: 1.45; }
.install-app { margin: 4px 0 18px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-0); }
.install-app a { color: var(--sea); font-size: var(--fs-base); }
.install-app small { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--bone-faint); }
.install-app p { margin: 0; }
.install-app p + p { margin-top: 12px; }
/* More settings: drawn from the server's keys, grouped by area */
.more-settings { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-0); }
.more-settings > summary { cursor: pointer; font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--sea); }
.more-settings > summary .scope { letter-spacing: .04em; text-transform: none; color: var(--bone-faint); font-size: var(--fs-2xs); margin-left: 6px; }
.set-area { border: 0; margin: 16px 0 0; padding: 0; }
.set-area legend { padding: 0; margin-bottom: 10px; font: italic 400 var(--fs-lg) var(--serif); color: var(--bone-dim); }
.set-area label:last-child { margin-bottom: 0; }
.sheet .set-area input, .sheet .set-area select { background-color: var(--ink-1); }
.sheet .set-reset { margin: 0 0 0 8px; padding: 0; font-size: var(--fs-xs); letter-spacing: 0; text-transform: none; }
.set-reset:disabled { color: var(--bone-faint); cursor: default; }
.sheet .set-toggle { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; }
.set-toggle small { grid-column: 1 / -1; }
.sheet .set-toggle input[type=checkbox] {
  width: 42px; height: 24px; margin: 0; padding: 0; border-radius: var(--pill); position: relative; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--ink-3); transition: background .2s var(--ease), border-color .2s;
}
.sheet .set-toggle input[type=checkbox]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bone-dim); transition: transform .2s var(--ease), background .2s;
}
.sheet .set-toggle input[type=checkbox]:checked { background: var(--sea-deep); border-color: var(--sea); }
.sheet .set-toggle input[type=checkbox]:checked::after { transform: translateX(18px); background: var(--sea); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.account { margin: 0 0 18px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-0); }
.account .link-btn { margin: 4px 0 0; }
.account-who { margin: 8px 0 0; font-size: var(--fs-md); color: var(--bone-dim); overflow-wrap: anywhere; }
.account #pwBox { margin-top: 12px; }
.account .devices { margin-top: 10px; font-size: var(--fs-sm); color: var(--bone-faint); }
.account .devices summary { cursor: pointer; color: var(--sea); }
.account .devices ul { list-style: none; margin: 8px 0 0; padding: 0; }
.account .devices li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.account .devices li span { color: var(--bone-dim); overflow-wrap: anywhere; }
.account .devices li .link-btn { margin: 0; flex: none; }
.signin-error { margin: 0 0 12px; font-size: var(--fs-md); color: var(--rose); }
.signin-foot { margin-top: 18px; }
.btn, .btn-quiet { border-radius: var(--pill); padding: 11px 20px; font-size: var(--fs-md); border: 0; }
.btn { background: var(--sea); color: var(--ink-0); font-weight: 600; }
.btn-quiet { background: transparent; color: var(--bone-dim); }
@media (max-width: 559px) {
  .sheet { margin: auto 0 0; width: 100vw; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0; }
  .sheet form { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .sheet[open] { animation: sheet-up .38s var(--ease); }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------- toast */
.toast {
  position: fixed; z-index: 50; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: var(--pill); background: var(--ink-3); border: 1px solid var(--line-strong);
  font-size: var(--fs-md); color: var(--bone); box-shadow: 0 16px 40px -10px rgba(0,0,0,.7);
  transition: opacity .3s var(--ease), transform .3s var(--ease); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { color: var(--rose); }
.toast.has-act { pointer-events: auto; display: flex; align-items: baseline; gap: 14px; }
.toast-act { border: 0; background: none; padding: 0; color: var(--sea); font: inherit; font-weight: 500; cursor: pointer; }
@media (min-width: 960px) { .toast { left: calc(50% + var(--rail) / 2); bottom: 28px; } }

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

/* ----------------------------------------------------------------- library */
.lib-tools { padding: 0 22px 6px; }
.lib-tools input[type=search] {
  width: 100%; padding: 11px 16px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--panel); font-size: var(--fs-lg); outline: 0; -webkit-appearance: none; appearance: none;
}
.lib-tools input[type=search]:focus { border-color: var(--sea-line); }
.lib-tools input::placeholder { color: var(--bone-faint); font-family: var(--serif); font-style: italic; }
.lib-picker { position: relative; padding: 10px 0 4px; }
.picker-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  border: 1px solid var(--line); background: transparent; color: var(--bone);
  border-radius: var(--radius-sm); padding: 7px 10px 7px 14px; font-size: var(--fs-md);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.picker-btn[aria-expanded=true] { border-color: var(--line-strong); background: var(--ink-2); }
@media (hover: hover) { .picker-btn:hover { border-color: var(--line-strong); background: var(--ink-2); } }
.picker-btn .picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn b { font-weight: 400; color: var(--sea); font-variant-numeric: tabular-nums; }
.picker-btn svg { width: 16px; height: 16px; color: var(--bone-faint); transition: transform .2s var(--ease); }
.picker-btn[aria-expanded=true] svg { transform: rotate(180deg); }
.picker-pop {
  position: absolute; z-index: 15; left: 0; top: calc(100% + 2px); width: min(300px, 100%);
  padding: 6px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--ink-2);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .75);
  animation: rise .2s var(--ease) both;
}
.picker-pop input {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--ink-1); font-size: var(--fs-lg); outline: 0;
}
.picker-pop input:focus { border-color: var(--sea-line); }
.picker-pop input::placeholder { color: var(--bone-faint); font-family: var(--serif); font-style: italic; }
.picker-list { max-height: min(360px, 50vh); overflow-y: auto; margin-top: 6px; }
.picker-opt {
  display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  border: 0; background: none; color: var(--bone-dim); padding: 8px 10px; border-radius: var(--radius-sm); font-size: var(--fs-md);
}
.picker-opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-opt b { font-weight: 400; font-size: var(--fs-xs); color: var(--bone-faint); font-variant-numeric: tabular-nums; }
.picker-opt.active { background: var(--ink-3); color: var(--bone); }
.picker-opt.on { color: var(--bone); }
.picker-opt.on b { color: var(--sea); }
.picker-none { margin: 0; padding: 10px; color: var(--bone-faint); font: italic 400 var(--fs-lg) var(--serif); }
.entry .cat { display: block; margin-top: 5px; color: var(--bone-faint); font-size: var(--fs-2xs); letter-spacing: .12em; text-transform: uppercase; white-space: normal; max-width: 76px; }
.task-text code { font: .85em var(--sans); padding: 1px 5px; border-radius: var(--radius-xs); background: var(--ink-3); color: var(--bone-dim); overflow-wrap: anywhere; }
.task-text strong { font-weight: 500; }
.entry-meta .review { color: var(--moon); }
.task-row, .loop-row {
  display: grid; grid-template-columns: 26px 1fr; gap: 4px 10px; align-items: start;
  padding: 11px 12px; border-radius: var(--radius);
}
@media (hover: hover) { .task-row:hover, .loop-row:hover { background: var(--panel-hover); } }
.task-text { font: 400 var(--fs-lg)/1.4 var(--serif); }
.task-row.done .task-text { color: var(--bone-faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task-where { grid-column: 2; font-size: var(--fs-xs); color: var(--bone-faint); }
.task-where a, .loop-row a { color: var(--bone-dim); border-bottom: 1px solid var(--line-strong); }
.tick {
  width: 20px; height: 20px; margin-top: 2px; border-radius: var(--radius-xs); padding: 0;
  border: 1.5px solid var(--bone-faint); background: transparent; color: var(--ink-0);
  display: grid; place-items: center; transition: background .2s, border-color .2s;
}
.tick svg { width: 13px; height: 13px; stroke-width: 2.5; opacity: 0; }
.tick.on { background: var(--sea); border-color: var(--sea); }
.tick.on svg { opacity: 1; }
.tick:disabled { opacity: .5; }
.loop-row::before { content: ""; margin: 7px 0 0 5px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--bone-faint); }

/* A vault file, read in full */
.doc-body { font: 400 var(--fs-lg)/1.7 var(--serif); color: var(--bone); overflow-wrap: anywhere; }
.doc-body h4 { margin: 26px 0 8px; font: 500 var(--fs-2xs)/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-faint); }
.doc-body h4.h1 { display: none; }
.doc-body p { margin: 0 0 12px; }
.doc-body ul, .doc-body ol { margin: 0 0 12px; padding-left: 20px; }
.doc-body li { margin: 4px 0; }
.doc-body li.task { list-style: none; margin-left: -22px; display: flex; gap: 10px; }
.doc-body li.task.done > span { color: var(--bone-faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.doc-body blockquote { margin: 0 0 12px; padding-left: 16px; border-left: 1px solid var(--line-strong); font-style: italic; color: var(--bone); }
.doc-body em { color: var(--bone-dim); }
.doc-body hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.doc-body code { font: .85em var(--sans); padding: 1px 5px; border-radius: var(--radius-xs); background: var(--ink-3); color: var(--bone-dim); }
.doc-body a, .dest a, .src-row, .mention a { color: var(--sea); }
.doc-body a.capture-link { font: var(--fs-sm) var(--sans); }
.doc-body a.dead { color: var(--bone-dim); border-bottom: 1px dashed var(--line-strong); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; align-items: center; }
.pill-btn {
  border: 1px solid var(--line-strong); background: transparent; color: var(--bone-dim);
  border-radius: var(--pill); padding: 7px 14px; font-size: var(--fs-sm);
}
@media (hover: hover) { .pill-btn:hover { color: var(--bone); } }
.pill-btn:disabled { opacity: .45; cursor: default; }
.pill-btn.armed { border-color: var(--sea); color: var(--sea); }
.pill-select {
  border: 1px solid var(--line-strong); background: var(--ink-0); color: var(--bone-dim);
  border-radius: var(--pill); padding: 7px 12px; font-size: var(--fs-sm); max-width: 100%;
}
.src-list { list-style: none; margin: 0; padding: 0; }
.src-list li { border-top: 1px solid var(--line); }
.src-list li:last-child { border-bottom: 1px solid var(--line); }
.src-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 11px 2px; }
.src-row .t { font: 400 var(--fs-lg)/1.35 var(--serif); color: var(--bone); }
.src-row .w { font-size: var(--fs-xs); color: var(--bone-faint); white-space: nowrap; }
.src-row .x { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--bone-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fm { margin-top: 10px; font-size: var(--fs-sm); color: var(--bone-faint); }
.fm summary { cursor: pointer; }
.fm dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 8px 0 0; }
.fm dt { color: var(--bone-faint); }
.fm dd { margin: 0; color: var(--bone-dim); overflow-wrap: anywhere; }

/* How a capture was processed */
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps li { position: relative; display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 12px; padding: 0 0 16px; }
.steps li::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 1px; background: var(--line-strong); }
.steps li:last-child::before { display: none; }
.step-mark { width: 21px; height: 21px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: var(--fs-2xs); color: var(--bone-faint); background: var(--ink-0); position: relative; z-index: 1; }
.steps .done .step-mark { border-color: var(--sea); color: var(--sea); }
.steps .failed .step-mark { border-color: var(--rose); color: var(--rose); }
.steps .running .step-mark { border-color: var(--moon); color: var(--moon); animation: breathe 1.4s infinite; }
.steps .skipped .step-mark { border-style: dashed; }
.step-label { font-size: var(--fs-md); color: var(--bone); padding-top: 1px; }
.steps .pending .step-label, .steps .skipped .step-label { color: var(--bone-faint); }
.step-at { font-size: var(--fs-xs); color: var(--bone-faint); padding-top: 2px; font-variant-numeric: tabular-nums; }
.step-detail { grid-column: 2 / -1; font-size: var(--fs-sm); color: var(--bone-faint); overflow-wrap: anywhere; }
.step-detail .err { color: var(--rose); }
.step-outs { grid-column: 2 / -1; list-style: none; margin: 6px 0 0; padding: 0; font-size: var(--fs-sm); }
.step-outs li { display: block; padding: 3px 0; }
.step-outs li::before { display: none; }
.step-outs .type-tag { margin-right: 8px; }
.step-outs a { color: var(--bone-dim); border-bottom: 1px solid var(--line-strong); overflow-wrap: anywhere; }
.step-outs .gone { color: var(--bone-faint); }
.job-line { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--moon); display: flex; align-items: center; gap: 10px; }
.job-line.failed { color: var(--rose); }
.rerun { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* The steward, and anything it proposes */
.steward { margin-top: 18px; }
.steward .composer { padding-left: 16px; }
.steward textarea { font-size: var(--fs-base); }
.steward .answer .inferred { font-size: var(--fs-base); }
.proposals { list-style: none; margin: 12px 0 0; padding: 0; }
.proposals li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.proposals .p-label { font-size: var(--fs-md); color: var(--bone); }
.proposals .p-why { grid-column: 1; font: italic var(--fs-sm)/1.45 var(--serif); color: var(--moon); }
.proposals .p-err { grid-column: 1 / -1; font-size: var(--fs-sm); color: var(--bone-faint); }
.proposals .applied { color: var(--sea); font-size: var(--fs-sm); }

/* Food capture: the annotated photo, full width, tap-free. */
.food-photo { display: block; width: 100%; border-radius: var(--radius-sm); margin: 0 0 18px; background: rgba(255,255,255,.04); min-height: 120px; }

/* ------------------------------------------------------------------ queues */
/* The open-item count on the Queues tab */
.nav-links a { position: relative; }
.nav-badge {
  position: absolute; top: 7px; left: calc(50% + 5px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--pill);
  background: var(--sea); color: var(--ink-0); font: 600 var(--fs-2xs)/17px var(--sans); text-align: center;
  font-variant-numeric: tabular-nums; letter-spacing: 0;
}
@media (min-width: 960px) {
  .nav-badge { position: static; margin-left: auto; }
  .rail-collapsed .nav-badge { position: absolute; top: 4px; left: calc(50% + 3px); }
}

.view-queues.active { display: flex; flex-direction: column; overflow: hidden; }
.q-head { position: relative; align-items: center; max-width: 820px; width: 100%; margin: 0 auto; }
.q-head h2 { flex: 1; min-width: 0; }
.q-jump { position: relative; }
.q-pos {
  border: 1px solid transparent; background: none; color: var(--bone-faint); border-radius: var(--pill); padding: 5px 10px;
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.q-pos[aria-expanded=true] { border-color: var(--line-strong); color: var(--bone); }
@media (hover: hover) { .q-pos:not(:disabled):hover { border-color: var(--line-strong); color: var(--bone); } }
.q-pos:disabled { cursor: default; }
.q-jump-pop { left: auto; right: 0; width: min(380px, calc(100vw - 32px)); }
.q-jump-pop .picker-opt b:first-child { min-width: 22px; text-align: right; }
.q-jump-pop .picker-opt { align-items: baseline; }
.q-jump-pop .picker-opt span { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@media (max-width: 559px) {        /* the header's width, not the button's */
  .q-jump { position: static; }
  .q-jump-pop { left: 16px; right: 16px; width: auto; top: calc(100% - 6px); }
}
/* Section picker, search and when: one row on a phone */
.q-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 22px 12px;
  max-width: 820px; width: 100%; margin: 0 auto; flex: none;
}
.q-tools .q-picker { padding: 0; flex: none; max-width: 46%; }
.q-tools input[type=search] {
  flex: 1; min-width: 0; padding: 7px 14px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--panel); font-size: var(--fs-lg); outline: 0; -webkit-appearance: none; appearance: none;
}
.q-tools input[type=search]:focus { border-color: var(--sea-line); }
.q-tools input::placeholder { color: var(--bone-faint); font-family: var(--serif); font-style: italic; font-size: var(--fs-md); }
.q-closed { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-md); color: var(--bone-dim); cursor: pointer; }
.q-hist-link { display: inline-block; margin: 0 0 10px 2px; font-size: var(--fs-sm); color: var(--sea); }
@media (hover: hover) { .q-hist-link:hover { text-decoration: underline; } }
.q-closed input { accent-color: var(--sea); margin: 0; }
.q-found .q-hist-status { margin-right: 10px; padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--ink-1); color: var(--bone-dim); font-size: var(--fs-sm); }
.q-tools select {
  flex: none; padding: 7px 28px 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); color: var(--bone-dim);
  background: transparent linear-gradient(45deg, transparent 50%, var(--bone-faint) 50%) calc(100% - 15px) 52% / 5px 5px no-repeat,
    linear-gradient(135deg, var(--bone-faint) 50%, transparent 50%) calc(100% - 10px) 52% / 5px 5px no-repeat;
  font-size: var(--fs-md); -webkit-appearance: none; appearance: none;
}
.q-range { display: flex; flex-wrap: wrap; gap: 8px 14px; width: 100%; font-size: var(--fs-sm); color: var(--bone-faint); }
.q-range input { margin-left: 6px; padding: 5px 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--ink-1); color: var(--bone); font-size: var(--fs-md); }
.q-picker-pop { width: min(280px, calc(100vw - 44px)); }
.q-picker-pop .picker-list { max-height: min(460px, 65vh); margin-top: 0; }
.picker-head { margin: 10px 10px 3px; font-size: var(--fs-2xs); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-faint); }
.picker-head:first-child { margin-top: 4px; }
.q-found { margin: 4px 0 10px; font-size: var(--fs-sm); color: var(--bone-faint); }
.q-found .link-btn { margin: 0 0 0 4px; padding: 0; }
.q-rows { display: flex; flex-direction: column; }
.q-row { display: block; padding: 12px 4px; border-top: 1px solid var(--line); color: var(--bone); }
@media (hover: hover) { .q-row:hover { background: var(--ink-1); } }
.q-row-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: var(--fs-xs); color: var(--bone-faint); }
.q-row-st { color: var(--moon); }
.q-row-when { margin-left: auto; }
.q-row-title { display: block; margin-top: 4px; font: 400 var(--fs-xl)/1.4 var(--serif); }
.q-back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px; font-size: var(--fs-sm); color: var(--sea); }
.q-back svg { width: 16px; height: 16px; }
.q-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.q-inner { max-width: 820px; margin: 0 auto; padding: 0 22px 40px; }
.q-composer { flex: none; }

.q-card.enter { animation: rise .45s var(--ease) both; }
.q-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 6px; color: var(--bone-faint); font-size: var(--fs-sm); }
.q-top > span:not(.q-steps) ~ span:not(.q-steps)::before { content: "·"; margin-right: 12px; color: var(--bone-faint); }
.byline .q-kind { color: var(--bone-dim); font-weight: 500; }
.q-steps { margin-left: auto; display: flex; gap: 6px; }
.q-steps .ghost-icon { width: 32px; height: 32px; }
.q-title { margin-top: 10px; overflow-wrap: anywhere; }
.q-title-edit {
  display: block; width: 100%; margin: 12px 0 6px; padding: 8px 12px; border-radius: var(--radius);
  border: 1px solid var(--sea-line); background: var(--ink-1);
  font: 400 var(--fs-headline)/1.2 var(--serif); outline: 0;
}
.byline .q-status { color: var(--moon); }
.byline .q-status.failed { color: var(--rose); }
.byline .q-status.done, .byline .q-status.approved { color: var(--sea); }

.q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.q-actions .btn { padding: 9px 20px; }
.q-snooze { position: relative; }
.q-menu {
  position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; width: 230px;
  display: flex; flex-direction: column; padding: 6px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--ink-2); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .75);
  animation: rise .2s var(--ease) both;
}
.q-menu button { border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--bone-dim); font-size: var(--fs-md); }
@media (hover: hover) { .q-menu button:hover { background: var(--ink-3); color: var(--bone); } }
.q-menu label { display: block; padding: 8px 10px 4px; font-size: var(--fs-2xs); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-faint); }
.q-menu input { display: block; width: 100%; margin-top: 6px; padding: 7px 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--ink-1); font-size: var(--fs-md); }
.q-menu .q-menu-go { color: var(--sea); }
.q-reject { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.q-reject input {
  flex: 1 1 220px; min-width: 0; padding: 9px 14px; border-radius: var(--pill); border: 1px solid var(--line-strong);
  background: var(--ink-1); font-size: var(--fs-base); outline: 0;
}
.q-reject input:focus { border-color: var(--sea-ring); }
@media (max-width: 559px) {   /* the reason gets the whole line; Reject and Cancel sit together under it */
  .q-reject input { flex-basis: 100%; }
}

/* The item's own content */
.q-fields { display: grid; grid-template-columns: minmax(80px, auto) 1fr; gap: 8px 18px; margin: 22px 0 0; font-size: var(--fs-base); }
.q-fields dt { color: var(--bone-faint); font-size: var(--fs-2xs); letter-spacing: .14em; text-transform: uppercase; padding-top: 3px; }
.q-fields dd { margin: 0; color: var(--bone); overflow-wrap: anywhere; }
.q-fields dd.md p { margin: 0 0 6px; }
@media (max-width: 559px) {   /* label over value: the value gets the whole line */
  .q-fields { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .q-fields dd { margin-bottom: 10px; }
}
.q-body { margin-top: 18px; color: var(--bone-dim); font: 400 var(--fs-lg)/1.65 var(--serif); }
.q-body p { margin: 0 0 10px; }
.q-draft-wrap { margin-top: 18px; }
.q-draft {
  display: block; width: 100%; min-height: 140px; resize: vertical; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--ink-1); outline: 0;
  font: 400 var(--fs-xl)/1.65 var(--serif); color: var(--bone); overflow: hidden;
}
.q-draft:focus { border-color: var(--sea-ring); }
.q-draft[readonly] { border-color: var(--line); background: transparent; }
.q-draft-wrap .pill-btn { margin-top: 8px; border-color: var(--sea); color: var(--sea); }
.q-question { margin: 18px 0 0; padding-left: 18px; border-left: 1px solid var(--moon); font: italic 400 var(--fs-2xl)/1.55 var(--serif); color: var(--moon); }
.q-answer { margin-top: 16px; }
.q-answered { margin-top: 16px; }
.q-held { margin: 18px 0 0; }
.q-will { margin: -6px 0 16px; font-size: var(--fs-md); color: var(--bone-faint); }
.q-outcome { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid var(--sea); border-radius: var(--radius); }
.q-outcome p { margin: 0; font: 400 var(--fs-xl)/1.45 var(--serif); color: var(--bone); }
.q-outcome .link-btn { margin: 6px 0 0; padding: 0; }
.q-outcome.failed { border-color: var(--rose); }
.q-outcome.working { border-style: dashed; }
.q-outcome.working .pending-dots { margin: 8px 0 0; }
.q-excerpt { margin: 10px 0 0; padding: 10px 12px; font-size: var(--fs-base); line-height: 1.5; }
.q-excerpt .tag-inferred { display: block; margin-bottom: 4px; }
.q-outcome-go { display: flex; gap: 18px; align-items: baseline; }
.q-redo { margin-top: 10px; }
.q-redo textarea { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--ink-1);
  color: var(--bone); font: 400 var(--fs-base)/1.5 var(--sans); outline: 0; resize: vertical; }
.q-redo .q-actions { margin-top: 8px; }
.q-note-link { margin-left: 6px; font-size: var(--fs-sm); color: var(--sea); }
.q-merged { margin: -4px 0 16px; font-size: var(--fs-md); color: var(--bone-faint); }
.q-merged a, .q-unmerge a { color: var(--bone); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.q-unmerge { display: inline-flex; gap: 12px; align-items: baseline; margin-left: 6px; font-size: var(--fs-sm); }
.q-unmerge .link-btn { margin: 0; padding: 0; }
.q-cannot { margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: var(--fs-md); color: var(--bone-dim, var(--bone)); }
.q-cannot p { margin: 0; }
.q-cannot b { color: var(--bone); font-weight: 500; }
.q-cannot .q-fix { margin-top: 6px; color: var(--sea); }
.byline .q-said, .q-theme .q-said { color: var(--sea); }
.q-repeats { margin: 2px 0 16px; font-size: var(--fs-md); color: var(--bone-faint); }
.q-repeats a { color: var(--bone); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.picker-opt .q-said-n { color: var(--sea); }
.q-held .said { margin-top: 6px; }
.q-rec .rec-live { display: none; flex: 1; align-items: center; gap: 10px; padding: 9px 0; color: var(--bone); font-variant-numeric: tabular-nums; }
.q-rec.rec-on .rec-live { display: flex; }
.q-rec.rec-on textarea { display: none; }

.q-edit { margin-top: 18px; display: grid; gap: 14px; }
.q-edit label { display: block; font-size: var(--fs-2xs); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-faint); }
.q-edit input[type=text], .q-edit input[type=date], .q-edit input[type=datetime-local], .q-edit textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--ink-1); font: 400 var(--fs-base)/1.5 var(--sans);
  letter-spacing: 0; text-transform: none; color: var(--bone); outline: 0; resize: vertical;
}
.q-edit textarea.q-draft { font: 400 var(--fs-lg)/1.6 var(--serif); overflow: auto; }
.q-edit input:focus, .q-edit textarea:focus { border-color: var(--sea-ring); }
.q-edit .q-check { display: flex; align-items: center; gap: 10px; letter-spacing: .06em; }
.q-edit .q-check input { width: 18px; height: 18px; accent-color: var(--sea); }

/* Where it came from: his words */
.q-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.q-sources a { display: block; }
.q-sources .q-quote { margin: 0; font-size: var(--fs-lg); line-height: 1.6; transition: border-color .2s; }
@media (hover: hover) { .q-sources a:hover .q-quote { border-left-color: var(--sea); } }
.q-sources .w { display: block; margin: 5px 0 0 19px; font-size: var(--fs-xs); color: var(--bone-faint); }
.q-where { font-family: var(--sans); font-size: var(--fs-sm); color: var(--moon); opacity: .85; }
.q-learned { font-style: italic; }
.q-policy-quote { margin: 12px 0 0; font-size: var(--fs-lg); }
.q-policy-quote .msg-meta { font-style: normal; }
.q-theme-title { font-size: var(--fs-2xl); color: var(--bone); }
.q-theme ul { margin: 0 0 10px; padding-left: 20px; }
.q-theme:not(.open) .q-theme-sum { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.q-theme:not(.open) .q-theme-rest { display: none; }
.q-theme-more { margin-top: 4px; }
.q-theme .q-sub { margin: 14px 0 4px; font: var(--fs-2xs) var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-faint); }

/* What waits on which device */
.q-outbox { list-style: none; margin: 0; padding: 0; }
.q-outbox li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0 10px 18px; border-top: 1px solid var(--line); position: relative; }
.q-outbox li:last-child { border-bottom: 1px solid var(--line); }
.q-outbox li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: var(--bone-faint); }
.q-outbox li.queued::before, .q-outbox li.claimed::before { background: var(--moon); animation: breathe 1.6s infinite; }
.q-outbox li.done::before { background: var(--sea); }
.q-outbox li.failed::before { background: var(--rose); }
.q-cap { font-size: var(--fs-md); color: var(--bone); }
.q-dev { font-size: var(--fs-sm); color: var(--bone-dim); }
.q-outbox li.failed .q-dev { color: var(--rose); }
.q-result { font-size: var(--fs-xs); color: var(--bone-faint); overflow-wrap: anywhere; }
.q-quiet { text-align: left; margin: 0; }
#qThread .msg-reply code { font-size: var(--fs-xs); overflow-wrap: anywhere; }
#qThread .msg-meta a { color: var(--sea); }

/* Policy and learned */
.q-docs > .lede { margin: 4px 0 20px; max-width: 620px; line-height: 1.55; }
.q-doc { margin-bottom: 14px; }
.q-learned-doc p { margin: 0 0 10px; }
.q-refs { font: var(--fs-xs) var(--sans); white-space: nowrap; }
.q-refs a { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: var(--pill); border: 1px solid var(--moon-line-strong); color: var(--moon); text-align: center; }
@media (hover: hover) { .q-refs a:hover { border-color: var(--moon); } }
.q-doc-edit {
  display: block; width: 100%; min-height: 260px; margin-bottom: 12px; padding: 18px 20px; resize: vertical;
  border-radius: var(--radius); border: 1px solid var(--sea-line); background: var(--ink-1); outline: 0;
  font: 400 var(--fs-xl)/1.7 var(--serif); color: var(--bone);
}
.q-doc-edit.learned { color: var(--moon); }
.q-history { list-style: none; margin: 0; padding: 0; }
.q-history li { padding: 12px 0; border-top: 1px solid var(--line); }
.q-history li:last-child { border-bottom: 1px solid var(--line); }
.q-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-sm); color: var(--bone-dim); }
.q-hist-head a { color: var(--sea); }
.q-hist-head .pill-btn { padding: 5px 12px; font-size: var(--fs-sm); }
.q-diff {
  margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ink-1); overflow-x: auto;
  font: var(--fs-sm)/1.55 ui-monospace, "SF Mono", Menlo, monospace; color: var(--bone-faint); white-space: pre-wrap; overflow-wrap: anywhere;
}
.q-diff .add { color: var(--sea); }
.q-diff .del { color: var(--rose); text-decoration: line-through; text-decoration-color: var(--rose-line); }
.q-next { margin: -22px 0 0; padding: 0 22px; }
.q-next .pill-btn { display: inline-block; }
/* "I said…": a correction from a transcript selection */
.said-fix-btn { position: fixed; z-index: 60; padding: 8px 16px; border-radius: var(--pill); border: 1px solid var(--sea);
  background: var(--ink-2, #1b1f26); color: var(--sea); font-size: var(--fs-md); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.said-fix { margin: 12px 0 4px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.said-fix label { display: block; margin: 10px 0 0; font-size: var(--fs-sm); color: var(--bone-faint); }
.said-fix input, .said-fix select { display: block; width: 100%; margin-top: 6px; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--ink-1); font: 400 var(--fs-lg)/1.4 var(--sans); color: var(--bone);
  outline: 0; -webkit-appearance: none; appearance: none; }
.said-fix input:focus, .said-fix select:focus { border-color: var(--sea-ring); }
.said-fix-from { margin: 0; font-size: var(--fs-md); color: var(--bone-dim); }
.said-fix-from q { color: var(--bone); }
.said-fix-go { display: flex; gap: 10px; align-items: center; margin-top: 12px; }

/* The dictionary, in Settings */
.dict input[type=search] { width: 100%; margin: 12px 0 6px; }
.dict-lede { margin: 4px 0 10px; font-size: var(--fs-sm); color: var(--bone-faint); }
.dict-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.dict-term { padding: 10px 0; border-top: 1px solid var(--line); }
.dict-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.dict-head b { font-weight: 500; color: var(--bone); }
.dict-lang, .dict-own { font-size: var(--fs-xs); color: var(--bone-faint); }
.dict-own.yours { color: var(--sea); }
.dict-note { margin: 4px 0 0; font-size: var(--fs-sm); font-style: italic; color: var(--bone-dim); }
.dict-aliases { list-style: none; margin: 6px 0 0; padding: 0; }
.dict-aliases li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: var(--fs-sm); color: var(--bone-dim); }
.dict-aliases .link-btn { margin: 0; padding: 2px 0; font-size: var(--fs-sm); }
.dict-n { color: var(--bone-faint); }
.dict-mark { font-size: var(--fs-xs); color: var(--bone-faint); }
.dict-mark.trusted { color: var(--sea); }

/* Who spoke: the voices in a recording, his and the others, to name */
.voices { list-style: none; margin: 0; padding: 0; }
.voice { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.voice:first-child { border-top: 0; }
.voice-play { width: 32px; height: 32px; }
.voice-play svg { width: 16px; height: 16px; }
.voice-play.on { color: var(--sea); }
.voice-who { font-size: var(--fs-md); color: var(--bone-dim); }
.voice-who b { font-weight: 500; color: var(--bone); }
.voice-secs { margin-left: 8px; font-size: var(--fs-sm); color: var(--bone-faint); font-variant-numeric: tabular-nums; }
.voice-tag { margin-left: 6px; font-size: var(--fs-xs); color: var(--moon); }
.voice-busy { margin-left: 8px; font-size: var(--fs-sm); color: var(--sea); }
.voice-name { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.voice-name input { flex: 1; min-width: 140px; padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--ink-1); color: var(--bone); font-size: var(--fs-lg); outline: 0; }
.voice-name input:focus { border-color: var(--sea-ring); }
.voice-name .link-btn { margin: 0; }

/* Where he spaced out: dimmed, still his words */
.said .aside { color: var(--bone-faint); }
.aside-note { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--bone-faint); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- M7 card */
/* In motion: at most four chips at the top of Queues, each opening its card */
.q-motion { display: flex; flex-direction: column; gap: 6px; max-width: 820px; width: 100%; margin: -6px auto 0; padding: 0 22px 12px; }
.q-motion-head { flex: none; font-size: var(--fs-2xs); letter-spacing: .16em; text-transform: uppercase; color: var(--bone-faint); }
.q-chips { position: relative; flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.q-chips::-webkit-scrollbar { display: none; }
.q-chip {
  flex: 1 1 0; min-width: 160px; max-width: 260px; display: flex; flex-direction: column; gap: 1px;
  padding: 7px 12px 8px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ink-1);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
@media (hover: hover) { .q-chip:hover { border-color: var(--line-strong); background: var(--ink-2); } }
.q-chip.on { border-color: var(--sea-line); }
.q-chip-top { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-sm); color: var(--bone); }
.q-chip-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-chip time { flex: none; font-size: var(--fs-xs); color: var(--bone-faint); font-variant-numeric: tabular-nums; }
.q-chip-line { padding-left: 15px; font-size: var(--fs-xs); color: var(--bone-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--bone-faint); }
.q-chip.running .q-dot { background: var(--moon); animation: breathe 1.6s infinite; }
.q-chip.waiting .q-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--sea); animation: breathe 1.6s infinite; }
.q-chip.done .q-dot { background: var(--sea); }
.q-chip.failed .q-dot { background: var(--rose); }
.q-chip-more { flex: none; align-self: center; padding: 6px 10px; border-radius: var(--pill); border: 1px solid var(--line); font-size: var(--fs-xs); color: var(--bone-dim); }
@media (hover: hover) { .q-chip-more:hover { color: var(--bone); border-color: var(--line-strong); } }
@media (max-width: 559px) {
  .q-motion { padding: 0 16px 10px; }
  .q-chip { flex: 0 0 72%; max-width: none; }
}

/* Before Do it: what it will do, from the code that will run it */
.q-plan {
  margin: 4px 0 16px; padding: 14px 16px 12px; border-radius: var(--radius);
  border: 1px solid var(--sea-line-soft); background: var(--sea-wash);
}
.q-plan-head { margin: 0 0 6px; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sea); }
.q-plan-will { margin: 0; font-size: var(--fs-base); color: var(--bone); }
.q-plan-rows { margin: 12px 0 0; gap: 6px 16px; font-size: var(--fs-md); }
.q-plan-text, .q-code {
  margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ink-0); border: 1px solid var(--line);
  font: var(--fs-sm)/1.55 ui-monospace, "SF Mono", Menlo, monospace; color: var(--bone-dim);
  white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto;
}
.q-plan-text.q-plan-said { font: 400 var(--fs-lg)/1.6 var(--serif); color: var(--bone); }
.q-plan-text.clamped { max-height: calc(6 * 1.55em + 20px); overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.q-plan-more { margin: 4px 0 0; }
.q-code code { font: inherit; color: var(--bone); }
.q-plan .q-draft-wrap { margin-top: 12px; }
.q-plan-after { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--bone-dim); }
.q-plan-after li { position: relative; padding: 2px 0 2px 18px; }
.q-plan-after li::before { content: "→"; position: absolute; left: 0; color: var(--bone-faint); }

/* It looks done or outdated: the model's reading, with its evidence */
.q-close { margin: 4px 0 14px; padding: 12px 14px; border-radius: var(--radius); border: 1px dashed var(--moon-line-strong); background: var(--moon-wash); }
.q-close-head { margin: 0; font-size: var(--fs-md); color: var(--bone); }
.q-close-head b { font-weight: 500; }
.q-close-head .tag-inferred { display: inline; margin-left: 6px; font: italic var(--fs-sm) var(--serif); color: var(--moon); }
.q-close-why { margin: 4px 0 0; font: italic 400 var(--fs-lg)/1.5 var(--serif); color: var(--moon); }
.q-close-ev { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-sm); color: var(--bone-dim); }
.q-close-ev li { padding-left: 12px; border-left: 1px solid var(--line-strong); }
.q-close-ev a { color: var(--bone); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.q-close-ev q { font-family: var(--serif); }
.q-close-ev .w { display: block; font-size: var(--fs-xs); color: var(--bone-faint); }
.q-close .q-actions { margin: 10px 0 0; }
.q-close .btn-quiet { padding: 7px 12px; font-size: var(--fs-sm); }

/* After Do it: where it is now */
.q-going { margin: 8px 0 12px; animation: none; }
.q-going .label { margin-bottom: 12px; }
.q-track { list-style: none; margin: 0; padding: 0; }
.q-track li { position: relative; display: flex; gap: 14px; padding-bottom: 14px; font-size: var(--fs-base); color: var(--bone); }
.q-track li:last-child { padding-bottom: 0; }
.q-track li::before { content: ""; position: absolute; left: 7.5px; top: 20px; bottom: 2px; width: 1px; background: var(--line-strong); }
.q-track li:last-child::before { display: none; }
.q-track li.done::before { background: var(--sea-ring); }
.q-mk { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1px solid rgba(236, 231, 220, .25); }
.q-track li.done .q-mk { background: var(--sea); border-color: var(--sea); }
.q-track li.now .q-mk { border: 2px solid var(--sea); box-shadow: 0 0 0 4px var(--sea-glow); animation: breathe 2.2s var(--ease) infinite; }
.q-track li.failed .q-mk { background: var(--rose); border-color: var(--rose); }
.q-track li.todo { color: var(--bone-faint); }
.q-track li.failed { color: var(--rose); }
.q-step small { display: block; margin-top: 1px; font-size: var(--fs-xs); color: var(--bone-faint); font-variant-numeric: tabular-nums; }

/* Done: what it did */
.q-did { margin: 4px 0 14px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--sea-line); }
.q-did.failed { border-color: var(--rose-line); }
.q-did-head { margin: 0 0 6px; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sea); }
.q-did.failed .q-did-head { color: var(--rose); }
.q-did p { margin: 0; }
.q-did-sum { font: 400 var(--fs-xl)/1.45 var(--serif); color: var(--bone); }
.q-did .q-did-err { margin-top: 6px; font-size: var(--fs-md); color: var(--rose); overflow-wrap: anywhere; }
.q-did .q-did-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: var(--fs-sm); }
.q-did-links a { color: var(--sea); }
.q-did-links span { color: var(--bone-dim); }
.q-did .q-excerpt { white-space: pre-wrap; }
.q-did-track { margin-top: 12px; font-size: var(--fs-sm); }
.q-did-track summary { cursor: pointer; color: var(--bone-faint); }
.q-did-track .q-track { margin-top: 10px; }
.q-did .q-outcome-go .link-btn { margin: 8px 0 0; padding: 0; }
.q-stale { margin: 4px 0 12px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); font-size: var(--fs-md); color: var(--bone-dim); }
.q-stale p { margin: 0; }
.q-stale b { font-weight: 500; color: var(--bone); }

/* Folded: where it came from */
.q-fold { margin: 26px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.q-fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; padding: 14px 2px;
  font-size: var(--fs-2xs); letter-spacing: .2em; text-transform: uppercase; color: var(--bone-dim);
}
.q-fold > summary::-webkit-details-marker { display: none; }
.q-fold > summary small { flex: 1; min-width: 0; font-size: var(--fs-sm); letter-spacing: 0; text-transform: none; color: var(--bone-faint); }
.q-fold > summary svg { flex: none; width: 16px; height: 16px; align-self: center; transition: transform .25s var(--ease); }
.q-fold[open] > summary svg { transform: rotate(180deg); }
@media (hover: hover) { .q-fold > summary:hover { color: var(--bone); } }
.q-fold-body { padding: 0 0 26px; }
.q-fold-body > .q-repeats { margin: 4px 0 0; }
.q-fold-body > .section:first-child { margin-top: 10px; }
.q-fold .section { animation: none; }

/* How it decides: Policy and Learned, one switch */
.q-doc-switch { display: inline-flex; gap: 2px; margin: 4px 0 16px; padding: 3px; border-radius: var(--pill); border: 1px solid var(--line-strong); font-size: var(--fs-sm); }
.q-doc-switch a { padding: 5px 14px; border-radius: var(--pill); color: var(--bone-dim); }
@media (hover: hover) { .q-doc-switch a:hover { color: var(--bone); } }
.q-doc-switch a.on { background: var(--sea-deep); color: var(--bone); }
.picker-opt.picker-foot { margin-top: 6px; border-top: 1px solid var(--line); font-family: var(--serif); font-style: italic; }}

/* ------------------------------------------------------------ interaction */
/* One set of states for every control. Hover is for pointers only; focus
   uses the global :focus-visible ring; press, disabled and the touch sizes
   come after. */
.btn, .btn-quiet, .pill-btn, .link-btn, .ghost-icon, .round-btn, .send, .mic, .detail-back, .picker-opt, .tick,
.q-pos, .toast-act, .said-fix-btn { transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), filter .2s var(--ease), transform .2s var(--ease), opacity .2s; }
@media (hover: hover) {
  .btn:not(:disabled):hover, .send:not(:disabled):hover { filter: brightness(1.1); }
  .btn-quiet:not(:disabled):hover { color: var(--bone); background: var(--ink-2); }
  .pill-btn:not(:disabled):hover { border-color: var(--bone-faint); }
  .link-btn:not(:disabled):hover, .toast-act:hover { text-decoration: underline; text-underline-offset: .2em; }
  .mic:not(:disabled):hover { color: var(--bone); background: var(--line-strong); }
  .detail-back:hover { color: var(--bone); }
  .picker-opt:hover { background: var(--ink-3); color: var(--bone); }
  .tick:not(:disabled):hover { border-color: var(--bone-dim); }
  .advisor:hover { border-color: var(--line-strong); }
  .said-fix-btn:hover { background: var(--ink-3); }
}
.btn:active, .btn-quiet:active, .pill-btn:active, .ghost-icon:active, .detail-back:active { transform: scale(.97); }
.link-btn:active, .toast-act:active { opacity: .7; }
.picker-opt:active { background: var(--ink-3); }
button:disabled, select:disabled, input:disabled, textarea:disabled, [aria-disabled="true"] { opacity: .45; cursor: default; }
.q-pos:disabled { opacity: 1; }
.tick:disabled { opacity: .5; }
.send:disabled { opacity: .35; }

/* Touch: primary controls and icon buttons reach 44px (phones and any coarse pointer) */
@media (max-width: 559px), (pointer: coarse) {
  .btn, .btn-quiet, .pill-btn, .pill-select, .picker-btn, .q-pos, .detail-back, .q-back, .q-hist-link, .history-link,
  .q-doc-switch a, .q-menu button, .picker-opt { min-height: var(--tap); }
  .btn, .btn-quiet, .pill-btn, .pill-select, .q-doc-switch a { display: inline-flex; align-items: center; justify-content: center; }
  .ghost-icon, .q-steps .ghost-icon { width: var(--tap); height: var(--tap); }
  .round-btn { width: var(--tap); height: var(--tap); }
  .send, .mic { flex-basis: var(--tap); height: var(--tap); }
  .composer { padding: 6px 6px 6px 18px; }
  .q-tools input[type=search], .q-tools select { min-height: var(--tap); }
  .q-tools input[type=search] { min-width: 80px; padding-inline: 12px; }
  .q-tools select { padding-right: 24px; max-width: 112px; }
  .picker-opt { align-items: center; }
  .q-closed, .recent-fold > summary, .q-found .q-hist-status { min-height: var(--tap); }
  .session-row, .src-row { min-height: var(--tap); }
  .more-settings > summary, .account .devices summary, .fm summary { padding-block: 12px; }
  .q-chip-more, .q-motion .q-chip { min-height: var(--tap); }
  .q-chip-more { display: inline-flex; align-items: center; }
  /* small things stay small to the eye and grow their reach instead */
  .link-btn, .tick, .set-reset, .toast-act { position: relative; }
  .link-btn::after, .tick::after, .set-reset::after, .toast-act::after { content: ""; position: absolute; inset: -12px -6px; }
  .tick::after { inset: -12px; }
}

/* Work: every task carried out or being carried out, by state; each row says where it runs */
.w-ctl { margin: 0 0 4px; }
.w-ctl .lib-picker { padding: 0; }
.q-work-pop { width: min(240px, calc(100vw - 44px)); }
.q-work-pop .picker-opt { align-items: center; }
.w-check { width: 14px; flex: none; font-style: normal; color: var(--sea); text-align: center; }
.w-group { margin-top: 22px; }
.w-row { padding: 14px 4px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.w-row > * { margin: 0; }
@media (hover: hover) { .w-row:hover { background: var(--ink-1); } }
.w-top { font-size: var(--fs-xs); color: var(--bone-faint); }
.w-state { color: var(--bone-dim); }
.w-needs_input .w-state { color: var(--moon); }
.w-failed .w-state { color: var(--rose); }
.w-done .w-state { color: var(--sea); }
.w-offline { color: var(--rose); }
.w-title { display: block; margin-top: 6px; font: 400 var(--fs-xl)/1.4 var(--serif); color: var(--bone); }
.w-project { margin-top: 2px; font-size: var(--fs-xs); color: var(--bone-faint); }
.w-lead { margin-top: 6px; font-size: var(--fs-sm); line-height: 1.5; color: var(--bone-dim); }
.w-fix { margin-top: 4px; font-size: var(--fs-sm); line-height: 1.5; color: var(--bone); }
.w-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.w-go { border-color: var(--sea); color: var(--sea); }
.w-session { font-size: var(--fs-sm); color: var(--sea); padding: 7px 0; }
.w-err { margin-top: 8px; font-size: var(--fs-xs); color: var(--rose); }
.w-more { margin: 14px 0 0; padding: 0; }


/* ======================================================== shared.js (stream F) */
/* Undo bar: the toast's look, one step below it when both show */
.undo-bar {
  position: fixed; z-index: 51; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: baseline; gap: 14px; max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: var(--pill); background: var(--ink-3); border: 1px solid var(--line-strong);
  font-size: var(--fs-md); color: var(--bone); box-shadow: 0 16px 40px -10px rgba(0,0,0,.7);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.undo-bar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.undo-bar.error { color: var(--rose); }
.undo-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-act { border: 0; background: none; padding: 0; color: var(--sea); font: inherit; font-weight: 500; cursor: pointer; position: relative; }
.undo-act::after { content: ""; position: absolute; inset: -12px -8px; }
.undo-bar kbd { font: inherit; font-size: var(--fs-xs); color: var(--bone-faint); }
@media (hover: hover) { .undo-act:hover { text-decoration: underline; text-underline-offset: .2em; } }
body.undo-on .toast { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 70px); }
@media (min-width: 960px) {
  .undo-bar { left: calc(50% + var(--rail) / 2); bottom: 28px; }
  body.undo-on .toast { bottom: 82px; }
}

/* Picker: a checkmark before each option; on a phone it opens as a sheet at the top */
.pk { display: inline-block; padding: 0; max-width: 100%; }
.pk .picker-opt { align-items: center; }
.pk-tick { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--sea); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pk-gap { width: 16px; flex: none; }
.pk-pop { width: min(300px, calc(100vw - 32px)); }
.pk-scrim { display: none; }
@media (max-width: 559px) {
  .pk-pop {
    position: fixed; z-index: 61; left: 12px; right: 12px; width: auto;
    top: calc(env(safe-area-inset-top) + 12px);
  }
  .pk-pop .picker-list { max-height: 50vh; }
  .pk-scrim:not([hidden]) { display: block; position: fixed; z-index: 60; inset: 0; background: var(--scrim); }
}

/* DropField: the capture composer, in a box's or a meal's page */
.drop-field.over .composer { border-color: var(--sea-line); box-shadow: 0 0 0 4px var(--sea-wash); }
.drop-img { cursor: pointer; }
.drop-img svg { width: 18px; height: 18px; }
.drop-note { margin: 6px 6px 0; font-size: var(--fs-sm); color: var(--bone-faint); }
.drop-note.error { color: var(--rose); }

/* Back: "‹ Life" on a place's first page */
.place-back {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); padding-right: 8px;
  color: var(--sea); font-size: var(--fs-md);
}
.place-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .place-back:hover span { text-decoration: underline; text-underline-offset: .2em; } }

/* Breadcrumb (shared.js Crumbs): one line under the top of every page, saying where the page lives */
.crumb-bar { flex: none; width: 100%; max-width: 1120px; margin: 0 auto; padding: 14px 22px 0; }
.crumb-bar[hidden] { display: none; }
/* Line up with the page's own column */
main:has(.view-queues.active) .crumb-bar { max-width: 820px; }
main:has(.view-team.active) .crumb-bar { max-width: 980px; }
main:has(.view-settings.active) .crumb-bar { max-width: 760px; }
main:has(.view-map.active .t-page) .crumb-bar { max-width: 880px; }
main:has(.view-recent.active) .crumb-bar, main:has(.view-coach.active) .crumb-bar, main:has(.view-capture.active) .crumb-bar { max-width: none; margin: 0; }
.cl { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 5px; min-width: 0; overflow: hidden; font-size: var(--fs-sm); line-height: 1.3; color: var(--bone-faint); }
.cl-i, .cl-sep, .cl-more { flex: none; white-space: nowrap; }
.cl-a { color: var(--sea); }
.cl-t { color: var(--bone-dim); }
.cl-cur { color: var(--bone); }
.cl-squeeze { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-sep { color: var(--bone-faint); }
.cl-more, .cl-fold { border: 0; background: none; color: var(--bone-dim); font: inherit; padding: 2px 4px; cursor: pointer; border-radius: 6px; }
.cl-fold { align-self: center; display: inline-grid; place-items: center; }
.cl-fold svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cl-open { flex-wrap: wrap; overflow: visible; row-gap: 2px; }
.cl-open .cl-i { white-space: normal; flex: 0 1 auto; overflow-wrap: anywhere; }
.cl-g { display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%; }
@media (hover: hover) { .cl-a:hover { text-decoration: underline; text-underline-offset: .2em; } .cl-more:hover, .cl-fold:hover { color: var(--bone); } }
/* On a card the line is part of the content: no gutter, wraps rather than folds when it is the whole of a row */
.cl-card { overflow: hidden; }
@media (max-width: 640px) { .crumb-bar { padding: 12px 16px 0; } }
.cl-solo { font-size: var(--fs-xs); letter-spacing: .03em; }
.cl-solo .cl-cur { color: var(--bone-faint); }
