/* Responsive breakpoints (Nov 12, 2026; see
   ~/workspace/mikesdash-overhaul/responsive-breakpoints.md):
   phone < 640px (base, one column, bottom nav), tablet 640-1024px
   (.wrap 800px, 2 columns where they fit), desktop > 1024px
   (.wrap 1180px, 2-3 columns, top nav instead of bottom nav).
   Rules live in the RESPONSIVE section at the end of this file.
   Version: 20261112k (responsive rebuild + Log JS syntax repair). */
/* MikesDash LCARS token set and shared shell. Wave 4, plan task W3.
   Source of truth: org/refactor-theme.md section 2. Token conflicts
   were resolved in favor of the Daily Log stylesheet
   (~/workspace/captains-log/lcars.css, 653 lines, verified Nov 11).
   Retired values (workout orange #ff9f1c, purple #cc99ff, blue #99ccff,
   pink #ff99cc, 6px card left border, 3px header border, 10px rounded
   strip, pill chips, prototype navy and bright status colors) must
   not reappear in merged code. See README.md for the conflict log.
   Version: 20261112k (responsive rebuild, Nov 12, 2026; was 20261112h Round 3 QA3 fix, Nov 12, 2026: Workout history + warmup Cancel + slimmer stack; Today peek + Inbox overflow; A3/A4, Nov 12, 2026: Today density +
   Journal collapse-by-default; chip one-line fix; collapsed-summary
   chip wrap; nav build 20261112a underneath).
   Bump VERSION on every deploy; see README.md.
   Round 2 additions are in the "ROUND 2 - SHARED DESIGN SYSTEM" section at
   the end of this file: the 13 ported components, the LCARS elbow and
   section bars, Antonio display type, and the contrast fixes. This file
   is the ONLY place hex color literals may appear (freeze rule).
   No em dashes in copy. Use hyphens where a pause is needed.
   No character names in user-facing copy (naming decision B1 pending).
*/

:root {
  /* Core surfaces (Daily Log wins) */
  --bg: #000000;
  --surface: #0d0d14;
  --surface-2: #14141f;
  --surface-3: #1c1c2b;
  --line: #6a6a84;
  --line-soft: #66667e;

  /* Text */
  --text: #f4f4f6;
  --text-muted: #c2c2d1;
  --text-dim: #8f8fa3;

  /* Theme palette */
  --theme-orange: #ff9f00;
  --theme-orange-deep: #e07f00;
  --theme-peach: #ffcc99;
  --theme-peach-soft: #f9c784;
  --theme-purple: #9b8cd9;
  --theme-purple-deep: #6a5cb0; /* SEL-1 (QA5 A2): deepened from #7a6cc0; white text on it is now 5.57:1, was 4.44:1. */
  --theme-blue: #5a8ac6;
  --theme-blue-soft: #8ab4e0;
  --theme-blue-pale: #c7d8f0;
  --theme-lilac: #cc99cc;
  --alert: #cc0000;

  /* Mode accents: set by body[data-mode] below */
  --accent: var(--theme-orange);
  --accent-deep: var(--theme-orange-deep);
  --accent-soft: var(--theme-peach);
  --accent-bg: #2b1d0a;

  /* Status: kept muted so the theme stays calm */
  --ok: #7fb069;
  --ok-bg: #16281a;
  --warn: var(--theme-peach-soft);
  --stale-bg: #2b1d0a;
  --danger: #d96a5a;
  --danger-bg: #2b1414;
  --stored-bg: #2a2a3d;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Display face (Antonio, OFL, self-hosted in static/fonts/): H1,
     section labels, and nav only. Body and data stay in system sans. */
  --font-display: "Antonio", "Arial Narrow", sans-serif;

  /* Shape: one list radius, one control radius, named exceptions only */
  --unit: 8px;
  --margin: 16px;
  --radius-list: 16px;
  --radius-control: 12px;
  --radius-table: 12px;
  --row: 64px;
  --primary-h: 56px;
  --link-h: 44px;
  --divider: 1px solid var(--line-soft);

  /* Tap targets */
  --tap-min: 56px;
  --tap-floor: 44px;
}

/* Morning. Warm orange and peach. This mapping was chosen by Mike
   (Nov 6-7) and is not reversible without his say-so. The swap note
   from the Daily Log stylesheet applies here too: to restore the old
   mapping, swap the --accent, --accent-deep, --accent-soft, and
   --accent-bg values between the morning block and the evening block
   below. That is one block swap, in this file only. */
body[data-mode="morning"] {
  --accent: var(--theme-orange);
  --accent-deep: var(--theme-orange-deep);
  --accent-soft: var(--theme-peach);
  --accent-bg: #2b1d0a;
}

/* Evening. Muted purple. */
body[data-mode="evening"] {
  --accent: var(--theme-purple);
  --accent-deep: var(--theme-purple-deep);
  --accent-soft: #d9d2f5;
  --accent-bg: #1d1933;
}

/* Neutral. Muted blue. Default for Today, Money, Health, Training,
   System, and any page that is neither morning nor evening. Orange
   and purple mean a time of day, never generic decoration. */
body[data-mode="neutral"] {
  --accent: var(--theme-blue);
  --accent-deep: var(--theme-blue);
  --accent-soft: var(--theme-blue-pale);
  --accent-bg: #122033;
}

/* Standards and code views: same neutral blue as body[data-mode="neutral"].
   Kept as an alias so Daily Log markup using data-mode="code" needs
   no change. */
body[data-mode="code"] {
  --accent: var(--theme-blue);
  --accent-deep: var(--theme-blue);
  --accent-soft: var(--theme-blue-pale);
  --accent-bg: #122033;
}

/* Base */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Header height plus 16px, so no card ever rests under the header. */
  scroll-padding-top: 112px;
  scroll-padding-bottom: 144px; /* Round 3 nav: worst-case fixed stack
    (action row + tabs) is ~135px incl. breathing room; anchor scrolls
    must clear it on bar pages too. QA3 D3 slimming, 2026-11-12: the
    stack was ~152px; the slimmer action row + nav below bring it to
    ~117px, so 144px keeps the same margin. */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); /* SAFE-1: bottom-bar clearance grows with the notch inset; env() is 0 on desktop. */
  overflow-x: clip;
  font-variant-numeric: tabular-nums;
}
/* Round 3 nav (2026-11-12): the fixed stack is always present except
   on login (.no-bottombar). Nav-only pages keep the 96px default
   above (60px stack + breathing room). When the action row is
   visible the stack is ~117px (QA3 D3 slimming, 2026-11-12: action row
   72 -> 60, nav 60 -> 56), so the clearance grows to 135px.
   The old rule zeroed padding whenever EITHER bar was .hidden - with
   both rows in one stack that stranded content under the visible nav
   whenever the action row hid (Log menu views, workout Program view). */
body:has(.bottombar:not(.hidden)) { padding-bottom: calc(135px + env(safe-area-inset-bottom, 0px)); }
body.no-bottombar { padding-bottom: 0; }

a { color: var(--theme-blue-soft); }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--theme-peach);
  outline-offset: 2px;
}

::selection { background: var(--theme-purple-deep); color: #fff; } /* SEL-1: 5.57:1 with the deepened purple. */

/* Disclosure rows (SUM-1, QA5 A1 / QA1 D-03): every <summary> meets the
   44px tap floor. Bare summaries were ~26px; 10px vertical padding plus
   min-height 44px lifts them to the floor. Classed summaries keep their
   own values: .pick-row sets 64px and .link-action sets 44px, and both
   beat this element rule by specificity. */
summary {
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
  cursor: pointer;
}

/* Layout: one narrow column, phone first, 16px side margins always */
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; }
main { display: flex; flex-direction: column; gap: 32px; }
main section { display: flex; flex-direction: column; gap: 32px; scroll-margin-top: 112px; }

/* Settings panel visibility (Round 3 QA3 fix, 2026-11-12): Settings
   showTab() toggles the hidden attribute on <section class="panel">,
   but `main section { display: flex }` above beats the browser's
   built-in [hidden] rule, so hidden panels kept rendering. This rule
   (higher specificity) beats it back, so only the picked panel shows. */
section.panel[hidden] { display: none; }

/* Headings: 28px H1, 20px H2, 17px H3, 13px uppercase labels, nothing centered */
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 700; text-align: left; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }

p { margin: 0; }
.lede { color: var(--text-muted); font-size: 17px; }
.small { font-size: 14px; color: var(--text-dim); line-height: 1.45; }
.label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
}
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.05em; }
.muted { color: var(--text-muted); font-size: 14px; }
#morningStandardDesc:empty, #eveningStandardDesc:empty, #eveningDoneStandardDesc:empty { display: none; }

/* Theme strip: thin colour bars, 4px high, a divider line not a bubble.
   One strip per screen, directly under the header, never repeated per card. */
.theme-strip { display: flex; gap: 8px; height: 4px; }
.theme-strip span { flex: 1 1 0; height: 4px; }
.theme-strip .s-orange { background: var(--theme-orange); }
.theme-strip .s-peach { background: var(--theme-peach); }
.theme-strip .s-purple { background: var(--theme-purple); }
.theme-strip .s-blue { background: var(--theme-blue); }

/* Header: solid black, fixed shape, 1px bottom border, never transparent */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #000000;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.top h1 { font-size: 28px; margin: 0; line-height: 1.3; letter-spacing: 0.02em; }
.top h1 span { color: var(--accent); }
.top p { margin: 0; color: var(--text-muted); font-size: 14px; }
.top-meta { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.top-meta p { white-space: nowrap; }

/* Why line (Daily Log, Nov 12, 2026): one quiet muted line in the
   header, wrapping to two lines at phone width. No card, no border,
   no accent colour, so it reads as a reminder, not a banner. */
.why-line { font-size: 13px; color: var(--text-muted); line-height: 1.4; margin: 2px 0 0; }

/* Header row (Round 3 nav, 2026-11-12): the H1 and the 44px hamburger
   share one row. The old .top-nav row (5 text links + a More button
   that took a whole row on phones) is gone: the 5 tabs live in the
   fixed bottom nav on every page, and the hamburger opens the More
   sheet (Sections + rest). The H1 flexes and may wrap; the button
   never shrinks below its 44px tap target, at 390px or 430px. */
.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.head-row h1 { flex: 1 1 auto; min-width: 0; }
.menu-btn {
  flex: 0 0 auto;
  width: 44px; height: 44px; min-height: 44px;
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  padding: 0;
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-control);
  cursor: pointer;
}
.menu-btn .bar {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 1px;
  transition: transform .15s ease, opacity .15s ease, background-color .15s ease;
}
/* Open state: the three bars become an X, so Close is obvious without
   scrolling to the sheet's Close button. */
.menu-btn[aria-expanded="true"] { border-color: var(--accent); }
.menu-btn[aria-expanded="true"] .bar { background: var(--accent-soft); }
.menu-btn[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Cards: 1px border all sides, 16px padding, 16px gap, no accent bar */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-list);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 112px;
}
.card.accent-card { border: 1px solid var(--line-soft); }
.card h2 + p, .card h3 + p { color: var(--text-muted); }

/* Card head: title line with an as-of chip at the right when it fits,
   otherwise on its own line below the title, left-aligned. */
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.card-head h2, .card-head h3 { flex: 1 1 auto; }

/* As-of chips (theme spec section 2.7). Every number wears its date.
   Anatomy: 13px / 700, mono date, radius 4px (not a pill), 1px border,
   padding 0 8px, text "<prefix> <Mon D> · <age>". Freshness is never
   color alone: the chip always carries the date and age in words.
   Levels: fresh under 48h, stale 48h to 14d, dead over 14d, stored
   for reference data and archives (never a freshness color). */
/* D-NEW-1 (2026-11-11): as-of chips wrap. The old inline-flex +
   nowrap rule let one long chip (Oura OAuth "as of Dec 11 - in the
   future (check the stored date)", 425px) push /system 68px past a
   390px viewport. inline-block + normal white-space + anywhere
   wrapping + max-width 100% keeps every chip inside its container
   at every width; box-sizing is border-box (line 115), so padding
   and border stay inside the 100%. */
.asof {
  display: inline-block;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.asof-fresh { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
.asof-stale { color: var(--warn); background: var(--stale-bg); border-color: var(--warn); }
.asof-dead { color: var(--danger); background: var(--danger-bg); border-color: var(--danger); }
.asof-stored { color: var(--text-muted); background: var(--stored-bg); border-color: var(--text-dim); } /* STORED-1: --text-dim on --stored-bg is 4.43:1, was 2.68:1 with --line. */
/* Compact tile chip: level color plus relative age only, used when the
   tile sub already prints the as-of date in words. One fact once. */
.asof-compact { font-size: 13px; }
/* Tile chip sits inside the stat, below the sub, as the last element. */
.stat .asof { margin-top: 8px; }

/* Buttons: one primary per screen, in the bottom bar only, radius 12px, never a pill */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--primary-h);
  padding: 8px 24px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #0a0a0f; }
body[data-mode="evening"] .btn-primary { color: #120e24; }
body[data-mode="morning"] .btn-primary { color: #140d02; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost {
  background: transparent;
  color: var(--accent-soft);
  border-color: var(--accent);
  min-height: var(--primary-h);
}
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 140px; }
/* Field row: two inputs side by side (Workout weight/reps, PZ minutes/type).
   The old .row flex geometry, renamed so .row can mean a list item. */
.field-row { display: flex; gap: 16px; }
.field-row > * { flex: 1; min-width: 0; }

/* Level 2: secondary actions are small left-aligned text links only */
.link-action {
  align-self: flex-start;
  background: transparent;
  border: 0;
  color: var(--accent-soft);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  padding: 0;
  min-height: var(--link-h);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: flex;
  align-items: center;
}
.link-stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.link-action:disabled { opacity: 0.45; cursor: default; text-decoration: none; }

/* Forms: one question at a time, big fields, 16px padding */
.field { display: flex; flex-direction: column; gap: 8px; }
label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin: 0;
}
.card > label { margin-top: 0; }

input:not([type]), input[type="text"], input[type="date"], input[type="number"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  min-height: var(--primary-h);
  padding: 16px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
}
textarea { min-height: 112px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-bg);
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* Pick list: one bordered box, rows 64px, 1px dividers, left text.
   This replaces the old chip bubbles. No centred text, no pills. */
.pick-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-list);
  background: var(--surface-2);
  overflow: hidden;
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: var(--row);
  padding: 16px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.pick-list > :last-child { border-bottom: 0; }
.pick-row .pick-text { flex: 1 1 auto; }
.pick-row .pick-check {
  flex: 0 0 auto;
  width: 24px;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  visibility: hidden;
  text-align: center;
}
.pick-row.selected { background: var(--accent-bg); box-shadow: inset 4px 0 0 var(--accent); }
.pick-row.selected .pick-check { visibility: visible; }
.pick-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pick-list.rows-tall .pick-row { min-height: 88px; height: 88px; }
.pick-label-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}

/* Legacy chip names, kept as aliases of the pick list so old markup
   can never render as bubbles again. */
.chips { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-list); background: var(--surface-2); overflow: hidden; }
.chip {
  display: flex; align-items: center; width: 100%; min-height: var(--row);
  padding: 16px; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0;
  background: transparent; color: var(--text); font-family: var(--font);
  font-size: 17px; font-weight: 600; line-height: 1.4; text-align: left; cursor: pointer;
}
.chips > :last-child { border-bottom: 0; }
.chip.selected { background: var(--accent-bg); box-shadow: inset 4px 0 0 var(--accent); }
.text-toggle {
  align-self: flex-start; background: transparent; border: 0; color: var(--accent-soft);
  font-family: var(--font); font-size: 15px; font-weight: 700; text-align: left;
  padding: 0; min-height: var(--link-h); cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

/* Noon note: one bordered box, 16px padding, short text only */
.noon-note {
  display: block;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}
.noon-note[hidden] { display: none; }

/* Missed-day card: quiet, one line of copy, one optional field, one link */
.missed-card .theme-strip { margin-bottom: 0; }

/* Status line: one line, dots and words, no pill ticks */
.status-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); flex-wrap: wrap; }
.status-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: 0 0 auto; }
.status-line .dot.done { background: var(--accent); }
.ticks { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.tick { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; color: var(--text-muted); }
.tick.done { color: var(--accent-soft); }

/* Progress bar: 8px high, radius 4px, no pill shape */
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* AI panel: clearly separate, never mixed into the log itself */
.ai-panel {
  background: var(--surface-2);
  border: 1px dashed var(--theme-blue);
  border-radius: var(--radius-list);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-panel .label { color: var(--theme-blue-soft); }
.ai-output { color: var(--text-muted); font-size: 16px; white-space: pre-wrap; }

/* Stats: 2 by 2 grid, 16px padding, 12px radius */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv div {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
  padding: 16px;
  text-align: center;
}
.kv b { font-size: 24px; line-height: 1.1; display: block; color: var(--accent-soft); }
.kv span { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.stat-row { display: flex; gap: 8px; }
.stat {
  flex: 1 1 0;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
  padding: 16px;
  text-align: center;
}
.stat b { display: block; font-size: 24px; line-height: 1.1; color: var(--accent-soft); }
.stat span { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }

/* Tags are display only, never tappable at this size */
.tag {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-right: 8px;
}

/* Saved practice notes use the same list system */
.labitem {
  width: 100%;
  min-height: var(--row);
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  border-radius: var(--radius-control);
  padding: 16px;
  margin-bottom: 8px;
  cursor: pointer;
}
.labitem.active { border-color: var(--accent); background: var(--accent-bg); }

/* Status: done states use the muted ok token only. Warn is peach. */
.status { font-size: 14px; color: var(--ok); margin-top: 0; }
.status.warn { color: var(--theme-peach-soft); }
.status.dead { color: var(--danger); }

/* Standards list: wrapping textareas, never a single-line input */
ol.code-list { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 16px; }
ol.code-list li { display: flex; flex-direction: column; gap: 8px; }
ol.code-list textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-size: 17px;
  line-height: 1.4;
}
ol.code-list .btn { min-height: var(--primary-h); padding: 8px 16px; align-self: flex-start; }
#standardsMorningInput, #standardsEveningInput { min-height: 64px; }

/* Two-button rows: use .btn-row (same geometry). .row is the row-list
   item now, defined in the Round 2 section below. */

/* History rows */
.history-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
#mPrincipleCustom { margin-top: 8px; }
#labRehearsed { min-height: 144px; }
#dayProgressText { margin: 0; }
#weekSummary { margin-top: 0; }
#exportBtn { margin-top: 0; }
.history-foot { margin-top: 0; }

/* Step label and the one-line nudge. Small, never a panel. */
.step-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin: 0;
}
.nudge-line { font-size: 14px; color: var(--text-muted); margin: 0; }
.nudge-line:empty { display: none; }

/* Morning and evening questions: 20px, bold, left aligned */
#morningQuestion, #eveningQuestion { font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--text); }

/* Evening ratings: one segmented control per check, equal cells.
   The 1px frame is an inset shadow, not a border, so the 56px height
   is the full tap target: a real border would shrink the cells to
   54px (the Daily Log stylesheet has that 2px shortfall; this file
   keeps the Daily Log tokens and fixes only the arithmetic). */
.e-rating { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.rating {
  display: flex;
  height: 56px;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  overflow: hidden;
  margin: 0;
}
.rating button {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.rating button:first-child { border-left: 0; }
.rating button.on,
.rating button[aria-pressed="true"] { background: var(--accent); color: #0a0a0f; }

/* Yes / No: one segmented control, two equal halves */
.yn-row {
  display: flex;
  height: 56px;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  overflow: hidden;
}
.yn-row .btn { flex: 1 1 0; border: 0; border-radius: 0; background: transparent; }
.yn-row .btn + .btn { border-left: 1px solid var(--line-soft); }
.yn-row .btn[aria-pressed="true"] { background: var(--accent); color: #0a0a0f; }

/* Generic segmented control: same shape as the rating and Yes/No
   controls, for any equal-cell choice. Cells are the tap target
   (56px tall control); the control itself is never a button. */
.segmented {
  display: flex;
  height: 56px;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  overflow: hidden;
}
.segmented button {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 8px;
}
.segmented button:first-child { border-left: 0; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: #0a0a0f; }

/* Bottom stack (Round 3 nav, 2026-11-12): ONE fixed chrome unit at the
   foot of every page except login. The action row (bar pages only:
   /log Next + Log menu, /workout Start/Done + Program) sits ABOVE the
   5-tab nav inside the same stack, separated by a 1px divider, so the
   two never read as two stacked 72px bars and the primary can never
   be mistaken for a tab mid-set: tabs sit at the very bottom edge.
   Total: action 72px + tabs 60px = ~132px + safe-area inset. The
   stack's own border-top is the only outer border; the nav's divider
   appears only while the action row is visible. When page JS hides
   the action row (.hidden), the tabs stay put and body padding drops
   back to nav-only via the :has() rule at the top of this file.
   Desktop shows the same stack: the old >=768px rule that hid the
   bottom nav (and relied on the header row for the 5 tabs) is gone
   with the header row itself. Tabs cap at 160px each and centre, so
   a wide screen gets a centred 5-tab bar, not five stretched tabs. */
.bottomstack {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* Action row: the screen's one primary button lives here and nowhere
   else. Static inside the stack (the stack does the fixing).
   QA3 D3 slimming (2026-11-12): row padding 8px -> 6px and the bar's
   buttons 56px -> 48px min-height, so the row is 60px tall (was 72px).
   48px still clears the 44px tap floor; the primary stays the biggest
   touch target on the screen. */
.bottombar {
  position: static;
  background: transparent;
  border-top: 0;
  display: flex;
  gap: 8px;
  padding: 6px 16px;
}
.bottombar .btn { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
.bottombar .btn-primary { flex: 1 1 auto; }
.bottombar .btn-secondary { flex: 0 0 auto; min-width: 96px; }

/* Bottom nav (workout re-skin, theme spec section 2.6): black
   background, 1px top border when it follows the action row (the 3px
   orange border retires), items at least 44px tall, active item in
   accent. The 5 fixed tabs, on every page except login. */
.bottomnav {
  position: static;
  /* Nov 12, 2026 (Log nav fix): the tabs used to sit on the page
     background in muted text, so they read as footer text, not
     navigation - Mike reported "no navigation in the log". The nav
     row now has its own surface and a top border, and inactive tabs
     are full-strength text. The active tab is a pill. */
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding: 6px 16px; /* QA3 D3 slimming (2026-11-12): 8px -> 6px, so the
    nav row is 56px tall (was 60px). Tap floor unchanged (44px). */
}
.bottomstack:has(.bottombar:not(.hidden)) .bottomnav { border-top: 1px solid var(--line-soft); }
.bottomnav a {
  flex: 1 1 0;
  max-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-floor);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
}
.bottomnav a.active { color: var(--accent-soft); background: var(--accent-bg); }

/* Rest bar (workout, in-session only): floating card above the bottom
   nav, orange background, dark text, rest timer plus controls. It is
   a session control, not a page primary, and never appears outside
   an active workout. Ported from the workout inline dialect (Round 2):
   hidden until JS adds .show; the markup stacks a head row, a label,
   and a .minirow of dark .rest-btn buttons. */
/* Rest timer bar (Workout): fixed above the bottom nav. JS shows it by
   removing .hidden, so the base rule is flex, not none; .hidden in the
   utility block does the hiding. Children: label span, .rest-time, and
   plain buttons for +30s / Skip / Pause. */
.restbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(133px + env(safe-area-inset-bottom)); /* Round 3 nav:
    clears the full stack (action row 60 + tabs 56 = 116, +1 border) +
    16px gap. QA3 D3 slimming, 2026-11-12: was 148px against the old
    132px stack. Gap 16 -> 10px and button padding 14 -> 10px also fix
    the QA3 cosmetic nit: at 390px the Pause button overshot the
    viewport by 2px; the bar now has ~40px of slack at 390px.
    The rest bar only shows mid-session, when the action row is
    visible, so the stack is always at full height under it. */
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--theme-orange);
  color: #140d02;
  border-radius: var(--radius-control);
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.restbar .rest-time { font-size: 24px; font-weight: 800; flex: 1; }
.restbar button {
  min-height: var(--tap-floor);
  padding: 8px 10px;
  border-radius: var(--radius-control);
  border: 1px solid #140d02;
  background: transparent;
  color: #140d02;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* More list: one bordered box, rows 64px, 1px dividers, left text */
/* More-sheet group label (NAV-1): on bottom-bar pages the sheet holds
   two groups, Sections (the 5 primaries) then More (secondaries). */
.more-group {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.more-group:first-child { margin-top: 0; }
.more-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-list);
  background: var(--surface-2);
  overflow: hidden;
}
.more-item {
  position: relative;
  width: 100%;
  min-height: var(--row);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 16px 32px 16px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.more-list > :last-child { border-bottom: 0; }
.more-item span { display: block; font-size: 14px; font-weight: 400; color: var(--text-muted); margin-top: 0; }
.more-item .chev {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 20px; font-weight: 700; color: var(--text-dim); display: block; margin-top: 0;
}
.more-item:active { background: var(--accent-bg); }
/* Schedule day rows: compact read-only lines (QA3 D7 fix). The 64px
   .more-item tap-row is for tappable items; a day's pattern lines are
   read-only, so they render one line at 30px (border-box) instead of
   ~64px. Same bordered .more-list box, same 1px dividers. */
.sched-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  min-height: 30px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
}
.sched-row span { display: block; font-size: 14px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }


/* Back to today: a text link, left aligned */
.back-btn { margin-bottom: 0; align-self: flex-start; }
section > .back-btn:last-child { margin-top: 0; margin-bottom: 0; }

.hidden { display: none !important; }

/* Check list: one row per item */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--primary-h);
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-control);
}
.check-item input[type="checkbox"] { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--accent); }
.check-item.done { opacity: 0.72; }
.check-item.done span { text-decoration: line-through; }

/* D-NEW-2 (2026-11-11): skip link and shell footer for base.html
   pages. Same treatment as style.css (.skip, .foot), adapted to the
   lcars tokens; .foot max-width matches the shell .wrap column
   (640px), not the inline-BASE 760px. */
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--surface);
  color: var(--accent); padding: 10px 14px; border-radius: 0 0 10px 0; z-index: 50;
  font-weight: 700; font-size: 14px;
}
.skip:focus { left: 0; }
.foot { max-width: 640px; margin: 8px auto 0; padding: 10px 16px; color: var(--text-muted); font-size: 13px; line-height: 1.6; }

/* Footer */
.footer {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Sync state line (workout): 13px, surface bg, line border, radius
   4px, never a 99px pill. Offline state in warn. */
.sync-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.sync-state.offline { color: var(--warn); }

@media (prefers-contrast: more) {
  :root { --text-muted: #d8d8e2; --text-dim: #b5b5c6; --line: #6a6a84; }
  .card, .check-item, .stat { border-width: 2px; }
}

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

/* Small phones: keep one column, never squeeze two columns */
@media (max-width: 380px) {
  body { font-size: 16px; }
  h1 { font-size: 24px; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { flex: 1 1 auto; }
}

/* Larger screens: same column, just centered and calmer */
@media (min-width: 700px) {
  .wrap { padding-top: 32px; }
  h1 { font-size: 32px; }
}

/* ================================================================
   ROUND 2 - SHARED DESIGN SYSTEM (theme lead, Nov 11, 2026)
   One stylesheet for every page. The 13 ported components from the
   design-system audit (file 09 section 6.3), the LCARS geometry that
   was missing (header elbow, color-block section headers, Antonio
   display type), and the contrast / type-floor fixes.
   Rules: no hex literal may appear anywhere except this file; no
   pill radii (20px) anywhere; nothing under 13px; body 17px/1.55.
   Daily Log is the reference page: its classes above are untouched
   except where this section says so explicitly.
   ================================================================ */

/* Antonio (OFL), self-hosted in static/fonts/. Variable font served
   as one woff2 per subset; weight range covers 100-900. Display text
   only: H1, section labels, nav. Body and data stay in system sans. */
@font-face {
  font-family: "Antonio";
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
  src: url("/static/fonts/antonio-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: "Antonio";
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
  src: url("/static/fonts/antonio-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;
}

/* Display type: H1, section labels, nav only. */
.top h1 { font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
.bottomnav a { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.label, .step-label, .pick-label-row { font-family: var(--font-display); }

/* Header elbow: one per screen. A horizontal accent bar bends 90
   degrees into a short vertical drop at the left of the header, the
   signature LCARS shape. Borders, not a radius hack: the outer corner
   is rounded, the inner corner stays square. Round 2 CSS fix (LCARS-1):
   bar widened 140px to 200px so it reads as a bar bending into a column
   rather than a corner bracket; height unchanged so the sticky header
   does not grow. Usage: one <div class="elbow" aria-hidden="true"></div>
   per screen, in templates/base.html directly above the H1. */
.elbow {
  width: 200px;
  height: 30px;
  border-top: 10px solid var(--accent);
  border-left: 10px solid var(--accent);
  border-top-left-radius: 30px;
}

/* Color-block section header: a short accent bar above a section
   title, the LCARS "bar as header" pattern. The bar's color carries
   the section's meaning through the day-part accent (blue neutral,
   orange morning, purple evening). Place one
   <div class="sec-bar" aria-hidden="true"></div> as the first child
   of a card; the proto card() helper emits it. */
.sec-bar {
  height: 8px;
  margin: -16px -16px 0;
  background: var(--accent);
  border-radius: 15px 15px 0 0;
}

/* As-of chip, unknown level: neutral, never a freshness color. */
.asof-unknown { color: var(--text-muted); background: var(--stored-bg); border-color: var(--text-dim); } /* STORED-1, same fix: shares the stored background and border. */

/* Stats: rows wrap (D-08: 140px base, lone last-row stat takes the
   row); the sub line under a stat value is plain 14px muted text. */
.stat-row { flex-wrap: wrap; }
.stat-row .stat { flex: 1 1 140px; }
.stat-sub { display: block; font-size: 14px; line-height: 1.4; color: var(--text-muted); margin-top: 2px; }

/* Net-worth hero: big figure 34px/800, delta line 14px muted.
   Amounts stay neutral; only the delta figure carries color (D-02). */
.hero { display: flex; flex-direction: column; gap: 8px; }
.hero-num { font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.hero-delta { font-size: 14px; color: var(--text-muted); }
.pos { color: var(--ok); }
.neg { color: var(--danger); }
@media (max-width: 520px) { .hero-num { font-size: 27px; } }

/* Sparklines / bar charts / weight chart: same heights as the proto
   (D-05, fixed by the system, never scaled by column width). Track is
   --surface-3, line and fill --accent, endpoint dot 6px --accent. */
.spark { width: 100%; height: 64px; display: block; }
.wchart { width: 100%; height: 112px; display: block; }
.bars { width: 100%; height: 88px; display: block; }
.chart-wrap { position: relative; }
.chart-dot {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
  background: var(--accent);
}

/* Row list: the single replacement for .txn / .focus-item / .plan-row
   / .log-entry / .school-item. One list grammar per page. */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-top: 1px solid var(--line-soft);
  font-size: 15px; line-height: 1.5;
}
.rows .row:first-child { border-top: 0; }
.row-main { flex: 1 1 auto; min-width: 0; }
.row-main b { display: block; font-size: 15px; }
.row-main span { color: var(--text-muted); font-size: 13px; }
.row-amt { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Legacy row-list classes, kept as aliases of the row list so the
   proto page bodies render in LCARS until their builders migrate the
   markup to .rows/.row. Same spacing, same dividers, token colors,
   13px floor throughout. */
.txn, .school-item, .plan-row, .log-entry, .focus-item {
  padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.txn:first-child, .school-item:first-child, .plan-row:first-child, .log-entry:first-child { border-top: 0; }
.txn { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.txn-main { flex: 1 1 auto; min-width: 0; }
.txn-main b { display: block; font-size: 15px; }
.txn-main span { color: var(--text-muted); font-size: 13px; }
.txn-amt { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.school-item b { display: block; font-size: 15px; line-height: 1.4; }
.school-item p { color: var(--text-muted); font-size: 14px; line-height: 1.5; margin-top: 3px; }
.s-head { display: flex; gap: 10px; font-size: 13px; color: var(--text-muted); margin-bottom: 3px; flex-wrap: wrap; }
.s-date { font-weight: 700; color: var(--text); }
.plan-row { display: flex; gap: 12px; align-items: flex-start; }
.log-entry { font-size: 15px; }
.log-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.ex { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0 3px 4px; }
.ex b { font-weight: 600; font-variant-numeric: tabular-nums; }
.fc-cancel { color: var(--text-muted); text-decoration: line-through; }
.cancel-tag { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--text-muted); text-transform: uppercase; }
.dl { color: var(--warn); font-weight: 700; }

/* Stat strip (sleep stages and friends): 4-col grid, 13px labels. */
.ministats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 4px; }
.ms-l { font-size: 13px; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.ms-v { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Banner: amber tint for warnings, red variant for dead data. The
   treatment takes the level of the data it reports (D-04). */
.banner {
  background: var(--stale-bg); border: 1px solid var(--warn); color: var(--text);
  border-radius: var(--radius-control); padding: 16px; font-size: 14px; line-height: 1.55;
}
.banner.dead { background: var(--danger-bg); border-color: var(--danger); }

/* Focus Today / Now-Next. .fcat is 4px radius, --surface-2 bg,
   --theme-blue-soft text; .nn-tag green is --ok. */
.focus-item { display: flex; gap: 10px; }
.focus-item p { font-size: 15px; line-height: 1.5; }
.fcat {
  flex: 0 0 auto; height: fit-content; font-size: 13px; font-weight: 700;
  background: var(--surface-2); color: var(--theme-blue-soft);
  border-radius: 4px; padding: 3px 8px; margin-top: 2px;
}
.focus-head { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.focus-details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-muted); line-height: 1.5; }
.focus-details summary .asof { margin-top: 0; margin-left: 10px; }
.focus-details .focus-head { margin-top: 12px; }
.nn-now, .nn-next { display: flex; gap: 12px; padding: 8px 0; align-items: flex-start; }
.nn-now b { font-size: 17px; }
.nn-tag { font-size: 13px; font-weight: 800; letter-spacing: .06em; color: var(--ok); padding-top: 4px; text-transform: uppercase; }
.nn-tag.dim { color: var(--text-muted); }
.nn-time { color: var(--text-muted); font-size: 13px; }
.nn-rest { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.nn-rest li { padding: 6px 0; font-size: 14px; color: var(--text-muted); border-bottom: 1px solid var(--line-soft); }
.nn-rest li span { display: inline-block; min-width: 86px; color: var(--text); font-weight: 600; }

/* Badge: 4px radius, 13px/700, theme colors only. Training program
   badges map push to peach, pull to blue-soft, legs to purple. */
.badge { display: inline-block; font-size: 13px; font-weight: 800; border-radius: 4px; padding: 3px 9px; letter-spacing: .04em; }
.badge.push { background: var(--stale-bg); color: var(--theme-peach); }
.badge.pull { background: var(--accent-bg); color: var(--theme-blue-soft); }
.badge.legs { background: #1d1933; color: var(--theme-purple); }

/* Journal entry: card-equivalent, 15px/1.6 body, blue-soft disclosure. */
.entry { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-list); padding: 16px; margin: 12px 0; }
.e-date { color: var(--text-muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.entry h3 { font-size: 17px; margin: 5px 0 8px; line-height: 1.35; }
.entry p { font-size: 15px; line-height: 1.6; color: var(--text-muted); }
.entry details { margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 9px; }
.entry summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--theme-blue-soft); }
.entry ul { margin: 8px 0 4px 18px; }
.entry li { font-size: 14px; line-height: 1.55; margin-bottom: 5px; color: var(--text-muted); }

/* DEAD-1 (Round 2 QA2 fix): month index / month link / month head rules pruned - no served template references them; the journal month browse now uses pick-row summaries. */

/* Table: the first true table component in LCARS. 14px, 1px --line
   cell borders, 13px uppercase muted header, tabular numbers. The
   schedule grid is the same component under its old class name. */
/* DEAD-1 (Round 2 QA2 fix): table scroll wrapper rules pruned - no served template references them; the schedule scroll wrapper covers the schedule grid. */
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 12px 8px; text-align: left; vertical-align: top; }
.tbl th { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); }
.tbl td { font-variant-numeric: tabular-nums; }
.sched-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sched-grid { border-collapse: collapse; width: 100%; font-size: 14px; }
.sched-grid th, .sched-grid td { border: 1px solid var(--line); padding: 12px 8px; text-align: left; vertical-align: top; }
.sched-grid th { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); }

/* System pipe row: promoted verbatim from system.html's inline style.
   This is the LCARS table replacement for status lists. */
.sys-row dl { margin: 8px 0 0; font-size: 14px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.sys-row dt { color: var(--text-muted); }
.sys-row dd { margin: 0; }
.sys-cause { margin: 8px 0 0; font-size: 14px; }
.sys-next { color: var(--text-muted); font-size: 13px; margin: 8px 0 0; }
.sys-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.sys-badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; border: 1px solid currentColor; border-radius: 4px; }
.sys-badge-OK { color: var(--ok); }
.sys-badge-IMPAIRED, .sys-badge-DRY, .sys-badge-MANUAL, .sys-badge-AWAITING { color: var(--warn); }
.sys-badge-DOWN { color: var(--danger); }
.sys-badge-ONDEMAND { color: var(--theme-purple); }

/* Tabs (Settings): ported from the settings inline style to tokens.
   Tab 56px min-height (was 44px); active tab accent bg + dark text. */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; } /* TABS-1: gap 6px -> 8px per the 8px spacing guidance. */
.tab {
  padding: 10px 12px; font-size: 15px; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  border-radius: var(--radius-control); min-height: 56px; cursor: pointer; font-family: var(--font);
}
.tab.active { background: var(--accent); color: #0a0a0f; border-color: var(--accent); }
.panel h2 { font-size: 20px; margin: 0 0 6px; }
.panel p { font-size: 14px; }
.panel pre { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.nrow { border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin: 0 0 10px; }
.msg { color: var(--text-muted); font-size: 14px; }

/* Page head (proto pages): the shell H1 now carries the title, so the
   in-body page head is a lede row only (sub line + net-worth corner). */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 4px; }
.page-sub { color: var(--text-muted); font-size: 14px; margin-top: 3px; }
.nw-corner { text-align: right; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.nw-corner .asof { margin-top: 5px; }
.card-note { color: var(--text-muted); font-size: 14px; margin-top: 12px; line-height: 1.5; }
.nb { white-space: nowrap; }
.card.demoted { background: var(--surface-2); }

/* ---- Workout session components (ported from the workout inline
   dialect, Round 2, with token fixes) ----
   - --accent-bg pairing corrected: the inline dialect put an orange
     accent on the neutral-blue tint; here .cue and friends use the
     mode tokens, so accent and tint always match.
   - .btn.secondary purple border retires: the template now uses the
     LCARS .btn-secondary class.
   - .barTrack height 14px retires to 8px to match .progress;
     .barFill purple retires to --accent.
   - .tag border --accent2 retires; the workout's tags take the accent
     border scoped to #view-workout so the Daily Log's .tag is untouched.
   - The workout's own .nav (in-page view switcher: Start / Week /
     History / Program) is KEPT, ported to tokens. It is not a route
     nav, so base.html's .bottomnav cannot replace it; deleting it
     would break view switching. See the theme-lead build note.
   - .restbar was already in this file; it was replaced above with the
     ported version (hidden until JS adds .show). */

/* Sync pill: 13px, 4px radius, never a pill. */
.sync {
  font-size: 13px; color: var(--text-muted); border: 1px solid var(--line);
  border-radius: 4px; padding: 6px 10px; background: var(--surface);
  white-space: nowrap; flex-shrink: 0;
}

/* Day picker: 56px tap targets. */
.dayrow { display: flex; gap: 8px; }
.daybtn {
  flex: 1; padding: 13px 4px; border-radius: var(--radius-control);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-weight: 800; font-family: var(--font); min-height: 56px; cursor: pointer;
}
.daybtn.active { background: var(--accent); color: #0a0a0f; border-color: var(--accent); }

/* In-session checklist row. */
.check { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.check input { width: 26px; height: 26px; accent-color: var(--accent); flex-shrink: 0; }

/* Big load number (weight / reps entry). */
.bigbox { text-align: center; padding: 8px 0; }
.bignum { font-size: 52px; font-weight: 900; line-height: 1; }
.biglabel {
  font-size: 13px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; display: flex; align-items: flex-end; min-height: 34px;
}

/* Set dots: 34px circles; done sets fill with the accent. Scoped to
   .setdots so they never collide with .status-line .dot (8px). */
.setdots { display: flex; gap: 8px; justify-content: center; margin: 12px 0; }
.setdots .dot {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line);
  display: grid; place-items: center; font-weight: 900;
}
.setdots .dot.done { background: var(--accent); color: #0a0a0f; border-color: var(--accent); }

/* Form cue: accent tint + accent border, always paired by the mode. */
.cue {
  background: var(--accent-bg); border: 1px solid var(--accent);
  border-radius: var(--radius-control); padding: 12px;
  text-align: center; font-weight: 700; margin: 12px 0;
}

/* Small button row (Undo / Swap / Skip / Watch demo): 56px targets. */
.minirow { display: flex; gap: 8px; align-items: stretch; }
.minirow button {
  flex: 1; padding: 12px; border-radius: var(--radius-control);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-weight: 700; font-family: var(--font); font-size: 15px;
  min-height: 56px; cursor: pointer;
}

/* DEAD-1 (Round 2 QA2 fix): workout view-nav rules pruned - no element carries a nav class in any served template; the workout now uses the base shell bottom nav. */

/* Sheet modal: the 20px top radius is the one allowed 20px radius. */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .75); display: none; place-items: end center; }
.modal.show { display: grid; }
.sheet { background: var(--surface); width: 100%; max-width: 640px; border-radius: 20px 20px 0 0; padding: 18px; max-height: 85vh; overflow: auto; }

/* Workout tags take the accent border; scoped so the Log's .tag stays. */
#view-workout .tag { border-color: var(--accent); color: var(--accent-soft); }

/* Ride history rows. */
.rideRow {
  display: flex; width: 100%; text-align: left; background: transparent;
  border: 0; border-bottom: 1px solid var(--line); color: var(--text);
  padding: 12px 2px; font-size: 16px; align-items: center; gap: 8px;
  font-family: var(--font); cursor: pointer;
}
.rideRow b { font-size: 16px; }
.rideRow .rideTxt { flex: 1; min-width: 0; }
.rideRow .chev { color: var(--text-muted); font-weight: 900; flex-shrink: 0; }

/* Ride detail grid: the bordered-grid .kv variant, kept for ride
   detail (1px dividers). .k/.v children are 13px/17px. */
.kv.bordered { gap: 0; border: 1px solid var(--line); border-radius: var(--radius-control); overflow: hidden; }
.kv.bordered > div { padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; }
.kv.bordered > div:nth-child(odd) { border-right: 1px solid var(--line); }
.kv.bordered > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv.bordered > div:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.kv .k { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 0; border: 0; }
.kv .v { font-size: 17px; font-weight: 800; margin-top: 2px; padding: 0; border: 0; }

/* Ride stat grid (JS-rendered): 2-col grid; .n/.l are the number and
   label children of a .stat tile. */
.statGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.statGrid .stat { padding: 12px; }
.stat .n { font-size: 24px; font-weight: 900; line-height: 1.1; display: block; }
.stat .l { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); display: block; margin-top: 2px; }

/* Ride charts: 8px track to match .progress; fill is --accent. */
.barRow { display: grid; grid-template-columns: 118px 1fr 56px; gap: 8px; align-items: center; padding: 6px 0; font-size: 14px; }
.barTrack { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.barFill { height: 100%; background: var(--accent); border-radius: 4px; }
.barRow .num { text-align: right; font-weight: 800; }
.chartBox { margin: 12px 0; }
.chartBox svg { width: 100%; height: auto; display: block; }
.legend { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* Demo video boxes: 16:9, black field, 12px radius. */
.video-wrap { margin: 12px 0; }
.video-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--bg); border-radius: var(--radius-control); overflow: hidden; }
.video-box + .video-box { margin-top: 10px; }
.video-frame { border: 0; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* DEAD-1: the workout clearance rule went with the pruned view-nav above. */

/* Danger text (cancel actions): alert-adjacent red is --danger, the
   muted set; hard alert red --alert is for alert banners only. */
.text-danger { color: var(--danger); }

/* ---- Round 3 navigation (2026-11-12) ----
   One nav source of truth: five fixed primary tabs in the bottom stack
   on every page except login, seven secondary destinations in the
   hamburger sheet. The header More (•••) button and its whole row are
   gone: the hamburger lives in the H1 row (see .head-row / .menu-btn
   above). The old >=768px rules that hid the bottom nav and showed
   the 5 + More in the top bar went with that row; desktop now shows
   the same bottom stack as the phone. The sheet is a bottom sheet at
   every width, max 640px, with a Close button and Escape/backdrop
   close (see the shell script in base.html). */
/* More sheet height (Round 3 QA3 fix, 2026-11-12): the sheet was
   989-990px tall in an 844px viewport with no max-height and no
   scrolling, so its top rows (Sections heading, Today, most of
   Money) sat above the screen and could never be reached. The cap
   leaves 186px at the top: the tallest sticky header measured
   across every route is 178px (two-line top-meta pages), so the
   sheet's top always sits below the header and the hamburger stays
   visible and tappable; the rest scrolls inside the sheet. */
.more-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 640px; margin: 0 auto; background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: calc(100vh - 186px);
  max-height: calc(100dvh - 186px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* More sheet open (same fix): keep the sticky header - and its
   hamburger/X - above the sheet, so the hamburger can always close
   it by touch. 45 sits above the sheet (40) but below the skip link
   and modals (50). The max-height cap above is what keeps the
   sheet's own top rows reachable; this only guards the toggle. */
body:has(.more-sheet:not(.hidden)) .top { z-index: 45; }
.more-sheet .more-item { display: block; text-decoration: none; }
.more-sheet .more-item.active { color: var(--accent-soft); }
.more-sheet .more-close { width: 100%; margin-top: 16px; }

/* QA Round 2 fix (Today/Money, 2026-11-11): ported Money presentation
   classes + Today first-viewport compression + glance tap targets.
   Appended, not interleaved, to avoid colliding with the theme
   builder's concurrent edits to this file. */
.kv b.tile-num { font-size: 20px; }
.row-split { display: flex; justify-content: space-between; gap: 8px; }
.nowrap { white-space: nowrap; }
.sum-row { cursor: pointer; }
.delta-up { color: var(--ok); font-weight: 700; }
.delta-down { color: var(--danger); font-weight: 700; }
.spark-blue { color: var(--theme-blue); }
.chart-dot.spark-dot { width: 8px; height: 8px; background: var(--theme-blue); }
/* D-11: glance stat links are inline text (~26px tall). Padding the
   link with equal negative margins grows the tap target to ~44px
   without moving any visible pixel. */
.stat b a { display: inline-block; padding: 9px 6px; margin: -9px -6px; }
/* TODAY-1: Today-only compression so the At-a-glance 2x2 + custody
   line fit the 390px first viewport. Spacing only; no content removed.
   The wrapper is a single <main> child, so its 16px gap replaces the
   32px main gap between the first two cards. */
.today-compact { display: flex; flex-direction: column; gap: 16px; }
.today-compact .card { padding: 12px; gap: 12px; }
.today-compact .sec-bar { margin: -12px -12px 0; }
.today-compact .stat { padding: 12px; }
.today-compact .stat .asof { margin-top: 4px; }
.today-compact .history-item { padding: 8px 0; }

/* Round 3 A3 (2026-11-12): second compression pass. Mike's Nov 12
   feedback: the Today block at the top is still very large - the
   first viewport showed Now / Next plus only part of At a glance.
   This settles the Round 2 TODAY-1 fold dispute in favour of a
   smaller first viewport. All rules are scoped to .today-compact
   (the Today page wrapper); no shared rule is touched, and no
   number or freshness date is removed - the savings are spacing,
   type size, one-line chips (see _today_chip in app.py), and
   shorter duplicate wording (see the Today builders in app.py).
   Tap floors are preserved: the 44px summary floor and the
   44px stat-link target (D-11 padding) are untouched. */
.today-compact { gap: 12px; }
.today-compact .card { padding: 10px; gap: 10px; }
.today-compact .sec-bar { margin: -10px -10px 0; }
.today-compact .card h2 { font-size: 18px; }
.today-compact .stat-row { gap: 6px; }
.today-compact .stat { padding: 10px 10px 8px; }
.today-compact .stat b { font-size: 21px; }
.today-compact .stat .muted { font-size: 13px; line-height: 1.4; }
/* Round 3 A3 (measured Nov 12): the 12px chip still wrapped - the
   mono face + inherited 0.12em letter-spacing made "synced Nov 10 ·
   1d" 141px of text in a 143px tile, and the 8px side padding pushed
   it over. 11px, no letter-spacing, 6px side padding fits the longest
   compact chip ("synced Nov 12 · now", 19 chars) on one line. A
   last-year date ("Nov 10, 2025") still wraps - acceptable, the tile
   just grows ~17px for that stat. No nowrap: a too-long chip must
   wrap, never overflow the tile. */
.today-compact .stat .asof { font-size: 11px; letter-spacing: 0; padding: 0 6px; }
.today-compact .history-item {
  padding: 6px 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
}
.today-compact .history-item .tag { margin-right: 0; }
.today-compact .history-item .muted { font-size: 13px; }
.today-compact .today-custody { font-size: 13px; line-height: 1.45; }
.today-compact summary { font-size: 15px; }

/* Round 3 A4 (2026-11-12): the collapsed Open-items summary on
   /journal is a .pick-row (flex, no wrap), so its "last activity
   Sep 9" chip was squeezed into a 3-line stack beside the long
   headline text. Let it wrap to its own line, one line, full width.
   Scoped to details.card summaries (only Journal uses them). Costs
   ~12px of collapsed height; the first entry stays in viewport. */
details.card > summary.pick-row { flex-wrap: wrap; }
details.card > summary.pick-row .asof { flex: 0 0 auto; }

/* ---- QA2 Health/Training/Workout fixes (Nov 11, 2026) ----
   Workout-only classes. The CSS builder owns the rest of this file;
   these were added because no class existed for them (checked Nov 11).
   .video-wrap / .video-box / .video-frame already existed and are
   reused by templates/workout.html, not redefined here. */

/* WORK-3: day picker is a 3-column segmented row. .btn-row gives each
   button flex 1 1 140px, which wraps 2+1 in a 358px container; the
   picker must not wrap. Grid columns share the width exactly. */
.day-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.day-picker .btn { min-width: 0; padding-left: 8px; padding-right: 8px; }

/* 36px weight / reps inputs (QA2 D11 inline port). */
.wo-big-input { font-size: 36px; font-weight: 900; text-align: center; padding: 14px; }

/* Exercise cue box. */
.wo-cue { background: var(--accent-bg); border: 1px solid var(--accent); border-radius: var(--radius-control); padding: 12px; text-align: center; font-weight: 700; margin: 12px 0; }

/* Workout headings. h2 defaults to 20px; these two sizes are deliberate. */
.wo-name { font-size: 26px; margin: 8px 0; }
.wo-warmup-name { font-size: 22px; margin: 10px 0; }
.wo-subhead { font-size: 16px; margin-top: 16px; }

/* Setup-notes inputs (static + night view) and feedback textarea. */
.wo-setup-input { padding: 10px; font-size: 15px; }
.wo-textarea { width: 100%; padding: 12px; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 16px; }

/* Ride-trend chart rows (data widths on the .progress bars stay inline). */
.wo-chart-row { margin: 12px 0; }
.wo-split-row { display: flex; justify-content: space-between; gap: 8px; }
.wo-chart-head { font-weight: 800; margin: 12px 0 4px; }

/* Cooldown rows + their Video buttons (WORK-4: 44px floor). */
.wo-cooldown-row { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.wo-video-btn { padding: 12px 16px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 700; flex-shrink: 0; cursor: pointer; }

/* Ride detail modal (QA2 D11 inline port). JS opens it by setting
   inline display:grid, which beats the display:none below. */
.ride-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.75); display: none; place-items: end center; }
.ride-modal-card { background: var(--surface); width: 100%; max-width: 640px; border-radius: 20px 20px 0 0; padding: 18px; max-height: 85vh; overflow: auto; }
.ride-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: sticky; top: 0; background: var(--surface); padding-bottom: 10px; z-index: 1; }
.ride-modal-sub { margin: 6px 0 0; }
/* WORK-4: Close was ~36px (padding 8px 12px); 44px floor now. */
.ride-modal-close { padding: 12px 16px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 800; cursor: pointer; }

/* History ride rows (QA2 D11 inline port). */
.ride-row { display: flex; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); padding: 12px 2px; font-size: 16px; align-items: center; gap: 8px; cursor: pointer; }
.ride-row-label { flex: 1; min-width: 0; }
.ride-row-chev { color: var(--text-muted); font-weight: 900; flex-shrink: 0; }

/* ---- Round 3 QA3 fix (2026-11-12, Today peek + Inbox overflow) ----
   QA1 D1: at 390px the Daily Log card top sat at doc y 792, behind the
   fixed bottom nav (top 784) - 0px genuinely visible. QA5 D1: one
   Inbox queue row's unbreakable sender line widened the page to
   446px, expanding the layout viewport and pushing the fixed nav
   off-screen. Appended, not interleaved (same convention as the
   Round 3 A3 block), so concurrent builders' edits above are untouched.
   TODAY: third compression pass, scoped to .today-compact only. No
   number, chip, date or line of copy is removed; the savings are
   spacing and type size only. Tap floors preserved: the 44px summary
   floor and the 44px stat-link target (D-11 padding) are untouched.
   Measured budget at 390px: need 61px+ above the Daily Log card
   (792 -> <=731 for a 52px genuine peek above the 784 nav top).
   INBOX: the queue row flex child may now shrink (min-width: 0) and
   long sender tokens may break anywhere, so no row can exceed the
   viewport; the tag keeps its size (flex: none). The .inbox-queue
   overflow rule is a hard backstop for any future long token. */
.today-compact { gap: 8px; }
.today-compact .card { padding: 8px; gap: 8px; }
.today-compact .sec-bar { margin: -8px -8px 0; height: 6px; }
.today-compact .card h2 { font-size: 17px; }
.today-compact .stat { padding: 8px 8px 6px; }
.today-compact .stat b { font-size: 20px; }
.today-compact .stat .asof { margin-top: 2px; }
.today-compact .history-item { padding: 4px 0; }
.today-compact .today-custody { line-height: 1.35; }
/* Inbox queue rows: shrink + break long tokens (QA5 D1). */
.check-item > div { min-width: 0; overflow-wrap: anywhere; }
.check-item .tag { flex: 0 0 auto; }
.inbox-queue .check-item { overflow: hidden; }
.inbox-queue .check-item .small { overflow-wrap: anywhere; }

/* ---- Round 3 QA3 fix (2026-11-12, Workout D2 warmup Cancel) ----
   QA3 D2: at 390px the warmup card's "Cancel workout" sat under the
   fixed stack on every warmup step (step 1: 709-765 vs stack top 707;
   step 5: 852-908, and at 430px step 5 also failed), so a tap on its
   centre hit "Warmup done - start lifts" or a nav tab instead. The
   card is too tall at phone widths for its last button to clear the
   stack at scroll position 0, and the cost varies by step: the
   Previous/Next/Watch-demo row wraps to two rows on steps 2-5 (123px,
   143px on the last step when the label becomes "Warmup done - start
   lifts"), the warmup name wraps to two lines on step 3, and the last
   step adds the warmup-set box (61px). Scoped to #warmupStage at
   <=480px only; desktop/tablet rendering and every other card are
   untouched. No copy, button, or control is removed; the savings are
   spacing plus the button row fitting on one line (buttons keep their
   56px min-height, so tap targets do not shrink). The header meta
   hides only while the in-workout view is showing (body.workout-active
   is toggled by showView in templates/workout.html): the Snapshot /
   rides lines are irrelevant mid-workout and cost 59px. Measured
   budget at 390px after the D3 stack slimming (stack top ~726):
   worst step needs 212px above Cancel; this block saves ~221px
   (button row one line 64-84px, card gap 16 -> 8px, card padding
   16 -> 12px, warmup-name margin 10 -> 6px, set-box margin 12 -> 6px
   in the template, header meta 59px), so Cancel is fully above the
   stack at scroll 0 on all five warmup steps at 390px and 430px. */
@media (max-width: 480px) {
  #warmupStage { gap: 8px; padding: 12px; }
  #warmupStage .wo-warmup-name { margin: 6px 0; }
  #warmupStage .btn-row { flex-wrap: nowrap; }
  #warmupStage .btn-row .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
    font-size: 15px;
  }
  body.workout-active .top-meta { display: none; }
}

/* Log fix, Nov 12, 2026: in-Log navigation + time-of-day greeting. */
.log-nav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.log-nav::-webkit-scrollbar { display: none; }
.log-nav-chip { flex: 0 0 auto; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--surface-2); color: var(--text-muted); font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.log-nav-chip.active { background: var(--accent-bg); color: var(--accent-soft); border-color: var(--accent); }
.greeting-card .label { color: var(--accent-soft); }
.greeting-card .btn-block { margin-top: 8px; }
.greeting-card #greetingAlt { margin-top: 4px; }
#middayBox .yn-row { margin: 8px 0; }
#middayBox .yn-row .btn { min-height: 44px; }

/* ================================================================
   RESPONSIVE - device-aware layouts (Nov 12, 2026)
   Breakpoints (also in ~/workspace/mikesdash-overhaul/responsive-breakpoints.md):
     phone   < 640px    base, unchanged: one column, bottom nav, hamburger,
                        44px tap targets, one question at a time.
     tablet  640-1024px .wrap 800px; card-list pages 2 columns where the
                        width allows; bottom nav stays; top nav hidden.
     desktop > 1024px   .wrap 1180px; card-list pages 2-3 columns; the
                        5-tab bottom nav becomes a top nav under the
                        header and the hamburger hides (every destination
                        is in the top nav). The bottom stack survives
                        ONLY as the slim action row on bar pages
                        (Daily Log, Workout), where the screen's one
                        primary button lives.
   Pages opt into the multi-column grid with body.layout-cols, set by
   the template's body_class block in base.html. Single-column pages
   stay centred: Daily Log / research detail 760px, Workout / Settings
   860px (body.layout-wide), login 480px (body.no-bottombar).
   No <table> exists in this instance by design; desktop widening
   applies to cards and rows, not tables. One stylesheet, TNG theme
   intact, token colours only, no new hex literals.
   ================================================================ */

/* Top nav is desktop-only; hidden (and out of the a11y tree) below. */
.topnav { display: none; }

/* ---- Tablet: 640-1024px ---- */
@media (min-width: 640px) and (max-width: 1024px) {
  .wrap { max-width: 800px; padding: 24px 24px 40px; }
  .foot { max-width: 800px; }
  /* Card-list pages: auto-fill grid, 340px minimum column. At
     640-767px that is 1 column; at 768px+ it is 2 columns. */
  body.layout-cols main.wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    align-items: start;
  }
  /* Today wraps its cards in .today-compact; let the cards join the
     main grid instead of the wrapper becoming one grid item. */
  body.layout-cols main.wrap > .today-compact { display: contents; }
  /* First card spans full width (At a glance / hero / this week). */
  body.layout-cols main.wrap > :first-child,
  body.layout-cols .today-compact > section:first-child { grid-column: 1 / -1; }
  /* Non-card children span full width: ledes, month headings, links,
     the journal month-browse row. */
  body.layout-cols main.wrap > :is(p, h2, a, details:not(.card)) { grid-column: 1 / -1; }
}

/* ---- Desktop: > 1024px ---- */
@media (min-width: 1025px) {
  html { scroll-padding-top: 168px; scroll-padding-bottom: 32px; }
  .wrap { max-width: 1180px; padding: 32px 32px 48px; }
  main section, .card { scroll-margin-top: 168px; }
  /* Single-column pages keep a readable centred column. */
  body:not(.layout-cols) main.wrap { max-width: 760px; }
  body.layout-wide main.wrap { max-width: 860px; }
  body.no-bottombar main.wrap { max-width: 480px; }
  /* Header contents centre to the content width. The theme strip and
     the elbow stay full-bleed (they are decoration, not content). */
  body.layout-cols .top > :not(.theme-strip):not(.elbow) {
    width: 100%; max-width: 1180px; margin-left: auto; margin-right: auto;
  }
  body:not(.layout-cols) .top > :not(.theme-strip):not(.elbow) {
    width: 100%; max-width: 760px; margin-left: auto; margin-right: auto;
  }
  body.layout-wide .top > :not(.theme-strip):not(.elbow) { max-width: 860px; }
  body.no-bottombar .top > :not(.theme-strip):not(.elbow) { max-width: 480px; }
  /* Footer follows the content width. */
  body.layout-cols .foot { max-width: 1180px; }
  body:not(.layout-cols) .foot { max-width: 760px; }
  body.layout-wide .foot { max-width: 860px; }
  body.no-bottombar .foot { max-width: 480px; }
  /* Card-list pages: same auto-fill grid; at 1180px content width
     that is 3 columns of ~340px. */
  body.layout-cols main.wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    align-items: start;
  }
  body.layout-cols main.wrap > .today-compact { display: contents; }
  body.layout-cols main.wrap > :first-child,
  body.layout-cols .today-compact > section:first-child { grid-column: 1 / -1; }
  body.layout-cols main.wrap > :is(p, h2, a, details:not(.card)) { grid-column: 1 / -1; }
  /* Desktop nav: the top nav appears under the H1; the hamburger
     hides (the full nav is visible); the bottom tabs hide. The
     bottom stack survives only as the action row on bar pages, so
     the Daily Log / Workout primary button is never lost. */
  .topnav {
    display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center;
  }
  .topnav a {
    font-family: var(--font-display); text-transform: uppercase;
    letter-spacing: .06em; font-size: 15px; font-weight: 700;
    color: var(--text); text-decoration: none;
    min-height: var(--tap-floor); padding: 10px 12px;
    display: inline-flex; align-items: center; border-radius: 12px;
  }
  .topnav a:hover { color: var(--accent-soft); }
  .topnav a.active { color: var(--accent-soft); background: var(--accent-bg); }
  .topnav-sep {
    width: 1px; align-self: stretch; background: var(--line-soft);
    margin: 8px 8px;
  }
  .menu-btn { display: none; }
  .bottomstack { display: none; }
  .bottomstack:has(.bottombar:not(.hidden)) { display: flex; }
  .bottomstack:has(.bottombar:not(.hidden)) .bottomnav { display: none; }
  .bottomstack:has(.bottombar:not(.hidden)) .bottombar {
    width: 100%; max-width: 720px; margin-left: auto; margin-right: auto;
  }
  /* No bottom nav: no bottom clearance, except the slim action row
     on bar pages (~60px + breathing room). */
  body { padding-bottom: 0; }
  body:has(.bottombar:not(.hidden)) { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  /* Rest bar clears the slim action row, not the old 133px stack. */
  .restbar {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(720px, calc(100vw - 32px));
  }
}

/* ---- Today desktop fill (2026-11-19): with 7 cards the grid is full
   (glance spans the row, then two rows of 3). Stretch cards in a row
   to equal height so no row ends short; the memo audio fills its
   card. Phone breakpoints untouched. */
@media (min-width: 1025px) {
  body.layout-cols .today-compact > section { align-self: stretch; }
  .today-compact audio { width: 100%; }
}
