/* ---------- Design tokens (v2 redesign, 008 ticket 01) ----------
   The approved mockup's palette (mockups/recall-web-v2.html :root),
   verbatim. Dark mode follows prefers-color-scheme — the app has no
   theme toggle; the mockup's data-theme switch is preview-only. */

:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --surface-3: #e6ece9;
  --text: #13201a;
  --text-2: #4b5a52;
  --text-3: #6b7a72;
  --border: #dde5e1;
  --border-strong: #c7d3cd;
  --brand: #19735a;
  --brand-hover: #145f4a;
  --brand-soft: #e3f1ec;
  --on-brand: #ffffff;
  --attention: #b45309;
  --attention-soft: #fdf1e3;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info: #1d5fa8;
  --info-soft: #e7f0fa;
  --ring: #19735a;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(19, 32, 26, 0.06), 0 4px 16px rgba(19, 32, 26, 0.05);
  --spk-1: #19735a;
  --spk-2: #1d5fa8;
  --spk-3: #8a3ffc;
  --spk-4: #b45309;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1411;
    --surface: #151d19;
    --surface-2: #1b2520;
    --surface-3: #23302a;
    --text: #e9f1ec;
    --text-2: #b3c1b9;
    --text-3: #8d9c94;
    --border: #29352f;
    --border-strong: #36453d;
    --brand: #4fc79c;
    --brand-hover: #6ad6ae;
    --brand-soft: #173a2e;
    --on-brand: #06140e;
    --attention: #f0a54a;
    --attention-soft: #3a2a14;
    --danger: #f28b82;
    --danger-soft: #3b1d1a;
    --info: #7fb1ef;
    --info-soft: #172a40;
    --ring: #4fc79c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.25);
    --spk-1: #4fc79c;
    --spk-2: #7fb1ef;
    --spk-3: #c4a3ff;
    --spk-4: #f0a54a;
    color-scheme: dark;
  }
}

/* ---------- Self-hosted fonts (008 ticket 01) ----------
   woff2 subsets served from app/static/fonts with their OFL files
   alongside. Plus Jakarta Sans is the variable font (the files carry
   wght 200-800; the app declares the 400-700 range it uses); JetBrains
   Mono is its static 500. The CSP needs no change: default-src 'self'
   already covers same-origin fonts. latin/latin-ext unicode-ranges let
   each pair of files coexist. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/jetbrains-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* {
  box-sizing: border-box;
}

/* The pages toggle views with the hidden attribute; without this, any rule
   that sets display (a grid form, a flex row) silently wins over it. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- Global control affordances (008 ticket 01) ----------
   A visible ring on keyboard focus for every interactive element and
   quick hover feedback — the transitions are skipped entirely under
   prefers-reduced-motion. */

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  :where(
      button,
      a,
      .pill,
      .filter-pill,
      .nav-item,
      .seg,
      .chip,
      .row,
      .search-option,
      .search-trigger
    ) {
    transition: background-color 0.18s ease, border-color 0.18s ease,
      color 0.18s ease, box-shadow 0.18s ease;
  }
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* The icon sprite shell.js builds once per page: rendered as nothing,
   just a source of <symbol>s for <use href="#i-..."> references. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Shared v2 components (008 ticket 06) ---------- The pieces
   every page composes, ONE definition each, here — pages never re-style
   them: the page head, the segmented filter, the pill, the card, the
   task checkbox, the timestamp chip, and the empty/gate state. */

/* The page head: title + sub line left, a filter (or actions) right. */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.sub {
  color: var(--text-2);
  margin: 4px 0 0;
  font-size: 14.5px;
}

/* The segmented filter (the Inbox's All / Needs attention / Processing /
   Done, the Tasks page's Open / Approved / All, the Memory kinds): one
   pressed segment carrying the raised page-surface look, a quiet count
   beside each label. */
.segs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--surface-3);
}

.seg {
  border: 0;
  background: none;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

.seg[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.seg .n {
  color: var(--text-3);
  font-weight: 500;
  margin-left: 4px;
}

/* Segments can also sit inside a card (the Memory kinds): a beat of
   space below, and — like the page-head's — they scroll within
   themselves on a narrow screen rather than squeezing (the ≤860px
   block in the Inbox section). */
.mcard .segs {
  margin: 0 0 10px;
}

/* The mockup's .pill badge (the iPhone's RecallPill): a capsule with a
   tone's soft fill — neutral by default, the attention tone for the
   needs-attention statuses, the danger tone for failures. */
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-3);
  white-space: nowrap;
}

.pill.warn {
  background: var(--attention-soft);
  border-color: transparent;
  color: var(--attention);
}

.pill.danger {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

/* The extra RecallPill tones the Process dialog and AI Setup rows use
   (the iPhone's .blue / .green). */
.pill.blue {
  background: var(--info-soft);
  border-color: transparent;
  color: var(--info);
}

.pill.green {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand);
}

/* A pill can be a link (the review statuses in the Inbox table and the
   Meeting header — 009 ticket 01): it keeps the pill look, underline
   only on hover like every other quiet affordance here. */
a.pill {
  text-decoration: none;
}

a.pill:hover {
  text-decoration: underline;
}

/* The mockup's card (its .card rule; the pairing page's older, narrower
   .card keeps its own name, so the app's cards are .mcard). */
.mcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.mcard + .mcard {
  margin-top: 16px;
}

.mcard h2 {
  font-size: 15px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcard h2 .icon {
  color: var(--text-3);
}

/* The tasks-group variant (the mockup's padding:6px card): rows only,
   edge to edge. */
.mcard.tight {
  padding: 6px;
}

/* The mockup's rounded-square check — every Task row's checkbox, on the
   detail page's cards and the Tasks page's alike. Filling it is the
   approve action (task-rows.js's checkboxToggle). */
button.checkbox {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}

button.checkbox.checked {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

/* A transcript timestamp as a chip: on the detail page it seeks AND
   plays the rail player (008 ticket 03) without changing tab; on the
   Tasks page the same chip is a link to the source moment in the
   Meeting's own Tasks tab. */
button.timestamp,
a.timestamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--brand);
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.78125rem;
  line-height: 1.5;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

button.timestamp:hover,
a.timestamp:hover {
  border-color: var(--brand);
}

.timestamp .icon {
  width: 12px;
  height: 12px;
}

/* Evidence-Backed Claims (CLAUDE.md): the marker on an item nothing
   traces to a transcript timestamp — never shown as established fact
   (the same label the iPhone's rows carry). */
.tag {
  font-size: 0.78125rem;
  font-weight: 700;
  color: var(--attention);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.125rem 0.4375rem;
  white-space: nowrap;
}

/* The empty and gate states: the page-level card that stands in for a
   list — the Free tier's Inbox, an empty Inbox or People page, the Pro
   gates, the Tasks page's empty state. */
.empty {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.empty h2 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  text-wrap: balance;
}

.empty p {
  margin: 0 0 0.75rem;
  font-size: 0.90625rem;
}

.empty p:last-child {
  margin-bottom: 0;
}

.empty a {
  color: var(--brand);
  font-weight: 700;
}

/* ---------- Web shell (redesigned to the v2 mockup, 008 ticket 01,
   ADR 0015) ---------- The mockup's .shell / .side / .content / .wrap
   layout on this app's class names (.desktop / .sidebar / .content /
   .page), so no page's markup changes. The tokens flip in the dark-mode
   block above, so the sidebar needs no rules of its own there. */

.desktop {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  padding: 2px 8px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.brand .mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: var(--on-brand);
}

.brand .mark svg {
  width: 18px;
  height: 18px;
}

/* The meeting search (008 ticket 05): a combobox — the input carries
   role=combobox and points at the results listbox with
   aria-activedescendant. The .search wrapper only positions; the
   mockup's box look lives on .search-field. z-index keeps the popover
   above the page content, the way the row menus' .menu does. */
.sidebar .search {
  position: relative;
  z-index: 1;
}

.sidebar .search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 14px;
}

/* The field owns the focus ring (the input's own would double it up). */
.sidebar .search-field:focus-within {
  border-color: var(--ring);
}

.sidebar .search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: none;
  color: var(--text);
  font: inherit;
  /* Shed the pairing page's code-entry input look (the global input
     rule's centering and 0.3em letter spacing), as the other pages'
     form inputs already do. */
  text-align: left;
  letter-spacing: normal;
}

.sidebar .search-input::placeholder {
  color: var(--text-3);
}

.sidebar .search-input:focus-visible {
  outline: none;
}

.sidebar .search-field:focus-within kbd {
  display: none;
}

.sidebar .search kbd {
  margin-left: auto;
  font-family: inherit;
  font-size: 12.5px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0 5px;
}

/* The results popover: the query's ranked matches, or the five most
   recent meetings for an empty query. Anchored by shell.js to the
   field's viewport rect — position: fixed, because the sidebar's
   overflow-y clips an absolute child at the sidebar's edge. The
   ≤860px sheet flows it instead (position: static wins on the
   computed style, and shell.js skips anchoring when it sees that). */
.search-pop {
  position: fixed;
  z-index: 40;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 6px;
}

.search-label {
  padding: 6px 10px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.search-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.search-option:hover,
.search-option[aria-selected="true"] {
  background: var(--surface-2);
}

.search-result {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-option .pill {
  flex: none;
}

.search-empty {
  padding: 14px 10px;
}

.search-empty strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.search-empty-hint {
  font-size: 12.5px;
  color: var(--text-3);
}

/* The strip's search icon — hidden on desktop, where the box itself
   sits in the sidebar. */
.sidebar .search-trigger {
  display: none;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

/* The Inbox attention badge: needs-attention + failed Meetings. */
.nav-item .count {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--attention-soft);
  color: var(--attention);
  border-radius: 999px;
  padding: 0 7px;
}

/* The storage meter footer (GET /users/me quota). Hidden on Free,
   whose quota object the backend omits entirely. */
.side-foot {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--text-2);
}

.side-foot strong {
  color: var(--text);
}

/* A native <progress>: the fill rides the value attribute, so the bar
   never needs an inline width (style="" is banned under the CSP). */
.meter {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-3);
  margin: 8px 0 4px;
  overflow: hidden;
}

.meter::-webkit-progress-bar {
  background: var(--surface-3);
}

.meter::-webkit-progress-value {
  background: var(--brand);
  border-radius: inherit;
}

.meter::-moz-progress-bar {
  background: var(--brand);
}

/* Breadcrumbs (shell.js's mountCrumbs), used by the detail/profile
   pages — the mockup's .crumbs row. */
.crumbs {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--text-3);
  font-size: 13.5px;
  margin-bottom: 10px;
}

.crumbs a {
  color: inherit;
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--text);
}

.content {
  padding: 28px 32px 64px;
  min-width: 0;
}

/* One shared content width everywhere (008 ticket 01) — the Inbox/
   detail width mismatch is gone. .page-wide stays on the pages that
   carry it but no longer widens anything. */
.page {
  max-width: 1120px;
  margin: 0 auto;
}

.page-wide {
  max-width: 1120px;
}

/* The mockup's own narrow-viewport intent: the sidebar becomes one
   horizontally scrollable strip. Its scroll is internal — the page
   itself gains no horizontal scroll at 375px. */
@media (max-width: 860px) {
  .desktop {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar .search,
  .sidebar .nav-label,
  .side-foot {
    display: none;
  }

  /* The search (008 ticket 05): the box is out of the strip, so a
     search icon opens the same combobox as a sheet across the top of
     the page. .search.open outranks the display: none above. */
  .sidebar .search-trigger {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text-2);
  }

  .sidebar .search-trigger:hover {
    background: var(--surface-2);
    color: var(--text);
  }

  .sidebar .search.open {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    padding: 8px 12px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .sidebar .search.open .search-pop {
    position: static;
    width: auto;
    max-height: min(420px, 55vh);
    margin-top: 6px;
    box-shadow: none;
  }

  .brand {
    padding-right: 4px;
  }

  .nav-group {
    flex-direction: row;
    flex: none;
  }

  .nav-item {
    white-space: nowrap;
    width: auto;
  }

  .content {
    padding: 20px 16px 48px;
  }
}

/* ---------- Minimal header (pairing page only — no sidebar there) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.center-shell {
  min-height: calc(100vh - 53px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 20px 64px;
}

.card {
  width: 100%;
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

label {
  font-weight: 700;
  font-size: 0.78125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.25rem;
  letter-spacing: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

button {
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--brand-hover);
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

button:disabled:hover {
  background: var(--brand);
}

#pair-status {
  min-height: 1.5em;
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

#pair-status.error {
  color: var(--danger);
}

.muted {
  color: var(--text-3);
  font-size: 0.875rem;
}

/* ---------- Meeting Inbox (/app/meetings/) — 008 ticket 02 ----------
   The approved v2 mockup's Inbox screen: a page head with filter
   segments, one attention callout, and the full-width table (Meeting ·
   People · Length · Status · ⋯) with per-row action menus. The tokens
   flip in the dark-mode block at the top, so none of these rules need a
   dark-mode block of their own. */

#meetings-status {
  min-height: 1.5em;
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

#meetings-status.error {
  color: var(--danger);
}

/* The one attention callout, summarising what needs review. */
.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--attention-soft);
  border: 1px solid color-mix(in srgb, var(--attention) 25%, transparent);
  margin-bottom: 20px;
}

.callout > .icon {
  color: var(--attention);
  margin-top: 2px;
}

.callout-body {
  min-width: 0;
}

.callout-body strong {
  display: block;
}

.callout-body p {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

/* Each callout entry is the shortcut to where that meeting's verdict
   happens (009 ticket 01); the separators around links are plain text
   nodes. */
.callout-body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.callout-body a:hover {
  color: var(--text);
}

.callout button {
  margin-left: auto;
  flex: none;
}

/* The table itself. overflow stays visible so a last row's ⋯ menu can
   hang below the card — the rounded corners are carried by the header
   and the last row instead. */
.list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.list-head,
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 88px 150px 44px;
  gap: 16px;
  align-items: center;
  padding: 0 16px;
}

.list-head {
  min-height: 40px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.row {
  min-height: 68px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.row:last-child {
  border-bottom: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.row:hover,
.row:focus-within {
  background: var(--surface-2);
}

/* The whole row is the title link's click target: the stretched-link
   pattern keeps navigation on a real <a> (keyboard, middle-click) while
   the ⋯ button and its menu sit above the stretch and never navigate. */
.row-link {
  font-weight: 600;
  font-size: 15px;
  color: inherit;
  text-decoration: none;
}

.row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.row .meta {
  color: var(--text-3);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
  min-width: 0;
}

.src {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.src .icon {
  width: 14px;
  height: 14px;
}

/* The People column: initials avatars with a "+N" overflow chip. The
   fill comes from the speaker palette; the text color rides --on-brand,
   which contrasts with the palette in both color schemes. */
.people-none {
  color: var(--text-3);
  font-size: 13px;
}

.avatars {
  display: flex;
}

.avatars span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--on-brand);
  border: 2px solid var(--surface);
  margin-left: -6px;
}

.avatars span:first-child {
  margin-left: 0;
}

.avatars span.spk-1 {
  background: var(--spk-1);
}

.avatars span.spk-2 {
  background: var(--spk-2);
}

.avatars span.spk-3 {
  background: var(--spk-3);
}

.avatars span.spk-4 {
  background: var(--spk-4);
}

/* The Status column's pill carries the mockup's leading dot and drops
   the bordered look the other pages' pills keep (ticket 06 settles
   those). A review status's pill is a link (009 ticket 01) and must sit
   above the row's stretched title link to be clickable at all. */
.list .pill {
  gap: 6px;
  border-color: transparent;
}

.list a.pill {
  position: relative;
  z-index: 1;
}

.list .pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

/* The ⋯ actions menu: an icon button above the row's stretched link and
   a popover of menu items anchored under it. */
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* The compact ⋯ the item rows use (008 ticket 03). */
.icon-btn.small {
  width: 28px;
  height: 28px;
}

.icon-btn.small .icon {
  width: 16px;
  height: 16px;
}

.menu {
  position: relative;
  z-index: 1;
}

.menu-pop {
  position: absolute;
  right: 0;
  top: 40px;
  z-index: 5;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
}

/* The compact button's popover anchors to its own height. */
.menu.sm .menu-pop {
  top: 32px;
}

.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
}

.menu-item:hover {
  background: var(--surface-2);
}

.menu-item.danger {
  color: var(--danger);
}

/* button.danger (the standalone destructive button) outranks .menu-item on
   specificity; inside a menu a destructive item is only red text. */
.menu-pop .menu-item.danger { border: 0; background: none; }
.menu-pop .menu-item.danger:hover { background: var(--danger-soft); }

/* Kept from the iPhone-port rows: the Memory and People pages' section
   headings and entity-row tops still use these. */
.section-label {
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  font-weight: 700;
}

.meeting-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.meeting-title {
  font-weight: 700;
  font-size: 0.90625rem;
}

/* The mockup's narrow-viewport table: the head goes away, People and
   Length drop out, and the row re-flows to Meeting / Status / ⋯. The
   segment strip scrolls within itself — the page never gains horizontal
   scroll. */
@media (max-width: 860px) {
  .list-head {
    display: none;
  }

  .row {
    grid-template-columns: minmax(0, 1fr) auto 44px;
  }

  .c-people,
  .c-dur {
    display: none;
  }

  /* Every filter row, not just the page header's (Memory's kind filter
     sits below the header) — otherwise it widens the page at 390px. */
  .segs {
    max-width: 100%;
    overflow-x: auto;
  }

  .seg {
    white-space: nowrap;
  }

  .callout {
    flex-wrap: wrap;
  }

  .callout button {
    margin-left: 30px;
  }
}

/* ---------- Meeting detail page (/app/meetings/{id}) — 008 ticket 03
   rebuilt to the approved v2 mockup: header with provenance pills and a
   ⋯ menu, four tabs, the card-based Summary, and the sticky right rail
   (draft card, player, evidence). The tokens flip in the dark-mode block
   at the top, so none of these rules need a dark-mode block of their
   own. */

.meeting-head {
  align-items: flex-start;
  margin-bottom: 0;
}

.meeting-head-main {
  min-width: 0;
}

.header-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

/* The provenance pills — the mockup's .prov row. Its pills carry the
   leading dot and the borderless soft fill (the same pill look the
   Inbox's Status column uses; ticket 06 settles the rest of the app). */
.prov {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.prov .pill {
  border-color: transparent;
  gap: 6px;
}

.prov .pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.error-line {
  margin: 0.625rem 0 0;
  font-size: 0.875rem;
  color: var(--danger);
}

.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;
}

#meeting-status {
  min-height: 1.5em;
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

#meeting-status.error {
  color: var(--danger);
}

#processing-view p,
#not-found-view p {
  margin: 0 0 0.75rem;
}

#open-process-dialog {
  margin-top: 0.25rem;
}

/* The mockup's tab row: underline tabs on a hairline. Real buttons
   carrying aria-selected; the page's own JS drives it from the URL hash
   (#chat and #audio still land — on Ask and Summary). */
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  /* overflow-x: auto forces overflow-y to auto too, and the active tab's
     -1px underline overlap then shows a stray vertical scrollbar. */
  overflow-y: hidden;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  margin: 20px 0;
}

button.tab {
  border: 0;
  background: none;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: max-content;
}

button.tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--brand);
}

.tabs .tab .icon {
  width: 16px;
  height: 16px;
}

/* The Tasks tab's count badge. */
.tab .n {
  font-size: 12.5px;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 999px;
  padding: 0 7px;
}

/* The Tasks tab's review bar (009 ticket 01): what the meeting's
   "Review Tasks" status is waiting on, with the bulk action beside it.
   It wraps on a phone rather than squeezing either side. */
#tasks-review-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 12px;
}

#tasks-review-summary {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
}

/* The action-items card's hint (009 ticket 01): hugs its title, keeps
   the list's top gap. */
#action-items-hint {
  margin: -6px 0 10px;
}

.tab-panel {
  min-width: 0;
}

#summary-actions {
  margin: 0 0 0.75rem;
}

#brief-summary {
  margin: 0;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.65;
}

/* The base item-list (Memory pages use it too): quiet boxed rows. The
   cards' rows restyle their own lists below. */
.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4375rem;
}

.item-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
}

.item-body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
  flex: 1;
}

.item-role {
  font-size: 0.8125rem;
  color: var(--text-3);
}

/* ---------- The meeting cards' item rows (008 ticket 03) ----------
   The mockup's .items/.item rows: transparent rows on the card surface
   that pick up a hover fill, a checkbox column, the text with its sub2
   line, and the trailing actions/menu. Scoped to .mcard so the Memory
   pages' boxed rows stay as they are until ticket 06 settles them. */

.mcard .item-list {
  gap: 2px;
}

.mcard .item-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 0.5rem;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 8px;
}

.mcard .item-list li:hover,
.mcard .item-list li:focus-within {
  background: var(--surface-2);
}

/* The row whose evidence is open (the mockup's .item.selected). */
.mcard .item-list li.selected {
  background: var(--brand-soft);
}

/* The labelled pill rows: Decision (green) and Objection (warn). The
   pill keeps its own width; the text block takes the rest. */
.mcard .item-list li.labeled .pill {
  margin-top: 2px;
}

/* The text-and-sub2 column the checkbox/pill row shares: the swap-able
   editor lives in the wrap, the sub2 line beside it (its own sibling, so
   editor rebuilds never wipe it). */
.mcard .item-mid {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mcard .sub2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- The Detailed Summary card (ticket 010-02) ----------
   The Brief's topic-by-topic recap: one block per section — heading,
   text, and the shared sub2 line (timestamp chip, Unverified tag) —
   separated by hairline rules rather than boxed rows, so the card reads
   as one continuous document. "Show all" and the generate button tuck
   under the sections like any other card footer. */
.detailed-sections {
  list-style: none;
  margin: 0;
  padding: 0;
}

.detailed-section {
  padding: 10px 0;
}

.detailed-section + .detailed-section {
  border-top: 1px solid var(--border);
}

.detailed-section h3 {
  margin: 0;
  font-size: 14px;
}

.detailed-text {
  margin: 4px 0 0;
  color: var(--text-2);
}

#detailed-summary-more,
#detailed-summary-generate {
  margin-top: 10px;
}

/* ---------- The rail's draft card (008 ticket 03) ---------- */

.draft-card {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
}

.draft-card h2 {
  margin: 4px 0 0;
}

.kicker {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.draft-lede {
  margin: 6px 0 14px;
  color: var(--text-2);
  font-size: 14px;
}

/* The mockup's full-width primary button on the draft card. */
#generate-draft {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.draft-state-note {
  margin: 8px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
}

/* ---------- The rail player (008 ticket 03) ---------- */

.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-btn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  display: grid;
  place-items: center;
  flex: none;
}

.play-btn:hover {
  background: var(--brand-hover);
}

.play-btn .icon {
  width: 18px;
  height: 18px;
}

/* The seekable track: a native range (keyboard-operable) themed with the
   brand accent — no filled-track tricks, nothing inline for the CSP to
   trip on. The overrides shed the pairing page's code-entry input look. */
#player-seek {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  accent-color: var(--brand);
  letter-spacing: normal;
  text-align: left;
  font-variant-numeric: normal;
}

.player-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-3);
  margin-top: 6px;
}

.speed-btn {
  min-height: 0;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}

.speed-btn:hover {
  background: var(--surface-3);
}

/* ---------- The detail grid and its rail (008 ticket 03) ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.detail-main {
  min-width: 0;
}

.rail {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* The rail spaces its cards with the flex gap — the sibling margin rule
   above would double it. */
.rail .mcard {
  margin-top: 0;
}

@media (max-width: 1100px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
  }
}

/* The not-done view keeps ticket 006-07's behaviour, in the card look. */
#processing-view {
  margin-top: 1.25rem;
}

#processing-view p,
#not-found-view p {
  margin: 0 0 0.75rem;
}

/* ---------- The Transcript tab (008 ticket 04) ---------- The mockup's
   transcript: one card of seg-line rows — timestamp pill, Speaker name in
   their colour, spoken text — with the line being spoken highlighted and
   search matches wrapped in <mark>. */

.segment-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  display: grid;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.seg-line {
  display: grid;
  grid-template-columns: 64px 110px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

/* The grid's columns assume both leading cells; a segment missing one
   shifts the spoken text into its place. */
.seg-line.no-ts {
  grid-template-columns: 110px minmax(0, 1fr);
}

.seg-line.wholess {
  grid-template-columns: 64px minmax(0, 1fr);
}

.seg-line.plain {
  grid-template-columns: minmax(0, 1fr);
}

.seg-line:hover {
  background: var(--surface-2);
}

/* The line being spoken (the follow-along's highlight). */
.seg-line.now {
  background: var(--brand-soft);
}

.seg-line .timestamp {
  justify-self: start;
  align-self: start;
}

.segment-speaker {
  font-weight: 700;
  font-size: 0.84375rem;
}

/* One colour per Speaker (the --spk-1..4 cycle), on the name here and on
   the chip above. The --info default stays only as a never-hit fallback:
   every rendered label comes from the map. */
.segment-speaker.spk-1 {
  color: var(--spk-1);
}

.segment-speaker.spk-2 {
  color: var(--spk-2);
}

.segment-speaker.spk-3 {
  color: var(--spk-3);
}

.segment-speaker.spk-4 {
  color: var(--spk-4);
}

.segment-text {
  display: block;
  font-size: 0.90625rem;
  line-height: 1.55;
}

/* A search match: the mockup's attention-coloured wash. */
.seg-line mark {
  background: color-mix(in srgb, var(--attention) 30%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* The mockup's narrow seg-line: timestamp pill and text share the row,
   the Speaker name drops above the text. */
@media (max-width: 860px) {
  .seg-line {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .seg-line .segment-speaker,
  .seg-line .segment-text {
    grid-column: 2;
  }

  .seg-line.no-ts,
  .seg-line.plain {
    grid-template-columns: minmax(0, 1fr);
  }

  .seg-line.no-ts .segment-speaker,
  .seg-line.no-ts .segment-text,
  .seg-line.plain .segment-speaker,
  .seg-line.plain .segment-text {
    grid-column: auto;
  }
}

.transcript-search {
  margin-bottom: 0.875rem;
  /* The search input and its Export .txt button share one row
     (ticket 007-02, relabelled to the mockup's wording by 008 ticket 04);
     the visually-hidden label takes no space. */
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.transcript-search input {
  /* flex sizing shares the row with the Export .txt button; the
     shared input rule's width: 100% stays harmlessly as the flex basis. */
  flex: 1 1 auto;
  min-width: 0;
}

.transcript-search button {
  white-space: nowrap;
}

/* Form inputs on this page read as normal text fields — the global input
   rule is the pairing page's code entry (centered, letter-spaced), which
   no other page wants. */
#metadata-form input,
.transcript-search input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  letter-spacing: normal;
  text-align: left;
  font-variant-numeric: normal;
}

#metadata-form {
  margin: 0 0 1.25rem;
}

.form-actions {
  display: flex;
  gap: 10px;
}

#not-found-view a {
  color: var(--brand);
}

/* The Free-tier state and the empty Inbox wear the shared .empty card
   (008 ticket 06's components section) — their old id rules are gone. */

/* ---------- Settings page (/app/settings/) ---------- */

.pair-code {
  margin: 1.25rem 0 0.25rem;
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pair-code.expired {
  color: var(--text-3);
}

button.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

button.secondary:hover {
  background: var(--surface-2);
}

button.small {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

button.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

button.danger:hover {
  background: var(--danger-soft);
}

/* ---------- Brief editing, Tasks tab, evidence drawer (web-parity
   ticket 05) ----------
   Ported from the mockup's Meeting Detail evidence drawer (.evidence,
   .quote, .split) onto this app's tokens. The tokens flip in the
   dark-mode block above, so none of these rules need a dark-mode block
   of their own. */

/* Item rows with a checkbox and actions line up from the top; the
   clickable text block takes the remaining width. */
.item-list li.rich {
  align-items: flex-start;
}

.item-row-main-wrap {
  flex: 1;
  min-width: 0;
}

/* The item's text is the row's evidence opener on the detail page (a
   real button styled as plain text, the way the iPhone's row text reads);
   on the Tasks page there is no drawer, so the same block renders as a
   plain div — the styles below cover both. */
button.item-row-main,
div.item-row-main {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 400;
  text-align: left;
}

button.item-row-main {
  cursor: pointer;
}

.item-row-main .item-text {
  display: block;
}

button.item-row-main:hover .item-text {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The iPhone renders a done action item secondary + strikethrough. */
.item-text.done {
  text-decoration: line-through;
  color: var(--text-3);
}

/* A Task/Decision's evidence quote, shown in its row as on the iPhone
   (independentItemRow's italic subheadline). */
.item-quote {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-style: italic;
  font-size: 0.8125rem;
  line-height: 1.4;
}

/* The checkmark button itself is the shared components section's
   canonical rounded-square checkbox (008 ticket 06). */

.item-actions {
  flex: none;
  display: flex;
  gap: 6px;
}

/* The shared inline text editor (action items and Tasks/Decisions). */
form.inline-editor {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.inline-editor input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.625rem;
  font-size: 0.9375rem;
  letter-spacing: normal;
  text-align: left;
  font-variant-numeric: normal;
}

.inline-editor-buttons {
  display: flex;
  gap: 6px;
}

.inline-editor .error-line {
  flex-basis: 100%;
  margin: 0;
}

/* The evidence drawer itself: the mockup's right-column panel (its
   .panel.alt with an .evidence block inside). */
.evidence-drawer {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: grid;
  gap: 10px;
  font-size: 0.8125rem;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-head strong {
  font-size: 0.90625rem;
}

.drawer-item-text {
  margin: 0;
  font-size: 0.90625rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.drawer-evidence {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.drawer-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.drawer-quote {
  margin: 0;
  color: var(--text-3);
  font-style: italic;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* "No quote recorded" reads as a statement, not a quotation. */
.drawer-quote.none {
  font-style: normal;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The drawer parked below a row on narrow screens: a plain wrapper <li>,
   stripped of the list's card look. */
.item-list li.drawer-holder {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* ---------- Follow-up Draft (web-parity ticket 06, ADR 0003) ----------
   The primary action lives in the rail's card on every tab (008 ticket
   03); the card's look is up in the rail section. */

#draft-body {
  width: 100%;
  min-height: 9rem;
  resize: vertical;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.55;
  letter-spacing: normal;
  text-align: left;
}

#draft-body:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* The clipboard note after a too-long-for-mailto send. */
.draft-note {
  margin: 10px 0 0;
  font-size: 0.875rem;
  color: var(--brand);
}

.mark-sent-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.mark-sent-row p {
  margin: 0 0 8px;
  font-size: 0.875rem;
}

.draft-sent-line {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand);
}

#draft-sent-body {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.90625rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ---------- Process Meeting dialog (web-parity ticket 07) ----------
   The iPhone's ProcessMeetingSheet and the mockup's Process screen,
   ported onto the v2 token set (--surface / --surface-2 / --border,
   008 ticket 01). The tokens flip in the dark-mode block at the top, so
   none of these rules need a dark-mode block of their own. */

dialog.process-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: 1.25rem;
  width: min(26rem, calc(100vw - 40px));
  box-shadow: var(--shadow);
}

dialog.process-dialog::backdrop {
  background: rgba(23, 33, 27, 0.45);
}

.process-dialog h2 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.process-dialog select {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  width: 100%;
}

.process-dialog .muted {
  margin: 0.25rem 0 0;
}

.process-dialog .muted a {
  color: var(--brand);
}

/* The re-transcribe toggle must not inherit the pairing page's
   code-entry input look (centered, letter-spaced). */
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0.25rem;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.process-dialog input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
  padding: 0;
  letter-spacing: normal;
  accent-color: var(--brand);
}

.process-card {
  margin-top: 0.75rem;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  gap: 4px;
}

.process-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.process-card-head h3 {
  margin: 0;
  font-size: 0.78125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.process-card strong {
  font-size: 0.9375rem;
}

.process-card p {
  margin: 0;
}

.process-warn {
  color: var(--attention);
  font-size: 0.875rem;
  font-weight: 600;
}

.process-actions {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}

.process-actions button {
  flex: 1;
}

/* ---------- AI Setup page (/app/ai-setup/) ----------
   The web's Manage Processing Methods (web-parity ticket 07): the
   iPhone's Form rows ported onto this app's tokens. The tokens flip in
   the dark-mode block above, so none of these rules need a dark-mode
   block of their own. */

.method-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5625rem;
}

.method-list li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.875rem;
  display: grid;
  gap: 2px;
}

.method-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.method-name {
  font-weight: 700;
  font-size: 0.90625rem;
  margin-right: auto;
}

.method-base-url,
.method-detail {
  font-size: 0.8125rem;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/* The Add forms' fields read as normal text fields — the global input
   rule is the pairing page's code entry (centered, letter-spaced). */
.setup-form input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  letter-spacing: normal;
  text-align: left;
  font-variant-numeric: normal;
}

/* ---------- Chat tab + Speaker rename (web-parity ticket 08) ----------
   The iPhone's MeetingChatView (user bubble right in the tint, answer
   left with evidence quotes and the ungrounded badge) and SpeakersView's
   rename row, ported onto this app's tokens. The tokens flip in the
   dark-mode block above, so none of these rules need one of their own. */

.chat-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.chat-log li.user {
  display: flex;
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(72ch, 88%);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  font-size: 0.90625rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.chat-bubble p {
  margin: 0;
}

.chat-text {
  white-space: pre-wrap;
}

/* The tinted question bubble. The accent flips with dark mode, so the
   text follows --bg and keeps its contrast in both schemes. */
.chat-log li.user .chat-bubble {
  background: var(--brand);
  color: var(--on-brand);
}

.chat-log li.assistant .chat-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  gap: 6px;
  justify-items: start;
}

.chat-log li.pending .chat-bubble {
  border-style: dashed;
  color: var(--text-3);
}

.chat-badge {
  margin-top: 2px;
}

/* One evidence entry: the clock timestamp over the verbatim quote,
   italic and secondary — the iPhone's evidenceRow. A button when the
   Meeting has a Recording (it seeks and plays); otherwise plain text. */
.chat-evidence {
  display: grid;
  gap: 2px;
}

p.chat-evidence {
  margin: 0;
}

button.chat-evidence {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.chat-evidence:hover .chat-evidence-quote {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chat-evidence-time {
  font-size: 0.78125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.chat-evidence-quote {
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--text-3);
}

.chat-form {
  /* The global form rule is a column (the pairing page's stacked
     fields); the chat bar is a row. */
  flex-direction: row;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 1rem;
}

.chat-form textarea {
  flex: 1;
  min-height: 2.75rem;
  max-height: 12rem;
  resize: vertical;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  letter-spacing: normal;
  text-align: left;
}

.chat-form textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

/* The Speakers row above the transcript: one chip per distinct label,
   each with its Rename action and — ticket 007-01 — that Speaker's own
   excerpts, so the labels can be told apart before naming. The editor
   takes the row's full width; the excerpts stay beneath it either way. */
.speakers-row {
  margin-bottom: 0.875rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.speakers-title {
  font-size: 0.78125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.speakers-list {
  list-style: none;
  margin: 0.375rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px 14px;
}

/* One chip is a column: the label + Rename head line, excerpts beneath. */
.speakers-list li {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.speaker-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.speakers-list li.renaming {
  flex-basis: 100%;
}

.speaker-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--info);
}

/* The Speaker's colour (008 ticket 04): the chip's dot and its name share
   the colour the Speaker's transcript lines carry, so the chips and the
   lines read as one. */
.chip-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}

.chip-dot.spk-1 {
  background: var(--spk-1);
}

.chip-dot.spk-2 {
  background: var(--spk-2);
}

.chip-dot.spk-3 {
  background: var(--spk-3);
}

.chip-dot.spk-4 {
  background: var(--spk-4);
}

.speaker-name.spk-1 {
  color: var(--spk-1);
}

.speaker-name.spk-2 {
  color: var(--spk-2);
}

.speaker-name.spk-3 {
  color: var(--spk-3);
}

.speaker-name.spk-4 {
  color: var(--spk-4);
}

/* One excerpt under a Speaker label: the clock timestamp over the
   truncated segment text — the chat evidence entry's visual language.
   A button when the Meeting has a Recording (it seeks and plays);
   otherwise plain text. */
.speaker-excerpts {
  display: grid;
  gap: 4px;
}

.speaker-excerpt {
  display: grid;
  gap: 1px;
}

p.speaker-excerpt {
  margin: 0;
}

button.speaker-excerpt {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.speaker-excerpt:hover .speaker-excerpt-text {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.speaker-excerpt-time {
  font-size: 0.78125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.speaker-excerpt-text {
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--text-3);
}

.speakers-note {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
}

/* ---------- Memory & People pages (web-parity ticket 10, ADR 0015) ----------
   The mockup's Memory screen: the sub-nav as the shared segmented filter
   (008 ticket 06's components), the entity rows as the shared card rows,
   and the profile's fact/evidence blocks. The tokens flip in the
   dark-mode block above, so none of these rules need a dark-mode block
   of their own. */

/* The entity rows (Memory's list, People's) on a card: the row's link
   fills it — title left, kind pill right (the .meeting-top pair) — and
   the hover fill comes from the shared card-row rule. */
.item-list a.meeting-link {
  flex: 1;
  min-width: 0;
  display: block;
  color: inherit;
  text-decoration: none;
}

/* A fact row's quiet header line: clock, status pill, the Pinned marker,
   or a timeline date. */
.fact-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.fact-clock {
  font-size: 0.78125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

/* One evidence entry inside a fact or commitment row: the source moment
   and verbatim quote, boxed like the drawer's .drawer-evidence. */
.fact-evidence {
  margin-top: 0.375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.fact-evidence-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.fact-evidence .item-quote {
  margin: 0;
}

/* Meeting references (evidence sources, timeline rows, commitments'
   "From" lines): the iPhone shows the raw id; here the same reference
   resolves to the meeting's label (title, or date) and links to its
   page. */
.fact-meeting-link {
  color: var(--info);
  font-size: 0.78125rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.fact-meeting-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Pricing page (/app/pricing/) (web-parity ticket 11) ----------
   The mockup's Pricing screen: plan cards in a row (.plans / .plan /
   .price), ported onto the v2 token set (008 ticket 01). The tokens
   flip in the dark-mode block at the top, so none of these rules need a
   dark-mode block of their own. The card contents' copy is the iPhone's,
   not the mockup's. */

#pricing-status {
  min-height: 1.5em;
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

#pricing-status.error {
  color: var(--danger);
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 0.75rem;
}

.plan {
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

/* The mockup's .plan.featured highlight — Personal, the tier the iPhone
   heads with a "Popular" pill. */
.plan.featured {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.plan-head,
.plan-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.plan-name {
  font-weight: 700;
}

.price {
  font-size: 1.375rem;
  font-weight: 800;
}

.plan ul {
  margin: 0;
  padding-left: 17px;
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.plan li {
  margin-bottom: 4px;
}

/* The live "used of cap" readouts under the current plan — the iPhone's
   subheadline Label lines, warn-colored when the server's near_cap
   verdict says so. */
.plan-usage {
  display: grid;
  gap: 4px;
}

.plan-usage-line {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.plan-usage-line.warn {
  color: var(--attention);
  font-weight: 600;
}

/* Card footnotes — the non-selectable Tiers' "Not yet available" line
   and Pro's hours note (the iPhone's cardNote). */
.plan-note {
  margin: 0;
  color: var(--text-3);
  font-size: 0.78125rem;
}

#current-plan h2 {
  margin: 0;
}

#current-plan p {
  margin: 0.25rem 0 0;
}

#current-plan .plan-usage,
#current-plan .button-row {
  margin-top: 0.75rem;
}

#plan-message {
  margin: 0.75rem 0 0;
}

/* ---------- Cross-meeting Tasks page (/app/tasks/) (web-parity ticket
   09, ADR 0015) ---------- The mockup's web-only Tasks screen: the sidebar
   entry's page groups every owned Task by Meeting. Rows are the shared
   task-rows module's output, so they need no styles of their own; the
   status filter reuses the Memory page's filter pills. The tokens flip in
   the dark-mode block above, so none of these rules need a dark-mode
   block of their own. */

.task-group {
  margin-bottom: 1.25rem;
}

/* The mockup's .group h3: small heading row — Meeting title as a
   brand-coloured link, followed by "· <date>" in muted text. */
.task-group h3 {
  font-size: 13.5px;
  margin: 0 0 8px;
  color: var(--text-2);
  display: flex;
  gap: 8px;
  align-items: center;
}

a.task-group-head {
  color: var(--brand);
  text-decoration: none;
}

a.task-group-head:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.task-group-sep {
  color: var(--text-3);
}

/* Swipeable strips (the phone nav, the filter segments) scroll without a
   visible scrollbar eating their height. */
.segs, .side { scrollbar-width: none; }
.segs::-webkit-scrollbar, .side::-webkit-scrollbar { display: none; }

.timestamp-static { cursor: default; color: var(--text-3); }

/* ---------- Sign-in page and Account settings (018-11) ---------- */

.method-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 1rem;
}

/* The base input is the big centred code field; an email or a typed
   confirmation reads better left-aligned at normal size. */
input.text-input {
  font-size: 1rem;
  letter-spacing: normal;
  text-align: left;
}

.settings-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.settings-list li {
  padding: 0.375rem 0;
}

.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

a.button-link {
  display: inline-block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}

a.button-link:hover {
  background: var(--brand-hover);
}

#account-status.error,
#add-method-status.error,
#devices-status.error,
#delete-status.error {
  color: var(--danger);
}
