/* Shared foundations. Components use roles below instead of embedding a palette. */
/* Hidden means hidden everywhere: a component's display rule never shows a control the code hid (#258, Retry reply mid-call). */
[hidden] { display: none !important; }
/* Every scrolling feed and list shows its scrollbar at all times (#258): content past the edge is never
   hidden with nothing to say there is more. Styling the WebKit bar makes macOS draw it permanently, not
   only while scrolling; the standard scrollbar-color would switch Chrome back to overlay bars, so it is
   not set. --scroll-thumb is the ink of the surface the list sits on. */
:is(.report-messages, .agent-thread-feed, .coach-call-body, .chat-source-context, .report-scroll, .nb-viewer-body, .recent-list, .records-review-list, .demo-guide) { --scroll-thumb: color-mix(in oklch, var(--ink) 38%, transparent); scrollbar-gutter: stable; }
.recent-list { --scroll-thumb: color-mix(in oklch, var(--rail-ink) 50%, transparent); }
:is(.report-messages, .agent-thread-feed, .coach-call-body, .chat-source-context, .report-scroll, .nb-viewer-body, .recent-list, .records-review-list, .demo-guide)::-webkit-scrollbar { width: 12px; height: 12px; }
:is(.report-messages, .agent-thread-feed, .coach-call-body, .chat-source-context, .report-scroll, .nb-viewer-body, .recent-list, .records-review-list, .demo-guide)::-webkit-scrollbar-track { background: transparent; }
:is(.report-messages, .agent-thread-feed, .coach-call-body, .chat-source-context, .report-scroll, .nb-viewer-body, .recent-list, .records-review-list, .demo-guide)::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 12px; background: var(--scroll-thumb) padding-box; }
:root {
  --font-body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-heading: Piazzolla, Georgia, serif;
  --text-caption: 12px;
  --text-small: 14px;
  --text-body: 16px;
  --text-page-title: 30px;
  --space-1: 4px;
  --space-compact: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;
  --page-padding-block: var(--space-7);
  --page-padding-inline: var(--space-8);
  --page-padding-bottom: var(--space-12);
  --radius-control: 8px;
  --radius-segment: calc(var(--radius-control) - 2px);
  --call-launch-shadow: 0 6px 18px oklch(0.2 0.03 300 / .22);
  --history-tab-shadow: 0 1px 2px rgb(0 0 0 / .12);
  --radius-panel: 6px;
  --radius-dialog: 12px;
  --radius-message: 12px;
  --radius-tab: 7px;
  --radius-small: 4px;
  --radius-text: 3px;
  --radius-pill: 999px;
  --control-height: 44px;
  --focus-width: 2px;
  --focus-offset: 2px;
  --control-padding-block: 10px;
  --control-padding-inline: 16px;
  --control-gap: 8px;
  --rail-surface: #2C2234;
  --rail-ink: #F7F5F6;
  --rail-muted: #CDBFCE;
  --rail-control: #44364E;
  --rail-input: #382C42;
  --rail-line: #6E5B79;
  --paper-surface: #F7F5F6;
  --paper-raised: #FFFFFF;
  --paper-ink: #2A252F;
  --paper-muted: #635B65;
  --paper-line: #D7D7D4;
  --paper-line-soft: #E7E7E3;
  --paper-failure: #A33232;
  --paper-warning: #765311;
  --paper-success: #176E4C;
  --source-focus: #335C63;
  --source-selection: color-mix(in srgb, var(--source-focus) 20%, transparent);
  --flow-colour: #ff6351;
  --brand-slate: #495575;
  --brand-teal: #547980;
  --brand-mauve: #413A48;
  --brand-aqua: #45ADA8;
  --overlay-dim: oklch(0 0 0 / .6);
  --overlay-media-dim: oklch(0 0 0 / .55);
  --overlay-caption-dim: oklch(0 0 0 / .72);
  --data-series-light: var(--source-focus);
  --data-series-dark: var(--brand-aqua);
  --data-series: var(--data-series-light);
  --link-ink: var(--source-focus);
  --camera-series-dark: oklch(.64 .105 196);
  --media-surface: #382C42;
  --media-stage: #302638;
  --media-ink: oklch(.97 .005 320);
  --media-muted: oklch(.8 .015 320);
  --media-pass: oklch(.72 .12 196);
  --media-caution: oklch(.82 .13 80);
  --call-surface: #382C42;
  --call-ink: oklch(.97 .005 300);
  --call-muted: oklch(.8 .015 300);
  --call-start-ink: oklch(.2 .02 300);
  --overlay-shadow: 0 18px 48px oklch(0 0 0 / .35);
  --cycle-light: oklch(.47 .09 355);
  --cycle-dark: oklch(.8 .075 355);
  --tracker-success-light: var(--data-series-light);
  --tracker-success-dark: var(--data-series-dark);
  --pillar-records-colour: oklch(.62 .1 196);
  --pillar-questions-colour: oklch(.6 .12 290);
  --pillar-goals-colour: oklch(.7 .13 70);
  /* The four pillars as the film and the demo walkthrough show them (#226, #247). */
  --pillar-understand-colour: #168A8F;
  --pillar-log-colour: #4B5BD6;
  --pillar-chart-colour: #C93D78;
  --pillar-monitor-colour: #23935A;
  --guide-dim: rgba(42, 37, 47, 0.28);
  --guide-card-shadow: 0 18px 44px rgba(42, 37, 47, 0.18);
  --guide-pointer-shadow: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
  /* The demo tour and the sign-in page (#258): text on a pillar fill, failure text on the dark rail
     surface, the portrait's disc, and their shadows. */
  --pillar-ink: #FFFFFF;
  --rail-failure: #F2A7A7;
  --portrait-fill: #EDE6DE;
  --elevation-card: 0 18px 44px rgba(42, 37, 47, .12), 0 0 0 1px rgba(42, 37, 47, .08);
  --elevation-tile: 0 14px 34px rgba(42, 37, 47, .10), 0 0 0 1px rgba(42, 37, 47, .10);
  --elevation-chip: 0 10px 28px rgba(42, 37, 47, .18);
  --elevation-portrait: 0 12px 30px rgba(42, 37, 47, .14);
  --elevation-sheet: 0 -8px 24px rgba(42, 37, 47, .08);
  --elevation-side: -12px 0 32px rgba(42, 37, 47, .18);
  --elevation-on-rail: 0 14px 36px rgba(0, 0, 0, .28);
  /* Meet Stellis category tiles (owner canvas): white glyphs on each fill. */
  --category-understand: #335C63;
  --category-monitor: #4F6B4A;
  --category-improve: #495575;
  --category-ink: #FFFFFF;
  --radius-tile: 16px;
  /* Chat composers (#225): a rounded message field, like a messaging app. */
  --radius-composer: 24px;

  --secondary-fill: var(--surface);
  --secondary-ink: var(--ink);
  --secondary-line: var(--line);
  --secondary-hover: var(--raised);
  --secondary-disabled-fill: var(--control-disabled-fill);
  --secondary-disabled-ink: var(--control-disabled-ink);
  --secondary-radius: var(--radius-control);
}

/* Self-hosted Inter and Piazzolla; sources and OFL notices are in /static/fonts/. */
@font-face {
  font-family: Inter;
  src: url('/static/fonts/inter-v20-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Piazzolla;
  src: url('/static/fonts/piazzolla-v42-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Piazzolla;
  src: url('/static/fonts/piazzolla-v42-latin-italic.woff2') format('woff2');
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Piazzolla;
  src: url('/static/fonts/piazzolla-v42-latin-300.woff2') format('woff2');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --field: #302638;
  --surface: #382C42;
  --raised: var(--rail-control);
  --input: var(--rail-input);
  --line: var(--rail-line);
  --line-soft: #51415C;
  --ink: var(--rail-ink);
  --muted: #DED5DE;
  --quiet: #C4B6C6;
  --accent: #FFFFFF;
  --accent-strong: #E5E2E7;
  --accent-ink: var(--rail-surface);
  --selected: #4A3A56;
  --selection: #86798E;
  --warning: #f3c983;
  --warning-bg: #322919;
  --success: #8bddba;
  --failure: #ffaaa7;
  --focus: #FFFFFF;
  --shadow: 0 16px 38px #2B2630A0;
  /* Colour blocks carry inverted ink: a light block with dark ink on dark pages. */
  --block-fill: var(--ink);
  --block-ink: var(--surface);
  --block-muted: #5B5260;
  --block-alert-fill: #FFB4AE;
  --block-alert-ink: #3B1012;
  --block-ok-fill: #9FE2C3;
  --block-ok-ink: #0E2E21;
  --block-calculated-fill: #F3C983;
  --block-calculated-ink: #33250A;
  --block-planned-fill: #D5D9EC;
  --block-planned-ink: #1F2433;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--field);
}



body {
  color: var(--ink);
  background:
    radial-gradient(ellipse at 86% 4%, #465da52a, transparent 36%),
    radial-gradient(ellipse at 8% 67%, #5b438e1b, transparent 43%),
    var(--field);
}
html[data-theme='dark'] body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 21%, #b6c9ff96 0 1px, transparent 2px),
    radial-gradient(circle at 78% 15%, #b6c9ff75 0 1px, transparent 2px),
    radial-gradient(circle at 38% 61%, #b6c9ff55 0 1px, transparent 2px),
    radial-gradient(circle at 92% 77%, #b6c9ff62 0 1px, transparent 2px);
}
header, main { position: relative; }
header {
  z-index: 2;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border-color: var(--line-soft);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  font: 400 28px/1 var(--font-heading);
  letter-spacing: -.045em;
}
/* The v2 mark is an alpha mask, so it takes the wordmark colour: one colour, light or dark. */
.brand-mark {
  width: 24px;
  height: 25px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("/static/logo-mark.png") center / contain no-repeat;
  mask: url("/static/logo-mark.png") center / contain no-repeat;
}
.header-side { display: flex; align-items: center; gap: var(--space-4); }
.calendar-card { margin: 0 0 var(--space-6); padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.calendar-heading, .calendar-connection, .calendar-meeting { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.calendar-heading h2 { margin: 0; font-size: 20px; }
.calendar-privacy { margin: var(--space-3) 0 0; font-size: 13px; }
.calendar-card button { padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--raised); color: var(--ink); cursor: pointer; }
.calendar-card button:hover { border-color: var(--accent); }
.calendar-card button:disabled { opacity: .6; cursor: default; }
.calendar-connections { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }
.calendar-connection { padding: var(--space-2) var(--space-3); border: 1px solid var(--line-soft); border-radius: var(--radius-panel); font-size: 13px; }
#calendar-status { margin: var(--space-4) 0 0; min-height: 20px; }
.calendar-meeting { padding: 13px 0; border-top: 1px solid var(--line-soft); }
.calendar-meeting > div { min-width: 0; display: grid; gap: var(--space-1); }
.calendar-meeting strong { overflow-wrap: anywhere; }
.calendar-meeting span { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .calendar-card { padding: var(--space-4); } .calendar-connections { display: grid; } .calendar-connection { width: 100%; box-sizing: border-box; } }
.capture-header-controls { display: flex; align-items: center; gap: var(--space-2); }
.capture-header-controls[hidden] { display: none; }
#capture-header-timer { min-width: 42px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.capture-header-controls button { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--raised); color: var(--ink); cursor: pointer; }
.capture-header-controls button:hover { border-color: var(--accent); }
#capture-header-stop { color: #fff; background: #c73632; border-color: #c73632; }
.header-note, p, .conversation-row small, .player-heading, .segment-time,
.turn-heading span, .seek-controls span, .highlight-controls span,
.vocabulary-card summary span, .ai-privacy { color: var(--muted); }
#logout-button {
  display: inline-flex; align-items: center;
  min-height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--ink);
  padding: 0 var(--space-4);
  cursor: pointer;
  font-size: var(--text-body);
  font-weight: 600;
  white-space: nowrap;
}
#logout-button:hover { border-color: var(--accent); }
#logout-button[hidden] { display: none; }
/* Icon-only theme switch on the bare header: the sun shows in dark mode, the moon in light mode. */
:is(#theme-toggle, #setup-theme) {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-panel);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition-property: color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
:is(#theme-toggle, #setup-theme) svg { width: 22px; height: 22px; }
:is(#theme-toggle, #setup-theme) .icon-moon, html[data-theme='light'] :is(#theme-toggle, #setup-theme) .icon-sun { display: none; }
html[data-theme='light'] :is(#theme-toggle, #setup-theme) .icon-moon { display: block; }
:is(#theme-toggle, #setup-theme):active { scale: .96; }
@media (hover: hover) and (pointer: fine) { :is(#theme-toggle, #setup-theme):hover { color: var(--ink); } }
h1, .transcript-heading h2, .ai-heading h2 {
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 300;
  letter-spacing: -.035em;
}
h1 { font-size: clamp(36px, 5vw, 54px); line-height: 1.05; }
.transcript-heading h2, .ai-heading h2 { font-size: 27px; }
main { max-width: 1100px; }
.heading { position: relative; z-index: 21; margin-bottom: var(--space-3); }
.heading > div:first-child p { max-width: 56ch; }

.transcript-card, .ai-card, .player-card, .next-card, .vocabulary-card,
.conversation-row, .recording-panel, .recovery-row, .drop-zone {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 1px 0 #ffffff0c;
}
.conversation-row:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--raised);
  box-shadow: var(--shadow);
}
.conversation-row small, .conversation-row .arrow,
.back-link, .vocabulary-card summary { color: var(--accent); }
.drop-icon, .drop-zone span { color: var(--accent); }
.drop-zone { min-height: 220px; background: color-mix(in srgb, var(--surface) 90%, transparent); }
.drop-zone strong, .conversation-row strong { color: var(--ink); }
#import-dialog { width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-sizing: border-box; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#import-dialog::backdrop { background: #02050eb8; }
.import-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.import-header h2 { margin: 0; font-size: 24px; }
.import-header button { border: 0; background: transparent; color: var(--ink); font-size: 27px; cursor: pointer; }
#import-dialog label { display: block; margin-bottom: var(--space-2); font-weight: 650; }
#import-language { width: 100%; }
.import-language-note, .import-formats { margin: var(--space-2) 0 var(--space-4); color: var(--quiet); font-size: 13px; }
#import-dialog .drop-zone { min-height: 200px; }
/* The dialog is a light panel in both themes, so its accents use the dialog's own action ink (the dark
   theme's --accent is light, for the dark page). */
#import-dialog :is(.drop-icon, .drop-zone span) { color: var(--action-fill); }
.import-formats { margin: var(--space-3) 0 0; text-align: center; }
#import-status { min-height: 20px; margin-top: var(--space-3); color: var(--failure); }
.recording-page main { max-width: none; padding: var(--space-6) var(--space-8) 130px; }
.recording-page .heading, .recording-page #status { display: none; }
.recording-page .recording-panel { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.recording-workspace-head { display: flex; align-items: center; gap: var(--space-5); margin-bottom: var(--space-7); }
.recording-workspace-head button { border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.recording-workspace-head label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.recording-workspace-head input { width: min(560px, 100%); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font: 300 28px/1.16 var(--font-heading); }
.recording-workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 31%); gap: var(--space-6); min-height: calc(100vh - 260px); }
.recording-workspace-grid > * { padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.recording-workspace-grid h2 { margin: 0 0 var(--space-6); font-size: 24px; }
.recording-workspace-grid p { color: var(--quiet); }
.recording-live-peek { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-width: 0; margin: -7px 0 var(--space-4); padding: var(--space-3) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--raised); color: var(--ink); text-align: left; cursor: pointer; }
.recording-live-peek[hidden] { display: none; }
.recording-live-peek strong { flex: none; font-size: 12px; color: var(--failure); }
.recording-live-peek span:nth-child(2) { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.recording-live-peek span:last-child { margin-left: auto; }
.recording-workspace-main > section[hidden] { display: none; }
.recording-workspace-main h2 { margin: 0 0 var(--space-4); }
.notes-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-1); padding-bottom: var(--space-3); border-bottom: 1px solid var(--line-soft); }
.notes-toolbar :is(button, .notes-import) { min-width: var(--control-height); min-height: var(--control-height); border: 1px solid transparent; border-radius: var(--radius-control); padding: var(--space-2); background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.notes-toolbar button:hover, .notes-toolbar button:focus-visible { border-color: var(--line); background: var(--raised); }
.notes-table-actions { position: relative; }
.notes-table-actions summary { min-height: var(--control-height); padding: var(--space-1) 9px; border: 1px solid transparent; border-radius: var(--radius-control); color: var(--ink); cursor: pointer; list-style: none; }
.notes-table-actions summary::-webkit-details-marker { display: none; }
.notes-table-actions summary:hover, .notes-table-actions summary:focus-visible { border-color: var(--line); background: var(--raised); }
.notes-table-actions > div { position: absolute; z-index: 20; top: 100%; left: 0; display: grid; gap: 3px; width: 170px; padding: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: 0 10px 24px #0005; }
.notes-table-actions:not([open]) > div { display: none; }
.notes-table-actions > div.opens-left { left: auto; right: 0; }
.notes-table-actions > div button { text-align: left; }
.notes-editor { min-height: 230px; padding: var(--space-4) 2px; color: var(--ink); line-height: 1.6; outline: none; overflow-wrap: anywhere; }
.notes-editor { overflow-x: auto; }
.notes-editor .note-table { border-collapse: collapse; width: max-content; min-width: min(100%, 320px); margin: var(--space-3) 0; }
.notes-editor .note-table-cell { min-width: 90px; border: 1px solid var(--line); padding: var(--space-2) var(--space-3); vertical-align: top; }
.notes-editor .note-table-header { background: var(--raised); font-weight: 650; }
.notes-editor .note-table-cell p { margin: 0; }
.notes-editor .note-image { width: min(100%, 580px); margin: var(--space-4) 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--raised); }
.notes-editor .note-image button { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.notes-editor .note-image img { display: block; max-width: 100%; max-height: 310px; margin: auto; object-fit: contain; }
.notes-editor .note-image figcaption { margin-top: var(--space-2); color: var(--muted); font-size: 13px; }
.notes-editor:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); border-radius: var(--radius-panel); }
.notes-editor p { margin: 0 0 var(--space-3); color: var(--ink); }
.notes-editor .note-heading-one { font-size: 26px; font-weight: 700; }
.notes-editor .note-heading-two { font-size: 21px; font-weight: 700; }
.notes-editor .note-heading-three { font-size: 17px; font-weight: 700; }
.notes-editor ul, .notes-editor ol { padding-left: 25px; }
.notes-editor .note-check-done { text-decoration: line-through; color: var(--quiet); }
/* Checklist items draw a box in place of the bullet marker. */
.notes-editor .note-check-open, .notes-editor .note-check-done { list-style: none; position: relative; }
.notes-editor .note-check-open::before, .notes-editor .note-check-done::before {
  content: ''; position: absolute; left: -22px; top: .32em; width: 15px; height: 15px; box-sizing: border-box;
  border: 1.5px solid var(--muted); border-radius: var(--radius-panel); background: transparent; cursor: pointer; text-decoration: none;
}
.notes-editor .note-check-done::before {
  border-color: var(--accent); background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23808080' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.notes-editor a { color: var(--accent-strong); text-decoration: underline; }
.notes-save-line { display: flex; align-items: center; gap: var(--space-3); min-height: 24px; }
.notes-save-line p { margin: 0; color: var(--quiet); font-size: 13px; }
.notes-save-line button { border: 0; background: transparent; color: var(--accent-strong); cursor: pointer; }
.conversation-notes { border-bottom: 1px solid var(--line); margin-bottom: var(--space-6); padding-bottom: var(--space-4); }
.conversation-notes h2 { margin-top: 0; }
.notes-choice { display: flex; gap: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--line-soft); }
.notes-choice button { padding: 9px 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.notes-choice button[aria-selected='true'] { border-color: var(--accent-strong); color: var(--ink); font-weight: 700; }
.enhanced-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.enhanced-heading h2 { margin: 0; }
.enhanced-heading > div { display: flex; align-items: center; gap: var(--space-2); }
#enhanced-status { flex: 1 1 220px; margin: 0; }
.enhanced-heading select { max-width: 190px; }
.enhanced-heading button { border: 1px solid var(--line); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.enhanced-heading button svg { display: block; width: 18px; height: 18px; }
/* Inverted against its current surface, including paper inside a dark theme. */
.enhanced-heading #refresh-enhanced {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: var(--ink);
  color: var(--surface);
  transition-property: background-color, scale;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}
.enhanced-heading #refresh-enhanced svg { width: 22px; height: 22px; }
.enhanced-heading #refresh-enhanced:active { scale: .96; }
@media (hover: hover) and (pointer: fine) {
  .enhanced-heading #refresh-enhanced:hover { background: color-mix(in oklch, var(--ink) 84%, var(--surface)); }
}
.enhanced-sources { margin-top: var(--space-4); }
.enhanced-sources summary { cursor: pointer; font-weight: 650; }
.recording-preview { display: grid; gap: var(--space-4); }
.recording-preview p { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: var(--space-3); margin: 0; color: var(--ink); line-height: 1.55; }
.recording-preview time { color: var(--quiet); font-size: 13px; font-variant-numeric: tabular-nums; }
#recording-chat-toggle { display: none; }
#recording-chat-toggle[aria-expanded='true'] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.recording-chat-prompts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.recording-chat-prompts button { border: 1px solid var(--line); border-radius: var(--radius-pill); padding: var(--space-2) var(--space-3); background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.recording-chat-messages { display: grid; align-content: start; gap: var(--space-3); min-height: 180px; max-height: 48vh; overflow-y: auto; }
.recording-chat-messages article, #saved-recording-chat article { border-top: 1px solid var(--line-soft); padding-top: var(--space-3); }
.recording-chat-messages h3, #saved-recording-chat h4 { margin: 0 0 var(--space-compact); font-size: 14px; }
.recording-chat-messages p, #saved-recording-chat p { margin: 0 0 var(--space-compact); }
#recording-chat-form { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
#recording-chat-form > div { display: flex; gap: var(--space-2); }
#recording-chat-form input { min-width: 0; flex: 1; }
#recording-chat-form button {
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--accent);
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { #recording-chat-form button:hover { background: var(--accent-strong); border-color: var(--accent-strong); } }
#recording-chat-status { font-size: 13px; }
#recording-waveform { display: block; width: min(320px, 30vw); height: 42px; flex: 0 1 320px; }
.recording-bar { position: fixed; z-index: 30; inset: auto 0 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 88px; padding: var(--space-4) max(var(--space-8), calc((100vw - 1440px)/2)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -8px 26px #00000018; }
.recording-source { display: grid; gap: 3px; }
.recording-source strong { font-size: 15px; }
.recording-source span, .recording-source p { color: var(--quiet); font-size: 13px; }
.recording-source p:empty { display: none; }
.recording-actions { display: flex; align-items: center; gap: var(--space-3); margin: 0; }
.recording-actions #recording-timer { min-width: 46px; font-variant-numeric: tabular-nums; font-weight: 700; text-align: center; }
.recording-actions #stop-recording { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media(max-width:700px) { .recording-page main { padding: var(--space-4) var(--space-4) 190px; } .recording-workspace-head { display: grid; gap: var(--space-3); } .recording-workspace-head input { font-size: 24px; } .recording-workspace-grid { grid-template-columns: 1fr; gap: var(--space-3); min-height: 0; } .recording-workspace-grid > * { min-height: 180px; padding: var(--space-5); } #recording-chat-toggle { display: inline-block; border: 1px solid var(--line); border-radius: var(--radius-panel); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); background: var(--raised); color: var(--ink); font: inherit; } .recording-ai { display: none; } .recording-chat-open .recording-ai { display: block; } .recording-chat-open .recording-workspace-main { min-height: 0; } .recording-chat-messages { min-height: 80px; } .recording-bar { align-items: flex-start; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); } #recording-waveform { width: 100%; height: 24px; flex: 0 0 24px; } .recording-actions { width: 100%; justify-content: space-between; } }
.speaker-turn, .ai-result-section, .ai-question, .ai-result-section li,
.segment, .conversation-tabs { border-color: var(--line-soft); }
.turn-heading button, .turn-heading strong, .segment .segment-text,
.clean-turn .segment-text, .ai-result-section p, .ai-answer p { color: var(--ink); }
.turn-heading span, .segment-speaker, .segment-speaker.uncertain { color: var(--quiet); }
.segment:hover, .segment.active, .speaker-turn .segment.active,
.speaker-turn:not(.editing) .segment:hover,
.speaker-turn:not(.editing) .segment.active,
.clean-turn .segment.active { background: var(--selected); }
.segment-time, .segment-action, .turn-heading .turn-edit,
.clean-compare-button { color: var(--accent); }
.speaker-pill, .ai-sources button, .highlight-controls button[aria-pressed='true'] {
  color: var(--accent-strong);
  background: var(--raised);
  border-color: var(--line);
}
.clean-review, .ai-answer small { color: var(--warning); }

.upload-button, .ai-heading button, .ai-question button, .ai-answer > button,
.vocabulary-entry button, .recording-actions button:first-child,
.recording-actions button:last-child {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.upload-button:hover, .ai-heading button:hover, .ai-question button:hover,
.vocabulary-entry button:hover { background: var(--accent-strong); }
.heading-actions #record-button {
  color: var(--ink);
  background: var(--raised);
  border-color: var(--line);
}
.heading-actions #record-button:hover { border-color: var(--accent); }
.transcript-heading button, .highlight-controls button, .seek-controls button,
.recording-actions button, .recovery-row button, .vocabulary-card button,
.segment-editor .editor-actions button, #clean-compare .editor-actions button {
  color: var(--ink);
  background: var(--raised);
  border-color: var(--line);
}
.transcript-heading button:hover, .highlight-controls button:hover,
.seek-controls button:hover, .recording-actions button:hover,
.recovery-row button:hover, .vocabulary-card button:hover,
#clean-compare .editor-actions button:hover { background: var(--selected); }
.segment button, .turn-heading button, .clean-compare-button { background: transparent; border: 0; }
.segment button:hover, .turn-heading button:hover { color: var(--accent-strong); }
#clean-compare .editor-actions button:first-child {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
button:disabled { opacity: .56; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, .drop-zone:focus-visible, .upload-button:focus-within {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
}

input, textarea, select, #clean-version, .segment-editor textarea,
.segment-editor input, .segment-editor select, .vocabulary-card input,
.recording-panel input, .ai-question input {
  color: var(--ink);
  background: var(--input);
  border-color: var(--line);
}
.recording-panel .recording-workspace-head input { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
input::placeholder, textarea::placeholder { color: var(--quiet); }
.segment-editor, #clean-compare, .ai-answer {
  color: var(--ink);
  background: var(--raised);
  border-color: var(--line);
}
.segment-editor label, .recording-panel label, .ai-question form label,
.vocabulary-card label { color: var(--ink); }
.segment-editor p, #processing-status, #edit-status,
#clean-status, #ai-status, #vocabulary-status { color: var(--muted); }
#import-reference { margin: 0 0 var(--space-4); }
#import-reference summary { cursor: pointer; }
#import-reference pre { max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
#processing-status.is-loading::before, #enhanced-status.is-loading::before, #document-status.is-loading::before, .page-loading::before {
  content: '';
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.65em;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: transcript-loading 0.8s linear infinite;
}
#transcript-tab.is-loading::after {
  content: '';
  display: inline-block;
  width: 0.65em;
  height: 0.65em;
  margin-left: 0.55em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: transcript-loading 0.8s linear infinite;
}
@keyframes transcript-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #processing-status.is-loading::before, #enhanced-status.is-loading::before, #document-status.is-loading::before, .page-loading::before, #transcript-tab.is-loading::after { animation: none; }
}
#status { color: var(--failure); }
#status.success { color: var(--success); }
.ai-stale, .recovery-row { color: var(--warning); background: var(--warning-bg); }
.ai-privacy { color: var(--quiet); }
.segment-text mark, .timed-word mark { color: var(--ink); background: #766338; }
.segment-text::selection, .segment-text *::selection { color: var(--ink); background: var(--selection); }
.timed-word:hover, .timed-word.active-word {
  background: var(--selected);
  box-shadow: 0 0 0 2px var(--selected);
}
.timed-word.active-word mark { box-shadow: 0 0 0 2px var(--selected); }
.speaker-turn.editing .segment-text[contenteditable='true']:focus,
.clean-turn.editing .segment-text[contenteditable='true']:focus {
  color: var(--ink);
  background: var(--input);
  border-color: var(--focus);
  box-shadow: 0 0 0 2px var(--selected);
}
#selection-toolbar {
  color: var(--ink);
  background: var(--raised);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
#selection-toolbar button { color: var(--ink); background: var(--selected); }
#selection-share-menu { position: absolute; top: calc(100% + 5px); right: 0; display: grid; gap: var(--space-1);
  min-width: 170px; padding: var(--space-compact); border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--raised); box-shadow: var(--shadow); }
#selection-share-menu.share-above { top: auto; bottom: calc(100% + 5px); }
#selection-share-menu button { text-align: left; white-space: nowrap; }
#selection-share-menu p { margin: 2px var(--space-1); max-width: 220px; font-size: 12px; color: var(--failure); }
.comment-range { text-decoration: underline dotted var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.transcript-comments { margin: var(--space-3) 0; }
#comments-toggle { border: 1px solid var(--line); border-radius: var(--radius-panel); padding: var(--space-2) var(--space-3); color: var(--ink); background: var(--raised); cursor: pointer; }
#comment-count { color: var(--muted); margin-left: 3px; }
#comments-list { display: grid; gap: var(--space-3); max-width: 650px; margin-top: var(--space-3); }
#comments-list[hidden] { display: none; }
.transcript-comment, .comment-composer { min-width: 0; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.transcript-comment blockquote, .comment-composer blockquote { margin: var(--space-2) 0; padding-left: var(--space-3); border-left: 2px solid var(--accent); color: var(--muted); overflow-wrap: anywhere; }
.transcript-comment p { margin: var(--space-2) 0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.transcript-comment small { color: var(--warning); }
.comment-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.transcript-comment button, .comment-composer button, .comment-edit button { border: 1px solid var(--line); border-radius: var(--radius-control); padding: var(--space-compact) var(--space-3); color: var(--ink); background: var(--raised); cursor: pointer; }
.comment-composer button[type='submit'], .comment-edit button[type='submit'] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.transcript-comments button:disabled { opacity: .5; cursor: default; }
.comment-composer textarea, .comment-edit textarea { width: 100%; min-height: 72px; border: 1px solid var(--line); border-radius: var(--radius-control); padding: 9px; color: var(--ink); background: var(--input); font: inherit; resize: vertical; }
.comment-composer [role='status'], .comment-edit [role='status'] { color: var(--failure); font-size: 13px; }
.player-card { background: var(--raised); box-shadow: var(--shadow); }
.player-card audio { color-scheme: inherit; }

.search-card { margin: 0 0 var(--space-5); padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.search-card label, .transcript-search label { display: block; margin-bottom: var(--space-3); color: var(--ink); font-weight: 650; }
.search-row { display: flex; align-items: center; gap: var(--space-2); }
.search-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-control); padding: var(--space-3) var(--space-3); }
.search-row select, .search-row button, #library-search-controls select {
  color: var(--ink); background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--radius-control); padding: var(--space-3) var(--space-3); cursor: pointer;
}
.search-row button:hover, .search-result:hover { background: var(--selected); border-color: var(--accent); }
#library-search-controls { margin-top: var(--space-4); }
#library-search-controls label { display: inline; margin-right: var(--space-2); }
#library-search-status, #transcript-search-status { min-height: 22px; margin-top: var(--space-3); color: var(--muted); font-size: 13px; }
#library-search-results { display: grid; gap: var(--space-2); }
.search-result { display: grid; gap: var(--space-1); padding: var(--space-3); color: var(--ink); text-decoration: none; border: 1px solid var(--line-soft); border-radius: var(--radius-panel); }
.search-result > span { color: var(--muted); font-size: 13px; }
.search-result .search-excerpt { color: var(--ink); font-size: 14px; }
.search-excerpt mark { color: var(--accent-ink); background: var(--accent); border-radius: var(--radius-text); }
.search-profile-link { color: var(--accent); font-size: 13px; margin: -3px 0 var(--space-2) var(--space-3); }
.transcript-search { margin-top: 15px; }
.transcript-search .search-row select { max-width: 180px; }
.segment.search-match { box-shadow: inset 3px 0 var(--accent); }
.segment.search-current { background: var(--selected); outline: var(--focus-width) solid var(--accent); outline-offset: -2px; }
.library-tools { margin: 0 0 var(--space-4); padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.library-toolbar, .category-row, .trash-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.library-toolbar select { flex: 1; max-width: 330px; }
.library-tools select, .library-tools button, #trash-view button,
.category-row button { color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 9px var(--space-3); cursor: pointer; }
.library-tools button:hover, #trash-view button:hover { border-color: var(--accent); }
#manage-categories { margin-top: var(--space-4); }
#manage-categories summary { color: var(--accent); cursor: pointer; font-weight: 650; }
#create-category-form { margin: var(--space-4) 0; }
#create-category-form label { display: block; margin-bottom: var(--space-2); }
.category-row { padding: var(--space-2) 0; border-top: 1px solid var(--line-soft); }
.category-row span { flex: 1; }
.category-tag { display: inline-block; margin: var(--space-compact) var(--space-1) 0 0; padding: 3px var(--space-2); border-radius: var(--radius-pill); color: var(--accent-strong); background: var(--raised); font-size: 12px; }
.button-with-icon { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
.button-with-icon[hidden] { display: none; }
.button-with-icon svg { width: 17px; height: 17px; flex: none; }
#conversation-categories-dialog, .library-dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-sizing: border-box; padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#conversation-categories-dialog::backdrop, .library-dialog::backdrop { background: #02050ea8; }
.category-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.category-dialog-header h2 { margin: 0; font-size: 21px; }
.category-dialog-header button { width: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 25px; cursor: pointer; }
#conversation-categories-dialog #conversation-category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1) var(--space-3); margin: var(--space-4) 0 var(--space-1); }
#conversation-categories-dialog .category-checkbox { min-height: 38px; padding: 0 9px; border-radius: var(--radius-dialog); }
#conversation-categories-dialog .category-checkbox:hover { background: var(--raised); }
#conversation-categories-dialog #categorization-status:empty { display: none; }
#conversation-categories-dialog #retry-categorization { margin-top: var(--space-2); }
@media (max-width: 420px) { #conversation-categories-dialog #conversation-category-list { grid-template-columns: 1fr; } }
.more-menu { position: relative; flex: 0 0 auto; }
.more-menu summary { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--raised); color: var(--ink); font-size: 25px; line-height: 1; cursor: pointer; list-style: none; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu summary:hover, .more-menu[open] summary { border-color: var(--accent); }
.more-menu-items { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; display: grid; gap: 2px; width: min(260px, calc(100vw - 40px)); padding: var(--space-compact); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow); }
.heading-actions .more-menu-items button { width: 100%; border: 0; background: transparent; color: var(--ink); text-align: left; }
.heading-actions .more-menu-items .button-with-icon { justify-content: flex-start; }
.more-menu-items button:hover { background: var(--raised); }
.more-menu-items button[hidden] { display: none; }
.more-menu-items #trash-conversation { border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-tab) var(--radius-tab); }
#recording-detail:empty { display: none; }
.category-checkbox { display: inline-flex; align-items: center; gap: var(--space-compact); cursor: pointer; }
.category-checkbox input { accent-color: var(--accent); }
#trash-conversation { color: var(--failure); }
#trash-view h2 { margin: var(--space-6) 0 var(--space-1); font: 300 30px var(--font-heading); }
.trash-row { padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.trash-row strong { flex: 1; min-width: 160px; }
.trash-expiry { color: var(--muted); font-size: .88rem; }
.trash-row button:last-child { color: var(--failure); }
.person-list-row { display: block; padding: var(--space-3) 0; color: var(--accent); border-top: 1px solid var(--line-soft); }
#people-panel summary, #person-merge-panel summary { color: var(--accent); cursor: pointer; font-weight: 650; }
#person-view { padding-top: var(--space-1); }
.profile-page .heading-actions, .profile-page #vocabulary-panel { display: none; }
#person-view h2 { font: 300 28px var(--font-heading); margin: var(--space-6) 0 var(--space-3); }
#person-rename-form, #person-merge-panel { margin-top: var(--space-6); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
#person-rename-form label, #person-merge-panel label { display: block; margin-bottom: var(--space-2); font-weight: 650; }
.person-conversation-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-2) var(--space-3); align-items: center; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.person-conversation-row a { color: var(--accent); font-weight: 650; }
.person-conversation-row small { grid-column: 1; color: var(--muted); }
.person-conversation-row button, #person-merge-panel button, #person-rename-form button { color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-control); padding: 9px var(--space-3); cursor: pointer; }
.person-conversation-row button:hover, #person-merge-panel button:hover, #person-rename-form button:hover { border-color: var(--accent); }
#person-delete { margin-top: var(--space-4); color: var(--failure); background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 9px var(--space-3); cursor: pointer; }
.person-confirmation { display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--line-soft); }
.person-confirmation label { display: grid; gap: var(--space-1); }
.turn-heading a { color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.turn-heading, .speaker-turn.editing .segment { position: relative; }
.speaker-picker { position: absolute; z-index: 35; top: 100%; left: 0; width: min(350px, calc(100vw - 44px)); min-height: 260px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); overflow: hidden; }
.speaker-picker-search { display: flex; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--line); }
.speaker-picker-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.speaker-picker-search button { border: 0; border-radius: var(--radius-control); background: var(--accent-strong); color: var(--field); padding: var(--space-2) var(--space-4); font-weight: 650; cursor: pointer; }
.speaker-picker-search button:disabled { background: var(--raised); color: var(--quiet); cursor: default; }
.speaker-picker-list { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: var(--space-4) var(--space-3); }
.speaker-picker-list strong { color: var(--muted); font-size: 13px; margin: 0 0 var(--space-2); }
.speaker-picker-list button { width: 100%; text-align: left; padding: 9px var(--space-3); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--ink); cursor: pointer; font-weight: 400; }
.speaker-picker-list button:hover { background: var(--raised); text-decoration: none; }
.speaker-picker-option { display: flex; align-items: center; }
.speaker-picker-option button:first-child { flex: 1; }
.speaker-picker-option button:last-child:not(:first-child) { flex: 0; color: var(--accent); font-size: 12px; }
.speaker-picker p { padding: 0 var(--space-3); color: var(--failure); font-size: 12px; }
.speaker-picker p:empty { display: none; }
.speaker-picker-manage { margin: auto var(--space-3) var(--space-3); width: calc(100% - 20px); padding: 9px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--raised); color: var(--ink); cursor: pointer; font-weight: 650; }
.speaker-picker-manage:hover { border-color: var(--accent); }
#manage-speakers-dialog { width: min(820px, calc(100vw - 24px)); max-height: min(680px, calc(100vh - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#manage-speakers-dialog::backdrop { background: #050a17aa; }
.manage-speakers-heading, .manage-speakers-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.manage-speakers-heading h2 { margin: 0; font-size: 19px; }
.manage-speakers-heading button { border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 24px; }
#manage-speakers-dialog > input { display: block; width: calc(50% - 30px); margin: 0 var(--space-5) var(--space-3); padding: 9px var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--input); color: var(--ink); }
.manage-speakers-body { display: grid; grid-template-columns: 1fr 1fr; min-height: 280px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.manage-speakers-list { padding: var(--space-3) var(--space-5); overflow: auto; max-height: 410px; }
.manage-speakers-detail { display: grid; align-content: center; justify-items: center; padding: var(--space-5); border-left: 1px solid var(--line-soft); color: var(--muted); }
.manage-speakers-detail label { display: grid; gap: var(--space-2); width: 100%; max-width: 220px; }
.manage-speakers-detail select, .manage-speaker-rename input { padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--input); color: var(--ink); }
.manage-speaker-row { display: flex; align-items: center; gap: var(--space-3); min-height: 50px; padding: var(--space-compact); border: 1px solid var(--line-soft); border-radius: var(--radius-panel); margin-bottom: var(--space-compact); }
.manage-speaker-row > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.manage-speaker-row small { display: block; color: var(--quiet); font-size: 11px; }
.manage-speaker-row button, .manage-speaker-rename button, .manage-speakers-footer button { border: 1px solid var(--line); border-radius: var(--radius-control); padding: var(--space-compact) 9px; background: var(--raised); color: var(--ink); cursor: pointer; }
.manage-speaker-row button:hover, .manage-speakers-footer button:hover { border-color: var(--accent); }
.manage-speaker-rename { display: flex; gap: var(--space-1); flex: 1; min-width: 0; }
.manage-speaker-rename input { flex: 1; min-width: 0; }
.manage-speakers-footer { justify-content: flex-end; }
.manage-speakers-footer button:disabled { opacity: .45; cursor: default; }
#manage-speakers-dialog > p { padding: 0 var(--space-5); color: var(--failure); font-size: 13px; }
#manage-speakers-dialog > p:empty { display: none; }
@media(max-width:600px) { #manage-speakers-dialog > input { width: calc(100% - 40px); } .manage-speakers-body { grid-template-columns: 1fr; } .manage-speakers-detail { border-left: 0; border-top: 1px solid var(--line-soft); min-height: 90px; } }

/* The media element owns playback; these controls expose the interview timeline. */
.player-card #audio-player { display: none; }
.seek-timeline { position: relative; height: 24px; margin: 0 2px var(--space-1); }
.seek-timeline::before { content: ''; position: absolute; top: 10px; left: 0; right: 0; height: 5px; border-radius: var(--radius-panel); background: linear-gradient(to right, var(--accent) 0 var(--seek-progress, 0%), var(--control-line) var(--seek-progress, 0%) 100%); }
#seek-segments { position: absolute; inset: 10px 0 auto; height: 5px; pointer-events: none; }
#seek-segments span { position: absolute; top: 0; height: 5px; min-width: 2px; border-right: 2px solid var(--surface); background: color-mix(in srgb, var(--accent) 46%, transparent); }
#seek-slider { position: absolute; inset: 0; width: 100%; height: 24px; margin: 0; cursor: pointer; appearance: none; background: transparent; }
#seek-slider::-webkit-slider-runnable-track { height: 24px; background: transparent; }
#seek-slider::-moz-range-track { height: 24px; background: transparent; }
#seek-slider::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: var(--space-1); border: 2px solid var(--surface); border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 1px var(--line); }
#seek-slider::-moz-range-thumb { width: 11px; height: 11px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent-strong); box-shadow: 0 0 0 1px var(--line); }
.player-transport { display: flex; align-items: center; gap: var(--space-3); min-height: 34px; }
.player-transport button, .player-transport summary { border: 0; padding: var(--space-1) var(--space-2); background: transparent; color: var(--ink); cursor: pointer; font-size: 15px; }
.player-transport button:hover, .player-transport summary:hover { color: var(--accent-strong); }
.player-transport button small { font-size: 10px; margin-left: 1px; }
#play-pause { min-width: 32px; font-size: 19px; }
#playback-speed-menu { position: relative; }
#playback-speed-menu summary { list-style: none; font-size: 13px; }
#playback-speed-menu summary::-webkit-details-marker { display: none; }
.speed-options { position: absolute; z-index: 25; bottom: calc(100% + 12px); left: 0; display: grid; min-width: 150px; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow); }
.speed-options strong { font-size: 12px; color: var(--muted); padding: var(--space-1) var(--space-2); }
.speed-options button { text-align: left; font-size: 13px; border-radius: var(--radius-control); }
.speed-options button[aria-pressed='true'] { color: var(--accent-strong); background: var(--raised); }
.skip-silence-option { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-1) 0 0; padding: var(--space-2); border-top: 1px solid var(--line); white-space: nowrap; cursor: pointer; font-size: 13px; }
.skip-silence-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
#skip-silence-status { color: var(--quiet); font-size: 11px; }
#skip-silence-status:empty { display: none; }
.player-time { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media(max-width:600px) { .player-transport { gap: var(--space-2); } .player-transport button, .player-transport summary { padding: var(--space-1); } .player-time { font-size: 11px; } }

html[data-theme='light'] body { background: var(--field); }
html[data-theme='light'] .upload-button:hover,
html[data-theme='light'] .ai-heading button:hover { color: #ffffff; }
html[data-theme='light'] .segment-text mark,
html[data-theme='light'] .timed-word mark { background: #f4dd84; }

#sync-dialog { width: min(400px, calc(100vw - 32px)); box-sizing: border-box; border: 1px solid var(--line); border-radius: var(--radius-dialog); padding: var(--space-6); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#sync-dialog::backdrop { background: #02050ea8; }
#sync-dialog h2 { margin: 0 0 var(--space-4); }
#sync-form { display: grid; gap: var(--space-3); }
#sync-passphrase { box-sizing: border-box; width: 100%; background: var(--input); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: var(--space-3); font: inherit; }
.sync-actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-3); }
.sync-actions button { border: 1px solid var(--line); border-radius: var(--radius-control); padding: 9px var(--space-4); cursor: pointer; }
#sync-submit { background: var(--accent); color: var(--accent-ink); }
#sync-status { color: var(--muted); min-height: 1.4em; }
#sync-account-link { color: var(--accent); }

#rename-conversation-dialog { width: min(440px, calc(100vw - 32px)); box-sizing: border-box; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#rename-conversation-dialog::backdrop { background: #02050ea8; }
#rename-conversation-form { display: grid; gap: var(--space-3); }
#rename-conversation-form h2 { margin: 0 0 var(--space-2); font-size: 20px; }
#rename-conversation-form label { font-size: 13px; font-weight: 650; }
#rename-conversation-input { width: 100%; min-height: 44px; padding: var(--space-3) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--input); color: var(--ink); }
#rename-conversation-status { color: var(--failure); font-size: 13px; }
#rename-conversation-status:empty { display: none; }
.rename-conversation-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-3); }
.rename-conversation-actions button { min-height: 44px; padding: 9px 15px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--raised); color: var(--ink); cursor: pointer; }
#rename-conversation-save { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

/* Keep the home library close to its main task: opening a conversation. */
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) main { max-width: 920px; padding-top: 42px; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading { margin-bottom: 25px; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) h1 { font-size: clamp(34px, 4vw, 46px); }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #status:empty { display: none; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #status:not(:empty) { min-height: 0; margin: -8px 0 var(--space-4); }
#list-view .search-card { padding: 0; margin: 0 0 15px; border: 0; border-radius: 0; background: transparent; }
#list-view .search-card label { margin-bottom: var(--space-2); font-size: 13px; }
#list-view .search-row input { min-height: 44px; }
#list-view .search-row button { min-height: 44px; }
#list-view #library-search-status:empty { display: none; }
#list-view #library-search-status:not(:empty) { min-height: 0; margin: 9px 0; }
#list-view #library-search-controls { margin: var(--space-3) 0 0; }
#list-view #library-search-results:not(:empty) { margin: var(--space-3) 0 var(--space-4); }
#list-view .library-toolbar { gap: 9px; margin-bottom: var(--space-3); color: var(--muted); font-size: 13px; }
#list-view .library-toolbar select { flex: 0 1 250px; max-width: 100%; min-height: 44px; padding: 9px var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--raised); color: var(--ink); }
#list-view .conversation-list { margin-top: 0; gap: 9px; }
#list-view .conversation-row { min-height: 74px; padding: 15px var(--space-4); }
#list-view .conversation-row strong { font-size: 16px; }
#list-view .conversation-row small { color: var(--muted); }
#list-view .conversation-row .arrow { font-size: 21px; }
.live-recording-card { position: relative; display: grid; gap: var(--space-2); margin: 0 0 var(--space-3); padding: 19px 54px var(--space-5) var(--space-5); border: 1px solid var(--failure); border-radius: var(--radius-panel); background: var(--surface); color: var(--ink); text-decoration: none; }
.live-recording-card[hidden] { display: none; }
.live-recording-card:hover, .live-recording-card:focus-visible { background: var(--raised); border-color: #f16c66; }
.live-recording-state { color: var(--failure); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.live-recording-state::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: var(--space-2); border-radius: 50%; background: currentColor; }
.live-recording-card strong { font-size: 20px; overflow-wrap: anywhere; }
.live-recording-card small { color: var(--muted); font-variant-numeric: tabular-nums; }
.live-recording-preview { min-height: 44px; margin-top: var(--space-2); padding: 2px 0 2px var(--space-3); border-left: 2px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
.live-recording-preview p, .remote-live-preview { color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0 0 var(--space-1); }
.live-recording-preview p:last-child { margin-bottom: 0; }
#live-recording-preview-status[hidden] { display: none; }
.live-recording-arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 21px; }
#list-view .recover-recordings:empty { display: none; }
#list-view .recover-recordings { display: grid; gap: var(--space-3); margin: 0 0 var(--space-3); }
#list-view .recovery-row { margin: 0; background: var(--surface); color: var(--ink); border-color: var(--line); }
#list-view .remote-live-recording { border-color: var(--failure); }
#list-view .remote-live-recording .recovery-summary span { color: var(--failure); }
.recovery-summary { display: grid; gap: var(--space-1); }
.recovery-summary strong { font-size: 16px; overflow-wrap: anywhere; }
.recovery-summary span { color: var(--muted); }
.recovery-summary .remote-live-preview { margin-top: var(--space-1); font-size: 13px; }
#list-view #manage-categories { margin-top: 0; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel { max-width: 920px; margin: 0 auto 35px; padding: 0; border-top: 1px solid var(--line-soft); border-bottom: 0; border-left: 0; border-right: 0; border-radius: 0; background: transparent; box-shadow: none; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel summary { padding: 13px 0; color: var(--muted); font-size: 13px; font-weight: 400; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel[open] { padding: 0 0 var(--space-4); }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel[open] summary { margin: 0; border: 0; }

@media (max-width: 600px) {
  header { padding: 0 var(--space-5); }
  .header-side { gap: 0; }
  .capture-header-controls { gap: var(--space-1); margin-right: var(--space-compact); }
  .capture-header-controls button { width: 36px; height: 36px; }
  #capture-header-timer { min-width: 37px; font-size: 12px; }
  h1 { font-size: clamp(35px, 9vw, 44px); }
  .transcript-heading h2, .ai-heading h2 { font-size: 25px; }
  .transcript-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .transcript-actions button, .transcript-actions select { min-width: 0; max-width: none; white-space: normal; text-align: center; }
  .search-card { padding: 17px; }
  .transcript-search .search-row { flex-wrap: wrap; }
  .transcript-search .search-row input { flex-basis: 100%; }
  .transcript-search .search-row select { max-width: none; flex: 1; }
  .library-toolbar select { min-width: 0; }
  .heading-actions .more-menu { position: absolute; right: 0; top: 0; flex: none; }
  .conversation-page .heading > div:first-child { padding-right: 50px; }
  .person-conversation-row { grid-template-columns: 1fr; }
  .person-conversation-row small { grid-column: 1; }
  #person-merge-panel .search-row { flex-wrap: wrap; }
  #person-merge-panel select { flex-basis: 100%; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) main { padding-top: 34px; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading { gap: 13px; margin-bottom: 25px; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) h1 { font-size: 36px; }
  #list-view .search-row { gap: var(--space-2); }
  #list-view .search-row button { padding: 9px var(--space-3); }
  #list-view .library-toolbar select { flex: 1; }
  #list-view .conversation-row { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Local meeting screenshots. */
.image-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.image-heading h2 { margin: 0; }
.image-heading button, #add-conversation-image, .image-card button, #image-dialog button, #image-viewer button {
  border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--raised); color: var(--ink);
  padding: var(--space-2) var(--space-3); font: inherit; font-size: 13px; cursor: pointer;
}
.image-heading button:disabled, #image-dialog button:disabled { opacity: .5; cursor: default; }
.image-list { display: grid; gap: var(--space-3); margin: var(--space-4) 0; }
.image-list:empty { display: none; }
.image-card { display: flex; align-items: flex-start; gap: var(--space-3); max-width: 650px; padding: var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--raised); }
.image-card .image-thumb { display: block; width: min(180px, 40vw); height: 110px; padding: 0;
  overflow: hidden; flex: none; border: 0; background: var(--surface); }
.image-card .image-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-card-info { display: grid; min-width: 0; gap: var(--space-2); }
.image-card-info p { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.image-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-compact); }
#image-dialog, #image-viewer { box-sizing: border-box; width: min(560px, calc(100vw - 24px)); max-height: 90vh;
  overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); padding: var(--space-6); }
#image-dialog::backdrop, #image-viewer::backdrop { background: #02050eb8; }
#image-form { display: grid; gap: var(--space-3); }
#image-form h2 { margin: 0; }
#image-anchor-label { margin: 0; color: var(--muted); }
#image-paste-target { padding: var(--space-6) var(--space-4); border: 2px dashed var(--line); border-radius: var(--radius-panel);
  background: var(--input); text-align: center; cursor: pointer; }
#image-paste-target:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
#image-preview { display: block; max-width: 100%; max-height: 270px; object-fit: contain; }
#image-preview[hidden] { display: none; }
#image-caption { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: var(--radius-panel);
  padding: var(--space-3); background: var(--input); color: var(--ink); font: inherit; }
#image-status { min-height: 1.2em; margin: 0; color: var(--failure); }
.image-dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
#save-image { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: var(--accent) !important; }
#image-viewer { width: min(1000px, calc(100vw - 24px)); }
#image-viewer img { display: block; max-width: 100%; max-height: 75vh; margin: var(--space-3) auto 0; object-fit: contain; }
@media (max-width: 600px) { .image-card { flex-direction: column; } .image-card .image-thumb { width: 100%; height: 180px; } }

/* Contrast workspace experiment: a quiet paper canvas beside a compact control rail. */
html[data-theme='light'] {
  --warning: var(--paper-warning);
  --warning-bg: #fff5df;
  --success: var(--paper-success);
  --failure: var(--paper-failure);
  --field: var(--paper-surface);
  --surface: var(--paper-surface);
  --raised: #EFEFEE;
  --input: #ffffff;
  --line: var(--paper-line);
  --line-soft: var(--paper-line-soft);
  --ink: var(--paper-ink);
  --muted: var(--paper-muted);
  --quiet: #605465;
  --accent: var(--brand-mauve);
  --accent-strong: color-mix(in srgb, var(--accent) 88%, var(--paper-ink));
  --accent-ink: #ffffff;
  --selected: #e5efed;
  --selection: #c8dcd7;
  --focus: var(--source-focus);
  --shadow: 0 16px 38px #2A252F1c;
  --waveform: #335C63;
  --check-bg: var(--brand-mauve);
  --check-ink: var(--paper-raised);
  --speaker-auto: #7A6E7C;
  /* Colour blocks carry inverted ink: a dark block with light ink on light pages. */
  --block-fill: var(--brand-mauve);
  --block-ink: var(--surface);
  --block-muted: #E4DCE8;
  --block-alert-fill: var(--paper-failure);
  --block-alert-ink: #FFFFFF;
  --block-ok-fill: var(--paper-success);
  --block-ok-ink: #FFFFFF;
  --block-calculated-fill: var(--paper-warning);
  --block-calculated-ink: #FFFFFF;
  --block-planned-fill: var(--brand-slate);
  --block-planned-ink: #FFFFFF;
  color-scheme: light;
}
html[data-theme='dark'] {
  --data-series: var(--data-series-dark);
  --link-ink: var(--brand-aqua);
  --field: #302638;
  --surface: #382C42;
  --raised: var(--rail-control);
  --input: var(--rail-input);
  --line: #605465;
  --line-soft: #51415C;
  --ink: var(--rail-ink);
  --muted: #DED5DE;
  --quiet: #C4B6C6;
  --accent: #FFFFFF;
  --accent-strong: #E5E2E7;
  --accent-ink: var(--rail-surface);
  --selected: #4A3A56;
  --selection: #86798E;
  --focus: #FFFFFF;
  --shadow: 0 16px 38px #2B2630A0;
  --waveform: #335C63;
  --check-bg: var(--ink);
  --check-ink: var(--surface);
  --speaker-auto: #A99BAB;
  /* Colour blocks carry inverted ink: a light block with dark ink on dark pages. */
  --block-fill: var(--ink);
  --block-ink: var(--surface);
  --block-muted: #5B5260;
  --block-alert-fill: #FFB4AE;
  --block-alert-ink: #3B1012;
  --block-ok-fill: #9FE2C3;
  --block-ok-ink: #0E2E21;
  --block-calculated-fill: #F3C983;
  --block-calculated-ink: #33250A;
  --block-planned-fill: #D5D9EC;
  --block-planned-ink: #1F2433;
  color-scheme: dark;
}
body, html[data-theme='light'] body {
  background: var(--field);
}
html[data-theme='dark'] body::before { display: none; }
#rail-shader { display: none; }

@media (min-width: 1001px) {
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page), body.recording-page {
    /* One width on every page; moving between pages never resizes the sidebar. */
    --rail-width: 280px;
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    grid-template-rows: 72px minmax(calc(100vh - 72px), auto);
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) {
    background:
      radial-gradient(ellipse 85% 55% at 52% 42%, #335C63 0%, #394C56 30%, #413A48 66%, var(--rail-surface) 100%)
        left top / var(--rail-width) 120% no-repeat,
      var(--field);
    animation: home-rail-drift 24s ease-in-out infinite alternate;
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page)::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    width: var(--rail-width);
    background: url('/static/rail-grain.svg') repeat;
    opacity: .15;
    mix-blend-mode: soft-light;
    pointer-events: none;
  }
  @keyframes home-rail-drift {
    from { background-position: left top, left top; }
    to { background-position: left bottom, left top; }
  }
  @media (prefers-reduced-motion: reduce) {
    body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) { animation: none; }
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #rail-shader {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 0;
    width: var(--rail-width);
    height: 100vh;
    /* Blob edge softness, 0 (defined) to 1 (diffuse). */
    --rail-blur: .55;
    pointer-events: none;
  }
  html.rail-shader-ready body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) { animation: none; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header, body.recording-page header {
    grid-column: 1;
    grid-row: 1;
    height: 72px;
    padding: 0 var(--space-6);
    border: 0;
    background: transparent;
    color: var(--rail-ink);
    /* The sidebar's head stays with the fixed sidebar below it; scrolling the page left a hole (#258). */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2;
    box-sizing: border-box;
    width: var(--rail-width);
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header { backdrop-filter: none; }
  body.recording-page header { background: var(--rail-surface); backdrop-filter: none; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header .brand, body.recording-page header .brand { color: var(--rail-ink); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header #logout-button, body.recording-page header #logout-button {
    border-color: #605465;
    background: var(--rail-control);
    color: var(--rail-ink);
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header :is(#theme-toggle, #setup-theme), body.recording-page header :is(#theme-toggle, #setup-theme) { color: var(--rail-ink); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) main, body.recording-page main {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    grid-auto-rows: min-content;
    align-content: start;
    max-width: none;
    min-width: 0;
    min-height: calc(100vh - 72px);
    margin: 0;
    padding: 0;
    background: transparent;
  }
  body.recording-page main { background: var(--field); }
  body.recording-page main::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    width: var(--rail-width);
    background: var(--rail-surface);
    pointer-events: none;
  }
  body.recording-page .recording-workspace-head,
  body.recording-page .recording-bar,
  body.recording-page .recording-ai { position: relative; z-index: 1; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading,
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #status,
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel,
  body.recording-page .recording-workspace-head,
  body.recording-page .recording-bar,
  body.recording-page .recording-ai {
    --ink: var(--rail-ink);
    --muted: var(--rail-muted);
    --quiet: #B6A8BA;
    --line: #605465;
    --line-soft: #5A4F60;
    --raised: var(--rail-control);
    --input: var(--rail-input);
    --accent: #FFFFFF;
    --accent-strong: #E5E2E7;
    --accent-ink: var(--rail-surface);
    --focus: #FFFFFF;
    color: var(--ink);
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 30px;
    margin: 0;
    padding: var(--space-12) var(--space-6) var(--space-6);
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(32px, 3vw, 44px);
    line-height: 1.07;
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading-actions button { min-height: 47px; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading-actions #record-button,
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading-actions #import-button {
    border: 1px solid #605465;
    background: var(--rail-control);
    color: var(--rail-ink);
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading-actions #record-button:hover,
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading-actions #import-button:hover { background: #38303D; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #status:not(:empty) { grid-column: 1; grid-row: 2; margin: 0 var(--space-6) 15px; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    width: auto;
    max-width: none;
    margin: var(--space-6) var(--space-6);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--rail-input);
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel summary { padding: var(--space-4) var(--space-4); color: var(--ink); font-size: 14px; font-weight: 650; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel[open] { padding: 0 var(--space-4) var(--space-4); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel[open] summary { padding-left: 2px; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #list-view {
    grid-column: 2;
    grid-row: 1 / span 5;
    min-width: 0;
    min-height: calc(100vh - 72px);
    padding: 54px clamp(var(--space-7), 5vw, 86px) 80px;
  }
  #list-view .search-card { max-width: 900px; }
  #list-view .conversation-list, #list-view .library-toolbar, #list-view .recover-recordings,
  #list-view .live-recording-card { max-width: 900px; }
  body.recording-page #status, body.recording-page .heading { display: none; }
  body.recording-page #recording-panel, body.recording-page .recording-workspace-grid { display: contents; }
  body.recording-page .recording-workspace-head {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    gap: var(--space-4);
    align-content: start;
    margin: 0;
    padding: 42px var(--space-6) var(--space-6);
  }
  body.recording-page .recording-workspace-head #back-from-recording { justify-self: start; padding: 0; color: var(--accent); }
  body.recording-page .recording-workspace-head input {
    width: 100%;
    min-width: 0;
    padding: var(--space-2) 0 var(--space-3);
    border-color: var(--line);
    color: var(--ink);
    font: 300 clamp(26px, 2.6vw, 36px)/1.16 var(--font-heading);
  }
  body.recording-page #recording-import {
    justify-self: start;
    min-width: 110px;
    min-height: var(--control-height);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--raised);
    color: var(--ink);
    cursor: pointer;
  }
  body.recording-page .recording-bar {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    display: grid;
    justify-content: stretch;
    gap: var(--space-3);
    min-width: 0;
    min-height: 0;
    padding: var(--space-6) var(--space-6);
    border: 0;
    border-top: 1px solid var(--line-soft);
    background: transparent;
    box-shadow: none;
  }
  body.recording-page #recording-waveform { width: 100%; max-width: 320px; height: 36px; }
  body.recording-page .recording-actions { flex-wrap: wrap; gap: var(--space-2); }
  body.recording-page .recording-actions button { min-height: var(--control-height); }
  body.recording-page .recording-actions #stop-recording { background: var(--action-danger-fill); border-color: var(--action-danger-fill); color: var(--action-danger-ink); }
  body.recording-page .recording-ai {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    min-width: 0;
    margin: 0 var(--space-6) var(--space-10);
    padding: var(--space-4) 0 0;
    border: 0;
    border-top: 1px solid var(--line-soft);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  body.recording-page .recording-ai h2 { color: var(--ink); font-size: 18px; }
  body.recording-page .recording-chat-prompts button { background: var(--raised); color: var(--ink); }
  body.recording-page .recording-chat-messages { min-height: 80px; max-height: 260px; }
  body.recording-page .recording-workspace-main {
    grid-column: 2;
    grid-row: 1 / span 5;
    min-width: 0;
    min-height: calc(100vh - 72px);
    padding: 52px clamp(30px, 5vw, 88px);
    border: 0;
    border-radius: 0;
    background: var(--field);
    box-shadow: none;
  }
  body.recording-page .recording-workspace-main > * { max-width: 920px; }
  body.recording-page .recording-workspace-main .notes-editor { min-height: 48vh; }
}

@media (max-width: 1000px) {
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header, body.recording-page header {
    background: var(--rail-surface);
    color: var(--rail-ink);
    border: 0;
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header .brand, body.recording-page header .brand { color: var(--rail-ink); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header #logout-button, body.recording-page header #logout-button { background: var(--rail-control); color: var(--rail-ink); border-color: #605465; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header :is(#theme-toggle, #setup-theme), body.recording-page header :is(#theme-toggle, #setup-theme) { color: var(--rail-ink); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) main, body.recording-page main { max-width: none; padding: 0; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading {
    display: grid;
    gap: var(--space-5);
    margin: 0;
    padding: var(--space-8) var(--space-5) var(--space-6);
    background: var(--rail-surface);
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading h1 { color: var(--rail-ink); font-size: 36px; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading-actions { display: flex; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading-actions button { width: auto; min-width: 115px; border-color: #605465; background: var(--rail-control); color: var(--rail-ink); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #status:not(:empty) { margin: 0; padding: var(--space-3) var(--space-5); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #list-view { padding: var(--space-7) var(--space-5) 45px; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #vocabulary-panel { margin: 0 var(--space-5) 30px; }
  body.recording-page .recording-panel { display: flex; flex-direction: column; margin: 0; padding: 0; border: 0; border-radius: 0; }
  body.recording-page .recording-workspace-head { order: 0; display: grid; gap: var(--space-4); margin: 0; padding: 25px var(--space-5) var(--space-4); background: var(--rail-surface); }
  body.recording-page .recording-workspace-head #back-from-recording { justify-self: start; color: #FFFFFF; }
  body.recording-page .recording-workspace-head input { width: 100%; color: var(--rail-ink); border-color: #605465; }
  body.recording-page #recording-import { justify-self: start; border: 1px solid #605465; border-radius: var(--radius-panel); padding: 9px var(--space-4); background: var(--rail-control); color: var(--rail-ink); }
  body.recording-page .recording-workspace-grid { order: 2; display: flex; flex-direction: column; gap: 0; }
  body.recording-page .recording-workspace-main { order: 0; min-height: 55vh; padding: var(--space-7) var(--space-5) 70px; border: 0; border-radius: 0; background: var(--field); }
  body.recording-page .recording-workspace-main .notes-editor { min-height: 42vh; }
  body.recording-page .recording-ai { order: 1; }
  body.recording-page .recording-bar { order: 1; position: static; display: grid; gap: var(--space-2); min-height: 0; padding: 15px var(--space-5) var(--space-6); border: 0; background: var(--rail-surface); color: var(--rail-ink); }
  body.recording-page .recording-source strong, body.recording-page .recording-source span, body.recording-page .recording-source p,
  body.recording-page #recording-timer { color: var(--rail-ink); }
  body.recording-page #recording-waveform { width: 100%; max-width: 360px; height: 22px; }
  body.recording-page .recording-actions { width: 100%; justify-content: flex-start; }
  body.recording-page .recording-actions button { min-height: var(--control-height); }
  body.recording-page .recording-actions #stop-recording { background: var(--action-danger-fill); border-color: var(--action-danger-fill); color: var(--action-danger-ink); }
}

/* Keep live transport visible even when the rail is at its narrowest. */
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page):has(#capture-header-controls:not([hidden])) header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 42px 38px;
  height: 112px;
  align-content: center;
  gap: 0;
}
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page):has(#capture-header-controls:not([hidden])) header .brand { grid-column: 1; grid-row: 1; align-self: center; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page):has(#capture-header-controls:not([hidden])) header .header-side { display: contents; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page):has(#capture-header-controls:not([hidden])) :is(#theme-toggle, #setup-theme) { grid-column: 2; grid-row: 1; align-self: center; }
body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page):has(#capture-header-controls:not([hidden])) .capture-header-controls { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
@media (min-width: 1001px) {
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page):has(#capture-header-controls:not([hidden])) { grid-template-rows: 112px minmax(calc(100vh - 112px), auto); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page):has(#capture-header-controls:not([hidden])) #list-view { min-height: calc(100vh - 112px); }
}

/* View tabs: small top corners. Selected is inverted (text-colour fill, surface-colour label) and joins the
   page's rule below it. `.view-tabs` is the same shape for notebook views. */
.recording-view-tabs, .conversation-tabs, .view-tabs {
  display: flex;
  align-items: flex-end;
  gap: var(--space-1);
  margin: 0 0 var(--space-5);
  padding: 0;
  border-bottom: 2px solid var(--ink);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.conversation-tabs { margin: var(--space-6) 0 0; }
.recording-view-tabs button, .conversation-tabs button, .view-tabs button,
.recording-view-tabs button[aria-selected='true'], .conversation-tabs button[aria-selected='true'],
.view-tabs button[aria-selected='true'] {
  flex: 0 0 auto;
  min-width: 120px;
  justify-content: center;
  min-height: 44px;
  margin: 0 0 -2px;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-tab) var(--radius-tab) 0 0;
  background: var(--raised);
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transform: none;
  transition: none; /* Frequent tab changes stay immediate, including keyboard navigation. */
}
.recording-view-tabs button:hover, .conversation-tabs button:hover, .view-tabs button:hover { color: var(--ink); }
.recording-view-tabs button[aria-selected='true'], .conversation-tabs button[aria-selected='true'],
.view-tabs button[aria-selected='true'] {
  border-color: var(--block-fill);
  background: var(--block-fill);
  color: var(--block-ink);
  font-weight: 750;
}
.recording-view-tabs button:focus-visible, .conversation-tabs button:focus-visible, .view-tabs button:focus-visible {
  outline: var(--focus-width) solid var(--focus); outline-offset: -3px;
}
.recording-view-tabs button::before, .conversation-tabs button::before, .view-tabs button::before,
.recording-view-tabs button::after, .conversation-tabs button::after, .view-tabs button::after { content: none; }
.conversation-tabs ~ #ai-card, .conversation-tabs ~ #edited-card,
.conversation-tabs ~ #transcript-card { margin-top: 0; }
@media (max-width: 600px) {
  .recording-view-tabs button, .conversation-tabs button, .view-tabs button,
  .recording-view-tabs button[aria-selected='true'], .conversation-tabs button[aria-selected='true'],
  .view-tabs button[aria-selected='true'] { min-width: 0; padding-inline: var(--space-4); font-size: 14px; }
}
@media (max-width: 1000px) {
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading,
  body.recording-page .recording-workspace-head,
  body.recording-page .recording-bar { background: var(--rail-surface); }
}

/* A squared document edge gives the file tabs a clean, continuous join. */
#detail-view .ai-card, #detail-view .transcript-card {
  margin-top: 0;
  border-top: 0;
  border-radius: 0;
}
#detail-view .player-card { border-radius: var(--radius-panel); }
#list-view .conversation-row, #list-view .live-recording-card,
#list-view .recovery-row { border-radius: var(--radius-panel); }
.recording-live-peek { border-radius: var(--radius-panel); }
.conversation-page .heading-actions #import-button {
  border-color: #413A48;
  background: #413A48;
  color: #ffffff;
}
.conversation-page #vocabulary-panel { border-radius: var(--radius-panel); }
.conversation-page #page-title { font-size: clamp(32px, 3.8vw, 40px); line-height: 1.1; }
#detail-view #my-notes-panel > h2 { display: none; }

/* Vocabulary has its own workspace so large lists never crowd the library. */
body:has(#vocabulary-panel:not([hidden])) .heading { display: none; }
#vocabulary-panel { max-width: 920px; margin: 0 auto 72px; }
#vocabulary-panel[hidden], #vocabulary-overview[hidden], #vocabulary-terms-page[hidden],
#vocabulary-bulk[hidden], #vocabulary-empty[hidden] { display: none; }
#vocabulary-panel .back-link { display: inline-block; margin-bottom: var(--space-7); }
#vocabulary-panel h2 { margin: 0 0 var(--space-5); font-size: clamp(22px, 3vw, 30px); }
.library-vocabulary-link { margin-left: auto; color: var(--accent); font-weight: 650; text-decoration: none; }
.library-vocabulary-link:hover, .vocab-subnav a:hover, .vocab-letters a:hover { text-decoration: underline; }
.vocab-section-link { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; gap: var(--space-4); align-items: center; min-height: 64px; padding: 0 var(--space-4); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.vocab-section-link:first-of-type { border-top: 1px solid var(--line); }
.vocab-section-link:hover { background: var(--raised); }
.vocab-section-link span:nth-child(2) { color: var(--muted); font-size: 13px; }
.vocab-subnav { display: flex; gap: 22px; overflow-x: auto; padding: 0 0 var(--space-3); margin-bottom: var(--space-7); border-bottom: 1px solid var(--line); white-space: nowrap; }
.vocab-subnav a { color: var(--muted); text-decoration: none; font-size: 13px; }
.vocab-subnav a[aria-current='page'] { color: var(--accent); font-weight: 700; }
#vocabulary-form label { display: block; margin-bottom: 9px; font-weight: 650; }
.vocab-entry { display: flex; gap: var(--space-3); align-items: flex-start; }
.vocab-entry textarea { box-sizing: border-box; flex: 1; min-width: 0; min-height: 72px; max-height: 220px; resize: vertical; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--input); color: var(--ink); font: inherit; }
.vocab-entry button, .vocab-bulk button, .vocab-row button, .vocab-edit button,
.vocab-dialog-actions button { border: 1px solid var(--line); border-radius: var(--radius-control); padding: var(--space-3) var(--space-4); background: var(--raised); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.vocab-entry button { min-width: 70px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vocab-entry button:hover { background: var(--accent-strong); }
.vocab-limit { margin: var(--space-3) 0 0; color: var(--muted); font-size: 12px; }
#vocabulary-status { min-height: 20px; margin: var(--space-3) 0; color: var(--muted); font-size: 13px; }
.vocab-bulk { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.vocab-bulk label { display: inline-flex; align-items: center; gap: var(--space-2); margin-right: var(--space-2); cursor: pointer; }
.vocab-bulk input, .vocab-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.vocab-bulk button:disabled { cursor: default; }
.vocab-letters { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) 0 15px; }
.vocab-letters:empty { display: none; }
.vocab-letters a { min-width: 24px; color: var(--accent); font-size: 13px; font-weight: 700; text-align: center; text-decoration: none; }
.vocab-group { margin: var(--space-compact) 0 var(--space-6); }
.vocab-group h3 { scroll-margin-top: 30px; margin: 0; padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.vocab-row { display: flex; align-items: center; gap: var(--space-3); min-height: 47px; padding: 3px var(--space-3); border-bottom: 1px solid var(--line-soft); }
.vocab-row label { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.vocab-row button { padding: var(--space-compact) 9px; font-size: 12px; }
.vocab-edit { display: flex; align-items: center; gap: var(--space-2); width: 100%; }
.vocab-edit input { box-sizing: border-box; flex: 1; min-width: 0; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--input); color: var(--ink); font: inherit; }
.vocab-empty { padding: 35px 0; color: var(--muted); text-align: center; }
#vocabulary-delete-dialog { width: min(420px, calc(100vw - 32px)); box-sizing: border-box; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#vocabulary-delete-dialog::backdrop { background: #02050ea8; }
#vocabulary-delete-dialog h2 { margin: 0 0 var(--space-3); }
.vocab-dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-5); }
#vocabulary-delete-confirm { color: #fff; background: #a33232; border-color: #a33232; }
@media (max-width: 600px) {
  .vocab-subnav { gap: var(--space-4); }
  .vocab-entry { flex-direction: column; }
  .vocab-entry textarea { width: 100%; }
  .vocab-entry button { align-self: flex-end; }
  .vocab-section-link { gap: var(--space-3); padding: 0 var(--space-compact); }
  .vocab-bulk button { padding: var(--space-2) var(--space-3); font-size: 12px; }
}

/* Home rail, notebooks, notebook page, and account settings. */
/* The HTML hidden attribute does not hide an svg element; keep the sprite out of layout. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
body.settings-page .heading, body.notebook-page .heading, body.todos-page .heading, body.note-page .heading { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { color: inherit; flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon use { color: inherit; stroke: currentColor; }
.icon-button {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--radius-control); background: transparent; color: var(--muted); cursor: pointer;
  transition-property: background-color, color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.icon-button:active { scale: .96; }
@media (hover: hover) and (pointer: fine) { .icon-button:hover { background: var(--raised); color: var(--ink); } }
.invert-button {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4) 0 15px;
  border: 0; border-radius: var(--radius-control); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; cursor: pointer;
  transition-property: background-color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.invert-button:active { scale: .96; }
@media (hover: hover) and (pointer: fine) { .invert-button:hover { background: var(--accent-strong); } }
.recent-dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  background: var(--dot, transparent);
  box-shadow: inset 0 0 0 1.5px var(--dot, color-mix(in srgb, currentColor 40%, transparent));
}

/* Rail: recent conversations scroll inside it; Account settings stays pinned at the foot. */
.home-rail {
  --ink: var(--rail-ink); --muted: var(--rail-muted); --line: #605465; --raised: var(--rail-control); --focus: var(--rail-ink);
  display: flex; flex-direction: column; gap: var(--space-4); color: var(--ink);
}
.home-rail-head { display: grid; justify-items: start; gap: var(--space-3); }
.home-rail-head[hidden] { display: none; }
.home-rail-head h2 { margin: 0; font: 300 26px/1.15 var(--font-heading); letter-spacing: -.02em; text-wrap: balance; }
.recent-list { display: grid; align-content: start; gap: 2px; margin: 0 -8px; padding: 0 var(--space-2); }
.recent-row {
  display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 3px;
  padding: 9px var(--space-2) 9px 27px; border-radius: var(--radius-panel); color: var(--ink); text-decoration: none;
  transition: background-color 150ms ease-out;
}
@media (hover: hover) and (pointer: fine) { .recent-row:hover { background: color-mix(in srgb, var(--rail-ink) 9%, transparent); } }
/* Titles and topic previews wrap in full rather than truncate; the date and dot stay on the first line. */
.recent-row strong { min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; text-wrap: pretty; }
.recent-row time { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent-row small { display: flex; flex-wrap: wrap; column-gap: var(--space-1); color: var(--muted); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; text-wrap: pretty; }
.recent-row .recent-processing { color: var(--ink); font-variant-numeric: tabular-nums; }
.recent-empty { color: var(--muted); font-size: 14px; }
/* Sidebar file tree: collections hold notebooks, notebooks hold meetings and notes. */
.rail-pinned { display: grid; gap: 2px; }
.rail-pin, .rail-new-button {
  display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-control);
  background: transparent; color: var(--ink); font: 600 14px var(--font-body); text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color 150ms ease-out;
}
.rail-pin[aria-current="page"] { background: var(--brand-mauve); color: var(--rail-ink); }
.rail-new-button { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .rail-pin:hover, .rail-new-button:hover { background: var(--rail-control); color: var(--rail-ink); } }
.rail-pin:focus-visible, .rail-new-button:focus-visible, .rail-toggle:focus-visible, .rail-move:focus-visible, .recent-row:focus-visible,
.rail-node a:focus-visible, .rail-new-form input:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.rail-node { display: flex; align-items: center; gap: var(--space-compact); min-height: 36px; padding-right: var(--space-1); border-radius: var(--radius-panel); color: var(--ink); font: 650 13px/1.3 var(--font-body); letter-spacing: .01em; }
.rail-node small { margin-left: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.rail-name { flex: 0 1 auto; min-width: 0; color: inherit; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; }
a.rail-name:hover { text-decoration: underline; }
.rail-toggle, .rail-move {
  display: inline-grid; flex: none; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-panel);
  background: transparent; color: var(--muted); cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .rail-toggle:hover, .rail-move:hover { background: color-mix(in srgb, var(--rail-ink) 12%, transparent); color: var(--ink); } }
.rail-toggle .icon { width: 16px; height: 16px; transition: rotate 150ms ease-out; }
.rail-toggle[aria-expanded="true"] .icon { rotate: 90deg; }
.rail-icon { width: 18px; height: 18px; color: color-mix(in srgb, var(--tint, var(--rail-muted)) 65%, var(--rail-ink)); }
.rail-node .rail-icon { flex: none; }
.rail-move { margin-left: 2px; }
.rail-children { margin-left: 15px; padding-left: var(--space-1); border-left: 1px solid var(--line); }
.recent-item { display: flex; align-items: flex-start; gap: 2px; }
.recent-item .recent-row { position: relative; flex: 1; min-width: 0; padding-left: var(--space-8); }
.recent-row > .rail-icon { position: absolute; left: 8px; top: 10px; width: 16px; height: 16px; }
.recent-page { cursor: grab; }
.recent-item .rail-move { margin-top: var(--space-1); }
@media (hover: hover) and (pointer: fine) {
  .rail-move { opacity: 0; transition: opacity 150ms ease-out, background-color 150ms ease-out; }
  .rail-node:hover .rail-move, .recent-item:hover .rail-move, .rail-move:focus-visible { opacity: 1; }
}
.rail-branch.drop-target > .rail-node { background: color-mix(in srgb, var(--rail-ink) 18%, transparent); outline: var(--focus-width) solid var(--rail-ink); outline-offset: -2px; }
.rail-node[draggable="true"] { cursor: grab; }
.rail-node.dragging { opacity: .5; }
.rail-new-form { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
.rail-new-form input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--raised); color: var(--ink); font: 14px var(--font-body);
}
.rail-new-form[hidden], .rail-new-button[hidden] { display: none; }
.todos-view[hidden] { display: none; }
.todos-view { display: grid; gap: 22px; max-width: none; }
.todos-view h2 { margin: 0; font: 300 30px/1.15 var(--font-heading); letter-spacing: -.02em; }
.trash-row strong .icon { margin-right: var(--space-2); vertical-align: -4px; color: var(--muted); }
.home-rail .recent-dot { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--rail-ink) 60%, transparent); }
.settings-link {
  display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: 0 var(--space-4); border-radius: var(--radius-panel);
  background: color-mix(in srgb, var(--rail-ink) 90%, transparent); backdrop-filter: blur(12px);
  color: var(--rail-surface); font-weight: 650; text-decoration: none; transition: background-color 150ms ease-out;
}
.settings-link .icon { transition: rotate 300ms cubic-bezier(.32, .72, 0, 1); }
@media (hover: hover) and (pointer: fine) {
  .settings-link:hover { background: #FFFFFF; }
  .settings-link:hover .icon { rotate: 45deg; }
}
.settings-link:focus-visible { outline: var(--focus-width) solid var(--rail-ink); outline-offset: var(--focus-offset); }

/* Main column: search and the two capture actions, then meetings and notebooks. */
.home-main { min-width: 0; max-width: 1100px; }
.home-topbar { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-4); margin-bottom: var(--space-7); }
.home-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.home-search .icon { position: absolute; top: 50%; left: 14px; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.home-search input {
  width: 100%; min-height: 44px; padding: 0 var(--space-4) 0 var(--space-11); border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); font: 16px var(--font-body);
}
.home-actions { display: flex; gap: var(--space-3); }
#list-view .search-card:has(#library-search-results:empty):has(#library-search-status:empty) { display: none; }
.notebooks-head { display: flex; align-items: center; gap: var(--space-compact); margin-bottom: var(--space-4); }
.notebooks-head h2, .calendar-heading h2 { margin: 0; color: var(--ink); font: 300 30px/1.15 var(--font-heading); letter-spacing: -.02em; }
.notebook-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: var(--space-5); }
.notebook-card, .notebook-new { min-height: 248px; border-radius: var(--radius-panel); }
.notebook-card {
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--space-4); min-width: 0;
  padding: var(--space-6) var(--space-6) var(--space-6); background: var(--notebook); color: var(--notebook-ink);
}
.notebook-card > *, .notebook-history li { min-width: 0; }
.notebook-card a { color: inherit; text-decoration: none; }
.notebook-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.notebook-card-head > .icon { width: 22px; height: 22px; opacity: .8; }
.notebook-card h3 { margin: 0; font: 300 23px/1.15 var(--font-heading); overflow-wrap: anywhere; text-wrap: balance; }
.notebook-plus {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid color-mix(in srgb, var(--notebook-ink) 28%, transparent); border-radius: var(--radius-pill); position: relative;
  background: transparent; color: inherit; cursor: pointer;
  transition-property: background-color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.notebook-plus::before { content: ''; position: absolute; inset: -5px; }
.notebook-plus .icon { width: 18px; height: 18px; }
.notebook-plus:active { scale: .96; }
@media (hover: hover) and (pointer: fine) {
  .notebook-plus:hover { background: color-mix(in srgb, var(--notebook-ink) 26%, transparent); }
  .notebook-card a:hover span, .notebook-card h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
}
.notebook-card :focus-visible { outline: var(--focus-width) solid var(--notebook-ink); outline-offset: var(--focus-offset); }
/* A rail row held over a card: the card lifts its outline so the drop target is unmistakable. */
.notebook-card { transition: outline-color 150ms ease-out, scale 150ms ease-out; outline: 2px dashed transparent; outline-offset: 4px; }
.notebook-card.drop-target { outline-color: var(--ink); scale: 1.01; }
.recent-row[draggable="true"] { cursor: grab; }
.recent-row.dragging { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .notebook-card.drop-target { scale: 1; } }
.notebook-latest, .notebook-meeting { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.notebook-latest span, .notebook-meeting span { min-width: 0; line-height: 1.3; overflow-wrap: anywhere; text-wrap: pretty; }
.notebook-latest { font-weight: 650; }
.notebook-card time { flex: none; opacity: 1; font-size: 13px; font-variant-numeric: tabular-nums; }
.notebook-progress, .notebook-history { display: grid; margin: 0; padding: 0; list-style: none; }
.notebook-progress { gap: 9px; }
.notebook-progress li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 1.38; }
.notebook-progress .icon { width: 18px; height: 18px; margin-top: 1px; opacity: .8; }
.notebook-progress span { opacity: .92; text-wrap: pretty; }
.notebook-history { gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid color-mix(in srgb, var(--notebook-ink) 20%, transparent); }
.notebook-meeting { font-size: 14px; opacity: .78; }
.notebook-empty { color: inherit; opacity: .72; }
.notebook-new {
  display: grid; place-content: center; justify-items: center; gap: var(--space-3); padding: var(--space-6);
  border: 1.5px dashed var(--line); background: transparent; color: var(--muted); font: inherit; cursor: pointer;
  transition: border-color 150ms ease-out, color 150ms ease-out;
}
.notebook-new .icon { width: 28px; height: 28px; }
@media (hover: hover) and (pointer: fine) { .notebook-new:hover { border-color: var(--ink); color: var(--ink); } }

/* Upcoming meetings from a connected calendar. */
#list-view .calendar-card { margin: 0 0 var(--space-11); padding: 0; border: 0; border-radius: 0; background: none; }
.calendar-card[hidden] { display: none; }
.calendar-heading { justify-content: flex-start; gap: var(--space-compact); margin-bottom: var(--space-4); }
#calendar-status:empty { display: none; }
#calendar-status { margin: 0 0 var(--space-3); min-height: 0; color: var(--muted); font-size: 14px; }
#list-view .calendar-card .icon-button { border: 0; background: transparent; padding: 0; }
.calendar-views { display: flex; gap: 2px; margin-left: auto; }
#list-view .calendar-views [aria-pressed='true'] { background: var(--raised); color: var(--ink); }

/* List: one plain row per meeting in the next three days. */
.calendar-meetings[hidden], .calendar-days[hidden] { display: none; }
.calendar-meetings { display: grid; }
.calendar-meeting {
  display: grid; grid-template-columns: 10rem minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-4);
  min-height: 52px; padding: var(--space-1) 0; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: none;
}
.calendar-meeting:first-child { border-top: 1px solid var(--line-soft); }
.calendar-meeting time { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.calendar-meeting strong { color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; text-wrap: pretty; }
.calendar-meeting-details { display: grid; gap: 2px; min-width: 0; }
.calendar-meeting-details small { color: var(--muted); font-size: 12px; }
.calendar-meeting.is-now time { color: var(--ink); font-weight: 650; }
.calendar-card .meeting-actions { display: flex; gap: 2px; }
#list-view .calendar-card .meeting-action { padding: 0; border: 0; background: transparent; color: var(--muted); }
#list-view .calendar-card .meeting-action.has-notes { color: var(--ink); }
.meeting-action {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: var(--radius-panel); background: transparent; color: var(--muted); cursor: pointer;
  transition-property: background-color, color, scale; transition-duration: 150ms; transition-timing-function: ease-out;
}
.meeting-action::before { content: ''; position: absolute; inset: -2px; }
.meeting-action:active { scale: .96; }
.meeting-action .icon { width: 20px; height: 20px; }
.meeting-action.has-notes { color: var(--ink); }
.meeting-action:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { #list-view .calendar-card .meeting-action:hover { background: var(--raised); color: var(--ink); } }
/* Record is a small dot in a ring, quieter than the page's Record button. */
.record-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; outline: 1.5px solid currentColor; outline-offset: 2.5px; }

/* Next 3 days: a day column per date on an hour grid, with a bar at the current time today. */
.calendar-days { --gutter: 52px; border: 1px solid var(--line-soft); border-radius: var(--radius-panel); background: var(--surface); overflow: hidden; }
.days-head, .days-all-day, .days-grid { display: grid; grid-template-columns: var(--gutter) repeat(3, minmax(0, 1fr)); }
.days-head, .days-all-day { border-bottom: 1px solid var(--line-soft); }
.days-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); padding: var(--space-3) var(--space-3); border-left: 1px solid var(--line-soft); }
.days-label strong { color: var(--ink); font-size: 14px; }
.days-label span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.days-all-day > div { display: grid; align-content: start; gap: var(--space-1); min-width: 0; padding: var(--space-compact); border-left: 1px solid var(--line-soft); }
.days-chip { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1); min-width: 0; padding: 0 0 0 var(--space-3); border-radius: var(--radius-pill); background: var(--raised); }
.days-chip strong { min-width: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.days-grid { position: relative; height: calc(var(--hour) * var(--hours)); }
.days-hours { display: grid; grid-auto-rows: var(--hour); }
.days-hours span { padding: 3px var(--space-2) 0 0; white-space: nowrap; color: var(--muted); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }
.days-column {
  position: relative; min-width: 0; border-left: 1px solid var(--line-soft);
  background: repeating-linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px var(--hour));
}
.days-event {
  position: absolute; box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 0 2px; padding: var(--space-1) 2px var(--space-1) var(--space-2); overflow: hidden; border-left: 3px solid var(--line); border-radius: var(--radius-panel);
  background: var(--raised); color: var(--ink);
}
.days-event.is-now { border-left-color: var(--ink); }
.days-event-text { display: grid; gap: 1px; min-width: 0; flex: 1 1 90px; }
.days-event strong { font-size: 13px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.days-event time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* A short block keeps the start of its title in view; the full title is its tooltip. */
.days-event.is-short { flex-wrap: nowrap; padding-top: 2px; padding-bottom: 0; }
.days-event.is-short time { display: none; }
.days-event.is-short .meeting-action { width: 28px; height: 22px; }
.days-event .meeting-action, .days-chip .meeting-action { width: 32px; height: 32px; }
.days-event .meeting-action .icon, .days-chip .meeting-action .icon { width: 17px; height: 17px; }
.days-event .record-dot, .days-chip .record-dot { width: 8px; height: 8px; outline-offset: var(--focus-offset); }
.days-now { position: absolute; left: -1px; right: 0; z-index: 2; height: 2px; background: var(--ink); pointer-events: none; }
.days-now::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
@media (max-width: 560px) {
  .calendar-meeting { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; padding: var(--space-2) 0; }
  .calendar-meeting time { grid-column: 1; }
  .calendar-meeting-details { grid-column: 1; }
  .calendar-meeting .meeting-actions { grid-column: 2; grid-row: 1 / 3; }
  .calendar-days { --gutter: 44px; }
  .days-hours span { padding-right: var(--space-1); font-size: 10.5px; }
  .days-label { padding: var(--space-2); }
  /* Narrow columns keep the title and both actions; the time reads from the grid. */
  .days-event { padding-left: var(--space-1); }
  .days-event time { display: none; }
}

/* Notes written before a meeting. */
#event-notes-dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-sizing: border-box; padding: var(--space-6);
  border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.event-notes-head { display: grid; gap: var(--space-1); margin-bottom: var(--space-4); }
.event-notes-head h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.event-notes-head time { color: var(--muted); font-size: 14px; }
#event-notes-editor { min-height: 180px; max-height: 50vh; overflow-y: auto; }
#event-notes-status { min-height: 20px; margin: var(--space-1) 0 0; color: var(--muted); font-size: 13px; }

/* Account settings. */
.settings-view { max-width: 760px; margin: 0 auto; }
.settings-title { margin: var(--space-6) 0 var(--space-4); color: var(--ink); font: 300 clamp(34px, 5vw, 44px)/1.1 var(--font-heading); letter-spacing: -.02em; }
.settings-section { display: grid; gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--line-soft); border-radius: var(--radius-panel); }
#settings-view > .settings-section + .settings-section { margin-top: var(--space-5); }
.settings-section-head { display: flex; align-items: center; gap: var(--space-3); }
.settings-section-head .icon { box-sizing: content-box; width: 20px; height: 20px; padding: var(--space-3); border-radius: var(--radius-panel); background: var(--raised); color: var(--ink); }
.settings-section-head h3 { margin: 0; color: var(--ink); font-size: 18px; }
.settings-section > p, .settings-note { margin: 0; color: var(--muted); font-size: 14px; }
.settings-form { display: grid; gap: var(--space-compact); max-width: 440px; }
.settings-section[hidden], .settings-form[hidden] { display: none; }
.settings-form + .settings-form { margin-top: var(--space-4); padding-top: var(--space-6); border-top: 1px dashed var(--line-soft); }
.settings-form select { min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); font: 16px var(--font-body); }
.settings-form label { margin-top: var(--space-2); color: var(--ink); font-size: 13px; font-weight: 650; }
.settings-form input {
  min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--input); color: var(--ink); font: 16px var(--font-body);
}
.settings-form small { color: var(--muted); font-size: 13px; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-3); }
/* A quiet button in an actions row keeps its quiet style beside the primary (#258). */
.settings-actions button:not(.is-quiet), .dialog-actions button[type='submit'], #notebook-save {
  min-height: 44px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-control); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 650; cursor: pointer; transition: scale 150ms ease-out;
}
.settings-actions button:active, .dialog-actions button:active { scale: .96; }
.settings-actions button:disabled { opacity: .5; cursor: default; }
.settings-actions p { margin: 0; color: var(--failure); font-size: 13px; }
.settings-actions p.success, #settings-calendar-status { color: var(--success); }
.settings-actions .danger-button { background: var(--action-danger-fill); color: var(--action-danger-ink); }
.settings-danger .settings-section-head .icon { background: var(--action-danger-fill); color: var(--action-danger-ink); }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.settings-row p { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.settings-button, .integration-row button, .dialog-actions button[type='button'] {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--raised); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .settings-button:hover, .integration-row button:hover, .dialog-actions button[type='button']:hover { border-color: var(--ink); }
}
.integration-list { display: grid; gap: var(--space-3); }
.integration-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border: 1px solid var(--line-soft); border-radius: var(--radius-panel); background: var(--surface);
}
.integration-row > .icon { width: 24px; height: 24px; color: var(--muted); }
.integration-row strong { display: block; color: var(--ink); font-size: 15px; }
.integration-row small { color: var(--muted); font-size: 13px; }
#settings-calendar-status:empty { display: none; }

/* Notebook page. */
.notebook-page-empty { padding: var(--space-7) var(--space-1); color: var(--muted); }

/* Notebook dialogs. */
#notebook-dialog, #notebook-settings-dialog, #notebook-add-dialog, #move-notebook-dialog, #calendar-notebook-dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-sizing: border-box; padding: var(--space-6);
  border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
#notebook-dialog h2, #notebook-settings-dialog h2, #notebook-add-dialog h2, #move-notebook-dialog h2, #calendar-notebook-dialog h2 { margin: 0 0 var(--space-4); font-size: 20px; }
#notebook-form, #notebook-settings-form, #move-notebook-form, #calendar-notebook-form { display: grid; gap: var(--space-2); }
#notebook-form label, #notebook-settings-form label, #calendar-notebook-form label { font-size: 13px; font-weight: 650; }
#notebook-name-input, #notebook-settings-name, #notebook-settings-form select, #calendar-notebook-select { min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--input); color: var(--ink); font: 16px var(--font-body); }
#calendar-notebook-series-row { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); font-weight: 500 !important; }
#calendar-notebook-series-row[hidden] { display: none; }
#calendar-notebook-series { width: 18px; height: 18px; accent-color: var(--ink); }
.swatches { margin: var(--space-3) 0 0; padding: 0; border: 0; }
.swatches legend { margin-bottom: var(--space-3); padding: 0; font-size: 13px; font-weight: 650; }
.swatch { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--swatch); cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; appearance: none; cursor: pointer; }
.swatch input:checked { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.swatch input:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 5px; }
#notebook-form-status, #notebook-settings-status, #move-notebook-status, #calendar-notebook-status { margin: var(--space-1) 0 0; color: var(--failure); font-size: 13px; }
#notebook-form-status:empty, #notebook-settings-status:empty, #move-notebook-status:empty, #calendar-notebook-status:empty, #notebook-add-status:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-3); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.dialog-header h2 { margin: 0 !important; }
.notebook-add-actions { display: flex; gap: var(--space-3); margin: var(--space-4) 0 var(--space-6); }
#notebook-add-dialog h3 { margin: 0 0 var(--space-2); color: var(--muted); font-size: 13px; font-weight: 650; }
.notebook-add-list { display: grid; max-height: 320px; overflow-y: auto; }
.notebook-add-row, .move-notebook-option {
  display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-2);
  border: 0; border-radius: var(--radius-panel); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.notebook-add-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notebook-add-row time { color: var(--muted); font-size: 13px; }
.move-notebook-option { grid-template-columns: auto 9px minmax(0, 1fr); }
@media (hover: hover) and (pointer: fine) { .notebook-add-row:hover, .move-notebook-option:hover { background: var(--raised); } }
.move-notebook-options { display: grid; gap: 2px; }

/* Desktop home: the fixed rail column holds recent conversations over the shader. */
@media (min-width: 1001px) {
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading { display: none; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .home-rail {
    position: fixed; z-index: 1; top: 72px; bottom: 0; left: 0; width: var(--rail-width);
    box-sizing: border-box; padding: var(--space-7) var(--space-6) var(--space-6);
  }
  /* The tree scrolls in its own region (#304); a short window keeps a usable height and scrolls the rail instead. */
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .home-rail { overflow-y: auto; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .recent-list { flex: 1 1 auto; min-height: 140px; overflow-y: auto; overscroll-behavior: contain; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .home-rail > :not(.recent-list) { flex: none; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .home-rail-head { gap: var(--space-2); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #list-view { padding-top: var(--space-8); }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page)::after { position: fixed; height: 100vh; opacity: .3; mix-blend-mode: overlay; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) #status:not(:empty) {
    position: fixed; z-index: 40; right: 28px; bottom: 24px; max-width: 420px; margin: 0; padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-control); background: var(--rail-surface); box-shadow: var(--shadow); color: var(--rail-ink);
  }
}
/* Narrow home: actions and notebooks first, then the recent list on a solid dark band. */
@media (max-width: 1000px) {
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .heading { display: none; }
  #list-view:not([hidden]) { display: flex; flex-direction: column; }
  #list-view .home-rail { order: 2; margin: var(--space-9) -20px -45px; padding: var(--space-7) var(--space-5) var(--space-8); background: var(--rail-surface); }
  .home-topbar { flex-wrap: wrap; margin-bottom: var(--space-7); }
  .home-library-title { flex: 1 0 100%; }
  .home-search { max-width: none; }
  .home-actions { width: 100%; }
  .home-actions .invert-button { flex: 1; justify-content: center; }
  .settings-link { margin-top: var(--space-3); }
  /* On the narrow band the tree also keeps its own scroll region (#304). */
  #conversation-list { max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 560px) {
  .notebook-grid { grid-template-columns: 1fr; }
  .notebook-new { min-height: 120px; }
  .integration-row { grid-template-columns: auto minmax(0, 1fr); }
  .integration-row button { grid-column: 1 / -1; justify-content: center; }
}

/* Speaker names (#210): grey when filled in automatically, ink when set by the user,
   with a check circle on passages the user labelled themselves. */
.turn-heading button.speaker-name { display: inline-flex; align-items: center; gap: var(--space-compact); }
.turn-heading button.speaker-auto { color: var(--speaker-auto); font-weight: 600; }
.turn-heading button.speaker-set { color: var(--ink); }
.turn-heading .speaker-check { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--check-bg); color: var(--check-ink); flex: none; }

/* Home: tag pills filter the rail (any selected tag); tag cards list five conversations each. */
.rail-tags { display: flex; flex-wrap: wrap; gap: var(--space-compact); }
.rail-tags:empty { display: none; }
.rail-filter-pill {
  min-height: 30px; padding: 0 var(--space-3); border: 1px solid color-mix(in srgb, var(--rail-ink) 22%, transparent); border-radius: var(--radius-pill);
  background: transparent; color: var(--ink); font: 13px var(--font-body); cursor: pointer;
}
/* The rail is always dark, so the selected pill uses the rail palette, not the page tokens. */
.rail-filter-pill[aria-pressed="true"] { background: var(--rail-ink); color: var(--rail-surface); border-color: var(--rail-ink); font-weight: 600; }
.rail-filter-clear { min-height: 30px; padding: 0 var(--space-compact); border: 0; background: transparent; color: var(--muted); font: 13px var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rail-filter-pill:focus-visible, .rail-filter-clear:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.category-groups { margin-bottom: var(--space-11); }
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-items: start; gap: var(--space-4); }
.tag-grid > .recent-empty { margin: 0; }
/* Tags stay neutral so the notebook colours keep meaning one notebook each. */
.notebook-card.tag-card { --notebook-ink: var(--ink); min-height: 0; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-4); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.tag-card .notebook-card-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); }
.tag-card .notebook-card-head > .icon { width: 18px; height: 18px; }
.tag-card .notebook-card-head small { opacity: .72; font-size: 13px; font-variant-numeric: tabular-nums; }
.category-card-name { padding: 0; border: 0; background: transparent; color: inherit; font: 300 19px/1.2 var(--font-heading);
  text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.category-card-name:hover { text-decoration: underline; text-underline-offset: 4px; }
.tag-list { display: grid; gap: var(--space-compact); margin: 0; padding: 0; list-style: none; }
.tag-list li { min-width: 0; }
.tag-card .notebook-meeting { font-size: 13.5px; opacity: .88; }
.tag-card .notebook-empty { margin: 0; font-size: 13.5px; }
/* Library options sit beside Record: custom vocabulary, tags, people, Recently deleted. */
.library-more summary { width: 44px; height: 44px; border-radius: var(--radius-pill); background: var(--surface); }
.library-more .more-menu-items a, .library-more .more-menu-items button {
  display: flex; align-items: center; min-height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control);
  background: transparent; color: var(--ink); font: 15px var(--font-body); text-align: left; text-decoration: none; cursor: pointer;
}
.library-more .more-menu-items a:hover, .library-more .more-menu-items button:hover { background: var(--raised); }
.library-dialog #category-list, .library-dialog #people-list { max-height: 50vh; overflow-y: auto; }
.library-dialog form { display: grid; gap: var(--space-compact); margin: var(--space-4) 0 var(--space-3); }
.library-dialog .category-checkbox { margin-top: var(--space-4); }
.library-dialog #category-status:empty { display: none; }

/* First-run model download (setup card). */
.setup-card { display: grid; gap: var(--space-3); margin: 0 0 var(--space-6); padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.setup-card h2 { margin: 0; font: 600 17px/1.3 var(--font-body); }
.setup-card p { margin: 0; color: var(--muted); }
.setup-card progress { width: 100%; height: 8px; accent-color: var(--accent); }

.ai-no-key { display: none; margin: 0 0 var(--space-4); color: var(--muted); font-size: 14px; }
.ai-no-key a, #category-status a { color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
body.no-ai .ai-no-key { display: block; }
body.no-ai #refresh-enhanced, body.no-ai #regenerate-summary, body.no-ai #clean-button, body.no-ai #ai-question-form,
body.no-ai #recording-chat-toggle, body.no-ai #recording-ai-panel { display: none; }
body.no-ai .ai-question:not(:has(#ai-answers > *, #saved-recording-chat > *)) { display: none; }
#enhanced-notes-panel.no-key-empty :is(#enhanced-status, #enhanced-version, #enhanced-notes-toolbar, #enhanced-notes-editor, .notes-save-line, .enhanced-sources) { display: none; }
body.no-ai.recording-page .recording-workspace-grid { grid-template-columns: minmax(0, 1fr); }

/* Sample meetings (home card and Settings). */
.setup-card[hidden] { display: none; }

/* List widget: a heading row and plain rows on the page surface. No card box; a hairline sits only between rows.
   A row's date is right-aligned plain text (see formatListDate), never a pill. */
.list-widget { display: grid; gap: var(--space-1); background: transparent; border: 0; box-shadow: none; }
.list-widget-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 44px; }
.list-widget-head h2, .list-widget-head h3 { margin: 0; color: var(--ink); font-size: 18px; }
.list-widget-rows { display: grid; margin: 0; padding: 0; list-style: none; }
.list-widget-row { display: flex; align-items: baseline; gap: var(--space-3); min-height: 40px; padding: var(--space-2) 0; color: var(--ink); }
.list-widget-row + .list-widget-row { border-top: 1px solid var(--line-soft); }
.list-widget-row .list-widget-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.list-widget-row .list-widget-date { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }

/* Home (#266): a heading row with the library menu, an action row, then the To-dos column beside the rest. */
.home-main { max-width: 1280px; container-type: inline-size; }
.home-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.home-heading h2 { display: flex; align-items: center; gap: var(--space-3); margin: 0; font: 300 34px/1.1 var(--font-heading); letter-spacing: -.02em; }
.home-heading h2 .icon { width: 26px; height: 26px; color: var(--muted); }
.library-more .more-menu-items, .record-more .more-menu-items { width: min(250px, calc(100vw - 40px)); }
.library-more .more-menu-items :is(a, button), .record-more .more-menu-items button {
  gap: var(--space-3); display: flex; align-items: center; min-height: 44px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control); width: 100%; box-sizing: border-box;
  background: transparent; color: var(--ink); font: 15px var(--font-body); text-align: left; text-decoration: none; cursor: pointer;
}
.record-more .more-menu-items button:hover { background: var(--raised); }
.more-menu-items .icon { color: var(--muted); }
.split-button { display: inline-flex; }
.split-button > .invert-button { border-radius: var(--radius-tab) 0 0 var(--radius-tab); }
.record-more summary {
  width: 40px; height: 44px; border: 0; border-left: 1px solid color-mix(in srgb, var(--accent-ink) 30%, transparent); border-radius: 0 var(--radius-tab) var(--radius-tab) 0;
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.record-more summary:hover, .record-more[open] summary { background: var(--accent-strong); border-color: color-mix(in srgb, var(--accent-ink) 30%, transparent); }
.record-more .more-menu-items { right: 0; }
.widget-off { display: none !important; }
.home-columns { display: grid; gap: var(--space-11); align-items: start; }
.todos-widget { grid-template-columns: minmax(0, 1fr); }
.home-col { display: grid; align-content: start; gap: var(--space-10); min-width: 0; }
.home-col > section { margin: 0 !important; min-width: 0; }
@container (min-width: 720px) {
  .home-columns { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .home-columns.single-column { grid-template-columns: minmax(0, 1fr); }
}
.home-columns h2, .todos-view .list-widget-head h2 { display: flex; align-items: center; gap: var(--space-3); margin: 0; color: var(--ink); font: 300 26px/1.15 var(--font-heading); letter-spacing: -.02em; }
.home-columns h2 .icon, .todos-view .list-widget-head h2 .icon { width: 22px; height: 22px; color: var(--muted); }
.home-columns .notebooks-head, .home-columns .calendar-heading { margin-bottom: var(--space-3); }
.notebook-groups { display: grid; gap: 26px; }
.notebook-group { display: grid; gap: var(--space-3); }
.notebook-group-head { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--muted); font: 650 13px var(--font-body); letter-spacing: .01em; }
.notebook-group-head .icon { width: 18px; height: 18px; color: var(--tint, var(--muted)); }
/* A collection's own colour can be dark; on the dark canvas it is lifted towards the ink so the icon stays 3:1. */
html[data-theme='dark'] .notebook-group-head .icon { color: color-mix(in oklch, var(--tint, var(--muted)) 45%, var(--ink)); }
.home-col .notebook-grid { grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); gap: var(--space-4); }
.home-col .notebook-card, .home-col .notebook-new { min-height: 0; }
.home-col .notebook-card { padding: var(--space-4) var(--space-4) var(--space-5); gap: var(--space-4); }
.card-item { min-height: 28px; align-items: center; cursor: grab; }
.card-item > .icon { width: 16px; height: 16px; opacity: .75; }
.card-item > span { flex: 1 1 auto; text-align: left; }
button.card-item { min-height: var(--control-height); width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; }
.card-item.dragging { opacity: .5; }
.notebook-latest.card-item { font-weight: 650; }
.notebook-none {
  display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-4); border: 1.5px dashed var(--line); border-radius: var(--radius-panel);
  color: var(--muted); font-size: 14px; transition: border-color 150ms ease-out, color 150ms ease-out;
}
.notebook-none small { margin-left: auto; font-variant-numeric: tabular-nums; }
.notebook-none.drop-target { border-color: var(--ink); color: var(--ink); }
.notebooks-head h2 { gap: var(--space-3); }
/* Recent conversations: plain rows, a tag-pill filter, dates at the right. */
.filter-pills { display: flex; flex-wrap: wrap; gap: var(--space-compact); margin: 2px 0 var(--space-compact); }
.filter-pills:empty { display: none; }
.filter-pill {
  min-height: 32px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-pill); background: transparent; color: var(--ink);
  font: 13px var(--font-body); cursor: pointer;
}
.filter-pill[aria-pressed="true"] { background: var(--block-fill); border-color: var(--block-fill); color: var(--block-ink); font-weight: 600; }
.filter-clear { min-height: 32px; padding: 0 var(--space-compact); border: 0; background: transparent; color: var(--muted); font: 13px var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.filter-pill:focus-visible, .filter-clear:focus-visible, .text-button:focus-visible, .todo-filter:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.recent-widget-row { align-items: center; cursor: grab; }
.recent-widget-row.dragging { opacity: .5; }
.recent-widget-row > a { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-3); align-items: baseline; color: inherit; text-decoration: none; }
.recent-widget-row > a .icon { grid-row: 1 / span 2; align-self: start; margin-top: 2px; width: 18px; height: 18px; color: var(--muted); }
.recent-widget-row strong { font-size: 15px; font-weight: 600; line-height: 1.3; }
.recent-widget-row small { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.4; }
.recent-widget-row > a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.recent-widget .recent-empty { padding: var(--space-3) 0; list-style: none; }
.text-button { display: inline-flex; align-items: center; gap: var(--space-compact); justify-self: start; min-height: 44px; padding: 0 var(--space-1); border: 0; background: transparent; color: var(--muted); font: 600 13px var(--font-body); cursor: pointer; }
.text-button[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .text-button:hover, .filter-pill:not([aria-pressed="true"]):hover { color: var(--ink); } }
/* To-dos widget: a writable plain list. The date is plain text at the right; pills belong to tags. */
.todos-widget .list-widget-head { flex-wrap: wrap; row-gap: var(--space-1); }
/* One segmented control: a shared track, every option the same height, the chosen one filled. */
:is(.todo-filters, .tracker-tabs) { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--raised); }
:is(.todo-filter, .tracker-tab) { min-height: 36px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--muted); font: 600 14px var(--font-body); cursor: pointer; }
:is(.todo-filter, .tracker-tab):is([aria-pressed="true"], [aria-selected="true"]) { background: var(--block-fill); color: var(--block-ink); }
.todo-filters[hidden] { display: none; }
.todo-filter {
  display: inline-flex; align-items: center; gap: var(--space-compact);
}
.todo-filter .icon { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .todo-filter[aria-pressed="false"]:hover { background: var(--raised); color: var(--ink); } }
.todo-add { display: flex; align-items: center; gap: var(--space-3); padding: 2px 0 var(--space-3); border-bottom: 1px solid var(--line-soft); }
.todo-add input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--surface); color: var(--ink); font: 16px var(--font-body);
}
.todo-add input:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: 1px; }
.todo-add-button:disabled { opacity: .6; cursor: default; }
.todo-note { margin: var(--space-compact) 0 0; color: var(--muted); font-size: 13px; }
.todo-note:empty { display: none; }
.todo-group { margin-top: var(--space-4); }
.todo-group-head { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 2px; font: 650 14px var(--font-body); }
.todo-group-head .icon { width: 18px; height: 18px; color: var(--muted); }
.todo-group-head a { color: inherit; text-decoration: none; }
.todo-group-head a:hover { text-decoration: underline; text-underline-offset: 3px; }
.todo-row { align-items: center; gap: var(--space-1); padding: 0; transition: opacity 150ms ease-out; }
.todo-row.leaving { opacity: 0; }
.todo-check { display: grid; place-items: center; flex: none; width: 44px; height: 44px; cursor: pointer; }
.todo-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.todo-row .list-widget-text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-2); padding: var(--space-2) 0; line-height: 1.4; }
.todo-source { margin-left: 0; color: var(--muted); font-size: 12px; font-weight: 400; text-decoration: none; }
a.todo-source:hover { text-decoration: underline; text-underline-offset: 3px; }
.todo-row[data-status="done"] .todo-text, .todo-row[data-status="canceled"] .todo-text { color: var(--muted); text-decoration: line-through; }
.todo-row.has-suggestion { background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
.todo-suggestion { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--muted); font-size: 12px; font-style: normal; }
.todo-suggestion .icon { width: 14px; height: 14px; }
.todo-empty { margin: var(--space-4) 0; color: var(--muted); }
.widgets-note { margin: var(--space-3) 0; color: var(--muted); font-size: 14px; }
.widgets-list { display: grid; gap: 2px; }
.widget-option { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; margin: 0; }
.widget-option .icon { color: var(--muted); }
@media (max-width: 560px) {
  .home-heading h2 { font-size: 30px; }
  .home-actions { flex-wrap: nowrap; }
  .home-actions .split-button { flex: 1; }
  .home-actions .split-button > .invert-button { flex: 1; }
}
.list-widget-head h2 a { color: inherit; text-decoration: none; }
.list-widget-head h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
/* ===== Notes editor dialect (#274, #276). Kept in one block so it merges cleanly with other work. ===== */
.notes-editor .note-quote { margin: 0 0 var(--space-3); padding: 2px 0 2px var(--space-4); border-left: 3px solid var(--line); color: var(--muted); }
.notes-editor .note-code-block { display: block; margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-3); border: 1px solid var(--line-soft); border-radius: var(--radius-panel); background: var(--raised); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-x: auto; tab-size: 4; }
.notes-editor .note-code { padding: 1px var(--space-1); border-radius: var(--radius-panel); background: var(--raised); font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; }
.notes-editor .note-strike { text-decoration: line-through; }
.notes-editor .note-divider { height: 0; margin: var(--space-4) 0; border: 0; border-top: 1px solid var(--line); }
.notes-editor .note-divider.selected, .notes-editor hr.selected { border-top-color: var(--focus); }

/* To-do lines in the notes editor (#276): canceled style, typed date at the right, and the line menu. */
.note-task-host { position: relative; }
.notes-editor .note-check-open, .notes-editor .note-check-done, .notes-editor .note-check-canceled { padding-right: 34px; }
.notes-editor .note-check-canceled { list-style: none; position: relative; text-decoration: line-through; color: var(--quiet); }
.notes-editor .note-check-canceled::before {
  content: ''; position: absolute; left: -22px; top: .32em; width: 15px; height: 15px; box-sizing: border-box;
  border: 1.5px solid var(--quiet); border-radius: var(--radius-panel); cursor: pointer; text-decoration: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23808080' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 8h8'/%3E%3C/svg%3E") center / 11px no-repeat;
}
/* The date is a plain right-aligned label drawn from data-due; it is not part of the text or the Markdown. */
.notes-editor li[data-due] { padding-right: 168px; }
.notes-editor li[data-due]::after {
  content: attr(data-due); position: absolute; right: 34px; top: 2px; max-width: 130px; color: var(--muted); font-size: 13px;
  text-align: right; text-decoration: none; white-space: nowrap; pointer-events: none;
}
.note-task-more {
  position: absolute; right: 0; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: var(--radius-panel); background: transparent; color: var(--muted); cursor: pointer;
}
.note-task-more[hidden], .note-task-menu[hidden] { display: none; }
.note-task-more:hover, .note-task-more:focus-visible { background: var(--raised); color: var(--ink); }
.note-task-more:focus-visible, .note-task-menu button:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }
.note-task-more svg, .note-task-menu svg { width: 18px; height: 18px; flex: none; }
.note-task-menu {
  position: absolute; right: 0; z-index: 3; display: grid; min-width: 210px; padding: var(--space-1); border: 1px solid var(--line);
  border-radius: var(--radius-panel); background: var(--surface); box-shadow: 0 8px 24px rgb(0 0 0 / .22);
}
.note-task-menu button {
  display: flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control);
  background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.note-task-menu button[hidden] { display: none; }
.note-task-menu button:hover { background: var(--raised); }
.note-task-menu span { flex: 1; }
.note-task-menu kbd { color: var(--muted); font: 12px var(--font-body); }
@media (max-width: 520px) {
  .notes-editor li[data-due] { padding-right: 34px; padding-bottom: var(--space-4); }
  .notes-editor li[data-due]::after { top: auto; bottom: 0; right: 34px; }
}

/* Note view: a plain document with its title, notebook, and tags above the editor. Corners stay small. */
.note-view[hidden] { display: none; }
.note-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); max-width: 820px; margin: 0 auto; }
.note-head { display: flex; align-items: center; gap: var(--space-3); }
.note-head > .icon { color: var(--muted); width: 26px; height: 26px; }
#note-title { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid transparent; border-radius: 0; padding: var(--space-1) 0; background: transparent; color: var(--ink); font: 300 32px/1.2 var(--font-heading); letter-spacing: -.02em; }
#note-title:hover, #note-title:focus-visible { border-bottom-color: var(--line); outline: none; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.note-notebook { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); }
.note-notebook select { min-height: var(--control-height); max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-control); padding: 0 var(--space-3); background: var(--raised); color: var(--ink); font: 14px var(--font-body); }
.note-tags { display: flex; flex-wrap: wrap; gap: var(--space-compact); }
.note-tag { display: inline-flex; align-items: center; gap: var(--space-compact); min-height: var(--control-height); padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-pill); background: transparent; color: var(--ink); font: 13px var(--font-body); cursor: pointer; }
.note-tag .icon { width: 16px; height: 16px; }
.note-tag[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.note-tag:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
#note-status { margin: 0; color: var(--quiet); font-size: 13px; min-height: 0; }
#note-status:empty { display: none; }
.notes-editor .note-callout {
  --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0%22/%3E%3Cpath d=%22M12 9h.01%22/%3E%3Cpath d=%22M11 12h1v4h1%22/%3E%3C/svg%3E");
  position: relative; margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-left: 3px solid var(--muted);
  border-radius: var(--radius-panel); background: var(--raised);
}
.notes-editor .note-callout::before {
  content: ""; position: absolute; top: 12px; left: 14px; width: 18px; height: 18px; background: var(--muted);
  -webkit-mask: var(--callout-icon) center / contain no-repeat; mask: var(--callout-icon) center / contain no-repeat;
}
.notes-editor .note-callout > :first-child { margin-bottom: var(--space-compact); padding-left: var(--space-6); font-weight: 650; }
.notes-editor .note-callout > :first-child:has(> br:only-child)::before { content: var(--callout-title); color: var(--muted); }
.notes-editor .note-callout > :last-child { margin-bottom: 0; }
.notes-editor .note-callout[data-callout="tip"], .notes-editor .note-callout[data-callout="hint"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12h1m8 -9v1m8 8h1m-15.4 -6.4l.7 .7m12.1 -.7l-.7 .7%22/%3E%3Cpath d=%22M9 16a5 5 0 1 1 6 0a3.5 3.5 0 0 0 -1 3a2 2 0 0 1 -4 0a3.5 3.5 0 0 0 -1 -3%22/%3E%3Cpath d=%22M9.7 17l4.6 0%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="important"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0%22/%3E%3Cpath d=%22M12 8v4%22/%3E%3Cpath d=%22M12 16h.01%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="warning"], .notes-editor .note-callout[data-callout="attention"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 9v4%22/%3E%3Cpath d=%22M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z%22/%3E%3Cpath d=%22M12 16h.01%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="caution"], .notes-editor .note-callout[data-callout="danger"], .notes-editor .note-callout[data-callout="error"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12.802 2.165l5.575 2.389c.48 .206 .863 .589 1.07 1.07l2.388 5.574c.22 .512 .22 1.092 0 1.604l-2.389 5.575c-.206 .48 -.589 .863 -1.07 1.07l-5.574 2.388c-.512 .22 -1.092 .22 -1.604 0l-5.575 -2.389a2.036 2.036 0 0 1 -1.07 -1.07l-2.388 -5.574a2.036 2.036 0 0 1 0 -1.604l2.389 -5.575c.206 -.48 .589 -.863 1.07 -1.07l5.574 -2.388a2.036 2.036 0 0 1 1.604 0z%22/%3E%3Cpath d=%22M12 8v4%22/%3E%3Cpath d=%22M12 16h.01%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="question"], .notes-editor .note-callout[data-callout="help"], .notes-editor .note-callout[data-callout="faq"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0%22/%3E%3Cpath d=%22M12 16v.01%22/%3E%3Cpath d=%22M12 13a2 2 0 0 0 .914 -3.782a1.98 1.98 0 0 0 -2.414 .483%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="success"], .notes-editor .note-callout[data-callout="check"], .notes-editor .note-callout[data-callout="done"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 12l5 5l10 -10%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="failure"], .notes-editor .note-callout[data-callout="fail"], .notes-editor .note-callout[data-callout="missing"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M18 6l-12 12%22/%3E%3Cpath d=%22M6 6l12 12%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="bug"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 9v-1a3 3 0 0 1 6 0v1%22/%3E%3Cpath d=%22M8 9h8a6 6 0 0 1 1 3v3a5 5 0 0 1 -10 0v-3a6 6 0 0 1 1 -3%22/%3E%3Cpath d=%22M3 13l4 0%22/%3E%3Cpath d=%22M17 13l4 0%22/%3E%3Cpath d=%22M12 20l0 -6%22/%3E%3Cpath d=%22M4 19l3.35 -2%22/%3E%3Cpath d=%22M20 19l-3.35 -2%22/%3E%3Cpath d=%22M4 7l3.75 2.4%22/%3E%3Cpath d=%22M20 7l-3.75 2.4%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="abstract"], .notes-editor .note-callout[data-callout="summary"], .notes-editor .note-callout[data-callout="tldr"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2%22/%3E%3Cpath d=%22M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z%22/%3E%3Cpath d=%22M9 12l.01 0%22/%3E%3Cpath d=%22M13 12l2 0%22/%3E%3Cpath d=%22M9 16l.01 0%22/%3E%3Cpath d=%22M13 16l2 0%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="example"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M13 5h8%22/%3E%3Cpath d=%22M13 9h5%22/%3E%3Cpath d=%22M13 15h8%22/%3E%3Cpath d=%22M13 19h5%22/%3E%3Cpath d=%22M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z%22/%3E%3Cpath d=%22M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="quote"], .notes-editor .note-callout[data-callout="cite"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5%22/%3E%3Cpath d=%22M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="todo"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0%22/%3E%3Cpath d=%22M9 12l2 2l4 -4%22/%3E%3C/svg%3E"); }
.notes-editor .note-callout[data-callout="experiment"] { --callout-icon: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 3l6 0%22/%3E%3Cpath d=%22M10 9l4 0%22/%3E%3Cpath d=%22M10 3v6l-4 11a.7 .7 0 0 0 .5 1h11a.7 .7 0 0 0 .5 -1l-4 -11v-6%22/%3E%3C/svg%3E"); }
.notes-toolbar .icon { width: 18px; height: 18px; vertical-align: -4px; }
.notes-callout-actions > summary { display: inline-flex; align-items: center; gap: var(--space-compact); }
.notes-callout-actions > div button { display: flex; align-items: center; gap: var(--space-2); }

/* === Notebook page (#269): tinted header band, view tabs, overview, items table, settings dialog === */
.notebook-view { max-width: 1000px; margin: 0 auto; }
.notebook-hero {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-5);
  margin: var(--space-6) 0 var(--space-6); padding: var(--space-6) var(--space-6); border-radius: var(--radius-panel); color: var(--ink);
  background: color-mix(in srgb, var(--notebook, var(--raised)) 24%, transparent);
}
.notebook-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-compact) var(--space-3); min-width: 0; color: var(--muted); }
.notebook-collection { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 17px; }
.notebook-collection[hidden] { display: none; }
.notebook-crumb-sep { margin-left: 2px; }
.notebook-hero h2 { display: flex; align-items: center; gap: var(--space-3); min-width: 0; margin: 0; color: var(--ink); overflow-wrap: anywhere; font: 300 clamp(28px, 4vw, 38px)/1.1 var(--font-heading); letter-spacing: -.02em; }
.notebook-hero h2 .icon { flex: none; width: 28px; height: 28px; opacity: .8; }
.notebook-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.notebook-more summary { background: var(--surface); }
.view-tabs button { display: inline-flex; align-items: center; gap: var(--space-2); }
.view-tabs button .icon { width: 18px; height: 18px; }
.notebook-overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-7) var(--space-10); margin-bottom: var(--space-10); }
.notebook-overview[hidden] { display: none; }
@media (min-width: 760px) { .notebook-overview:not(.no-summary) { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.notebook-summary[hidden] { display: none; }
.notebook-summary { display: grid; gap: var(--space-compact); align-content: start; }
.notebook-overview h2, .notebook-items h2 { display: flex; align-items: center; gap: var(--space-3); margin: 0; color: var(--ink); font: 300 26px/1.15 var(--font-heading); letter-spacing: -.02em; }
.notebook-overview h2 .icon, .notebook-items h2 .icon { width: 22px; height: 22px; color: var(--muted); }
.notebook-summary-source { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: 0; color: var(--muted); font-size: 13px; }
.notebook-summary-source a { color: var(--muted); text-underline-offset: 3px; }
.notebook-summary-text { max-width: 64ch; margin: var(--space-1) 0 0; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.notebook-items { display: grid; gap: var(--space-compact); }
.notebook-items .list-widget-head { flex-wrap: wrap; row-gap: var(--space-1); }
.items-table { width: 100%; border-collapse: collapse; }
.items-table th { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); color: var(--muted); font: 600 12px var(--font-body); text-align: left; }
.items-table td { padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.items-table .items-icon { width: 38px; color: var(--muted); }
.items-table td.items-icon .icon { display: block; width: 18px; height: 18px; }
.items-title a { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; text-decoration: none; }
.items-table .items-date { width: 1%; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.items-table .items-todos { width: 1%; white-space: nowrap; }
.tag-chip { display: inline-block; margin: 2px var(--space-1) 2px 0; padding: 2px var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--ink); font-size: 12px; line-height: 1.5; }
.items-count { display: inline-flex; align-items: center; gap: var(--space-1); margin-right: var(--space-3); color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.items-count:last-child { margin-right: 0; }
.items-count .icon { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .items-title a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.items-title a:focus-visible { outline: var(--focus-width) solid var(--focus, var(--accent)); outline-offset: var(--focus-offset); }
@media (max-width: 640px) {
  .items-table, .items-table tbody { display: block; }
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line-soft); }
  .items-table td, .items-table td.items-date, .items-table td.items-todos { display: block; width: auto; padding: 0; border: 0; }
  .items-table td:empty { display: none; }
  .items-table td.items-icon { grid-row: 1; width: auto; }
  .items-table td.items-title { grid-column: 2; }
  .items-table td.items-date { grid-column: 3; grid-row: 1; }
  .items-table td.items-tags { grid-column: 2; }
  .items-table td.items-todos { grid-column: 3; grid-row: 2; }
}
.notebook-add-actions { flex-wrap: wrap; }
.swatch-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.colour-custom { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.colour-custom label { margin-right: auto; font-size: 13px; font-weight: 650; }
.colour-wheel { width: 44px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--input); cursor: pointer; }
.colour-text { width: 116px; min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--input); color: var(--ink); font: 16px ui-monospace, Menlo, monospace; text-transform: uppercase; }
.colour-text[aria-invalid="true"] { border-color: var(--failure); }
#notebook-settings-form label[for] { margin-top: var(--space-2); }
#notebook-settings-form .colour-custom label { margin-top: 0; }
/* === end Notebook page (#269) === */
/* Link cards and the Paste as menu (#281). Small corners per the UI style guide. */
.notes-editor .note-bookmark { position: relative; width: min(100%, 720px); margin: var(--space-4) 0; }
/* Link cards, video embeds, external images and the Paste as menu (#281, #282). Small corners per the UI style guide. */
.notes-editor .note-bookmark, .notes-editor .note-embed { position: relative; width: min(100%, 720px); margin: var(--space-4) 0; }
.notes-editor .note-bookmark-card { display: flex; min-height: 96px; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--raised); color: var(--ink); text-decoration: none; overflow: hidden; }
.notes-editor .note-bookmark-card:hover { border-color: var(--quiet); }
.notes-editor .note-bookmark-card:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.notes-editor .note-bookmark-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--space-1); min-width: 0; padding: var(--space-3) var(--space-4); }
.notes-editor .note-bookmark-text strong { font-size: 15px; line-height: 1.3; }
.notes-editor .note-bookmark-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 13px; line-height: 1.4; }
.notes-editor .note-bookmark-site { display: flex; align-items: center; gap: var(--space-compact); margin-top: auto; color: var(--quiet); font-size: 12px; }
.notes-editor .note-bookmark-site img { width: 14px; height: 14px; border-radius: var(--radius-panel); }
.notes-editor .note-bookmark-site span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-editor .note-bookmark-image { flex: 0 0 34%; max-width: 220px; width: 34%; object-fit: cover; border-left: 1px solid var(--line); }
.notes-editor .note-embed-frame { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--raised); overflow: hidden; }
.notes-editor .note-embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.notes-editor .note-embed figcaption { margin-top: var(--space-2); color: var(--muted); font-size: 13px; }
.notes-editor .note-image-external { position: relative; width: min(100%, 720px); }
.notes-editor .note-image-failed { margin: 0; padding: var(--space-4) var(--space-2); color: var(--muted); font-size: 13px; text-align: center; }
.notes-editor .note-embed-remove { position: absolute; top: 6px; right: 6px; display: none; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); color: var(--ink); cursor: pointer; }
.notes-editor .note-embed-remove .icon { width: 16px; height: 16px; }
.notes-editor .note-bookmark:hover .note-embed-remove, .notes-editor .note-embed:hover .note-embed-remove, .notes-editor .note-image-external:hover .note-embed-remove,
.notes-editor .note-embed-remove:focus-visible { display: inline-flex; }
@media (hover: none) { .notes-editor .note-embed-remove { display: inline-flex; } }
@media (max-width: 520px) { .notes-editor .note-bookmark-image { display: none; } }
.note-paste-menu { position: fixed; z-index: 60; min-width: 176px; padding: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.note-paste-menu small { display: block; padding: var(--space-1) var(--space-2); color: var(--quiet); font-size: 12px; }
.note-paste-menu button { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 32px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--ink); font: 14px var(--font-body); text-align: left; cursor: pointer; }
.note-paste-menu button:hover, .note-paste-menu button.active, .note-paste-menu button:focus-visible { background: var(--raised); }
.note-paste-menu .icon { width: 16px; height: 16px; }
.note-slash-menu { position: fixed; z-index: 60; width: 320px; max-width: calc(100vw - 16px); overflow-y: auto; overscroll-behavior: contain; padding: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.note-slash-menu small { display: block; padding: var(--space-2) var(--space-2) var(--space-1); color: var(--quiet); font: 12px var(--font-body); }
.note-slash-menu .note-slash-foot { position: sticky; bottom: -4px; margin: var(--space-1) -4px -4px; padding: var(--space-2); border-top: 1px solid var(--line); background: var(--surface); }
.note-slash-row { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-2); border-radius: var(--radius-panel); color: var(--ink); font: 14px var(--font-body); cursor: pointer; }
.note-slash-row.active { background: var(--raised); }
.note-slash-row .icon { flex: none; width: 18px; height: 18px; }
.note-slash-label { flex: 1; min-width: 0; }
.note-slash-row kbd { flex: none; color: var(--quiet); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 639px) { .note-slash-row { min-height: 44px; } }

/* === Agent suggestions (#270) === */
/* The cards stand beside the editor and stack under it at narrow widths. Every edge is straight. */
.notes-suggest-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.notes-suggest-layout > * { min-width: 0; }
@media (min-width: 900px) {
  .note-view.has-suggestions { max-width: 1180px; }
  .notes-suggest-layout:has(.suggestions-column:not([hidden])) { grid-template-columns: minmax(0, 1fr) 300px; }
}
.suggestions-column { display: grid; gap: var(--space-3); align-content: start; }
.suggestions-column[hidden] { display: none; }
.suggestions-head { display: grid; grid-template-columns: 1fr repeat(4, 44px); align-items: center; gap: 2px; padding-bottom: var(--space-3); border-bottom: 1px solid var(--line); }
.suggestions-count { margin: 0; font: 600 15px var(--font-body); }
.suggestions-note { margin: 0; color: var(--muted); font-size: 13px; }
.suggestions-note:empty { display: none; }
.suggestion-cards { display: grid; gap: var(--space-3); }
.suggestion-card { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: 0; background: var(--surface); text-align: left; }
.suggestion-card:focus-visible, .suggestion-card:focus { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.suggestion-author { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--muted); }
.agent-avatar { display: inline-grid; place-items: center; flex: none; width: var(--avatar-size, 24px); height: var(--avatar-size, 24px); border-radius: 50%; }
.agent-avatar svg { width: 62%; height: 62%; }
.agent-avatar-coordinator { background: var(--avatar-color); }
.agent-avatar-coordinator path { fill: #FFFFFF; }
.agent-avatar-acting { background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line); }
.agent-avatar-acting path { fill: var(--avatar-color); }
.agent-name { font-weight: 600; color: var(--ink); }
.recording-chat-agent { display: flex; align-items: center; gap: var(--space-compact); font-size: 13px; color: var(--ink); }
.suggestion-words { margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
.suggestion-quote { margin: 0; padding: 0 0 0 var(--space-3); border-left: 2px solid var(--line); border-radius: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.suggestion-quote p { margin: 0 0 var(--space-1); overflow-wrap: anywhere; }
.suggestion-time { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 44px; padding: 0 var(--space-1); border: 0; background: transparent; color: var(--accent-strong); font: 600 13px var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.suggestion-time .icon { width: 14px; height: 14px; }
.suggestion-actions { display: flex; gap: 2px; margin-left: -10px; }
.suggestion-actions button, .suggestions-head button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); cursor: pointer; }
.suggestions-head button:hover, .suggestion-actions button:hover { background: var(--raised); }
.suggestions-head button:focus-visible, .suggestion-actions button:focus-visible, .suggestion-time:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: -2px; }
.suggestion-accept { color: var(--success) !important; }
.suggestions-head .icon, .suggestion-actions .icon { width: 20px; height: 20px; }
.suggestions-column[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
.agent-status { display: flex; align-items: center; gap: var(--space-compact); margin: 0 0 var(--space-2); color: var(--muted); font-size: 13px; }
.agent-status[hidden] { display: none; }
.agent-status .icon { width: 16px; height: 16px; }
.suggested-todos { margin: var(--space-1) 0 var(--space-3); }
.suggested-todos[hidden] { display: none; }
.suggested-todos-label { display: flex; align-items: center; gap: var(--space-compact); margin: 0 0 var(--space-compact); color: var(--success); font: 600 13px var(--font-body); }
.suggested-todos-label .icon { width: 16px; height: 16px; }
.suggested-lines { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.suggested-line { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-2); background: color-mix(in srgb, var(--success) 12%, transparent); box-shadow: inset 2px 0 0 var(--success); border-radius: 0; color: var(--success); }
.suggested-line .icon { flex: none; width: 18px; height: 18px; }
.suggested-line-input { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; outline: none; }
.suggested-line:focus-within { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }
.notes-editor .suggested-change { background: color-mix(in srgb, var(--success) 12%, transparent); box-shadow: inset 2px 0 0 var(--success); }
a.todo-suggestion { text-decoration: none; }
a.todo-suggestion:hover { text-decoration: underline; text-underline-offset: 3px; }
/* === end Agent suggestions (#270) === */

/* === First-run tour (#301) === */
.tour-layer { position: fixed; inset: 0; z-index: 1000; }
.tour-layer[hidden] { display: none; }
.tour-spot {
  position: fixed; border-radius: var(--radius-panel); pointer-events: none;
  box-shadow: 0 0 0 2px var(--focus), 0 0 0 100vmax rgba(8, 12, 24, .58);
  transition: left 180ms ease-out, top 180ms ease-out, width 180ms ease-out, height 180ms ease-out;
}
.tour-no-target .tour-spot { width: 0 !important; height: 0 !important; box-shadow: 0 0 0 100vmax rgba(8, 12, 24, .58); }
.tour-card {
  position: fixed; box-sizing: border-box; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-panel);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.tour-card:focus { outline: none; }
.tour-card:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.tour-head h2 { display: flex; align-items: center; gap: var(--space-3); margin: 0; font-family: var(--font-heading); font-size: 22px; font-weight: 300; line-height: 1.2; }
.tour-head .icon { flex: none; width: 22px; height: 22px; }
.tour-body { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tour-extra { display: grid; gap: var(--space-3); }
.tour-extra:empty { display: none; }
.tour-form { display: grid; gap: var(--space-2); }
.tour-form label { font-size: 13px; font-weight: 650; }
.tour-form input {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--input); color: var(--ink); font: inherit;
}
.tour-link { display: inline-flex; align-items: center; gap: var(--space-compact); width: fit-content; min-height: 44px; color: var(--accent); font-weight: 650; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.tour-save, .tour-back, .tour-skip {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-panel); background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
.tour-skip { min-height: 44px; padding: 0 var(--space-2); border-color: transparent; color: var(--muted); font-weight: 500; }
.tour-save:disabled { opacity: .55; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .tour-save:hover:not(:disabled), .tour-back:hover { border-color: var(--ink); }
  .tour-skip:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
}
.tour-save:focus-visible, .tour-back:focus-visible, .tour-skip:focus-visible, .tour-next:focus-visible, .tour-link:focus-visible, .tour-form input:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.tour-status { min-height: 1.4em; margin: 0; font-size: 13px; color: var(--muted); }
.tour-status[data-state='ok'] { color: var(--success); }
.tour-status[data-state='error'] { color: var(--failure); }
.tour-extra progress { width: 100%; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.tour-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.tour-counter { flex: none; padding-top: var(--space-1); color: var(--quiet); font-size: 13px; }
.tour-actions { display: flex; gap: var(--space-2); }
@media (max-width: 639px) { .tour-card { left: 16px !important; width: calc(100vw - 32px); max-height: 62vh; } }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }
/* === end First-run tour (#301) === */

/* Closed menus take no layout space and cannot be hit. */
details.more-menu:not([open]) > .more-menu-items { display: none; }
#playback-speed-menu:not([open]) > .speed-options { display: none; }
/* === Notes toggles and columns (#280) === */
.notes-editor .note-toggle { margin: 0 0 var(--space-3); --toggle-chevron: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 6l6 6l-6 6%22/%3E%3C/svg%3E"); }
.notes-editor .note-toggle > :first-child { position: relative; margin-bottom: var(--space-1); padding-left: var(--space-6); font-weight: 650; }
.notes-editor .note-toggle > :first-child::before {
  content: ""; position: absolute; left: 2px; top: .35em; width: 18px; height: 18px; border-radius: var(--radius-panel); background: var(--muted);
  -webkit-mask: var(--toggle-chevron) center / contain no-repeat; mask: var(--toggle-chevron) center / contain no-repeat;
  transform: rotate(90deg); transition: transform .12s; cursor: pointer;
}
.notes-editor .note-toggle > :first-child:hover::before { background: var(--ink); }
.notes-editor .note-toggle[data-collapsed] > :first-child::before { transform: none; }
.notes-editor .note-toggle[data-collapsed] > :not(:first-child) { display: none; }
.notes-editor .note-toggle > :not(:first-child) { margin-left: 9px; padding-left: 17px; border-left: 2px solid var(--line); }
.notes-editor .note-toggle > :is(ul, ol) { padding-left: 34px; }
.notes-editor .note-toggle > :last-child { margin-bottom: 0; }
.notes-editor .note-columns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-4); margin: 0 0 var(--space-3); padding: 0 3px; }
.notes-editor .note-column { min-width: 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.notes-editor .note-column > :last-child { margin-bottom: 0; }
@media (max-width: 640px) { .notes-editor .note-columns { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); } }

/* The local inference profile has no Nebius credential form. */
#nebius-key-form[hidden] { display: none; }

#local-model-controls[hidden] { display: none; }
.inference-routes { margin: var(--space-3) 0 var(--space-5); }
.inference-route { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--line-soft); }
.inference-route code, .trace-model { overflow-wrap: anywhere; }
.inference-route .settings-note { margin: var(--space-1) 0 0; }
#local-model-controls { margin-top: var(--space-5); }
#local-model-select { width: 100%; max-width: 100%; min-height: 44px; }
.inference-traces { margin-top: var(--space-4); }
.inference-trace { padding: var(--space-4) 0; border-bottom: 1px solid var(--line-soft); }
.inference-trace summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-4); min-height: 44px; align-items: center; cursor: pointer; }
.inference-trace summary strong { overflow-wrap: anywhere; }
.inference-trace summary strong::before { content: '▸ '; }
.inference-trace[open] summary strong::before { content: '▾ '; }
.inference-trace summary:focus-visible { outline: var(--focus-width) solid currentColor; outline-offset: var(--focus-offset); }
.trace-state, .trace-duration { font-size: 13px; }
.trace-events { padding-left: var(--space-6); }
.trace-events li { padding: var(--space-1) 0; }
.trace-events li > span:first-child { margin-right: var(--space-4); }
.inference-trace small { display: block; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .inference-route { grid-template-columns: 1fr; gap: var(--space-2); }
  .inference-trace summary { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); }
  .inference-trace summary .trace-duration { grid-column: 2; }
}

/* Agent behavior and deployment controls share the existing Chat surfaces. */
.agent-behavior { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: .65rem 1rem; margin: 1rem 0; }
.agent-behavior dt { color: var(--muted); }
.agent-behavior dd { margin: 0; overflow-wrap: anywhere; }
.agent-identity-form textarea { min-height: 100px; resize: vertical; }
@media (max-width: 600px) { .agent-behavior { grid-template-columns: 5rem minmax(0, 1fr); gap: .65rem; } }

.recording-inputs { display:flex; flex-wrap:wrap; align-items:end; gap: var(--space-3) var(--space-5); margin: var(--space-1) 0; min-width:0; --ink:var(--rail-ink); --quiet:var(--rail-muted); --line:#605465; color:var(--ink); }
.recording-inputs label { display:grid; gap: var(--space-compact); font-size:14px; min-width:0; flex:0 1 260px; }
.recording-inputs select { width:100%; min-height:44px; border:1px solid var(--line); border-radius: var(--radius-control); padding: var(--space-2) var(--space-3); background:var(--rail-input); color:var(--ink); font:inherit; }
.recording-inputs p { font-size:13px; color:var(--quiet); margin: 0 0 var(--space-3); }
#recording-input-status:empty { display:none; }
@media(max-width:700px) { .recording-inputs label { flex:1 1 140px; } .recording-inputs p { flex-basis:100%; margin: 0; } }
body.recording-page #back-from-recording { min-height:44px; }

.recording-destination { display:grid; gap: var(--space-compact); min-width:0; color:var(--rail-ink); font-size:14px; }
.recording-destination > span { color:var(--rail-muted); font-size:13px; }
.recording-destination strong { overflow-wrap:anywhere; }
.recording-destination > button { justify-self:start; min-height:44px; padding: 0 var(--space-4); background:transparent; color:inherit; border:1px solid var(--rail-line); border-radius: var(--radius-control); font:inherit; cursor:pointer; } /* an outline button like its neighbours; no raw underline (owner) */
.recording-destination form:not([hidden]) { display:grid; gap: var(--space-2); }
.recording-destination select { width:100%; min-width:0; min-height:44px; padding: var(--space-2); background:var(--rail-input); color:var(--rail-ink); border:1px solid #605465; border-radius: var(--radius-control); font:inherit; }
.recording-destination form div { display:flex; gap: var(--space-2); }
.recording-destination p { margin: 0; font-size:13px; color:var(--rail-muted); }
.recording-destination p:empty { display:none; }
.recording-destination label { color:var(--rail-ink); font-size:14px; }
.recording-destination form button { min-height:44px; padding: var(--space-2) var(--space-4); border:1px solid #605465; border-radius: var(--radius-control); background:var(--rail-control); color:var(--rail-ink); font:inherit; cursor:pointer; }
.recording-destination form button[type='submit'] { background:var(--rail-ink); color:var(--rail-surface); border-color:var(--rail-ink); }

.recording-chat-messages a { display:inline-block; min-height:24px; padding: 3px 2px; color:var(--ink); text-decoration:underline; text-underline-offset:3px; overflow-wrap:anywhere; }
.recording-chat-messages small { display:block; margin-top: var(--space-2); }
.recording-chat-messages small button { min-width:44px; min-height:44px; margin-right: var(--space-2); padding: var(--space-2) var(--space-3); border:1px solid var(--line); border-radius: var(--radius-control); background:var(--raised); color:var(--ink); font:inherit; cursor:pointer; }
.recording-chat-messages a:focus-visible, .recording-chat-messages small button:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
@media(pointer:coarse) { .recording-chat-messages a { min-height:44px; } }
@media(max-width:700px) {
  body.recording-page .recording-workspace-grid.recording-chat-open .recording-workspace-main { min-height:0; padding-bottom: var(--space-4); }
}

.inference-route-editor{display:flex;gap: var(--space-2);align-items:center;flex-wrap:wrap;margin-top: var(--space-3)}.inference-route-editor :is(input,select){min-height:44px;min-width:0;max-width:100%;flex:1;border:1px solid var(--line);border-radius: var(--radius-control);background:var(--input);color:var(--ink);padding: var(--space-2) var(--space-3);font:inherit}.inference-route-editor button{min-height:44px;border:1px solid var(--accent);border-radius: var(--radius-control);background:var(--accent);color:var(--accent-ink);padding: var(--space-2) var(--space-4);font:inherit;cursor:pointer}.inference-route-editor button:disabled{opacity:.5;cursor:default}
.settings-page .back-link { display: inline-flex; align-items: center; min-height: 32px; }

.daily-brief{margin: 0 0 var(--space-8);padding: 0 0 var(--space-6);border-bottom:1px solid var(--line);min-width:0;overflow-wrap:anywhere}.daily-brief-heading{display:flex;align-items:center;gap: var(--space-3);flex-wrap:wrap}.daily-brief h2{font:300 26px/1.15 var(--font-heading);margin: 0 auto 0 0}.daily-brief button{min-height:44px;padding: var(--space-3) var(--space-4);border:1px solid var(--line);border-radius: var(--radius-control);background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}.daily-brief button:disabled{opacity:.6;cursor:default}.daily-brief button:hover:not(:disabled){background:var(--accent);color:var(--accent-ink)}.daily-brief p{line-height:1.6}.daily-brief a{display:inline-flex;align-items:center;min-height:44px}.daily-brief [hidden]{display:none!important}#daily-brief-coverage,#daily-brief-status{font-size:13px;color:var(--muted)}
@media(max-width:767px){.home-main .todo-group-head a,.home-main .category-card-name{display:inline-flex;align-items:center;min-height:44px}.home-rail .rail-name{display:inline-flex;align-items:center;min-height:24px}}

.settings-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.settings-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}


/* Shared form defaults stay below component styles in specificity. */
:root {
  --control-disabled-ink: color-mix(in oklch, var(--ink) 55%, var(--input));
  --control-disabled-fill: color-mix(in oklch, var(--input) 60%, var(--surface));
  --control-hover-line: var(--muted);
  --control-chevron-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232A252F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --control-chevron-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7F5F6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --control-chevron: var(--control-chevron-light);
  --control-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232A252F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4 10-10'/%3E%3C/svg%3E");
}
:where(button:not(.visually-hidden), input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='hidden'], [type='file']), textarea, select) {
  box-sizing: border-box;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--input);
  font: inherit;
}
:where(textarea) { resize: vertical; }
:where(button) { cursor: pointer; }
:where(input[type='radio'], input[type='range']) { accent-color: var(--check-bg); }
:root :is(input, textarea, select):disabled {
  color: var(--control-disabled-ink);
  background-color: var(--control-disabled-fill);
  cursor: default;
  opacity: 1;
}
:root :is(input, textarea, select):user-invalid {
  border-color: var(--failure);
  outline: var(--focus-width) solid var(--failure);
  outline-offset: var(--focus-offset);
}

/* Keep form semantics, label activation and the browser's keyboard handling. */
:root select:not([multiple]):not([size]) {
  appearance: none;
  padding-inline-end: var(--space-9);
  background-image: var(--control-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  cursor: pointer;
}
:root select:not([multiple]):not([size]):disabled { cursor: default; }
:root select option { color: var(--ink); background: var(--input); }
@supports (appearance: base-select) {
  :root select:not([multiple]):not([size]),
  :root select:not([multiple]):not([size])::picker(select) {
    appearance: base-select;
  }
  :root select:not([multiple]):not([size]) {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-inline-end: var(--space-3);
    background-image: none;
  }
  :root select::picker-icon {
    content: '';
    flex: none;
    width: 18px;
    height: 18px;
    margin-inline-start: auto;
    color: var(--muted);
    background: currentColor;
    mask: var(--control-chevron) center / contain no-repeat;
  }
  :root select:disabled::picker-icon { color: var(--control-disabled-ink); }
  :root select::picker(select) {
    max-height: min(320px, 60vh);
    max-width: calc(100vw - 16px);
    margin-block: var(--space-1);
    padding: var(--space-1);
    border: 0;
    border-radius: var(--radius-control);
    color: var(--ink);
    background: var(--raised);
    box-shadow: var(--shadow);
    font: inherit;
  }
  :root select option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 44px;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-control);
    white-space: normal;
    overflow-wrap: anywhere;
    background: transparent;
  }
  :root select option:checked { background: var(--selected); }
  :root select option:focus-visible {
    outline: var(--focus-width) solid var(--focus);
    outline-offset: -2px;
  }
  :root select option:disabled { color: var(--control-disabled-ink); }
  :root select option::checkmark {
    content: '';
    order: 1;
    margin-inline-start: auto;
    flex: none;
    width: 18px;
    height: 18px;
    background: currentColor;
    mask: var(--control-check) center / contain no-repeat;
  }
  @media (hover: hover) and (pointer: fine) {
    :root select option:enabled:hover { background: var(--selected); }
  }
}
:root input[type='checkbox']:not([hidden]) {
  appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--muted);
  border-radius: var(--radius-control);
  background: var(--input);
  color: var(--surface);
  vertical-align: middle;
  cursor: pointer;
}
:root input[type='checkbox']:not([hidden]):checked,
:root input[type='checkbox']:not([hidden]):indeterminate {
  border-color: var(--block-fill);
  background: var(--block-fill);
  color: var(--block-ink);
}
:root input[type='checkbox']:not([hidden])::before {
  content: '';
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: var(--control-check) center / contain no-repeat;
  visibility: hidden;
}
:root input[type='checkbox']:not([hidden]):checked::before { visibility: visible; }
:root input[type='checkbox']:not([hidden]):indeterminate::before {
  width: 12px;
  height: 2px;
  mask: none;
  visibility: visible;
}
@media (max-width: 760px) {
  :root :is(input:not([type='checkbox'], [type='radio'], [type='range'], [type='color']), textarea, select) {
    font-size: max(16px, 1em);
  }
}
@media (forced-colors: active) {
  :root input[type='checkbox']:not([hidden]) { appearance: auto; }
  :root input[type='checkbox']:not([hidden])::before { display: none; }
}

html[data-theme='dark'] {
  --control-chevron: var(--control-chevron-dark);
}

#setup-retry { justify-self: start; }
#setup-retry[hidden], #setup-progress[hidden] { display: none; }

/* Shared task-action roles follow the established Record control. */
:root {
  --action-radius: var(--radius-control);
  --action-fill: var(--accent);
  --action-ink: var(--accent-ink);
  --action-hover: var(--accent-strong);
  --action-disabled-fill: var(--control-disabled-fill);
  --action-disabled-ink: var(--control-disabled-ink);
  --action-danger-fill: #654654;
  --action-danger-ink: var(--rail-ink);
  --paper-action-fill: var(--brand-mauve);
  --paper-action-ink: #FFFFFF;
  --paper-action-hover: color-mix(in srgb, var(--paper-action-fill) 88%, var(--paper-ink));
  --paper-control-fill: #F0ECEF;
  --paper-control-ink: #635B65;
}
.auth-card {
  --action-fill: var(--paper-action-fill);
  --action-ink: var(--paper-action-ink);
  --action-hover: var(--paper-action-hover);
  --action-disabled-fill: var(--paper-control-fill);
  --action-disabled-ink: var(--paper-control-ink);
}

:root :is(.invert-button,
  .coach-button.is-primary,
  .trend-card .trend-add,
  :is(.trend-card, .trend-untracked) .trend-save,
  .pulse-dialog .pulse-primary,
  .summary-view .summary-update,
  .records-view .records-sort,
  .records-view .records-file,
  .facts .facts-find,
  .settings-actions button:not(.danger-button, .is-quiet),
  .inference-route-editor button,
  .vocab-entry button,
  .dialog-actions button[type='submit'],
  .onboarding-page button.primary,
  .onboarding-page .call-start,
  .agent-ask-form button,
  .agent-identity-form button[type='submit'],
  .agent-memory-add button,
  .nb-input button[type='submit'],
  .nb-add-paste button,
  .artifact-actions button:first-child,
  .auth-card form button) {
  min-height: var(--control-height);
  padding: var(--control-padding-block) var(--control-padding-inline);
  gap: var(--control-gap);
  border: 1px solid var(--action-fill);
  border-radius: var(--action-radius);
  background: var(--action-fill);
  color: var(--action-ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 120ms var(--ease-enter, ease-out),
    border-color 120ms var(--ease-enter, ease-out),
    color 120ms var(--ease-enter, ease-out),
    scale 120ms var(--ease-enter, ease-out);
}
:root :is(.invert-button,
  .coach-button.is-primary,
  .trend-card .trend-add,
  :is(.trend-card, .trend-untracked) .trend-save,
  .pulse-dialog .pulse-primary,
  .summary-view .summary-update,
  .records-view .records-sort,
  .records-view .records-file,
  .facts .facts-find,
  .settings-actions button:not(.danger-button, .is-quiet),
  .inference-route-editor button,
  .vocab-entry button,
  .dialog-actions button[type='submit'],
  .onboarding-page button.primary,
  .onboarding-page .call-start,
  .agent-ask-form button,
  .agent-identity-form button[type='submit'],
  .agent-memory-add button,
  .nb-input button[type='submit'],
  .nb-add-paste button,
  .artifact-actions button:first-child,
  .auth-card form button):disabled {
  border-color: var(--action-disabled-fill);
  background: var(--action-disabled-fill);
  color: var(--action-disabled-ink);
  opacity: 1;
  cursor: default;
}
@media (hover: hover) and (pointer: fine) {
  :root :is(.invert-button,
  .coach-button.is-primary,
  .trend-card .trend-add,
  :is(.trend-card, .trend-untracked) .trend-save,
  .pulse-dialog .pulse-primary,
  .summary-view .summary-update,
  .records-view .records-sort,
  .records-view .records-file,
  .facts .facts-find,
  .settings-actions button:not(.danger-button, .is-quiet),
  .inference-route-editor button,
  .vocab-entry button,
  .dialog-actions button[type='submit'],
  .onboarding-page button.primary,
  .onboarding-page .call-start,
  .agent-ask-form button,
  .agent-identity-form button[type='submit'],
  .agent-memory-add button,
  .nb-input button[type='submit'],
  .nb-add-paste button,
  .artifact-actions button:first-child,
  .auth-card form button):enabled:hover {
    border-color: var(--action-hover);
    background: var(--action-hover);
    color: var(--action-ink);
  }
}
:root .auth-card form button[type] { min-height: 48px; }

body.recording-page .recording-actions #start-recording {
  min-height: 44px;
  border-radius: var(--action-radius);
  background: var(--action-fill);
  border-color: var(--action-fill);
  color: var(--action-ink);
}
@media (hover: hover) and (pointer: fine) {
  body.recording-page .recording-actions #start-recording:enabled:hover {
    background: var(--action-hover);
    border-color: var(--action-hover);
  }
}

/* Incoming-call actions invert against the filled notification surface. */
.coach-incoming {
  --action-fill: var(--accent-ink);
  --action-ink: var(--accent);
  --action-hover: color-mix(in oklch, var(--accent-ink) 90%, var(--accent));
}

/* Dark actions use white pills; secondary surfaces retain their translucency. */
html[data-theme='dark'] {
  --action-radius: var(--radius-pill);
  --glass-fill: oklch(1 0 0 / .8);
  --glass-ink: #2A252F;
  --glass-hover: oklch(1 0 0 / .9);
  --glass-line: oklch(1 0 0 / .45);
  --secondary-fill: var(--glass-fill);
  --secondary-ink: var(--glass-ink);
  --secondary-line: var(--glass-line);
  --secondary-hover: var(--glass-hover);
  --secondary-disabled-fill: var(--glass-disabled-fill);
  --secondary-disabled-ink: var(--glass-disabled-ink);
  --secondary-radius: var(--action-radius);
  --glass-disabled-fill: oklch(1 0 0 / .12);
  --glass-disabled-ink: oklch(1 0 0 / .55);
}
html[data-theme='dark'] :is(.coach-button:not(.is-primary, .invert-button, .is-danger, .is-quiet), :is(.trend-card, .trend-untracked) .trend-cancel,
  .pulse-dialog .pulse-secondary, .onboarding-page button.secondary,
  .document-text-editor button:not(.invert-button), .auth-card) {
  background: var(--glass-fill);
  color: var(--glass-ink);
  border-color: var(--glass-line);
}
html[data-theme='dark'] :is(.coach-button, :is(.trend-card, .trend-untracked) .trend-cancel,
  .pulse-dialog .pulse-secondary, .onboarding-page button.secondary) {
  border-radius: var(--action-radius);
}
html[data-theme='dark'] .auth-card {
  --action-fill: var(--paper-action-fill);
  --action-ink: var(--paper-action-ink);
  --action-hover: var(--paper-action-hover);
  --action-disabled-fill: #BBB8BF;
  --action-disabled-ink: #514B55;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme='dark'] :is(.coach-button:not(.is-primary, .invert-button, .is-danger, .is-quiet, [aria-pressed='true']),
    :is(.trend-card, .trend-untracked) .trend-cancel, .pulse-dialog .pulse-secondary,
    .onboarding-page button.secondary):enabled:hover {
    background: var(--glass-hover);
    color: var(--glass-ink);
  }
}

/* White glass overlays sit above page content, with dark text for contrast. */
html[data-theme='dark'] :is(dialog:not([data-stage='live']), .more-menu-items, .coach-call) {
  color-scheme: light;
  --ink: var(--paper-ink);
  --muted: #514B55;
  --quiet: #514B55;
  --surface: var(--rail-ink);
  --input: #FFFFFF;
  --raised: #E2DFE4;
  --line: #9B949F;
  --line-soft: #BBB5BF;
  --selected: #D8D3DC;
  --focus: var(--source-focus);
  /* Blocks on light glass take the light-page pairing: dark fill, light ink. */
  --block-fill: var(--brand-mauve);
  --block-ink: #FFFFFF;
  --block-muted: #E4DCE8;
  --block-alert-fill: var(--paper-failure);
  --block-alert-ink: #FFFFFF;
  --block-ok-fill: var(--paper-success);
  --block-ok-ink: #FFFFFF;
  --block-calculated-fill: var(--paper-warning);
  --block-calculated-ink: #FFFFFF;
  --block-planned-fill: var(--brand-slate);
  --block-planned-ink: #FFFFFF;
  /* Primary actions on light glass are dark blocks too, not white on white. */
  --action-fill: var(--paper-action-fill);
  --action-ink: var(--paper-action-ink);
  --action-hover: var(--paper-action-hover);
  background: var(--glass-fill);
  color: var(--ink);
  border-color: var(--glass-line);
  backdrop-filter: blur(12px);
}

@supports (appearance: base-select) {
  html[data-theme='dark'] select::picker(select) {
    background: var(--glass-fill);
    color: var(--glass-ink);
    backdrop-filter: blur(12px);
  }
  html[data-theme='dark'] select option { color: var(--glass-ink); }
  html[data-theme='dark'] select option:checked { background: var(--glass-hover); }
  html[data-theme='dark'] select option:focus-visible { outline-color: var(--glass-ink); }
}

.note-page .back-link { display: inline-flex; align-items: center; min-height: 44px; }

html[data-theme='dark'] :is(.coach-button:not(.is-primary, .invert-button, .is-danger, .is-quiet),
  :is(.trend-card, .trend-untracked) .trend-cancel, .pulse-dialog .pulse-secondary,
  .onboarding-page button.secondary):disabled {
  background: var(--glass-disabled-fill);
  color: var(--glass-disabled-ink);
  border-color: transparent;
  cursor: default;
}

html[data-theme='dark'] .auth-card .auth-modes button:not([aria-current='page']) {
  color: #514B55;
}

/* Standard secondary controls share the same states on every surface. */
:root :is(.document-actions button:not(.invert-button, .danger-button, .is-primary),
  .document-actions a, .facts button:not(.facts-find, .is-primary),
  .chat-file button, .chat-attach, .calendar-card button,
  .trend-untracked .trend-manual, .trend-card .trend-manual, .trend-card .trend-table-toggle, :is(.trend-card, .trend-untracked) .trend-cancel,
  .notebook-work-actions button, .agent-composer-actions .agent-attach,
  .notebook-chat button:not(.nb-sources-toggle, .nb-source-open, .nb-viewer-segment, [type='submit']),
  .nb-viewer > .nb-viewer-open) {
  min-height: var(--control-height);
  padding: var(--control-padding-block) var(--control-padding-inline);
  gap: var(--control-gap);
  border: 1px solid var(--secondary-line);
  border-radius: var(--secondary-radius);
  background: var(--secondary-fill);
  color: var(--secondary-ink);
  font: inherit;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  :root :is(.document-actions button:not(.invert-button, .danger-button, .is-primary),
    .document-actions a, .facts button:not(.facts-find, .is-primary),
    .chat-file button, .chat-attach, .calendar-card button,
    .trend-untracked .trend-manual, .trend-card .trend-manual, .trend-card .trend-table-toggle, :is(.trend-card, .trend-untracked) .trend-cancel,
    .notebook-work-actions button, .agent-composer-actions .agent-attach,
  .notebook-chat button:not(.nb-sources-toggle, .nb-source-open, .nb-viewer-segment, [type='submit']),
  .nb-viewer > .nb-viewer-open):enabled:hover {
    background: var(--secondary-hover);
    color: var(--secondary-ink);
  }
  :root .document-actions a:hover { background: var(--secondary-hover); }
}
:root :is(.document-actions button:not(.invert-button), .facts button:not(.facts-find, .is-primary),
  .chat-file button, .chat-attach, .calendar-card button,
  .trend-untracked .trend-manual, .trend-card .trend-manual, .trend-card .trend-table-toggle, :is(.trend-card, .trend-untracked) .trend-cancel,
  .notebook-work-actions button, .agent-composer-actions .agent-attach,
  .notebook-chat button:not(.nb-sources-toggle, .nb-source-open, .nb-viewer-segment, [type='submit']),
  .nb-viewer > .nb-viewer-open):disabled {
  background: var(--secondary-disabled-fill);
  color: var(--secondary-disabled-ink);
  border-color: transparent;
  opacity: 1;
  cursor: default;
}
:where(button, a, summary, input, textarea, select):focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
}
/* Light glass and paper contexts need local status/disabled roles in dark mode too. */
:is(.auth-card, html[data-theme='dark'] dialog:not([data-stage='live']),
  html[data-theme='dark'] .more-menu-items, html[data-theme='dark'] .coach-call) {
  --control-disabled-ink: color-mix(in oklch, var(--ink) 55%, var(--input));
  --control-disabled-fill: color-mix(in oklch, var(--input) 60%, var(--surface));
  --control-chevron: var(--control-chevron-light);
  --secondary-disabled-ink: var(--control-disabled-ink);
  --secondary-disabled-fill: var(--control-disabled-fill);
  --failure: var(--paper-failure);
  --warning: var(--paper-warning);
  --success: var(--paper-success);
}
/* The report source itself stays paper-coloured in either application theme. */
.report-regions { --focus: var(--source-focus); }

:root .danger-button {
  min-height: var(--control-height);
  padding: var(--control-padding-block) var(--control-padding-inline);
  border: 1px solid var(--action-danger-fill);
  border-radius: var(--action-radius);
  color: var(--action-danger-ink);
  background: var(--action-danger-fill);
  font: inherit;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  :root .danger-button:enabled:hover {
    background: color-mix(in srgb, var(--action-danger-fill) 85%, var(--ink));
  }
}
:root .danger-button:disabled {
  background: var(--control-disabled-fill);
  color: var(--control-disabled-ink);
  border-color: transparent;
  cursor: default;
}

@media (max-width: 1000px) {
  :root {
    --page-padding-block: var(--space-4);
    --page-padding-inline: var(--space-4);
  }
}

/* Status blocks: a solid fill with inverted ink in both themes. Light pages use
   dark fills with light ink; dark pages flip to light fills with dark ink. */
.status-block {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-small);
  background: var(--block-fill);
  color: var(--block-ink);
  font-size: var(--text-caption);
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}
.status-block.is-alert { background: var(--block-alert-fill); color: var(--block-alert-ink); }
.status-block.is-ok { background: var(--block-ok-fill); color: var(--block-ok-ink); }
.status-block.is-calculated { background: var(--block-calculated-fill); color: var(--block-calculated-ink); }
.status-block.is-planned { background: var(--block-planned-fill); color: var(--block-planned-ink); }
.status-block .icon { width: 14px; height: 14px; color: currentColor; }

/* Selected data/action widgets provide hierarchy on the purple dark canvas.
   This is a local context, never a blanket white fill for a page or column. */
:root {
  --widget-fill: #FFFFFF;
  --widget-ink: #2C2234;
  --widget-muted: #5C4F66;
  --widget-raised: #F7F5F6;
  --widget-line: #D7D7D4;
  --widget-series: var(--source-focus);
}
html[data-theme] :is(.widget-paper:is(section, article, aside, div, dialog), .notebook-hero,
  .records-drop, .summary-head, .timeline-head, .note-head, .agent-detail-head,
  #todos-view .todos-widget, #settings-view > .settings-section:has(#profile-form),
  #recording-notes-panel, #recording-transcript-panel, #detail-view .player-card, #vocabulary-overview, #vocabulary-form, .welcome-copy, .setup-call-head, .document-head,
  .records-review) {
  color-scheme: light;
  --action-radius: var(--radius-control);
  --secondary-radius: var(--radius-control);
  --glass-fill: var(--widget-fill);
  --glass-ink: var(--widget-ink);
  --glass-line: var(--widget-line);
  --glass-hover: var(--widget-raised);
  --ink: var(--widget-ink);
  --muted: var(--widget-muted);
  --quiet: var(--widget-muted);
  --surface: var(--widget-fill);
  --field: var(--widget-fill);
  --input: var(--widget-fill);
  --raised: var(--widget-raised);
  --line: var(--widget-line);
  --line-soft: var(--paper-line-soft);
  --focus: var(--source-focus);
  --data-series: var(--widget-series);
  --accent: var(--brand-mauve);
  --accent-strong: var(--paper-action-hover);
  --accent-ink: var(--widget-fill);
  --selected: var(--widget-raised);
  --action-fill: var(--paper-action-fill);
  --action-ink: var(--paper-action-ink);
  --action-hover: var(--paper-action-hover);
  --secondary-fill: var(--widget-fill);
  --secondary-ink: var(--widget-ink);
  --secondary-hover: var(--widget-raised);
  --secondary-line: var(--widget-line);
  --block-fill: var(--brand-mauve);
  --block-ink: var(--widget-fill);
  --block-muted: var(--rail-muted);
  --block-alert-fill: var(--paper-failure);
  --block-alert-ink: var(--widget-fill);
  --block-ok-fill: var(--paper-success);
  --block-ok-ink: var(--widget-fill);
  --block-calculated-fill: var(--paper-warning);
  --block-calculated-ink: var(--widget-fill);
  --block-planned-fill: var(--brand-slate);
  --block-planned-ink: var(--widget-fill);
  --failure: var(--paper-failure);
  --warning: var(--paper-warning);
  --success: var(--paper-success);
  --control-chevron: var(--control-chevron-light);
  --control-disabled-ink: var(--widget-muted);
  --control-disabled-fill: var(--widget-raised);
  --mantine-color-text: var(--widget-ink);
  --mantine-color-dimmed: var(--widget-muted);
  --mantine-color-default: var(--widget-fill);
  --mantine-color-default-color: var(--widget-ink);
  --mantine-color-default-border: var(--widget-line);
  background: var(--widget-fill);
  color: var(--widget-ink);
  border-color: var(--widget-line);
  backdrop-filter: none;
}

/* #219: account actions have their own row above rail navigation. */
@media (min-width: 1001px) {
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) header,
  body.recording-page header {
    flex-direction: column; align-items: flex-start; justify-content: center;
    height: 128px; gap: var(--space-2);
  }
  header .brand { flex-shrink: 0; white-space: nowrap; }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .home-rail { top: 128px; }
  .home-rail .recent-list { overflow-x: hidden; }
}
.notebook-hero h2 .icon { color: inherit; opacity: 1; }

.notebook-hero { --action-radius: var(--radius-pill); --secondary-radius: var(--radius-pill); }

/* #220: a deliberate content focal point, with quiet sections left on the canvas. */
:is(.summary-head, .timeline-head, .note-head, .agent-detail-head,
  #todos-view .todos-widget, #settings-view > .settings-section:has(#profile-form),
  #recording-notes-panel, #recording-transcript-panel, #detail-view .player-card, #vocabulary-overview, #vocabulary-form, .welcome-copy, .setup-call-head, .document-head,
  .records-review) {
  padding: var(--space-5); border: 1px solid var(--widget-line); border-radius: var(--radius-panel);
}
:is(.summary-head, .timeline-head) h2 { font-size: var(--text-page-title); }
.records-drop { border-style: solid; }
.records-drop:is(:hover, :focus-visible) { border-color: var(--widget-ink); }
.note-head #note-title { min-height: var(--control-height); }
#recording-notes-panel .notes-editor { background: var(--field); color: var(--ink); }
/* The footer belongs to the rail, independent of the length of its tree. */
@media (min-width: 1001px) {
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .home-rail {
    display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; overflow: hidden;
  }
  body:is(:has(#list-view:not([hidden])), .agent-chat-page, .notebook-page, .timeline-page, .records-page, .summary-page, .trends-page, .document-page, .settings-page, .todos-page, .note-page) .home-rail .recent-list { min-height: 0; }
  .home-rail .settings-link { align-self: end; }
}
#notebooks-drawer-body { display: flex; flex-direction: column; }
#notebooks-drawer #home-rail { flex: 1; min-height: 0; overflow: hidden; }
#notebooks-drawer .settings-link { margin-top: auto; background: var(--paper-action-fill); color: var(--paper-action-ink); }

/* Supporting pages keep the same navigation and bottom account anchor. */
@media (min-width: 1001px) {
  body:is(.settings-page, .todos-page, .note-page) :is(#settings-view, #todos-view, #page-view) {
    grid-column: 2; grid-row: 1; width: 100%; max-width: 980px; margin: 0 auto;
    padding: var(--space-7) var(--space-8) var(--space-12);
  }
  body:is(.settings-page, .todos-page, .note-page) .heading { display: none; }
}
:root { --control-line: #8A7D92; }
html[data-theme='dark'] { --control-line: #A59AAA; }
html[data-theme] :is(.widget-paper, .notebook-hero, .records-drop, .summary-head,
  .timeline-head, .note-head, .agent-detail-head, #todos-view .todos-widget,
  #settings-view > .settings-section:has(#profile-form), #recording-notes-panel, #recording-transcript-panel, #detail-view .player-card, #vocabulary-overview, #vocabulary-form, .welcome-copy, .setup-call-head, .document-head) {
  --control-line: #8A7D92;
}
/* Text fields (#227 owner correction): a hairline or no outline, a smooth soft fill and the
   44px control height, so a field sits level with the buttons beside it. The fill identifies the
   field; hover darkens the hairline and focus keeps the full focus ring. This supersedes #220's
   3:1 field boundary. Its specificity stays at one pseudo-class, so a field's own local style wins;
   Mantine inputs in the measurements frame keep Mantine's own roles. --field-fill is
   set only by white widgets; declaring it on :root would freeze the canvas input everywhere. */
html[data-theme] :is(.widget-paper, .notebook-hero, .records-drop, .summary-head,
  .timeline-head, .note-head, .agent-detail-head, #todos-view .todos-widget,
  #settings-view > .settings-section:has(#profile-form), #recording-notes-panel, #recording-transcript-panel, #detail-view .player-card, #vocabulary-overview, #vocabulary-form, .welcome-copy, .setup-call-head, .document-head) {
  --field-fill: var(--widget-raised);
  /* Composers are always paper; inside a white widget they take the same soft fill as fields. */
  --composer-fill: var(--widget-raised);
}
:where(input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='search'],
  input[type='date'], input[type='time'], input[type='number'], input[type='url'], textarea, select):not(:disabled, .mantine-Input-input) {
  border-color: color-mix(in oklch, currentColor 12%, transparent);
  /* Each context's own --input (sign-in card, dialogs) unless a white widget sets --field-fill. */
  background-color: var(--field-fill, var(--input));
}
/* Single-line fields match the 44px buttons exactly, whatever their font weight. */
:where(input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='search'],
  input[type='date'], input[type='time'], input[type='number'], input[type='url'], select:not([multiple], [size])) {
  height: var(--control-height);
  padding-block: 0;
}
@media (hover: hover) and (pointer: fine) {
  :where(input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='search'],
    input[type='date'], input[type='time'], input[type='number'], input[type='url'], textarea, select):enabled:hover {
    border-color: color-mix(in oklch, currentColor 28%, transparent);
  }
}
/* Disabled is indicated by a quiet fill and cursor, without fading the label. */
html[data-theme] :is(button, input, select, textarea):disabled {
  --action-disabled-ink: var(--muted); --action-disabled-fill: var(--raised);
  --secondary-disabled-ink: var(--muted); --secondary-disabled-fill: var(--raised);
  --control-disabled-ink: var(--muted); --control-disabled-fill: var(--raised);
  opacity: 1; color: var(--muted); background: var(--raised); border-color: color-mix(in oklch, currentColor 12%, transparent); cursor: not-allowed;
}
html[data-theme] :is(button, input, select, textarea):disabled .icon { opacity: 1; color: inherit; }
/* Text on the gradient uses full rail ink; muted ink remains for supporting glyphs. */
.home-rail .rail-new-button { color: var(--rail-ink); }

.settings-link[aria-current='page'] span { text-decoration: underline; text-underline-offset: var(--space-1); }
/* Custom notebook colours already choose contrast-checked ink; keep it opaque. */
.notebook-card :is(.notebook-empty, .notebook-meeting, .notebook-progress) { opacity: 1; }
.notebook-card :is(.icon, .notebook-progress span) { opacity: 1; }
.home-rail :is(.rail-icon, .rail-node small) { color: var(--ink); }
/* Unnamed speakers remain readable without relying on a faint auto-label tint. */
.turn-heading button.speaker-auto { color: var(--muted); opacity: 1; }

#notebooks-drawer .settings-link:hover { background: var(--paper-action-hover); }

/* #222: account controls above the brand, with the full rail width between. */
html body #app-header:has(.header-account-controls) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: var(--space-2);
  height: 128px;
  padding-block: var(--space-3);
  box-sizing: border-box;
}
#app-header .header-account-controls {
  /* #222 order: Log out at the left edge, the theme switch at the right. The switch keeps its corner
     when Log out is hidden (no sign-in), instead of sliding to the left. */
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  width: 100%; grid-column: 1; grid-row: 1;
}
#app-header .brand { grid-column: 1; grid-row: 2; justify-self: start; }
#app-header .header-side { display: contents; }
#app-header .header-account-controls #logout-button { margin: 0; }
#app-header .header-account-controls #theme-toggle { margin-left: auto; }
html body #app-header:has(.header-account-controls):has(#capture-header-controls:not([hidden])) {
  height: auto; min-height: 180px; grid-template-rows: auto auto auto;
}
#app-header #capture-header-controls { grid-column: 1; grid-row: 3; }
@media (min-width: 1001px) {
  body:has(#capture-header-controls:not([hidden])) .home-rail { top: 180px; }
}
/* Local widget and page roles keep every icon on its own control's ink. */
:is(.view-tabs, .nb-input, .nb-sources-actions) .icon { flex-shrink: 0; color: currentColor; }

/* A page load holds everything but the sidebar's surface until app.js has routed (index.html sets
   data-routing): the sidebar's links wait too, so My Health never shows selected on another page. */
html[data-routing] main > :not(.home-rail), html[data-routing] .home-rail > * { visibility: hidden; }
/* While it routes, a skeleton of a page stands where the content will be: a heading, a line and two
   cards, drawn by one mask so it takes the theme's ink (owner, 2026-10-29: loading should look like the
   page arriving, not like a broken one). It waits 120ms, so a quick load never flashes it. */
html[data-routing] main::before {
  content: ''; display: block; height: 360px; margin-bottom: -360px; opacity: 0;
  background: color-mix(in oklch, var(--ink) 9%, transparent);
  -webkit-mask: var(--page-skeleton) top left / 100% 360px no-repeat; mask: var(--page-skeleton) top left / 100% 360px no-repeat;
  animation: page-loading-in 150ms 120ms ease-out forwards, page-skeleton-pulse 1.2s 270ms ease-in-out infinite alternate;
}
:root { --page-skeleton: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='42%25' height='38' rx='10'/%3E%3Crect y='56' width='26%25' height='14' rx='7'/%3E%3Crect y='102' width='100%25' height='118' rx='18'/%3E%3Crect y='238' width='100%25' height='118' rx='18'/%3E%3C/svg%3E"); }
@keyframes page-loading-in { to { opacity: 1; } }
@keyframes page-skeleton-pulse { from { opacity: 1; } to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { html[data-routing] main::before { animation: page-loading-in 150ms 120ms forwards; } }

/* Log out is small and outline only in every header, rail and theme (owner, 2026-10-27). */
html body #app-header .header-account-controls #logout-button {
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  font-size: var(--text-small);
  font-weight: 500;
  opacity: .85;
}
html body #app-header .header-account-controls #logout-button:hover,
html body #app-header .header-account-controls #logout-button:focus-visible { opacity: 1; border-color: currentColor; }
/* The visible outline is 32px; an invisible margin keeps a 44px tap target. */
html body #app-header .header-account-controls #logout-button { position: relative; }
html body #app-header .header-account-controls #logout-button::after { content: ''; position: absolute; inset: -6px; }
/* Settings show one tab's sections at a time (settings-tabs.js). */
.settings-tabs { margin: 0 0 var(--space-5); }
#settings-view > .settings-section.settings-off { display: none; }

/* Dark theme, actions on the canvas (owner, 2026-10-28, against the dashboard prototype): quiet outlines
   in the rail's ink, so nothing on the dark page is a white slab. Filled actions stay inside the paper
   widgets; Call Stellis keeps its round light handle as the one bright mark. */
html[data-theme='dark'] :is(.home-heading .invert-button, .home-heading .dashboard-add-menu > summary, .home-heading .record-more > summary, .home-heading .library-more > summary, #health-capture-toolbar #global-add, .measurement-camera, .measurement-manual, .home-heading .call-launch) {
  border: 1px solid color-mix(in oklch, var(--rail-ink) 38%, transparent);
  background: transparent;
  color: var(--rail-ink);
  box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  html[data-theme='dark'] :is(.home-heading .invert-button, .home-heading .dashboard-add-menu > summary, .home-heading .record-more > summary, .home-heading .library-more > summary, #health-capture-toolbar #global-add, .measurement-camera, .measurement-manual, .home-heading .call-launch):hover {
    background: color-mix(in oklch, var(--rail-ink) 10%, transparent);
  }
}
html[data-theme='dark'] .home-heading .call-launch-handle { background: var(--rail-ink); color: var(--rail-surface); }
/* The split Record button reads as one outlined control: its chevron shares the border, with a divider. */
html[data-theme='dark'] .home-heading .split-button > .invert-button { border-right: 0; }
html[data-theme='dark'] .home-heading .record-more > summary { border-left-color: color-mix(in oklch, var(--rail-ink) 22%, transparent); }

/* Page changes in the app cut over in one frame: the old page holds until the new one is ready (app.js
   route), with no cross-fade. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }

/* Clean transcript is a side action beside the visit's questions, so it is an outline button; Ask is
   the section's one filled button. */
.ai-heading #clean-button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
/* The back link sits on the dark recording panel; hovering it keeps the panel's ink on its control fill
   (the generic button hover gave a light fill under white text). */
body.recording-page .recording-workspace-head #back-from-recording:is(:hover, :focus-visible) { background: var(--rail-control); color: var(--rail-ink); }

/* A page's loader, in its own area, until the page's content arrives (app.js showRailPage). */
.page-loading { margin: var(--space-6) 0; color: var(--muted); }
