/* Goals vertical styles. Ported from the legacy single-file
 * dashboard's <style> block. Variable names map to tokens.css
 * via short legacy aliases below. Nothing here leaks back into
 * /lib/platform/ — stays goals-specific.
 */

/* Local aliases for the legacy stylesheet's short names. Keeps the
 * imperative renderers readable without a bulk find/replace. */
:root {
  --bg: var(--surface-bg);
  --surface: var(--surface-card);
  --surface2: var(--surface-muted);
  --surface3: var(--surface-elev);
  --border: var(--surface-border);
  --border-light: var(--surface-border-light);
  --text: var(--text-primary);
  --accent: var(--color-accent);
  --accent-light: var(--color-accent-light);
  --accent-dim: var(--color-accent-dim);
  --accent-bg: var(--color-accent-bg);
  --accent-border: var(--color-accent-border);
  --accent-text: var(--color-accent-text);
  --green: var(--color-green);
  --green-bg: var(--color-green-bg);
  --green-border: var(--color-green-border);
  --green-text: var(--color-green-text);
  --amber: var(--color-amber);
  --amber-bg: var(--color-amber-bg);
  --amber-border: var(--color-amber-border);
  --red: var(--color-red);
  --red-bg: var(--color-red-bg);
  --red-border: var(--color-red-border);
  --red-text: var(--color-red-text);
  --blue: var(--color-blue);
  --blue-bg: var(--color-blue-bg);
  --blue-border: var(--color-blue-border);
  --blue-text: var(--color-blue-text);
  --pink: var(--color-pink);
  --pink-bg: var(--color-pink-bg);
  --pink-border: var(--color-pink-border);
  --purple: var(--color-purple);
  --purple-bg: var(--color-purple-bg);
  --gold: var(--color-gold);
  --gold-bg: var(--color-gold-bg);
  --gold-border: var(--color-gold-border);
  /* More Life Area colours, so each starting area has its own (the
     wheel's wedges are told apart by colour). */
  --lime: #a3e635;
  --orange: #fb923c;
  --teal: #2dd4bf;
  --indigo: #818cf8;
  --fuchsia: #e879f9;
  --slate: #94a3b8;
  --yellow: #fde047;
  --violet: #c4b5fd;
  --brown: #c08457;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}

/* ==== Header ==== */
.header {
  /* More vibrant blue gradient — sweeps from a deep midnight to a
   * brighter cobalt mid-stop and back, reinforcing the "blue but
   * colourful" identity. */
  background: linear-gradient(135deg, #15224a 0%, #2440a0 50%, #15224a 100%);
  border-bottom: 1px solid var(--border);
  padding: 20px 28px;
  /* The background is full width; its content lines up with the page's
     1200px frame (C23: .main's 1144px of content, centred). */
  padding-inline: max(28px, calc((100% - 1144px) / 2));
  position: sticky; top: 0; z-index: 100;
}
/* "Skip to content" (C8): off screen until a keyboard reaches it. */
.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 1000;
  padding: 8px 14px; border-radius: var(--radius-sm); background: var(--accent); color: #fff;
  font-size: 0.875rem; font-weight: 600; text-decoration: none;
}
.skip-link:focus, .skip-link:focus-visible { top: 8px; }
/* Focused by the skip link only (tabindex -1): no ring round the page. */
#main:focus { outline: none; box-shadow: none; }
.header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; }
.header h1 .accent { color: var(--accent-light); }
.header-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.header-controls {
  display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center;
}

.tab-nav { display: flex; min-width: 0; max-width: 100%; }
.tab-bar { display: flex; gap: 3px; }
.tab {
  padding: 5px 14px; border-radius: 6px; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; background: transparent;
  color: var(--text-muted); transition: all 0.15s;
}
.tab:hover { color: var(--text); background: var(--surface2); }
.tab.active { background: var(--accent); color: #fff; }
/* B6: the tab being pressed looks chosen at once (no fade), and the
   current one lets go of the look, while a slow tab draws. */
.tab.tab-pressing { background: var(--accent); color: #fff; transition: none; }
.tab-bar:has(.tab-pressing) .tab.active:not(.tab-pressing) { background: transparent; color: var(--text-muted); transition: none; }

.filter-bar { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.filter-label { font-size: 0.75rem; color: var(--text-muted); margin-right: 2px; }
.fpill {
  padding: 3px 10px; border-radius: 16px; font-size: 0.8125rem; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  transition: all 0.12s;
}
.fpill:hover { border-color: var(--text-muted); }
.fpill.active { background: var(--surface2); color: var(--text); border-color: var(--accent); }
.fpill-count {
  display: inline-block; margin-left: 4px;
  font-size: 0.75rem; font-weight: 700;
}

.search-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 10px; color: var(--text); font-size: 0.75rem; width: 180px; outline: none;
}
.search-box:focus { border-color: var(--accent); }

#syncBtn { background: var(--accent); color: #fff; border-color: var(--accent); }
#syncBtn:hover { background: var(--accent-dim); }

/* ==== Sections ==== */
.main { padding: 20px 28px; max-width: 1200px; margin: 0 auto; }
.section { display: none; animation: fadeIn 0.2s ease; }
.section.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==== Stats ==== */
.stats-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
/* No figures (an empty list, A7): no strip, and no lone ⓘ where it was. */
.stats-bar:not(:has(.stat-card)) { display: none; }
/* At most four figures, one row (UI audit C6); two per row on a phone. */
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; min-width: 0; flex: 1 1 0;
}
.stat-value { font-size: 1.375rem; font-weight: 700; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .stat-card { flex: 1 1 calc(50% - 5px); padding: 10px 12px; }
  .stat-value { font-size: 1.125rem; }
}
/* Pace: done so far, and a marker at the share of time gone. */
.stat-pace-bar { position: relative; height: 6px; margin-top: 6px; background: var(--border); border-radius: 3px; }
.stat-pace-fill { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }
.stat-pace-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }

/* ==== OKR board toggle ==== */
.okr-board-toggle {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.okr-board-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-family: inherit; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.okr-board-btn:hover { color: var(--text); border-color: var(--text-muted); }
.okr-board-btn.active {
  background: var(--accent-bg); color: var(--accent-light); border-color: var(--accent);
}
.okr-board-pct {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; padding: 1px 6px; border-radius: 10px;
  background: var(--surface2); color: var(--text-muted);
}
.okr-board-btn.active .okr-board-pct {
  background: var(--accent-bg); color: var(--accent-text);
}
.okr-board-add { border-style: dashed; }
/* "Start 2027 Q1 now", near a quarter's end (period-ahead.js). */
.okr-board-ahead { border-style: dashed; color: var(--accent-text); }
/* "⋯ Edit board", after "+ Board": rename or delete the board on
   screen (UI audit B7). Its words say which board it is for. */
.okr-board-manage {
  margin-left: 6px; padding: 6px 8px; border-radius: 8px; white-space: nowrap;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); font-family: inherit; font-size: 0.8125rem; font-weight: 700;
  cursor: pointer; line-height: 1;
}
.okr-board-manage:hover { color: var(--text); border-color: var(--border); }
.btn-danger {
  padding: 6px 12px; border-radius: 6px; font-family: inherit; font-size: 0.75rem; font-weight: 600;
  background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); cursor: pointer;
}
/* Copy source picker on an empty board. */
.okr-clone-source {
  margin-right: 8px; padding: 6px 10px; border-radius: 6px; font-size: 0.75rem;
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
}

/* Empty-state CTA on a non-default board (offer to clone). */
.okr-empty-board {
  padding: 24px 18px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border-light); border-radius: 10px;
}

/* ==== OKR groups ==== */
.okr-group {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 12px; overflow: hidden;
}
.okr-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.okr-header:hover { background: var(--surface2); }
.okr-obj { font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
/* The objective's (or area's) name is its group's h3 (C8); it looks as
   it did. */
.okr-obj-heading { margin: 0; font: inherit; }
.okr-obj-heading > .okr-obj-name { display: block; }
.prog-mini { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.prog-bar { position: relative; width: 70px; height: 4px; background: var(--surface3); border-radius: 4px; }
.prog-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.3s; }
/* Pace (F056): the marker is how much of the period has gone; the fill
 * turns amber when progress is behind it, green when ahead. */
.pace-marker {
  position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px;
  background: var(--text); opacity: 0.7; border-radius: 1px; pointer-events: none;
}
.prog-mini[data-pace="behind"] .prog-fill { background: var(--amber); }
.prog-mini[data-pace="ahead"] .prog-fill { background: var(--green); }
/* The health the evidence suggests, beside the manual one (F158). */
.health-hint {
  margin-left: 6px; padding: 1px 8px; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 0.75rem; font-weight: 600;
  background: transparent; color: var(--text-muted); border: 1px dashed var(--border-light);
}
.health-hint:hover { color: var(--text); border-color: var(--text-muted); }
.health-hint[data-health="at-risk"] { color: var(--red); border-color: var(--red-border); }
.health-hint[data-health="behind"] { color: var(--amber); border-color: var(--amber-border); }
.health-hint[hidden] { display: none; }
.okr-body.collapsed { display: none; }

.filtered-show-all { margin-top: 10px; }
/* "+ Add Objective" tile at the bottom of the OKRs list. */
.okr-add-objective {
  display: block; width: 100%;
  padding: 14px 16px; margin-top: 4px;
  background: transparent;
  border: 1px dashed var(--border-light); border-radius: 10px;
  color: var(--text-muted); font-weight: 600; font-family: inherit;
  font-size: 0.8125rem; cursor: pointer; transition: all 0.15s;
}
.okr-add-objective:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent-light);
}

.kr-row {
  padding: 8px 16px 8px 28px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; font-weight: 500;
  color: var(--accent-light); background: var(--accent-bg);
}

.init-row {
  padding: 7px 16px 7px 44px; border-bottom: 1px solid rgba(30, 45, 74, 0.5);
  display: flex; align-items: center; gap: 10px; font-size: 0.8125rem;
  transition: background 0.2s, border-color 0.2s;
}
.init-row:last-child { border-bottom: none; }
/* An objective's "+ Add KR" / "+ Add Initiative" (okr-6). */
.okr-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 16px; }
.init-name { flex: 1; color: var(--text); }

/* ==== Inline-edit input ==== */
/* When the user clicks an editable name span, it swaps for an <input>
 * that inherits the surrounding row's styling so the layout doesn't
 * jump. The class on the original span is mirrored onto the input so
 * .init-name / .kr-label / .bucket-name etc. still target it. */
.inline-edit-input {
  flex: 1; min-width: 0;
  padding: 2px 6px;
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit; font-size: inherit; font-weight: inherit;
  outline: none;
}
.inline-edit-input:focus { border-color: var(--accent-light); }
/* Editable names get a subtle hover affordance so users discover the
 * click-to-edit interaction. */
.okr-obj-name, .kr-label, .init-name, .bucket-name, .hi-name, .plan-item-text { transition: background 0.12s; border-radius: 3px; }
.okr-obj-name:hover, .kr-label:hover, .init-name:hover, .bucket-name:hover, .hi-name:hover, .plan-item-text:hover {
  background: var(--accent-bg);
  cursor: text;
}
/* Names with no row behind them (the synthetic "Unsorted" group and its
 * "Standalone initiatives" KR) can't be renamed: no edit affordance. */
.okr-obj-name.okr-readonly:hover, .kr-label.okr-readonly:hover { background: none; cursor: inherit; }
.okr-synthetic-note { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
/* A name saved blank before blank names were refused (G4b) collapses
 * to 0px and can't be clicked. Show a stand-in so it can still be
 * renamed. Display only: the stored name stays ''. */
span.okr-obj-name:empty::before, span.kr-label:empty::before, span.init-name:empty::before,
span.bucket-name:empty::before, span.hi-name:empty::before, span.plan-item-text:empty::before {
  content: 'Untitled (click to name)';
  font-style: italic;
  opacity: 0.5;
}
/* Motto sits on the dark gradient header — hover halo tuned for that
 * surface; input swap inherits the h1 font size so the layout doesn't
 * jump on click. */
.motto-edit { padding: 0 4px; border-radius: 4px; transition: background 0.12s; }
.motto-edit:hover { background: rgba(96,165,250,0.18); cursor: text; }
.inline-edit-input.motto-edit {
  font-size: inherit; font-weight: inherit; min-width: 240px;
}

/* ==== Inline time-commitment chip on init rows ==== */
.init-commitment {
  display: inline-flex; align-items: center;
  min-width: 4rem; justify-content: center; padding: 2px 8px; border-radius: 6px;
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; white-space: nowrap;
  transition: border-color 0.12s, color 0.12s;
}
.init-commitment:hover { border-color: var(--accent); color: var(--text); }
.init-commitment-empty {
  border-style: dashed; opacity: 0.5; font-weight: 500;
}
.init-commitment-empty:hover { opacity: 1; }
/* Hide the "+ time" placeholder unless the row is hovered, to keep
 * the focused at-a-glance view tidy. Items with a real commitment
 * always show. */
.init-row:not(:hover):not(:focus-within) .init-commitment-empty { visibility: hidden; }
.init-commitment-input {
  width: 90px; padding: 1px 6px; border-radius: 6px;
  border: 1px solid var(--accent); background: var(--surface2);
  color: var(--text); font-size: 0.75rem; font-family: inherit; outline: none;
}

/* ==== Inline time-remaining badge on init rows ==== */
.init-time-remaining {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 4.875rem; padding: 2px 8px; border-radius: 10px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2px;
  white-space: nowrap; text-align: center;
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent;
}
.init-time-remaining:empty { display: none; }
/* Fixed columns on wide screens (C24): an empty badge keeps its place,
 * so the due, status and celebration cells line up down a list. */
@media (min-width: 769px) {
  :is(.init-row, .horizon-item) > .init-time-remaining { min-width: 7.5rem; }
  :is(.init-row, .horizon-item) > .init-time-remaining:empty { display: inline-flex; visibility: hidden; }
}
.init-time-remaining.time-overdue {
  background: var(--red-bg); color: var(--red-text); border-color: var(--red-border);
}
.init-time-remaining.time-due-now {
  background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border);
}
.init-time-remaining.time-soon {
  background: var(--blue-bg); color: var(--blue-text); border-color: var(--blue-border);
}
.init-time-remaining.time-later {
  background: var(--surface2); color: var(--text-muted); border-color: var(--border);
}
/* A done item's completion date, from the ledger (F017). */
.init-time-remaining.time-done {
  background: var(--green-bg); color: var(--green-text); border-color: var(--green-border);
}
/* "Untouched 41 days": an open item with no edit for a month. Quiet,
 * not alarming: a nudge, not a failure. */
.stale-chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 1px 7px; border-radius: 10px;
  /* Quiet grey (C13): amber/gold is the celebration colour. */
  font-size: 0.75rem; font-weight: 500; color: var(--text-muted);
  border: 1px dashed var(--border-light);
}

/* ==== Status + month dropdowns ==== */
select.status-sel, select.month-sel, select.year-sel, select.goal-year-sel {
  appearance: none; -webkit-appearance: none; outline: none; cursor: pointer;
  background-repeat: no-repeat; font-family: inherit;
}
/* Due control: month + year dropdowns sit together as one unit. */
.due-sel { display: inline-flex; gap: 4px; align-items: center; }
select.status-sel {
  padding: 2px 22px 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600;
  border: 1px solid; min-width: 100px;
  background-position: right 6px center; background-size: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237b8ba8'/%3E%3C/svg%3E");
}
select.status-sel option { background: var(--surface2); color: var(--text); }

.s-not-started { background: rgba(123,139,168,0.10); color: var(--text-muted); border-color: rgba(123,139,168,0.30); }
.s-in-progress { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.s-complete    { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.s-wine        { background: var(--gold-bg); color: var(--gold); border-color: var(--gold-border); font-weight: 700; }
.s-abandoned   { background: transparent; color: var(--text-muted); border-color: var(--border); }

/* Objective-level health (separate enum: on-track / behind / at-risk / complete).
 * Per the spec: green / amber / red / blue. */
.h-none     { background: var(--surface2); color: var(--text-muted); border-color: var(--border); }
.h-on-track { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.h-behind   { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.h-at-risk  { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.h-complete { background: var(--accent-bg); color: var(--accent-light); border-color: var(--accent-border); }

select.month-sel, select.goal-year-sel {
  padding: 2px 18px 2px 6px; border-radius: 4px; font-size: 0.75rem;
  background-color: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
  min-width: 72px; background-position: right 4px center; background-size: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%237b8ba8'/%3E%3C/svg%3E");
}
select.month-sel option, select.goal-year-sel option { background: var(--surface2); color: var(--text); }

select.year-sel {
  padding: 2px 16px 2px 6px; border-radius: 4px; font-size: 0.75rem;
  background-color: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
  min-width: 54px; background-position: right 4px center; background-size: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%237b8ba8'/%3E%3C/svg%3E");
}
select.year-sel option { background: var(--surface2); color: var(--text); }

/* ==== Wine toggle (celebration tick) ====
 * One element, one meaning. The emoji *is* the indicator — faded
 * when off, full saturation with a soft gold halo when on. The
 * checkbox is kept in the DOM (visually hidden but focusable) so
 * keyboard navigation + screen readers still work. */
.wine-check {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; white-space: nowrap;
  padding: 4px 8px; border-radius: 8px;
  min-width: 32px; min-height: 28px; user-select: none;
  transition: background 0.12s, transform 0.12s;
}
.wine-check:hover { background: var(--gold-bg); }
.wine-check:active { transform: scale(0.92); }
/* Visually hide the actual <input> but keep it focusable for a11y. */
.wine-check input[type="checkbox"] {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.wine-check .wine-label {
  font-size: 1rem; line-height: 1;
  filter: grayscale(0.85);
  opacity: 0.7;
  transition: filter 0.12s, opacity 0.12s, text-shadow 0.12s;
}
.wine-check:hover .wine-label { opacity: 0.85; filter: grayscale(0.2); }
.wine-check input[type="checkbox"]:checked ~ .wine-label,
.wine-check:has(input:checked) .wine-label {
  filter: none; opacity: 1;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}
/* Keyboard focus ring on the wrap when the hidden input is focused. */
.wine-check:focus-within {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
/* A celebrated row (C14): the gold left edge, gold name and lit emoji.
 * No gold band over the row, so its status colour still shows. */
.wine-glow {
  border-left: 3px solid var(--gold) !important;
}
.wine-glow .init-name, .wine-glow .hi-name, .wine-glow .bucket-name,
.wine-glow .okr-obj-name, .wine-glow .kr-label {
  color: var(--gold) !important; font-weight: 600;
}
/* Celebrated but still late: the gold stays, the red edge says late
 * (F150). */
.wine-glow.row-overdue { border-left-color: var(--red) !important; }
.wine-glow.row-due-month { border-left-color: var(--purple) !important; }

/* ==== Row colour by status ==== */
.row-not-started { }
.row-in-progress { background: rgba(56,189,248,0.06); border-left: 3px solid var(--blue); }
.row-complete    { background: rgba(52,211,153,0.08); border-left: 3px solid var(--green); }
/* Dropped is a decision, not a failure: neutral grey, struck through,
 * never red (F159). */
.row-abandoned   { background: transparent; border-left: 3px solid var(--border-light); opacity: 0.55; }
.row-abandoned .init-name, .row-abandoned .hi-name { text-decoration: line-through; }
.row-due-month   { background: rgba(167,139,250,0.10); border-left: 3px solid var(--purple); }
.row-overdue     { background: rgba(248,113,113,0.10); border-left: 3px solid var(--red); }
.row-due-month .init-name { color: var(--purple); }
.row-overdue .init-name   { color: var(--red-text); }
.row-complete .hi-name    { color: var(--green); }
.row-in-progress .hi-name { color: var(--blue); }

/* ==== Add / delete buttons ==== */
.add-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  background: var(--accent-bg); color: var(--accent-text); border: 1px solid var(--accent-border);
  cursor: pointer; transition: all 0.12s;
}
/* No margin of its own (C25): the container spaces it, so an Add button
 * starts at the same edge as the content around it. */
.add-btn:hover { background: var(--accent); color: #fff; }
.del-btn {
  width: 18px; height: 18px; border-radius: 4px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 0.8125rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.12s; flex-shrink: 0;
}
/* Revealed while its row is hovered or holds keyboard focus. Every row
 * that renders a makeDeleteBtn must be listed, or its × never shows:
 * objective headers and KR rows were missing (F043). The
 * delete-buttons test checks this list against the rendered rows. */
.okr-header:hover .del-btn,
.kr-row:hover .del-btn,
.init-row:hover .del-btn,
.bucket-item:hover .del-btn,
.horizon-item:hover .del-btn,
.plan-item:hover .del-btn,
.okr-header:focus-within .del-btn,
.kr-row:focus-within .del-btn,
.init-row:focus-within .del-btn,
.bucket-item:focus-within .del-btn,
.horizon-item:focus-within .del-btn,
.plan-item:focus-within .del-btn,
.del-btn:focus-visible { opacity: 1; }
.del-btn:hover { background: var(--red-bg); color: var(--red); }
/* Touch screens have no hover to reveal anything, so the × is always
 * shown, subdued, with a finger-sized target. The button keeps its
 * 18px box: a wider one pushes the objective header's progress count
 * off the edge of a phone screen, and taller ones grow the bucket and
 * 5-year rows. The target grows instead through an invisible ::before,
 * 7px out on every side (32 x 32). It stays inside the row's padding
 * above and below, and sideways it reaches only into the 8px or 10px
 * flex gap beside the ×, so a tap that just misses the wine glass,
 * checkbox or name still hits that control. */
@media (hover: none), (pointer: coarse) {
  .del-btn { opacity: 0.6; position: relative; }
  .del-btn::before { content: ''; position: absolute; inset: -7px; }
  /* Except to the right of the objective's ×. It ends .okr-obj, and
   * .okr-header has no gap (space-between only spaces .prog-mini off
   * when there is room), so on a phone the progress block is often
   * flush against it. Reaching right there turned a tap on the left of
   * the progress bar, which collapses the objective, into the cascade
   * delete. So that target is 25 x 32. An 8px header gap would keep it
   * at 32 x 32, but it clips the progress count on more objectives. */
  .okr-obj > .del-btn::before { right: 0; }
  /* Likewise the "+ time" placeholder hidden above. Same selector as
   * the hide rule, so this wins on source order. */
  .init-row:not(:hover):not(:focus-within) .init-commitment-empty { visibility: visible; }
}

/* ==== Horizon cards (Annual goals) ==== */
.horizon-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px;
}
.horizon-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
}
.horizon-card h3 { font-size: 0.8125rem; font-weight: 700; color: var(--accent-light); margin-bottom: 2px; }
.horizon-card .subtitle { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; }
.horizon-item {
  padding: 5px 4px; font-size: 0.75rem; border-bottom: 1px solid rgba(30,45,74,0.3);
  display: flex; align-items: center; gap: 8px; border-radius: 4px;
  transition: background 0.2s, border-color 0.2s; border-left: 3px solid transparent;
}
.horizon-item:last-child { border-bottom: none; }
.horizon-item .hi-name { flex: 1; transition: color 0.2s; }

/* ==== Bucket list ==== */
/* The year toggle (bucket-years.js): pills that wrap at phone width. */
.bucket-years { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.bucket-years[hidden] { display: none; }
.bucket-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px;
}
.bucket-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; font-size: 0.75rem; display: flex; align-items: center; gap: 8px;
  transition: all 0.2s; cursor: default;
}
.bucket-item:hover { border-color: var(--accent); background: var(--surface2); }
.bucket-num { color: var(--text-muted); font-size: 0.75rem; font-weight: 700; min-width: 22px; }
.bucket-name { flex: 1; transition: color 0.2s; }
.bucket-check {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px;
  border: 2px solid var(--border-light); border-radius: 4px; background: transparent;
  cursor: pointer; position: relative; flex-shrink: 0; transition: all 0.2s;
}
.bucket-check:checked { background: var(--green); border-color: var(--green); }
.bucket-check:checked::after {
  content: '\2713'; position: absolute; top: -1px; left: 2px;
  font-size: 0.75rem; font-weight: 700; color: #0a0e1a;
}
.bucket-done {
  background: rgba(52,211,153,0.10) !important;
  border-color: rgba(52,211,153,0.30) !important;
}
.bucket-done .bucket-name { color: var(--green); font-weight: 600; }
.bucket-done .bucket-num  { color: var(--green); }

/* Category headings span the grid; the meta row under a card holds its
 * time badge, category and target date (G4c, F059). The category chip
 * and empty chips show only in Plan mode, so a plain list stays plain. */
.bucket-category {
  grid-column: 1 / -1; margin: 12px 0 2px; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.bucket-category:first-child { margin-top: 0; }
.bucket-item { flex-wrap: wrap; }
/* Plan mode lists items in one column: a drag picks its place by height
 * alone (views/sortable.js), which a multi-column grid can't follow. */
.plan-mode .bucket-grid { grid-template-columns: 1fr; }
.bucket-meta {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding-left: 30px;
}
.bucket-meta-empty, .bucket-chip-empty, .bucket-cat-chip { display: none; }
/* A done card's date sits on its first line, before the checkbox,
   muted, so done and open cards are one height and the checkboxes line
   up (UI audit D8). Plan mode keeps the chips on a line of their own. */
.bucket-item > .bucket-check, .bucket-item > .del-btn { order: 1; }
.bucket-item > .bucket-meta { order: 2; }
body:not(:has(.plan-mode)) .bucket-done > .bucket-meta { order: 0; flex-basis: auto; padding-left: 0; }
.bucket-done .bucket-meta .time-done { color: var(--text-muted); background: transparent; border-color: transparent; }
.plan-mode .bucket-meta-empty { display: flex; }
.plan-mode .bucket-chip-empty, .plan-mode .bucket-cat-chip { display: inline-flex; }
/* An open item with no date (A4): "+ target date" outside Plan mode
   too. On touch, on its own line under the name. With a mouse, on the
   first line before the checkbox while the card is pointed at or holds
   focus (focus shows it before Tab reaches it); hidden, it takes no
   room. */
body:not(:has(.plan-mode)) .bucket-item > .bucket-meta-undated { display: flex; }
body:not(:has(.plan-mode)) .bucket-meta-undated > .bucket-target-chip { display: inline-flex; }
@media (hover: hover) and (pointer: fine) {
  body:not(:has(.plan-mode)) .bucket-item > .bucket-meta-undated { order: 0; flex-basis: auto; padding-left: 0; }
  body:not(:has(.plan-mode)) .bucket-item:not(:hover):not(:focus-within) > .bucket-meta-undated { display: none; }
}
.bucket-meta .init-time-remaining:empty { display: none; }
.bucket-chip {
  font: inherit; font-size: 0.75rem; line-height: 1.6; padding: 0 8px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  cursor: pointer;
}
.bucket-chip:hover, .bucket-chip:focus-visible { border-color: var(--accent); color: var(--accent-light); }
.bucket-chip-empty { border-style: dashed; }
.bucket-dup {
  font-size: 0.75rem; font-weight: 600; padding: 0 6px; border-radius: 8px;
  color: var(--amber); background: var(--amber-bg); border: 1px solid var(--amber-border);
}

/* "+ Add bucket goal" tile — sits at the end of the grid as a dashed
 * action card so it reads as a CTA, not a list item. */
.bucket-add {
  background: transparent !important;
  border: 1px dashed var(--border-light) !important;
  color: var(--text-muted) !important;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  justify-content: center;
}
.bucket-add:hover {
  background: var(--accent-bg) !important;
  border-color: var(--accent) !important;
  color: var(--accent-light) !important;
}

/* ==== Top 3 daily focus ==== */
.daily-focus { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.focus-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px;
}
.focus-title {
  font-size: 0.8125rem; font-weight: 700; color: var(--accent-light); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.focus-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.focus-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--surface2); border-radius: 8px; border: 1px solid var(--border);
  font-size: 0.8125rem; font-weight: 500;
}
.focus-item .focus-text { flex: 1; }
.focus-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; background: var(--accent); color: #fff; flex-shrink: 0;
}
.focus-edit-btn {
  margin-left: auto; font-size: 0.75rem; color: var(--text-muted); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.focus-edit-btn:hover { background: var(--surface3); color: var(--text); }

/* ==== Vivid Vision ==== */
.vision-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 12px; overflow: hidden; transition: border-color 0.2s;
}
.vision-section:hover { border-color: var(--border-light); }
.vision-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; cursor: pointer; user-select: none;
}
.vision-section-icon {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.vision-section-title-wrap { flex: 1; margin-left: 12px; }
.vision-section-name { font-size: 0.875rem; font-weight: 700; }
.vision-section-sub  { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.vision-section-toggle { font-size: 0.75rem; color: var(--text-muted); transition: transform 0.2s; }
.vision-section-body {
  padding: 0 18px 16px; font-size: 0.8125rem; line-height: 1.7; color: var(--text);
  overflow: hidden; max-height: 2000px; transition: max-height 0.3s ease, padding 0.3s ease;
}
.vision-section-body.collapsed {
  max-height: 0; padding-top: 0; padding-bottom: 0;
}
.vision-section-body p { margin-bottom: 8px; white-space: pre-wrap; }
.vision-edit-area {
  width: 100%; min-height: 120px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; color: var(--text); font-size: 0.8125rem;
  font-family: inherit; line-height: 1.7; resize: vertical; outline: none;
}
.vision-edit-area:focus { border-color: var(--accent); }

/* ==== 5 Year Plan ==== */
.plan-timeline { display: flex; flex-direction: column; gap: 16px; }
.plan-year-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.plan-year-header {
  padding: 14px 18px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border-bottom: 1px solid var(--border);
  font-size: 0.9375rem; font-weight: 700;
}
.plan-year-header:hover { background: var(--surface3); }
.plan-year-badge {
  font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 10px;
  background: var(--accent-bg); color: var(--accent-text); border: 1px solid var(--accent-border);
}
.plan-year-body { padding: 12px 18px; }
.plan-year-body.collapsed { display: none; }
/* Long term goals: a year's areas sit inside its card; on a phone the
   card's own padding is trimmed so a goal's controls keep their room. */
@media (max-width: 480px) {
  .plan-year-body { padding: 10px 6px; }
  .plan-year-body > .annual-domain { margin-bottom: 8px; }
}
.plan-category { margin-bottom: 12px; }
.plan-cat-title {
  font-size: 0.75rem; font-weight: 700; color: var(--accent-light); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.plan-items { display: flex; flex-direction: column; gap: 4px; }
.plan-item {
  font-size: 0.8125rem; padding: 6px 10px; border-radius: 6px;
  background: var(--surface2); border: 1px solid transparent;
  display: flex; align-items: center; gap: 8px;
}
.plan-item:hover { border-color: var(--border); }
/* A finished 5-year goal is a win, shown like a done bucket item, not
 * faded out (F077). */
.plan-item.plan-done .plan-item-text { color: var(--green); font-weight: 600; }
.plan-item .plan-check { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; flex-shrink: 0; }
.plan-item .plan-item-text { flex: 1; }

/* + Add goal button under each 5-year category. */
.plan-add-btn {
  margin-top: 6px;
  padding: 5px 12px; border-radius: 6px;
  background: transparent; border: 1px dashed var(--border-light);
  color: var(--text-muted); font-family: inherit; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.plan-add-btn:hover {
  background: var(--accent-bg); border-color: var(--accent); color: var(--accent-light);
}
.plan-item-due {
  font-size: 0.75rem; font-weight: 600;
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--accent-bg); color: var(--accent-light); border: 1px solid var(--accent-border);
  white-space: nowrap;
}

/* ==== Sign-in screen ==== */
.signin {
  text-align: center; padding: 64px 16px;
  max-width: 480px; margin: 0 auto;
}
.signin h1 { font-size: 2rem; margin-bottom: 8px; }
.signin p  { color: var(--text-muted); margin-bottom: 24px; }
.signin .btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent); border-radius: 8px;
  font-weight: 600; cursor: pointer;
}
.signin .btn:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.signin .signin-acronym { color: var(--text-muted); font-size: 0.875rem; letter-spacing: 0.02em; margin: -4px 0 12px; }
.signin .signin-acronym b { color: var(--text); font-weight: 700; }
.signin .signin-promise { color: var(--text); font-size: 1.0625rem; line-height: 1.5; }
.signin .signin-notice {
  margin: 0 auto 20px; padding: 10px 14px; border-radius: 8px; font-size: 0.875rem; text-align: left;
  border: 1px solid var(--border-light); background: var(--surface2); color: var(--text);
}
.signin .signin-notice--warn { border-color: var(--amber-border); background: var(--amber-bg); }
.signin .signin-how { color: var(--text); font-size: 0.875rem; }
.signin .signin-fine { font-size: 0.8125rem; margin: 20px 0 0; }
.signin .signin-link {
  display: block; width: 100%; margin-top: 12px; padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.8125rem;
}
.signin .signin-anyway {
  margin-top: 16px; background: none; border: none; padding: 8px; min-height: 44px;
  color: var(--text-muted); text-decoration: underline; font-size: 0.8125rem; cursor: pointer;
}

/* ==== Vivid Vision header / banner / badges (Cowork visual-diff #3–9) ==== */
.vision-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.vision-title {
  display: inline-block; font-size: 1.125rem; font-weight: 700; color: var(--text);
}
.vision-subtitle {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
}
.vision-content-prompt { color: var(--text-muted); font-style: italic; }
/* No ratings to jump to: gone (the rules above would show it). */
.vision-progress {
  font-size: 0.75rem; color: var(--text-muted);
  margin-left: auto; padding-right: 8px;
}
.vision-review-banner {
  background: linear-gradient(135deg, var(--gold-bg), rgba(251,191,36,0.08));
  border: 1px solid var(--gold-border); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 16px; display: none;
  font-size: 0.8125rem; color: var(--gold); font-weight: 600;
  align-items: center; gap: 8px;
}
.vision-review-banner.show { display: flex; }

/* ==== UPW ratings + wheel side-by-side row ==== */
.vision-ratings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}
.vision-ratings-row > .vision-ratings-bar { margin-bottom: 0; }
.vision-ratings-row > .vision-wheel { margin-bottom: 0; }
@media (max-width: 900px) {
  .vision-ratings-row { grid-template-columns: 1fr; }
}

/* ==== UPW wheel-of-life chart ==== */
.vision-wheel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.vision-wheel-svg { max-width: 100%; height: auto; }
.vision-wheel-caption {
  margin-top: 8px; font-size: 0.75rem; color: var(--text-muted);
}
.vision-wheel-svg path:hover { fill-opacity: 1; cursor: help; }
/* The wheel's legend (V4): HTML, so it grows with the text size. */
.vision-wheel-legend {
  list-style: none; margin: 10px 0 0; padding: 0; width: 100%;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 4px 12px;
  font-size: 0.75rem;
}
.vision-wheel-legend li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.vision-wheel-swatch { flex: none; width: 0.625rem; height: 0.625rem; border-radius: 2px; }
.vision-wheel-name { flex: 1 1 auto; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.vision-wheel-score { flex: none; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ==== UPW ratings strip (Vivid Vision) ====
 * The life areas in columns of at least 11rem next to the wheel chart:
 * 4 across on a desktop, fewer as the screen narrows or the text grows,
 * so the labels never compress past readability (they wrap, too). */
.vision-ratings-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr));
  gap: 12px 10px;
  padding: 14px 16px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.vision-ratings-item { min-width: 0; text-align: center; }
/* The area's name, with its ⓘ beside it (V2). */
.vision-ratings-label-row { display: flex; align-items: center; gap: 4px; min-width: 0; margin-bottom: 5px; }
.vision-ratings-label {
  font-size: 0.75rem; font-weight: 700; white-space: normal; overflow-wrap: anywhere; min-width: 0;
  position: relative;
}
.vision-ratings-track {
  height: 6px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.vision-ratings-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.vision-ratings-val-row {
  display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 3px;
}
.vision-ratings-val {
  font-size: 0.75rem; color: var(--text-muted); font-weight: 600; min-width: 28px;
}
.vision-ratings-unrated { font-weight: 500; }
.vision-ratings-btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.vision-ratings-btn {
  width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-size: 0.75rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.vision-ratings-btn:hover { background: var(--border); color: var(--text); }
.vision-ratings-desc {
  font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; margin-top: 4px;
}
/* An area not described yet: a prompt in the muted ink, not faded text (V6). */
.vision-ratings-desc-empty { font-style: italic; }
.vision-ratings-desc-input {
  width: 100%; font-size: 0.75rem; color: var(--text); background: var(--surface2);
  border: 1px solid var(--accent); border-radius: 4px; padding: 3px 6px;
  margin-top: 4px; outline: none; line-height: 1.4; resize: vertical;
  min-height: 48px; font-family: inherit;
}

/* ==== Vision rich-text editor toolbar ==== */
.vision-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 6px; padding: 4px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
}
.vision-tool-btn {
  font-size: 0.75rem; font-weight: 700; padding: 4px 10px; min-width: 28px;
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent; border-radius: 4px; cursor: pointer;
  font-family: inherit; line-height: 1;
}
.vision-tool-btn:hover {
  background: var(--surface3); color: var(--text); border-color: var(--border);
}
.vision-tool-btn:active { transform: translateY(1px); }

/* ==== Vision edit / save / cancel buttons ==== */
.vision-content-text { margin-bottom: 8px; white-space: pre-wrap; }
/* The text uses the card's width (a 68ch measure left half of a wide
   card empty and the text bunched up on its left). */
.vision-section .vision-content-text { font-size: 0.9688rem; line-height: 1.65; }
.vision-btn-row { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.vision-edit-btn {
  font-size: 0.75rem; color: var(--text-muted); background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.vision-edit-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border-light); }
/* A quiet way to add a goal for a section with none (UI audit C2c). */
.vision-add-goal {
  font: inherit; font-size: 0.75rem; color: var(--accent-light); background: none; border: 1px dashed var(--border);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.vision-add-goal:hover, .vision-add-goal:focus-visible { border-style: solid; border-color: var(--accent); }
.vision-save-btn {
  font-size: 0.75rem; color: #fff; background: var(--accent); border: none;
  border-radius: 6px; padding: 5px 12px; cursor: pointer; font-weight: 600;
}
.vision-save-btn:hover { background: var(--accent-dim); }
.vision-cancel-btn {
  font-size: 0.75rem; color: var(--text-muted); background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; cursor: pointer;
}

/* ==== Modal (paste-import) ==== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center;
  z-index: 300;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  /* rem: the dialog widens with the text size (F11). */
  padding: 20px; width: min(25rem, 92vw);
}
.modal h3 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 12px; }
.modal label {
  font-size: 0.75rem; color: var(--text-muted);
  display: block; margin-bottom: 4px; margin-top: 10px;
}
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 7px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-size: 0.8125rem; font-family: inherit; outline: none;
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
  border-color: var(--accent);
}
/* A field's error (views/field-error.js): the field outlined, the
   message under it. */
.modal [aria-invalid="true"], .modal [aria-invalid="true"]:focus { border-color: var(--red); }
.field-error { font-size: 0.75rem; color: var(--red); margin: 4px 0 0; }
.modal-btns { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.modal-btns button {
  padding: 6px 16px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; border: none;
}
.btn-cancel { background: var(--surface2); color: var(--text-muted); }
.btn-cancel:hover { background: var(--surface3); }
.btn-confirm { background: var(--accent); color: #fff; }
.btn-confirm:hover { background: var(--accent-dim); }

/* ==== Last-sync timestamp ==== */
.last-sync {
  font-size: 0.75rem; color: var(--text-muted);
  white-space: nowrap;
}

/* ==== Sync indicator ==== */
.sync-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; color: var(--text-muted);
  padding: 4px 10px; border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.sync-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.2s;
}
.sync-indicator[data-state="idle"]   { opacity: 0.65; }
.sync-indicator[data-state="idle"] .sync-dot   { background: var(--green); }
.sync-indicator[data-state="saving"] { color: var(--accent-light); border-color: var(--accent-border); background: var(--accent-bg); }
.sync-indicator[data-state="saving"] .sync-dot { background: var(--accent-light); animation: sync-pulse 1.2s ease-in-out infinite; }
.sync-indicator[data-state="saved"]  { color: var(--green); border-color: var(--green-border); background: var(--green-bg); opacity: 1; }
.sync-indicator[data-state="saved"] .sync-dot  { background: var(--green); }
.sync-indicator[data-state="pending"] { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); }
.sync-indicator[data-state="pending"] .sync-dot { background: var(--amber); }
.sync-indicator[data-state="error"]  { color: var(--red); border-color: var(--red-border); background: var(--red-bg); }
.sync-indicator[data-state="error"] .sync-dot  { background: var(--red); animation: sync-pulse 0.9s ease-in-out infinite; }
/* Saves given up on over a week ago: calm, no pulse, Discard only. */
.sync-indicator[data-state="stale"] { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); }
.sync-indicator[data-state="stale"] .sync-dot { background: var(--amber); }
.sync-indicator[hidden] { display: none; }
.sync-actions { display: inline-flex; gap: 4px; margin-left: 2px; }
.sync-actions[hidden], .sync-action[hidden] { display: none; }
.sync-action {
  font: inherit; font-size: 0.75rem; font-weight: 600; color: inherit;
  background: transparent; border: 1px solid currentColor;
  border-radius: var(--radius-pill); padding: 1px 7px; cursor: pointer;
}
.sync-action:hover { background: color-mix(in srgb, currentColor 18%, transparent); }
@keyframes sync-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ==== Mobile ==== */
@media (max-width: 768px) {
  .header { padding: 14px; }
  .main { padding: 14px; }
  .filter-bar { margin-left: 0; margin-top: 6px; }
  .horizon-grid { grid-template-columns: 1fr; }
  .init-row { padding-left: 28px; flex-wrap: wrap; }
  .daily-focus { padding: 0 14px; }
  .acct-strip-wrap { padding: 0 14px; }
}

/* Period theme: emoji before the header title, and the button that
   opens the theme dialog (title, emoji, colour, past themes). */
.theme-btn {
  margin-left: 8px; padding: 2px 6px; border-radius: 6px; vertical-align: middle;
  background: transparent; border: 1px solid transparent; cursor: pointer;
  font-size: 0.875rem; line-height: 1; opacity: 0.55;
}
.theme-btn:hover, .theme-btn:focus-visible { opacity: 1; border-color: var(--border); }

/* "By 1 February 2028" in the Vivid Vision subtitle: the account's own
   target date, click to change. Reads as text with a dotted underline. */
.vision-target-btn {
  padding: 0; border: 0; background: none; font: inherit; color: inherit;
  cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px;
}
.vision-target-btn:hover { color: var(--text); }

/* An empty list (emptyMessage): the words, then its one way in, both
   centred (A7). */
.empty-state { padding: 40px 20px; text-align: center; grid-column: 1 / -1; }
.empty-state-text { margin: 0; font-size: 0.875rem; color: var(--text-muted); }
.empty-state-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; }
.empty-state-action { padding: 8px 18px; border: none; border-radius: 8px; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.empty-state-actions .add-btn { margin: 0; }

/* Annual tab toolbar: "+ Add goal" and "Life areas". */
.annual-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* The pencil at the end of the tab bar (C17): rename, hide or reorder
   tabs. */
.tab-customise {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  padding: 6px 10px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--text-muted); font-family: inherit;
  font-size: 0.8125rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.tab-customise-icon { width: 1em; height: 1em; }
.tab-bar > .info-tip-wrap { align-self: center; flex: none; }
.tab-customise:hover, .tab-customise:focus-visible { color: var(--text); border-color: var(--border); }

/* The row editors: Tabs and Life areas (one row per tab or area). */
.row-editor-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.row-editor-row.is-hidden { opacity: 0.5; }
.modal .row-editor-field {
  width: auto; padding: 5px 7px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text); font-size: 0.75rem; font-family: inherit;
}
.modal .row-editor-name { flex: 1; min-width: 0; }
.modal .row-editor-emoji { width: 2.75rem; text-align: center; }
.row-editor-move { cursor: pointer; min-width: 1.75rem; min-height: 1.75rem; }
.row-editor-move:disabled { opacity: 0.4; cursor: default; }
.modal label.row-editor-check {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; cursor: pointer;
}
.modal .row-editor-check input { width: auto; margin: 0; }
.tab-layout-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 8px; }

/* ==== Accountability strip (F045, F056) ==== */
.acct-strip-wrap { max-width: 900px; margin: 12px auto; padding: 0 20px; }
.acct-strip-wrap[hidden] { display: none; }
.acct-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; font-size: 0.75rem;
  background: var(--surface); border: 1px solid var(--border);
}
.acct-strip[data-mood="good"] { border-color: var(--green-border); background: var(--green-bg); }
.acct-strip[data-mood="late"] { border-color: var(--red-border); }
.acct-sep { color: var(--text-muted); opacity: 0.6; }
.acct-chip {
  font-family: inherit; font-size: 0.75rem; font-weight: 600; color: var(--text);
  background: transparent; border: none; padding: 2px 4px; border-radius: 6px;
}
button.acct-chip { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
button.acct-chip:hover { background: var(--surface2); }
.acct-overdue { color: var(--red); }
.acct-due { color: var(--amber); }
.acct-clear { color: var(--green); }
.acct-untouched { color: var(--amber); font-weight: 500; }
.acct-pace { color: var(--text-muted); font-weight: 500; }
.acct-pace[data-pace="behind"] { color: var(--amber); }
.acct-pace[data-pace="ahead"] { color: var(--green); }
.fpill[hidden] { display: none; }
.fpill-acct { border-style: dashed; }

/* Overdue / untouched lists */
.item-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.item-list-where {
  margin-top: 8px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-muted);
}
.item-list-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 8px;
  border-radius: 8px; background: var(--surface2);
}
/* At least 12rem before the badge and buttons wrap under it (okr-1). */
.item-list-name { flex: 1 1 12rem; min-width: 0; font-size: 0.8125rem; overflow-wrap: anywhere; }
.flash-row { animation: flashRow 1.6s ease-out; }
@keyframes flashRow {
  0%, 40% { box-shadow: 0 0 0 2px var(--accent-light); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .flash-row { animation: none; outline: 2px solid var(--accent-light); }
}

/* Settings */
.settings-form { display: flex; flex-direction: column; gap: 8px; }
.settings-group-title {
  margin-top: 6px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-muted);
}
.settings-row { display: flex; gap: 8px; align-items: flex-start; font-size: 0.8125rem; color: var(--text); cursor: pointer; }
/* Over the generic .modal label (block, muted, 12px), as
   .plan-year-choice does (C26). */
.modal label.settings-row { display: flex; margin: 2px 0 0; font-size: 0.8125rem; color: var(--text); }
/* The box grows with the text and keeps its distance from it (F11). */
.settings-row input[type="checkbox"] { flex: none; margin: 0.15em 0 0; }
/* Touch keeps its 22px box (the coarse-pointer rule below). */
@media not all and (pointer: coarse) {
  .settings-row input[type="checkbox"] { width: 1.1em; height: 1.1em; }
}
.settings-hint { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }

/* Settings sections: Preferences / Account / Advanced */
.settings-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px;
  border-bottom: 1px solid var(--border); padding-bottom: 8px;
  /* Stays at the top of the scrolling body (F7). */
  position: sticky; top: -3px; z-index: 1; background: var(--surface); padding-top: 3px;
  /* -3px: over the body's 3px padding (for focus rings), not under it. */
}
/* A height of its own, at the top of the screen (F7): see the check-in's. */
.modal:has(.settings-sections) { height: min(52rem, calc(100dvh - 2 * var(--modal-gap))); max-height: none; }
/* One row that scrolls rather than wraps (C26): on phones, and in the
   dialog's width elsewhere once Finance adds a fifth section. */
.settings-tabs { flex-wrap: nowrap; overflow-x: auto; }
@media (max-width: 480px) {
  .settings-tab { flex: 1 0 auto; padding: 5px 8px; }
}
.settings-tab {
  flex: 0 0 auto; padding: 5px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer;
}
.settings-tab:hover { color: var(--text); background: var(--surface2); }
.settings-tab.active { background: var(--surface2); color: var(--text); border-color: var(--accent); }
.settings-pane[hidden] { display: none; }
.settings-pane > div { display: flex; flex-direction: column; gap: 8px; }
.settings-block { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.settings-text { font-size: 0.8125rem; color: var(--text); line-height: 1.5; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-actions .fpill { font-size: 0.75rem; padding: 5px 12px; color: var(--text); }
.settings-actions .settings-danger { border-color: var(--red-border); color: var(--red); }
.settings-actions .settings-danger:hover { background: var(--red-bg); }
.settings-actions .fpill:disabled { opacity: 0.6; cursor: progress; }

/* The account button in the header: the signed-in account's initial. */
.account-btn {
  width: 2rem; height: 2rem; padding: 0; border-radius: 50%;
  font-family: inherit; font-size: 0.875rem; font-weight: 700; color: var(--text); background: var(--surface2);
}
@media (pointer: coarse) { .account-btn { min-width: 44px; min-height: 44px; } }

/* The owner's invite list (Settings → Advanced). */
.invite-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.invite-row { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.invite-email { flex: 1; overflow-wrap: anywhere; }
.invite-tag { font-size: 0.75rem; color: var(--text-muted); }
.invite-form { display: flex; gap: 8px; }
.invite-form input { flex: 1; }
.invite-error { color: var(--red); }
/* The invite-only screen's buttons, one under another on a phone. */
.signin-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.signin .btn--ghost { background: transparent; color: var(--text); border-color: var(--border-light); }
.signin .btn--ghost:hover { background: var(--surface2); }
.signin a { color: var(--accent-light); }

/* Onboarding (views/onboarding.js). `.modal label` and `.modal input`
   style form fields; these are cards with a radio. */
.modal .onboarding-template { display: flex; margin: 0; font-size: 0.875rem; color: var(--text); }
.modal .onboarding-template input { width: auto; padding: 0; flex: none; }
.onboarding { display: flex; flex-direction: column; gap: 10px; }
.onboarding-step { display: flex; flex-direction: column; gap: 10px; }
.onboarding-step[hidden] { display: none; }
.onboarding-step h4 { font-size: 1rem; }
.onboarding-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.onboarding-progress { font-size: 0.75rem; color: var(--text-muted); }
.onboarding-points { padding-left: 18px; font-size: 0.875rem; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.onboarding-templates { display: flex; flex-direction: column; gap: 8px; }
.onboarding-template {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer; font-size: 0.875rem; color: var(--text);
}
.onboarding-template:has(input:checked) { border-color: var(--accent); background: var(--surface2); }
.onboarding-template input { margin-top: 4px; }
.onboarding-template span { display: flex; flex-direction: column; gap: 2px; }
.onboarding-theme { display: flex; gap: 8px; }
.onboarding-theme .settings-field:not(.settings-emoji) { flex: 1; }
.onboarding-theme .settings-emoji { width: 72px; }
.onboarding-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.onboarding-msg:empty { display: none; }

/* Delete my data (views/delete-data.js). */
.delete-data { display: flex; flex-direction: column; gap: 10px; }
.delete-data .fpill { align-self: flex-start; font-size: 0.75rem; padding: 5px 12px; color: var(--text); }
.delete-data-label { font-size: 0.8125rem; color: var(--text); }
.delete-data-msg:empty { display: none; }

/* Diagnostics (Settings → Advanced). */
.diag-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 0.8125rem; color: var(--text); }
.diag-list dt { color: var(--text-muted); }
.diag-list dd { overflow-wrap: anywhere; }
.diag-details summary { cursor: pointer; font-size: 0.75rem; color: var(--text-muted); }
.diag-report {
  max-height: 240px; overflow: auto; margin-top: 6px; padding: 8px; border-radius: 6px; font-size: 0.75rem;
  background: var(--surface2); border: 1px solid var(--border); white-space: pre-wrap; user-select: all;
}

/* A short status line (views/status.js). */
.app-status {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10000;
  max-width: min(420px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 8px;
  background: var(--surface3); color: var(--text); border: 1px solid var(--border-light);
  font-size: 0.8125rem; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}
.app-status[hidden] { display: none; }

/* ==== Overdue triage (F156) ==== */
.init-time-remaining.time-overdue[role="button"] { cursor: pointer; }
.init-time-remaining.time-overdue[role="button"]:hover,
.init-time-remaining.time-overdue[role="button"]:focus-visible {
  outline: 2px solid var(--red-border); outline-offset: 1px;
}
.slip-chip, .letgo-chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 1px 7px; border-radius: 10px; font-size: 0.75rem; font-weight: 600;
}
.slip-chip { color: var(--amber); background: var(--amber-bg); border: 1px solid var(--amber-border); }
.letgo-chip { color: var(--text-muted); border: 1px solid var(--border); cursor: help; }
.triage { display: flex; flex-direction: column; gap: 8px; }
.triage-head { font-size: 0.8125rem; color: var(--text); margin: 0; }
.triage-ask, .triage-note { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 4px; }
.triage-btn {
  font-family: inherit; font-size: 0.8125rem; font-weight: 600; text-align: left;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
}
.triage-btn:hover { border-color: var(--accent); }
.triage-done { color: var(--green); }
.triage-letgo, .triage-letgo-confirm { color: var(--text-muted); }
.triage-pick, .triage-reason { display: flex; gap: 6px; align-items: center; }
.triage-pick .triage-btn, .triage-reason .triage-btn { white-space: nowrap; }
.triage-pick select, .triage-reason-input {
  padding: 6px 8px; border-radius: 6px; font-size: 0.8125rem; font-family: inherit;
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
}
.triage-reason-input { flex: 1; min-width: 0; }
.triage-reason[hidden], .triage-btn[hidden] { display: none; }

/* ==== Celebrations and the Wins wall (F051) ==== */
.win-burst { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 10000; }
.win-particle {
  position: absolute; left: 0; top: 0; font-size: 1rem; color: var(--gold);
  transform: translate(-50%, -50%); animation: winBurst 1.1s ease-out forwards;
}
@keyframes winBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); }
}
.win-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9998;
  display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--gold-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35); animation: winToastIn 0.25s ease-out;
}
.win-toast-calm { animation: none; }
@keyframes winToastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.win-toast-emoji { font-size: 1.375rem; }
.win-toast-text { display: flex; flex-direction: column; min-width: 0; font-size: 0.8125rem; }
.win-toast-title { overflow-wrap: anywhere; }
.win-toast-detail, .win-toast-reward { font-size: 0.75rem; color: var(--text-muted); }
.win-toast-reward { color: var(--gold); }
.win-toast-action {
  font-family: inherit; font-size: 0.75rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  padding: 5px 10px; border-radius: 8px; background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-border);
}
.win-toast-close { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .win-particle, .win-toast { animation: none; }
}

.wins-wall { display: flex; flex-direction: column; gap: 16px; }
.wins-empty { padding: 40px 20px; text-align: center; opacity: 0.6; font-size: 0.875rem; }
.wins-month-title {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px;
  font-size: 0.9375rem; font-weight: 700; color: var(--text);
}
.wins-month-count { font-size: 0.75rem; font-weight: 600; color: var(--green); }
.wins-list { display: flex; flex-direction: column; gap: 6px; }
.win-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--green);
}
.win-card.win-medium { border-left-color: var(--accent-light); }
.win-card.win-big { border-left-color: var(--purple); }
.win-card.win-celebrated { background: var(--gold-bg); border-color: var(--gold-border); border-left-color: var(--gold); }
.win-icon { font-size: 1rem; }
.win-name { flex: 1; min-width: 0; font-size: 0.8125rem; font-weight: 600; overflow-wrap: anywhere; }
.win-meta { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.wins-before summary { cursor: pointer; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
@media (max-width: 640px) {
  .win-card { flex-wrap: wrap; }
  .win-meta { white-space: normal; width: 100%; padding-left: 26px; }
}

/* ==== Rewards (settings + Wins tab) ==== */
.settings-field { display: flex; flex-direction: column; gap: 3px; font-size: 0.75rem; color: var(--text-muted); }
.settings-field input, .settings-field select, .settings-preset {
  padding: 6px 8px; border-radius: 6px; font-size: 0.8125rem; font-family: inherit;
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
}
.settings-own { display: flex; gap: 8px; }
.settings-own[hidden] { display: none; }
.settings-own .settings-emoji { flex: 0 0 80px; }
.settings-own .settings-field:not(.settings-emoji) { flex: 1; }
.rewards-panel {
  background: var(--surface); border: 1px solid var(--gold-border); border-radius: 12px;
  padding: 12px 16px; display: flex; flex-direction: column; gap: 10px;
}
.rewards-title { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 0.9375rem; color: var(--gold); }
.rewards-tally { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.reward-menu { display: flex; flex-direction: column; gap: 4px; }
.reward-menu-row { display: flex; gap: 10px; font-size: 0.8125rem; }
.reward-tier { flex: 0 0 110px; color: var(--text-muted); cursor: help; }
.reward-text { color: var(--text); font-weight: 600; }
.reward-edit { align-self: flex-start; }
.to-claim { display: flex; flex-direction: column; gap: 6px; }
.to-claim-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; background: var(--surface2);
}
.to-claim-btn {
  font-family: inherit; font-size: 0.75rem; font-weight: 700; white-space: nowrap; cursor: pointer;
  padding: 4px 10px; border-radius: 8px; background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold-border);
}

/* ==== Metrics tab ==== */
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.metric-title { margin: 0; font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.metric-note { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.metric-warn { color: var(--amber); }
.metric-empty-areas summary { cursor: pointer; }
@media (pointer: coarse) { .metric-empty-areas summary { min-height: 44px; display: flex; align-items: center; } }
.metric-heatmap-wrap { overflow-x: auto; }
.metric-heatmap-wrap .metric-heatmap { overflow-x: visible; }
.heat-months { display: flex; gap: 2px; min-height: 14px; line-height: 1.2; font-size: 0.75rem; color: var(--text-muted); }
.heat-month { width: 10px; flex: none; overflow: visible; white-space: nowrap; }
.heat-key { display: flex; align-items: center; gap: 3px; margin-top: 6px; font-size: 0.75rem; color: var(--text-muted); }
.heat-key .heat-cell { display: inline-block; }
.heat-key .heat-cell:first-of-type { margin-left: 3px; }
.heat-key .heat-cell:last-of-type { margin-right: 3px; }
.metric-list { margin: 0; padding-left: 18px; font-size: 0.75rem; color: var(--text-muted); }
.metric-hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.metric-hero-value { font-size: 1.875rem; font-weight: 800; color: var(--text); }
.metric-hero-label { font-size: 0.75rem; color: var(--text-muted); }
.metric-hero-value.metric-hero-empty { font-size: 0.9375rem; font-weight: 600; color: var(--text-muted); }
.metric-rate { align-self: flex-start; margin-top: 6px; }
/* Vertical bars: one series, one hue; recessive track. */
.metric-columns { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.metric-columns-dense { gap: 3px; }
.metric-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.metric-col-value { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); min-height: 12px; }
.metric-col-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.metric-col-fill { width: 100%; min-height: 0; background: var(--accent-light); border-radius: 4px 4px 0 0; opacity: 0.75; }
.metric-col-current .metric-col-fill { opacity: 1; }
.metric-col:hover .metric-col-fill { opacity: 1; }
.metric-col-label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; min-height: 12px; }
/* Completion's quarter over its year, and its counts (M2, C19). */
.metric-completion .metric-columns { height: 10rem; }
.metric-col-label { text-align: center; line-height: 1.2; }
.metric-col-year { display: block; }
.metric-col-sub { font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.2; min-height: 2.4em; overflow-wrap: anywhere; }
/* Horizontal bars. */
.metric-rows { display: flex; flex-direction: column; gap: 6px; }
/* Names wrap to a second line rather than being cut (M2). */
.metric-row { display: grid; grid-template-columns: minmax(0, 40%) 1fr auto; gap: 8px; align-items: center; font-size: 0.75rem; }
.metric-row-label { color: var(--text); min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.metric-row-track { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.metric-row-fill { height: 100%; border-radius: 4px; background: var(--accent-light); }
.metric-row-text { color: var(--text-muted); white-space: nowrap; }
/* Activity heatmap: one hue (green), stepped light → dark. */
.metric-heatmap { display: flex; gap: 2px; overflow-x: auto; }
.heat-col { display: flex; flex-direction: column; gap: 2px; }
.heat-cell { width: 10px; height: 10px; border-radius: 2px; background: var(--surface2); }
.heat-1 { background: rgba(52, 211, 153, 0.30); }
.heat-2 { background: rgba(52, 211, 153, 0.50); }
.heat-3 { background: rgba(52, 211, 153, 0.75); }
.heat-4 { background: rgba(52, 211, 153, 1); }
@media (max-width: 640px) {
  .metrics { grid-template-columns: 1fr; }
}

/* ==== Close out a period, and the Year in review (F046) ==== */
.closeout-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; font-size: 0.8125rem;
  background: var(--accent-bg); border: 1px solid var(--accent-border); color: var(--text);
}
.closeout-banner.closeout-done { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
.okr-board-btn.okr-board-archived { opacity: 0.6; }
.okr-board-btn.okr-board-archived .okr-board-label::after { content: ' ✓'; }
.closeout { display: flex; flex-direction: column; gap: 10px; }
.closeout-score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.closeout-pct { font-size: 1.875rem; font-weight: 800; color: var(--accent-light); }
.closeout-detail, .closeout-note { font-size: 0.75rem; color: var(--text-muted); margin: 0; }
.closeout-all { display: flex; gap: 6px; align-items: center; font-size: 0.75rem; color: var(--text-muted); }
.closeout-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.closeout-row {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center;
  padding: 6px 8px; border-radius: 8px; background: var(--surface2);
}
.closeout-name { font-size: 0.8125rem; overflow-wrap: anywhere; }
.closeout-sub { display: block; font-size: 0.75rem; color: var(--text-muted); }
.closeout-why { display: block; font-size: 0.75rem; color: var(--text-muted); font-style: italic; }
.closeout-choice, .closeout-reason {
  padding: 5px 8px; border-radius: 6px; font-size: 0.75rem; font-family: inherit;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.closeout-reason { grid-column: 1 / -1; }
.closeout-reason[hidden] { display: none; }
.wins-reviews { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.year-review-wrap { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow-y: auto; }
.yr-print { align-self: flex-start; }
.year-review { display: flex; flex-direction: column; gap: 16px; }
.yr-title { margin: 0; font-size: 1.25rem; }
.yr-heads { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.yr-head { display: flex; flex-direction: column; padding: 10px; border-radius: 10px; background: var(--surface2); }
.yr-head-value { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.yr-head-label { font-size: 0.75rem; color: var(--text-muted); }
.yr-h { margin: 0 0 6px; font-size: 0.8125rem; }
.yr-note { margin: 4px 0 0; font-size: 0.75rem; color: var(--text-muted); }
.yr-list { margin: 0; padding-left: 18px; font-size: 0.8125rem; display: flex; flex-direction: column; gap: 2px; }
.yr-empty { color: var(--text-muted); }
.yr-months { display: flex; gap: 4px; align-items: flex-end; height: 90px; }
.yr-month { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.yr-month-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.yr-month-fill { width: 100%; background: var(--green); border-radius: 3px 3px 0 0; opacity: 0.8; }
.yr-month-count, .yr-month-label { font-size: 0.75rem; color: var(--text-muted); min-height: 12px; }
/* Printing the Year in review prints just the review, dark on white.
 * Printing anything else is untouched. */
@media print {
  body:has(.year-review) > *:not(.modal-overlay) { display: none !important; }
  body:has(.year-review) .modal-overlay { position: static !important; background: none !important; }
  body:has(.year-review) .modal {
    box-shadow: none !important; max-width: none !important; width: auto !important;
    background: #fff !important; border: none !important;
  }
  body:has(.year-review) .modal * { color: #111 !important; }
  body:has(.year-review) .yr-head { background: #f2f2f2 !important; }
  body:has(.year-review) .yr-month-fill { background: #2e8b57 !important; }
  body:has(.year-review) .modal-btns, .yr-print { display: none !important; }
  .year-review-wrap { max-height: none; overflow: visible; }
  /* All of it on paper, not the screen's scroller. */
  body:has(.year-review) .modal, body:has(.year-review) .modal-body {
    display: block !important; max-height: none !important; overflow: visible !important;
  }
}

/* ==== 5-year accountability (F076, F071) ==== */
.plan-year-current { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.plan-year-behind { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.plan-year-overdue { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.plan-year-progress { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 0.75rem; color: var(--text-muted); }
.plan-item-badge { min-width: 0; }

/* ==== Life wheel then and now (F080) ==== */
.vision-ratings-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 14px; font-size: 0.75rem; }
.rating-delta { font-weight: 700; }
.rating-up { color: var(--green); }
.rating-down { color: var(--red); }
.rating-when { color: var(--text-muted); }
.rating-stale { color: var(--amber); font-weight: 600; }

/* ==== Plan mode: reorder handles and ⋯ menus (F034, F012) ==== */
.plan-ctl { display: none; }
.plan-mode .plan-ctl { display: inline-flex; }
.sort-handle {
  align-items: center; justify-content: center; flex: 0 0 auto;
  /* Grows with the text size; 24px at the default (WCAG 2.5.8). */
  width: max(24px, 1.55em); height: max(24px, 1.55em); border-radius: 6px; cursor: grab;
  color: var(--text-muted); font-size: 0.875rem; user-select: none;
}
.sort-handle:hover, .sort-handle:focus-visible { color: var(--text); background: var(--surface2); outline: none; }
.sort-handle:focus-visible { box-shadow: 0 0 0 2px var(--accent-light); }
.sort-dragging { opacity: 0.6; }
.sort-dragging .sort-handle { cursor: grabbing; }
.sort-before { box-shadow: 0 -2px 0 0 var(--accent-light); }
.sort-after { box-shadow: 0 2px 0 0 var(--accent-light); }
.sort-handle.sort-solo { visibility: hidden; }
.item-menu-open {
  align-items: center; justify-content: center; flex: 0 0 auto;
  width: max(24px, 1.8em); height: max(24px, 1.65em); border-radius: 6px; cursor: pointer; font-family: inherit;
  background: transparent; border: 1px solid var(--border); color: var(--text-muted); font-size: 0.8125rem;
}
.item-menu-open:hover, .item-menu-open[aria-expanded="true"] { color: var(--text); border-color: var(--text-muted); }
.item-menu {
  position: absolute; z-index: 9990; min-width: 170px; padding: 4px;
  display: flex; flex-direction: column; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.item-menu-btn {
  /* 36px rows, 14px text (UI audit D9); 44px on touch (below). */
  text-align: left; font-family: inherit; font-size: 0.875rem; padding: 8px 12px; min-height: 36px; border-radius: 6px;
  background: transparent; border: none; color: var(--text); cursor: pointer;
}
.item-menu-btn:hover:not(:disabled), .item-menu-btn:focus-visible { background: var(--surface2); outline: none; }
.item-menu-btn:disabled { color: var(--text-muted); opacity: 0.5; cursor: default; }
.item-menu-danger { color: var(--red); }
#planBtn.active { background: var(--accent-bg); color: var(--text); border-color: var(--accent); }

/* ==== Groups: rename, move, delete (F057, F072) ==== */
.horizon-title-row, .plan-cat-row { display: flex; align-items: center; gap: 6px; }
.horizon-title-row h3 { flex: 1; min-width: 0; }
.plan-mode .plan-year-tools { display: flex; justify-content: flex-end; padding: 6px 12px 0; }
.group-dialog { display: flex; flex-direction: column; gap: 10px; }
.group-choice { display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem; color: var(--text); }
.group-choice > input[type="radio"] { position: absolute; opacity: 0; }
.group-choice > span { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.group-choice > span::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-light); flex: 0 0 auto;
}
.group-choice > input:checked + span::before { border-color: var(--accent-light); background: var(--accent-light); box-shadow: inset 0 0 0 2px var(--surface); }
.group-choice > input:focus-visible + span { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.group-choice-danger > span { color: var(--red); }

/* ==== Undo and Recently deleted (F018, F138) ==== */
.undo-toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 9997;
  display: flex; align-items: center; gap: 12px; max-width: min(520px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: 12px; font-size: 0.8125rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.undo-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.undo-btn {
  font-family: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer; padding: 5px 12px; border-radius: 8px;
  background: var(--accent-bg); color: var(--accent-light); border: 1px solid var(--accent-border);
}
.confirm-text { margin: 0 0 8px; font-size: 0.8125rem; color: var(--text); white-space: pre-line; }
.btn-danger-confirm { background: var(--red) !important; border-color: var(--red) !important; }
/* What else a restore brings back, under its row. */
.trash-also { flex-basis: 100%; }

/* ==== Loading skeleton (F147) ==== */
/* In index.html's #app until boot draws the sign-in screen or the
 * dashboard (both clear #app). A banner added to #app instead (an error,
 * or a note before sign-in) hides it, so it never says "Loading" next to
 * a failure. */
.boot-skeleton { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.boot-skeleton:not(:only-child) { display: none; }
.boot-skeleton .sk-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.boot-skeleton .sk-tabs, .boot-skeleton .sk-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.boot-skeleton .sk-rows { display: flex; flex-direction: column; gap: 8px; }
.sk-bar, .sk-pill, .sk-card, .sk-row {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface2) 50%, var(--surface) 100%);
  background-size: 200% 100%; animation: skShimmer 1.4s ease-in-out infinite;
}
.sk-title { width: 220px; height: 24px; }
.sk-sub { width: 320px; max-width: 80%; height: 12px; }
.sk-pill { width: 96px; height: 28px; border-radius: 14px; }
.sk-card { flex: 1 1 160px; height: 72px; }
.sk-row { height: 44px; }
.sk-text { margin-top: 18px; text-align: center; font-size: 0.8125rem; color: var(--text-muted); }
/* After 20s with no sign-in screen or dashboard, say what to do. */
.sk-slow {
  margin-top: 6px; text-align: center; font-size: 0.8125rem; color: var(--text);
  visibility: hidden; animation: skReveal 0s linear 20s forwards;
}
.sk-slow.sk-now { visibility: visible; animation: none; }
@keyframes skReveal { to { visibility: visible; } }
@keyframes skShimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .sk-bar, .sk-pill, .sk-card, .sk-row { animation: none; }
}

/* ==== Updated or reset in another tab (F015) ==== */
/* Covers the page once another tab has upgraded the saved copy, or
 * deleted it (a Reset): this tab can no longer read or save, so the
 * only way on is Reload. */
.upgrade-overlay {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5, 8, 20, 0.78);
}
.upgrade-box {
  max-width: 420px; padding: 20px 22px; border-radius: 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
.upgrade-box h2 { margin: 0 0 8px; font-size: 1.0625rem; }
.upgrade-box p { margin: 0 0 14px; font-size: 0.8125rem; color: var(--text-muted); }

/* ==== Weekly check-in (F098) ==== */
/* The check-in's dialog is wider than the 400px default. */
.modal:has(.checkin) { width: 560px; }
/* The check-in and Settings open at the top with a height of their own,
 * so moving between steps or sections doesn't move the dialog (its
 * Next, its section tabs) under the pointer. The body scrolls. */
.modal-overlay:has(.checkin), .modal-overlay:has(.settings-sections) {
  --modal-gap: max(1rem, 4dvh);
  align-items: flex-start; padding-top: var(--modal-gap);
}
.modal:has(.checkin) { height: min(44rem, calc(100dvh - 2 * var(--modal-gap))); max-height: none; }
.checkin label.checkin-name, .checkin .checkin-field { margin: 0; }
.checkin .checkin-field { margin-bottom: 12px; }
.checkin-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.checkin-dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.checkin-dots li { width: 8px; height: 8px; border-radius: 50%; background: var(--border-light); }
.checkin-dots li.done { background: var(--green); }
.checkin-dots li.now { background: var(--accent-light); box-shadow: 0 0 0 3px var(--accent-bg); }
.checkin-step { margin: 0; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); flex: 1; }
.checkin-back {
  font: inherit; font-size: 0.75rem; background: none; border: none; color: var(--accent-light); cursor: pointer; padding: 4px 6px;
}
.checkin-lead { margin: 0 0 8px; font-size: 0.875rem; color: var(--text); }
.checkin-hint { margin: 0 0 8px; font-size: 0.75rem; color: var(--text-muted); }
/* A long overdue list: the rest at once (UI audit D7). */
/* Spaced off the list it acts on, and from the dialog's own buttons. */
.checkin-bulk { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.checkin-bulk .add-btn { margin: 0; }
.checkin-bulk-done { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 8px; }
.checkin-bulk-note { margin: 0; font-size: 0.8125rem; color: var(--green); }
.checkin-bulk-note:empty { display: none; }
.checkin-bulk-undo {
  font: inherit; font-size: 0.8125rem; font-weight: 600; background: none; border: none; padding: 2px 4px;
  color: var(--accent-light); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
@media (pointer: coarse) { .checkin-bulk .add-btn, .checkin-decide { min-height: 44px; } }
/* The dialog's body scrolls, so a long list needs no scroller of its own. */
.checkin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checkin-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 7px 10px; border-radius: 8px;
  background: var(--surface2); font-size: 0.8125rem;
}
.checkin-name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.checkin-meta { font-size: 0.75rem; color: var(--text-muted); }
.checkin-meta.time-overdue { color: var(--red-text); font-weight: 600; }
.checkin-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.checkin-seg-btn {
  font: inherit; font-size: 0.75rem; padding: 4px 10px; min-height: 30px; background: transparent; color: var(--text-muted);
  border: none; border-left: 1px solid var(--border); cursor: pointer;
}
.checkin-seg-btn:first-child { border-left: none; }
.checkin-seg-btn.on { background: var(--accent-bg); color: var(--accent-light); font-weight: 600; }
.checkin-range { flex: 1 1 140px; accent-color: var(--accent); }
.checkin-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 0.75rem; color: var(--text-muted); }
.checkin-field textarea, .checkin-field input {
  font: inherit; font-size: 0.8125rem; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
}
/* The header line: the next check-in and the streak, as a link-like
 * button that opens the check-in. */
.checkin-line {
  font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.checkin-line:hover, .checkin-line:focus-visible { color: var(--accent-light); }
.acct-checkin { color: var(--accent-light); font-weight: 600; }
/* Started the next quarter early: the note and the way back. */
.period-ahead-note { color: var(--accent-light); font-weight: 600; }

/* ==== Stability Check (Peterson, a Life Areas lens) ==== */
/* Status by text and mark (✓ ~ ✗) as well as colour. */
.metric-stability { grid-column: 1 / -1; }
.stab-summary { margin: 0; font-size: 0.8125rem; color: var(--text); }
.stab-take { align-self: flex-start; }
.stab-due { border-color: var(--amber-border); color: var(--amber); }
.stab-nudge {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--amber-bg); border: 1px solid var(--amber-border); font-size: 0.75rem; color: var(--text);
}
.stab-scroll { overflow-x: auto; }
.stab-table { border-collapse: separate; border-spacing: 2px; font-size: 0.75rem; }
.stab-table th, .stab-table td { padding: 5px 8px; text-align: left; white-space: nowrap; border-radius: 6px; }
.stab-table thead th { font-weight: 600; color: var(--text-muted); font-size: 0.75rem; }
.stab-q { color: var(--text); font-weight: 600; }
.stab-cell { color: var(--text-muted); background: var(--surface2); }
.stab-yes { background: var(--green-bg); color: var(--green); }
.stab-somewhat { background: var(--amber-bg); color: var(--amber); }
.stab-no { background: var(--red-bg); color: var(--red); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.modal:has(.stab-form) { width: 600px; }

/* ==== Today (F058, in place of Top 3) ==== */
.today-head { flex-wrap: wrap; }
.today-date { color: var(--text-muted); font-weight: 500; }
.today-streak {
  margin-left: auto; font-size: 0.75rem; font-weight: 700; color: var(--gold);
  background: var(--gold-bg); border-radius: 10px; padding: 2px 8px;
}
.today-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.today-empty { font-size: 0.75rem; color: var(--text-muted); padding: 6px 0; }
.today-item { flex-wrap: wrap; }
.today-check { width: 18px; height: 18px; accent-color: var(--green); flex-shrink: 0; }
.today-done .focus-text { text-decoration: line-through; color: var(--text-muted); }
.today-badge {
  font-size: 0.75rem; font-weight: 600; color: var(--amber); background: var(--amber-bg);
  border: 1px solid var(--amber-border); border-radius: 8px; padding: 1px 6px;
}
.today-linked {
  flex-basis: 100%; padding: 0 0 0 28px; font: inherit; font-size: 0.75rem; color: var(--text-muted);
  background: none; border: none; text-align: left; cursor: pointer; min-height: 28px;
}
.today-linked:hover, .today-linked:focus-visible { color: var(--text); text-decoration: underline; }
.today-link-add {
  font: inherit; font-size: 0.75rem; background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px 6px; border-radius: 6px; min-height: 28px;
}
.today-link-add:hover, .today-link-add:focus-visible { color: var(--text); background: var(--surface2); }
.today-link.today-relink { flex: 1 1 100%; margin-left: 28px; max-width: calc(100% - 28px); font-size: 0.75rem; }
.today-item .focus-text { transition: background 0.12s; border-radius: 3px; }
.today-item .focus-text:hover { background: var(--accent-bg); cursor: text; }
.today-undated { color: var(--text-muted); background: none; border-color: var(--border); }
.today-remove {
  font: inherit; font-size: 1rem; line-height: 1; background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px 6px; border-radius: 6px; min-width: 28px; min-height: 28px;
}
.today-remove:hover, .today-remove:focus-visible { color: var(--red); background: var(--red-bg); }
.today-earlier { margin-top: 12px; }
.today-earlier-title { margin: 0 0 6px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.today-carry {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 12px;
  border: 1px dashed var(--border-light); border-radius: 8px; font-size: 0.8125rem;
}
.today-carry .focus-text { flex: 1; }
.today-letgo-btn { font: inherit; font-size: 0.75rem; background: none; border: none; color: var(--text-muted); cursor: pointer; text-decoration: underline; }
.today-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
/* As tall as the field and the link beside it (okr-6). */
.today-add .today-add-btn { align-self: stretch; }
.today-input {
  /* min-width 0: a text field is as wide as its size attribute by
     default, which with large text and a wide font is wider than a
     phone; on its own line it shrinks to fit. */
  flex: 1 1 200px; min-width: 0; font: inherit; font-size: 0.8125rem; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
}
.today-link {
  flex: 0 1 220px; min-width: 0; font: inherit; font-size: 0.75rem; padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
}
.today-note { margin: 6px 0 0; font-size: 0.75rem; color: var(--amber); }
.today-note:empty { display: none; }
.today-chip {
  font-size: 0.75rem; font-weight: 700; border-radius: 8px; padding: 1px 7px;
  color: var(--accent-text); background: var(--accent-bg); border: 1px solid var(--accent-border);
}
.today-chip-done { color: var(--green-text); background: var(--green-bg); border-color: var(--green-border); }
.today-older { margin: 8px 0 0; font-size: 0.75rem; color: var(--text-muted); }
.today-carry-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==== Measurable key results (F041, F155) ==== */
.kr-measure {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.75rem; font-weight: 600;
  color: var(--text); background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 2px 8px; cursor: pointer; white-space: nowrap;
}
.kr-measure:hover, .kr-measure:focus-visible { border-color: var(--accent); }
.kr-measure-track { width: 48px; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.kr-measure-fill { display: block; height: 100%; background: var(--accent-light); border-radius: 3px; }
.kr-measure-done { color: var(--green); }
.kr-measure-done .kr-measure-fill { background: var(--green); }
.kr-measure-empty { border-style: dashed; color: var(--text-muted); font-weight: 500; display: none; }
.plan-mode .kr-measure-empty { display: inline-flex; }
.measure-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.measure-fields .triage-error { grid-column: 1 / -1; margin: 0; }
.measure-fields .triage-error:empty { display: none; }
.checkin-measures { margin-bottom: 14px; }
.checkin-measure {
  width: 90px; font: inherit; font-size: 0.8125rem; padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
}
/* A KR row wraps on a phone, as an initiative row does; the measure's
 * bar gives way first. */
@media (max-width: 768px) {
  .kr-row { flex-wrap: wrap; }
  .kr-measure-track { display: none; }
}
.measure-hint { grid-column: 1 / -1; margin: 0; }

/* ==== Goal links up the ladder (F157) ==== */
.serves-chip {
  display: inline-flex; align-items: center; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: inherit; font-size: 0.75rem; color: var(--accent-light); background: var(--accent-bg);
  border: 1px solid var(--accent-border); border-radius: 10px; padding: 1px 8px; cursor: pointer;
}
.serves-chip:hover, .serves-chip:focus-visible { border-color: var(--accent); }
.serves-empty { color: var(--text-muted); background: transparent; border-style: dashed; border-color: var(--border-light); display: none; }
.plan-mode .serves-empty { display: inline-flex; }
.vision-feed { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface2); }
.vision-feed-head { margin: 0 0 6px; font-size: 0.75rem; font-weight: 700; color: var(--text); }
.vision-feed-list { margin: 0; padding-left: 18px; font-size: 0.75rem; color: var(--text); }
.vision-feed-done { color: var(--green); }
.vision-feed-meta { color: var(--text-muted); }
.serves-gone { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-border); }

/* ==== Vivid Vision sections: add, move, delete (F069) ==== */
.vision-add-section {
  display: block; width: 100%; margin: 4px 0 12px; padding: 10px; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
  background: transparent; border: 1px dashed var(--border-light);
}
.vision-add-section:hover, .vision-add-section:focus-visible { color: var(--accent-light); border-color: var(--accent); background: var(--accent-bg); }
.vision-removed { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }
.vision-restore { font: inherit; font-size: 0.75rem; background: none; border: none; color: var(--accent-light); cursor: pointer; text-decoration: underline; padding: 0; }
.vision-section-header .sort-handle, .vision-section-header .item-menu-open { flex-shrink: 0; }

/* ==== Vision alignment from goal links (F070) ==== */
.vision-status {
  flex-shrink: 0; margin-left: auto; margin-right: 8px; font: inherit; font-size: 0.75rem; font-weight: 600;
  border-radius: 10px; padding: 2px 8px; white-space: nowrap;
}
.vision-status-on { color: var(--green); background: var(--green-bg); border: 1px solid var(--green-border); }
.vision-rate-more { display: flex; gap: 6px; align-items: center; grid-column: 1 / -1; }
.vision-rate-select { font: inherit; font-size: 0.75rem; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); }

/* ==== Life Areas on goals, and the balance (life-areas design) ==== */
.life-area-add { margin-top: 8px; }
.area-chip {
  display: inline-flex; align-items: center; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: inherit; font-size: 0.75rem; color: var(--text); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; cursor: pointer;
}
.area-chip:hover, .area-chip:focus-visible { border-color: var(--accent); }
.area-derived { color: var(--text-muted); border-style: dashed; display: none; }
.plan-mode .area-derived { display: inline-flex; }
.metric-life-balance { grid-column: 1 / -1; }
/* An area with no goal is a fact here, not a warning (UI audit D6): the
   nudges above flag the ones that matter (rated low, or a "no"). */
.balance-empty .balance-open { color: var(--text-muted); }
.balance-none { color: var(--text-muted); }
/* Each "Set a goal" on the nudge's right edge, the reason beside it (C29). */
.balance-nudge { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.balance-nudge .balance-goal { margin: 0; }
/* On a phone the table fits the card (M1): area names wrap, the
   figures stay on one line. */
@media (max-width: 600px) {
  .balance-table { width: 100%; }
  .balance-table { border-spacing: 1px; }
  .balance-table .stab-q { white-space: normal; overflow-wrap: break-word; hyphens: auto; }
  .balance-table th, .balance-table td { padding: 4px 3px; }
  /* The figures take only their width; the area name the rest. */
  .balance-table td, .balance-table thead th:not(:first-child) { width: 1%; }
  .balance-table td.stab-cell { white-space: normal; }
}

/* ==== Accessibility and mobile pass (F048, F079, F095, F140, F096, F142) ==== */
/* Every control shows where the keyboard is: tokens.css's focus ring. */
[role="button"][tabindex="0"] { cursor: pointer; }

/* Fold / unfold buttons in group headers. */
.fold-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-right: 4px; padding: 0; border: none; border-radius: 4px;
  background: transparent; color: var(--text-muted); font-size: 0.875rem; cursor: pointer;
}
.fold-btn:hover { color: var(--text); background: var(--surface2); }

/* Touch screens: the main controls are at least 44px to tap (WCAG
   2.5.5); the small ones inside rows (× delete, chips) keep their own
   larger hit area (::before, above) so rows don't grow. */
@media (pointer: coarse) {
  .fpill, .tab, .settings-tab, select, .fold-btn, .vision-ratings-btn,
  .sync-action, .item-menu-btn, .btn, .btn-confirm, .btn-cancel, .plan-replan,
  .add-btn, .plan-add-btn, .okr-board-btn, .okr-board-manage, .modal .btn-danger, .tab-customise,
  .tab-layout-up, .tab-layout-down, .checkin-back, .checkin-seg-btn, .page-intro-skip,
  .row-editor-move, .vision-jump, .to-claim-more, .checkin-bulk-undo, .partners-share, .page-intro-more-toggle {
    min-height: 44px; min-width: 44px;
  }
  .vision-jump, .to-claim-more, .checkin-bulk-undo, .partners-share { display: inline-flex; align-items: center; }
  .plan-add-btn, .page-intro-skip, .tab-layout-up, .tab-layout-down, .checkin-back, .checkin-seg-btn {
    display: inline-flex; align-items: center; justify-content: center;
  }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; }
  /* As specific as its own rule (16px), so this wins. */
  .plan-item .plan-check { width: 22px; height: 22px; }
  .bucket-check { width: 22px; height: 22px; }
  .settings-row { min-height: 44px; align-items: center; }
  /* The small in-row controls (celebration tick, Today's remove, link
     and edit) keep their size so rows don't grow; an invisible ::after
     makes the target about 40-44px. Vertically it stays within the
     6px gap between rows, so it never reaches the next row's controls. */
  .wine-check, .today-remove, .today-link-add, .today-linked, .focus-edit-btn { position: relative; }
  .wine-check::after, .today-remove::after, .today-link-add::after, .today-linked::after,
  .focus-edit-btn::after { content: ''; position: absolute; }
  .wine-check::after { inset: -6px -6px; }
  .today-remove::after { inset: -6px -8px; }
  .today-link-add::after { inset: -6px -4px; }
  .today-linked::after { inset: -6px 0; }
  .focus-edit-btn::after { inset: -10px -6px; }
  input.today-check { width: 24px; height: 24px; }
  /* Likewise the chips in rows and lines (the strip's counts, the
     suggested health, a KR's measure, the time chips, a bucket card's
     date, the theme button and a year's ×): about 40-44px to tap, the
     row's height unchanged. */
  .acct-chip, .health-hint, .kr-measure, .init-commitment, .init-time-remaining[role="button"],
  .bucket-chip, .theme-btn { position: relative; }
  .acct-chip::after, .health-hint::after, .kr-measure::after, .init-commitment::after,
  .init-time-remaining[role="button"]::after, .bucket-chip::after, .theme-btn::after { content: ''; position: absolute; }
  .acct-chip::after { inset: -12px -4px; }
  .health-hint::after { inset: -10px -4px; }
  .kr-measure::after, .init-commitment::after, .init-time-remaining[role="button"]::after { inset: -8px -4px; }
  .bucket-chip::after { inset: -11px -4px; }
  .theme-btn::after { inset: -12px -6px; }
}

/* With a mouse (WCAG 2.5.8): every control is at least 24px to point
   at. The row selects, pills and text-like buttons get a min-height
   (1.5rem, so it grows with the text); the small icons and in-row chips
   keep their look and get an invisible hit area, so rows don't grow. */
@media (pointer: fine) {
  select.status-sel, select.month-sel, select.year-sel, select.goal-year-sel, .fpill, .page-intro-skip, .plan-replan,
  .metric-empty-areas summary, .wins-before summary, .diag-details summary,
  .vision-jump, .to-claim-more, .checkin-bulk-undo, .partners-share, .page-intro-more-toggle { min-height: 1.5rem; }
  .page-intro-skip, .vision-jump, .to-claim-more, .checkin-bulk-undo, .partners-share { display: inline-flex; align-items: center; }
  .tab-layout-up, .tab-layout-down { min-width: 1.5rem; }
  .del-btn, .info-tip, .theme-btn, .checkin-line, .acct-chip, .health-hint, .vision-target-btn { position: relative; }
  .del-btn::before, .info-tip::after, .theme-btn::after, .checkin-line::after, .acct-chip::after,
  .health-hint::after, .vision-target-btn::after { content: ''; position: absolute; }
  .del-btn::before, .info-tip::after { inset: -3px; }
  .theme-btn::after, .checkin-line::after, .vision-target-btn::after { inset: -3px 0; }
  .acct-chip::after, .health-hint::after { inset: -3px -1px; }
}

/* Press feedback on touch (and with a mouse): tabs, pills, chips and
   the click-to-edit controls answer a tap at once. */
.tab:active, .fpill:active, .settings-tab:active, .add-btn:active, .fold-btn:active,
.item-menu-btn:active, .today-remove:active, .today-link-add:active, .focus-edit-btn:active,
.account-btn:active, .sync-action:active, [role="button"]:active {
  filter: brightness(1.25);
}
@media (prefers-reduced-motion: no-preference) {
  .tab:active, .fpill:active, .add-btn:active, .item-menu-btn:active, .account-btn:active { transform: translateY(1px); }
}
/* The objective / area header: the fold button, then the name taking
   the room, then the controls. */
.okr-header > .fold-btn { flex: none; }
.okr-header > .okr-obj { flex: 1; min-width: 0; }
.search-box { appearance: none; -webkit-appearance: none; }
/* Muted text on the header's bright gradient: the lighter tone. */
.header-sub, .last-sync { color: var(--text-secondary); }

/* Phones: the header scrolls away instead of taking a third of the
   screen, the tabs scroll sideways on one line, and group headers wrap
   rather than cut off their progress bar. */
@media (max-width: 768px) {
  .header { position: static; }
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; }
  .okr-header { flex-wrap: wrap; gap: 8px; }
  .okr-obj { flex-wrap: wrap; min-width: 0; }
  .search-box { width: 100%; }
}
/* Phones (okr-11): the objective's name gets the card's width, its
   controls wrap under it from one left edge, the fold button stays at
   the top, and the progress takes its own line at the right. */
@media (max-width: 480px) {
  .okr-header > .fold-btn { align-self: flex-start; }
  .okr-obj > :is(.okr-obj-name, .okr-obj-heading) { flex: 1 0 100%; }
  .okr-obj .health-hint { margin-left: 0; }
  .okr-header > .prog-mini { flex: 1 0 100%; justify-content: flex-end; }
}

/* ==== Partners (F115) ==== */
.partners { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.partners-head h3 { font-size: 1.125rem; }
/* The heading with its ⓘ beside it, the sharing line under (C22). */
.partners-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.partners-head > p { flex-basis: 100%; }
.partners-share { margin-left: 4px; }
.partners-empty-share { align-self: flex-start; }
.linklike { background: none; border: none; padding: 0; color: var(--accent-light); text-decoration: underline; cursor: pointer; font: inherit; }
.partner-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.partner-name { font-size: 1rem; overflow-wrap: anywhere; }
.partner-week { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.partner-week-title { font-size: 0.875rem; }
/* Older weeks folded (P2): the summary is the week's title. */
details.partner-week { display: block; }
details.partner-week > summary { cursor: pointer; font-weight: 600; color: var(--text); }
details.partner-week[open] > summary { margin-bottom: 4px; }
.partner-streak { font-size: 0.8125rem; color: var(--amber); }
.partner-label { font-size: 0.8125rem; color: var(--text-muted); }
.partner-list { padding-left: 18px; font-size: 0.875rem; color: var(--text); }
.partner-wheel { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 0.8125rem; }
.partner-wheel li { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: 8px; align-items: center; }
.partner-wheel-bar { height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.partner-wheel-fill { display: block; height: 100%; background: var(--accent-light); }
.partner-cheer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--border); padding-top: 10px; }
.partner-cheer .partner-label { width: 100%; }
.partner-cheer-emoji { display: flex; gap: 4px; }
/* The chosen cheer is plain to see (P2), the send is the main action,
   and leaving is a small link, not a full-width one. */
.partner-emoji[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 2px var(--accent); }
.partner-send { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; font-size: 0.8125rem; }
.partner-send:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.partner-leave { align-self: flex-start; font-size: 0.8125rem; }
.partner-cheer-msg {
  flex: 1; min-width: 160px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; color: var(--text); font-size: 0.8125rem;
}
.cheers-list { display: flex; flex-direction: column; gap: 8px; }
.cheer-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; color: var(--text); }
.cheer-emoji { font-size: 1.25rem; }

/* ==== Layout fixes (UI audit, batch A) ====
   Rows wrap their controls under the name instead of squeezing the name
   to one word per line, pushing controls out of their card, or making
   the whole page wider than a phone (tests/e2e/layout.spec.js). */

/* Goals by year (A1, A2): a column never grows past its share (it did
   on phones, and the card clipped the status select), and two columns
   only where a row fits in one. */
.horizon-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr)); }
.horizon-card { min-width: 0; }
/* A goal's row lines up with the others in its card (A9): in a wide card
   it is one line, the name taking what the controls leave; in a narrow
   one (two horizons side by side, a phone) the name has the first line
   and the chips and controls the next, the controls pushed right.
   .hi-controls (date, status, celebration) is the same width on every
   row (a hidden date select keeps its room) and wraps as one, so the
   status lines up either way. */
.horizon-card { container-type: inline-size; }
.horizon-item { flex-wrap: wrap; }
/* The name keeps room (14rem) before anything else does: past that the
   row wraps, the controls going to the next line, still at the right. */
.horizon-item .hi-name { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.hi-controls { display: inline-flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
@container (max-width: 50rem) {
  .horizon-item { flex-wrap: wrap; column-gap: 6px; row-gap: 4px; }
  .horizon-item .hi-name { flex-basis: 100%; }
  /* Plan mode: the handle and ⋯ stay on the name's line. */
  .plan-mode .horizon-item .hi-name { flex-basis: 60%; }
  .hi-controls { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
}
/* A phone-wide card (C30): the controls join the chips in one flow
   under the name, the celebration beside the chips, the date and status
   on the line after, rather than a line each. */
@container (max-width: 30rem) {
  .hi-controls { display: contents; }
  .horizon-item > .hi-controls > :is(.due-sel, .goal-year-sel, .status-sel) { order: 2; }
  .horizon-item > .hi-controls > .wine-check { order: 1; }
  .horizon-item > .del-btn { order: 3; }
  /* A break after the celebration: the year, date and status start a line. */
  .horizon-item::after { content: ''; order: 1; flex-basis: 100%; height: 0; }
}
@media (max-width: 768px) {
  .horizon-grid { grid-template-columns: minmax(0, 1fr); }
}
/* An area's body (A10). On phones, less padding, and no card inside a
   card: a horizon's goals sit in the area's own, under its heading, a
   rule between horizons. */
.annual-body { padding: 4px 16px 8px; }
@media (max-width: 480px) {
  .annual-body { padding: 4px 8px 8px; }
  .horizon-grid > .horizon-card { padding: 4px 0 0; border: none; border-radius: 0; background: transparent; }
  .horizon-grid > .horizon-card + .horizon-card { padding-top: 10px; border-top: 1px solid var(--border); }
}

/* Compact goals by year. An area showing one horizon (a year page's
   usual case) has no card inside its card: its goals sit straight under
   the area's heading. Rows are 2px from their rules, not 5px. On a
   phone-wide card a goal is two lines, not three: its name, then its
   chips with the date and status, pushed right. */
.horizon-grid > .horizon-card:only-child { padding: 0; border: none; border-radius: 0; background: transparent; }
.horizon-item { padding-top: 2px; padding-bottom: 2px; }
@container (max-width: 30rem) {
  /* No forced line break: the chips, celebration and date flow on, and
     the status keeps to the right edge, so every row's status lines up
     whether or not the row wraps. */
  .horizon-item::after { content: none; }
  .horizon-item > .hi-controls > .status-sel { margin-left: auto; }
}
/* A card where the name has a line of its own (narrower than 50rem):
   the × ends the name's line. After the status it moved the status by
   its width when it wrapped or didn't, so the statuses didn't line up. */
@container (max-width: 50rem) {
  .horizon-item > :not(.plan-ctl, .hi-name, .del-btn) { order: 1; }
  .horizon-item > .del-btn { order: 0; }
  .horizon-item .hi-name { flex-basis: calc(100% - 32px); }
  .plan-mode .horizon-item .hi-name { flex-basis: 60%; }
}
}

/* The header on phones (A3): pills stay whole and wrap as a group; the
   tabs scroll on one line with no scrollbar. */
.fpill { white-space: nowrap; }
.tab { flex: none; white-space: nowrap; }
.filter-bar { flex-wrap: wrap; min-width: 0; }
@media (max-width: 768px) {
  .tab-bar { scrollbar-width: none; }
  .tab-bar::-webkit-scrollbar { display: none; }
  /* C2: with no scrollbar, an edge fades where more tabs are hidden
     (syncTabOverflow sets the classes). */
  .tab-bar.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
  .tab-bar.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); }
  .tab-bar.more-left.more-right {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  }
  .filter-bar { width: 100%; }
  .prog-mini { flex-wrap: wrap; }
}

/* OKRs (A7): an initiative's or KR's name keeps a line's worth of room,
   and its controls go under it when there isn't more (a tablet too). */
.init-row, .kr-row { flex-wrap: wrap; }
.init-row .init-name, .kr-row .kr-label { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }

/* Wins on phones (A4): the full-width meta line is the win cards'
   only; a reward row wraps instead of squeezing the name to nothing. */
@media (max-width: 640px) {
  .win-meta { width: auto; padding-left: 0; }
  .win-card .win-meta, .trash-list .win-meta { width: 100%; padding-left: 26px; }
  .to-claim-row { flex-wrap: wrap; }
}

/* 5 Year Plan (A5): the goal keeps most of the row, its badges go under
   it, and the year header wraps rather than cutting off the count. */
.plan-item { flex-wrap: wrap; }
.plan-item .plan-item-text { flex: 1 1 60%; min-width: 0; overflow-wrap: anywhere; }
.plan-year-header { flex-wrap: wrap; }

/* Settings (A6): `.modal input { width: 100% }` is for text fields, not
   checkboxes and radios (on touch screens they stay 22px, as elsewhere). */
.modal input[type="checkbox"], .modal input[type="radio"] { width: auto; flex: none; }
@media (pointer: coarse) {
  .modal input[type="checkbox"], .modal input[type="radio"] { width: 22px; height: 22px; }
}

/* iOS zooms into a field whose text is under 16px when it is focused
   (E3): every field is 16px on touch screens. !important because many
   fields set their size in a class rule or an inline style. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: max(16px, 1rem) !important; }
}

/* ==== 5 Year Plan: delete a year, add the next ==== */
/* The year's × is always shown (deleting a year is a normal step in
   rolling the plan forward), a little stronger on hover or focus. It is
   pinned to the header's first line, top right, so a wrapping header
   never leaves it on a line of its own under the fold arrow (A5); the
   header keeps room for it. On touch its target is 44px (::before). */
.plan-year-header:has(> .plan-year-del) { position: relative; padding-right: 44px; }
.plan-year-header .plan-year-del { opacity: 0.7; font-size: 1rem; position: absolute; top: 14px; right: 14px; height: 24px; margin: 0; }
@media (pointer: coarse) {
  /* 44px tall, over the header's first line (not past a one-line header). */
  .plan-year-header .plan-year-del { height: 44px; top: 3px; }
  .plan-year-header .plan-year-del::before { inset: 0 -13px; }
}
.plan-year-header:hover .del-btn, .plan-year-header:focus-within .del-btn { opacity: 1; }
.plan-year-empty { font-size: 0.8125rem; color: var(--text-muted); margin: 2px 0 8px; }
.fiveyr-add-year { margin-top: 4px; align-self: flex-start; }
.fiveyr-add-goal { align-self: flex-start; }
.modal label.plan-year-choice {
  display: flex; gap: 8px; align-items: flex-start; font-size: 0.8125rem; color: var(--text); margin-top: 10px;
}

/* ==== Header, account menu, page toolbar (UI audit B1–B3) ====
   Row 1: the theme and one status line, then Check in, the sync chip
   and the account menu. Row 2: the tabs. Filters, search and Plan live
   in the page's toolbar, on the tabs they work on. */
.header-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.header-title { flex: 1 1 18rem; min-width: 0; }
.header-title h1 { overflow-wrap: anywhere; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; min-width: 0; }
.header-controls { margin-top: 10px; }
.fpill-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.fpill-primary:hover { border-color: var(--accent-light); }
.fpill-primary:disabled { background: var(--surface2); border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }

.account-menu-wrap { position: relative; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 200; min-width: 240px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.account-menu[hidden] { display: none; }
.account-menu.opens-right { right: auto; left: 0; }
.account-menu-who { margin: 0; padding: 4px 8px 0; font-size: 0.75rem; color: var(--text-muted); overflow-wrap: anywhere; }
.account-menu .last-sync { margin: 0; padding: 0 8px 6px; font-size: 0.75rem; }
.account-menu-item {
  text-align: left; background: transparent; border: none; border-radius: 6px; cursor: pointer;
  padding: 8px; color: var(--text); font: inherit; font-size: 0.8125rem;
}
.account-menu-item:hover, .account-menu-item:focus-visible { background: var(--surface2); }
.account-menu-rule { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
@media (pointer: coarse) { .account-menu-item { min-height: 44px; } }

.page-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.page-toolbar[hidden], .page-toolbar [hidden] { display: none !important; }
.page-toolbar .filter-bar { margin: 0; flex: 0 1 auto; }
.page-toolbar .search-box { margin-left: auto; }
.acct-strip-wrap.page-hidden, .daily-focus.page-hidden { display: none; }
@media (max-width: 768px) {
  .page-toolbar .search-box { margin-left: 0; flex: 1 1 12rem; width: auto; }
}

/* Phones and tablets: all saved is just the green dot (the words are
   still read out; the account menu has the last sync); anything else
   keeps its words. F6: so it never grows the header after a save. */
@media (max-width: 768px) {
  .sync-indicator[data-state="saved"] .sync-text, .sync-indicator[data-state="idle"] .sync-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .sync-indicator:is([data-state="saved"], [data-state="idle"]) { padding: 0; border: 0; background: none; }
  .sync-indicator:is([data-state="saved"], [data-state="idle"]) .info-tip-wrap { display: none; }
}

/* Settings → Help. */
.settings-help-pages { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.8125rem; color: var(--text); }
.settings-link { font-size: 0.8125rem; color: var(--accent-light); }
/* Phones: Check in and the account menu stay beside the title (it wraps
   instead), so the header keeps to two short rows and the tabs. */
@media (max-width: 480px) {
  .header-top { align-items: center; }
  /* Its buttons join the row: a save warning with words takes a row of
     its own under them instead of squeezing the title. */
  .header-actions { display: contents; }
  .header-title { order: 1; flex: 1 1 8rem; }
  .header-top #checkInBtn { order: 2; }
  /* F1: wrapped onto a row of its own (large text), the account button
     stays on the right, so its menu (right: 0) opens on screen. */
  .header-top .account-menu-wrap { order: 3; margin-left: auto; }
  .header-top .sync-indicator { order: 4; }
  /* F6: all saved is a bare dot before Check in, on the title's row:
     it never takes a row of its own (the header would jump under the
     finger after every save). */
  .header-top .sync-indicator:is([data-state="saved"], [data-state="idle"]) { order: 2; flex: none; }
  .header-top .sync-indicator:not([data-state="saved"]):not([data-state="idle"]) {
    flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start;
  }
  .header-title h1 { font-size: 1.0625rem; }
}
/* One page width (UI audit B4): the strip and Today line up with the
   page below them (.main: 1200px, 28px sides). */
.acct-strip-wrap, .daily-focus { max-width: 1200px; padding-left: 28px; padding-right: 28px; }
@media (max-width: 768px) {
  .acct-strip-wrap, .daily-focus { padding-left: 14px; padding-right: 14px; }
}
/* Phones (A8): the strip's chips wrap with gaps, without "·" lines of
   their own. */
@media (max-width: 640px) {
  .acct-sep { display: none; }
  .acct-strip { gap: 4px 10px; }
}

/* Small phones: the life-wheel ratings' one column never grows past the
   screen; a reward row's name and reward share it, wrapping. */
@media (max-width: 600px) {
  .vision-ratings-bar { grid-template-columns: minmax(0, 1fr); }
}
.to-claim-row .win-name { flex: 1 1 12rem; }
.to-claim-row .win-meta { flex: 1 1 12rem; min-width: 0; white-space: normal; }

/* ==== ⓘ hints (hints.js, views/info-tip.js) ====
   The glyph is CSS, so a heading a tip sits in keeps its own text. */
.info-tip-wrap { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.info-tip {
  width: max(18px, 1.35em); height: max(18px, 1.35em); padding: 0; border-radius: 50%; border: none; cursor: help;
  background: transparent; color: var(--text-muted); font: inherit; font-size: 0.8125rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
}
.info-tip::before { content: 'ⓘ'; }
.info-tip:hover, .info-tip.is-open { color: var(--accent-light); background: var(--surface2); }
/* A card's ⓘ sits in its corner, beside its heading (never inside it:
   a heading's spoken name would take the ⓘ's in). */
.metric-card, .rewards-panel { position: relative; }
.metric-card > .info-tip-wrap, .rewards-panel > .info-tip-wrap { position: absolute; top: 12px; right: 12px; margin: 0; }
@media (pointer: coarse) { #themeBtn + .info-tip-wrap { margin-left: 16px; } }
/* A finger-sized target on touch screens, without growing the line. */
@media (pointer: coarse) { .info-tip::after { content: ''; position: absolute; inset: -13px; } }
.info-tip-pop {
  position: fixed; z-index: 1000; max-width: 300px; padding: 10px 12px; border-radius: 8px;
  background: var(--surface3); color: var(--text); border: 1px solid var(--border-light);
  font-size: 0.8125rem; line-height: 1.45; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.info-tip-pop[hidden] { display: none; }

/* Plan mode on (UI audit D1): a bar at the bottom of the screen says so,
   with Done. */
.plan-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 150;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; max-width: calc(100vw - 24px);
  background: var(--surface3); border: 1px solid var(--accent); border-radius: var(--radius-pill);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); font-size: 0.8125rem; color: var(--text);
}
.plan-bar[hidden] { display: none; }
@media (max-width: 480px) { .plan-bar { bottom: 10px; } .plan-bar-more { display: none; } }
/* The page's end stays reachable above the bar, which grows with the
 * text size (okr-13), so the room does too. */
.plan-mode .main { padding-bottom: calc(5.5rem + 16px); }

/* ==== First-visit page intros (intros.js, views/page-intro.js) ==== */
/* The page's intro sits above the strip and Today (first on the page),
   lined up with the page. */
.page-intro-slot { max-width: 1200px; margin: 12px auto 0; padding: 0 28px; }
.page-intro-slot:empty { display: none; }
@media (max-width: 768px) { .page-intro-slot { padding: 0 14px; } }
.page-intro {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; padding: 16px 18px;
  background: linear-gradient(135deg, var(--surface2) 0%, var(--surface) 100%);
  border: 1px solid var(--accent-border); border-radius: 12px;
}
/* C23: the card spans the page like the cards under it; its words keep
   a readable line. */
.page-intro-purpose, .page-intro-fit, .page-intro-tips { max-width: 70ch; }
.page-intro-title { margin: 0; font-size: 1.0625rem; color: var(--accent-light); }
.page-intro-title:focus { outline: none; }
.page-intro-purpose { margin: 0; font-size: 0.875rem; color: var(--text); line-height: 1.5; }
.page-intro-fit { margin: 0; font-size: 0.8125rem; color: var(--text-secondary, var(--text-muted)); }
.page-intro-tips { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 0.8125rem; color: var(--text); }
/* The fit line and tips (C30): one block, always open past a phone's
   width, so its "More" shows only on a phone (page-intro.js NARROW). */
.page-intro-more > .page-intro-fit + .page-intro-tips { margin-top: 8px; }
.page-intro-more-toggle { display: none; }
@media (max-width: 480px) {
  .page-intro-more-toggle { display: list-item; cursor: pointer; font-size: 0.8125rem; color: var(--accent-light); width: max-content; }
  .page-intro-more[open] .page-intro-more-toggle { margin-bottom: 6px; }
}
@media (max-width: 480px) and (pointer: coarse) {
  .page-intro-more-toggle { min-height: 44px; padding: 12px 0; box-sizing: border-box; }
}
.page-intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.page-intro-skip { margin-left: auto; font-size: 0.8125rem; }
@media (max-width: 480px) { .page-intro { padding: 12px 14px; } .page-intro-purpose { font-size: 0.8125rem; } }
@media (prefers-reduced-motion: no-preference) {
  .page-intro { animation: fadeIn 0.25s ease; }
}
.tour-target { outline: 3px solid var(--accent-light); outline-offset: 4px; border-radius: 8px; position: relative; z-index: 1; }
.tour-tip {
  position: absolute; z-index: 1100; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  background: var(--surface3); color: var(--text); border: 1px solid var(--accent); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); font-size: 0.875rem; line-height: 1.45;
}
.tour-text { margin: 0; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-count { margin-right: auto; font-size: 0.75rem; color: var(--text-muted); }

/* ==== Long-term pages, calmer (UI audit C1, C2, C4, C5, D2) ====
   Where there's a mouse, a row's date selects and an unticked
   celebration show when the row is pointed at or holds focus (only
   see-through, so the keyboard still reaches them; the date is in the
   row's badge). Touch screens and Plan mode show everything. */
@media (hover: hover) and (pointer: fine) {
  :is(.horizon-item, .plan-item, .init-row):not(:hover):not(:focus-within) :is(.due-sel, .plan-item-due, .wine-check:not(:has(input:checked))) {
    opacity: 0;
  }
  /* Objective and key result rows too (C14): only the unticked tick. */
  :is(.okr-header, .kr-row):not(:hover):not(:focus-within) .wine-check:not(:has(input:checked)) { opacity: 0; }
  :is(.horizon-item, .plan-item, .init-row) :is(.due-sel, .plan-item-due, .wine-check),
  :is(.okr-header, .kr-row) .wine-check { transition: opacity 0.12s; }
  /* As specific as the rules above, so they win. */
  .plan-mode :is(.horizon-item, .plan-item, .init-row):not(:hover):not(:focus-within) :is(.due-sel, .plan-item-due, .wine-check:not(:has(input:checked))) { opacity: 1; }
  .plan-mode :is(.okr-header, .kr-row):not(:hover):not(:focus-within) .wine-check:not(:has(input:checked)) { opacity: 1; }
}
/* A narrow window with a mouse (C30): what is hidden until pointed at
   takes no room while hidden, so a row isn't a line taller for it.
   Focus in the row shows it again before Tab reaches it. */
@media (hover: hover) and (pointer: fine) and (max-width: 480px) {
  body:not(:has(.plan-mode)) :is(.horizon-item, .plan-item, .init-row):not(:hover):not(:focus-within) :is(.due-sel, .plan-item-due, .wine-check:not(:has(input:checked)), .init-commitment-empty) {
    display: none;
  }
}
/* An initiative on a phone (C30), as a goal by year: the name has the
   first line; the chips, time and celebration the next; the date and
   status the one after, not a line each. */
@media (max-width: 480px) {
  .init-row { padding-left: 20px; padding-right: 8px; }
  .init-row .init-name { flex-basis: 100%; }
  .plan-mode .init-row .init-name { flex-basis: 60%; }
  .init-row { column-gap: 6px; row-gap: 4px; }
  .init-row > .wine-check { order: 1; }
  .init-row > :is(.due-sel, .status-sel) { order: 2; }
  .init-row > .del-btn { order: 3; }
  .init-row::after { content: ''; order: 1; flex-basis: 100%; height: 0; }
}
/* 5 Year Plan rows: overdue is the year's "N to re-plan" link, not a red
   badge on every row. The row keeps its date words, plain (it still
   opens the goal's triage). */
.plan-item .plan-item-badge.time-overdue { background: transparent; color: var(--text-muted); border-color: transparent; }
.plan-item .plan-item-badge.time-overdue[role="button"]:hover,
.plan-item .plan-item-badge.time-overdue[role="button"]:focus-visible { text-decoration: underline; color: var(--text); }
.plan-replan { cursor: pointer; font-family: inherit; }
/* Attention, not alarm: amber like the strip's other prompts. */
.plan-year-badge.plan-replan { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-border); }
.plan-replan:hover, .plan-replan:focus-visible { filter: brightness(1.2); }
/* A folded year says what's in it. */
.plan-year-peek { display: none; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); min-width: 0; overflow-wrap: anywhere; }
.plan-year-header:has(+ .plan-year-body.collapsed) .plan-year-peek { display: inline; }
.plan-add-year-goal { margin-top: 2px; }

/* ==== Vivid Vision, story first (UI audit C7, C9, C10) ====
   The ratings come first, above the sections, under their own heading. Notes
   are 13px and left-aligned, a fall since last time isn't red, and the
   ± are easier to hit. Section titles share one ink; the icon keeps the
   section's colour. */
.vision-ratings-block { margin: 0 0 20px; }
.vision-ratings-heading { display: inline-block; margin: 0 0 8px; font-size: 0.9375rem; font-weight: 700; color: var(--text); }
.vision-ratings-desc { font-size: 0.8125rem; text-align: left; }
/* The whole tile reads left to right. */
.vision-ratings-item { text-align: left; }
.vision-ratings-val-row, .vision-ratings-meta { justify-content: flex-start; }
.rating-down { color: var(--text-muted); }
@media (pointer: fine) {
  .vision-ratings-btn { width: 28px; height: 28px; font-size: 0.9375rem; }
}
/* The strip's ⓘ sits in its corner, not on a row of its own. */
.stats-bar { position: relative; }
.stats-bar > .info-tip-wrap { position: absolute; top: 4px; right: 4px; }

/* ==== Touch and the page frame (UI audit A8, E4) ==== */
/* Today: the tick, the words and × on the first line; the badges and
   "↳ link" (.today-meta, views/today.js) on a line of their own under
   the words, so they never squeeze them. */
.today-item .focus-text { min-width: 0; overflow-wrap: anywhere; }
.today-meta { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 28px; }
.today-meta:empty { display: none; }
/* Touch screens: no × beside every row, next to its checkbox, to hit by
   mistake. Delete is in the row's ⋯ menu in Plan mode (and its × shows
   there too). The same test for touch as the × rule above. */
@media (hover: none), (pointer: coarse) {
  body:not(:has(.plan-mode)) :is(.okr-header, .kr-row, .init-row, .bucket-item, .horizon-item, .plan-item) > .del-btn,
  body:not(:has(.plan-mode)) .okr-obj > .del-btn { display: none; }
}

/* ==== Home (views/home.js) ==== */
/* One card per section of the app: Goals with its summary lines, and
   Finance, which isn't here yet. */
.home { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.home-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; min-width: 0;
}
.home-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; }
.home-card-title { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--text); }
.home-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.home-line {
  display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text); font: inherit; text-align: left;
}
button.home-line { cursor: pointer; }
button.home-line:hover { border-color: var(--accent); }
.home-line-value {
  flex: 0 0 auto; min-width: 3.25rem; font-size: 1.125rem; font-weight: 700;
  color: var(--accent-light); font-variant-numeric: tabular-nums;
}
.home-line[data-state="behind"] .home-line-value { color: var(--amber); }
.home-line[data-state="late"] .home-line-value { color: var(--red-text, var(--red)); }
.home-line[data-state="good"] .home-line-value { color: var(--green); }
.home-line-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-line-label { font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.home-line-detail { font-size: 0.8125rem; color: var(--text-muted); overflow-wrap: anywhere; }
.home-line-go { flex: 0 0 auto; font-size: 1.25rem; color: var(--text-muted); }
.home-soon-tag {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}
.home-soon-text { margin: 0; font-size: 0.875rem; color: var(--text-muted); }
@media (min-width: 900px) {
  .home { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); max-width: none; }
  .home-soon { align-self: start; }
}
@media (pointer: coarse) {
  .home-line, .home-open { min-height: 44px; }
}

/* ==== The Assistant (views/assistant.js, views/ai-core.js; migration 0020) ==== */
/* The AI look on the app's navy: a glowing core, glass panels with a
   thin cyan edge and a faint grid, agent tiles, and inbox cards with a
   left line in each agent's colour. The --ai-* colours are the app's
   own (tokens.css), shared with lib/goals/theme-ai.css (the whole-app
   AI look). Agents' words are plain text: line breaks kept, long words
   and URLs wrapped. */
/* Text in the AI colours that must read at 4.5:1 on the glass. */
.assistant { --ai-text: var(--color-accent-light); }

/* -- The core (views/ai-core.js) -- */
.ai-core { position: relative; flex: none; display: grid; place-items: center; }
.ai-core-large { width: min(220px, 45vw); aspect-ratio: 1; }
.ai-core-small { width: 2.75rem; aspect-ratio: 1; }
.ai-core-svg { width: 100%; height: 100%; overflow: visible; }
:where(.ai-core-svg circle) { fill: none; transform-origin: 100px 100px; transform-box: view-box; }
.ai-core-halo { fill: var(--ai-cyan-soft); opacity: 0.5; }
.ai-core-ring { stroke: var(--ai-cyan); stroke-width: 1; opacity: 0.45; }
.ai-core-ticks { stroke-width: 6; opacity: 0.25; }
.ai-core-inner { stroke-width: 1.5; opacity: 0.7; }
.ai-core-arcs { stroke: var(--ai-cyan); stroke-width: 5; opacity: 0.8; filter: drop-shadow(0 0 4px var(--ai-glow)); }
.ai-core-heart { fill: rgba(var(--ai-rgb), 0.28); stroke: var(--ai-cyan); stroke-width: 2; filter: drop-shadow(0 0 10px var(--ai-glow)); }
.ai-core-spark { fill: #e0fbff; filter: drop-shadow(0 0 8px var(--ai-cyan)); }
.ai-core::before {
  content: ""; position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle, var(--ai-glow) 0%, transparent 70%); opacity: 0.6; pointer-events: none;
}
.ai-core[data-state="active"]::before { opacity: 1; inset: 10%; }
.ai-core[data-state="active"] .ai-core-ring { opacity: 0.7; }
.ai-core[data-state="active"] .ai-core-heart { fill: rgba(var(--ai-rgb), 0.45); }
@media (prefers-reduced-motion: no-preference) {
  .ai-core-spin { animation: ai-spin 18s linear infinite; }
  .ai-core-spin-slow { animation: ai-spin 60s linear infinite; }
  .ai-core-spin-rev { animation: ai-spin 40s linear infinite reverse; }
  .ai-core-heart, .ai-core::before { animation: ai-breathe 5s ease-in-out infinite; }
  .ai-core[data-state="active"] .ai-core-heart, .ai-core[data-state="active"]::before { animation-duration: 2.4s; }
  .ai-core-small .ai-core-spin, .ai-core-small .ai-core-spin-slow, .ai-core-small .ai-core-spin-rev { animation: none; }
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes ai-breathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* -- The page -- */
.assistant { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.assistant-card {
  position: relative; min-width: 0; padding: 16px; border-radius: 12px;
  background:
    linear-gradient(var(--ai-grid) 1px, transparent 1px) 0 0 / 100% 22px,
    linear-gradient(90deg, var(--ai-grid) 1px, transparent 1px) 0 0 / 22px 100%,
    var(--ai-glass);
  border: 1px solid var(--ai-glass-border);
  box-shadow: 0 0 0 1px rgba(var(--ai-rgb), 0.04), 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.assistant-hero { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: center; min-width: 0; }
.assistant-core { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.assistant-core-status {
  margin: 0; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ai-text);
}
.assistant-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 8px; }
.assistant-card-title { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--text); }
.assistant-card-title:focus { outline: none; }
.assistant-card-title:focus-visible { outline: 2px solid var(--ai-cyan); outline-offset: 2px; }
.assistant-meta {
  margin: 0 0 4px; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.75rem; color: var(--text-muted); overflow-wrap: anywhere;
}
.assistant-agent { font-weight: 600; color: var(--ai-text); }
.assistant-status {
  display: inline-block; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--border);
  border-radius: 999px; padding: 0 8px; margin-left: 4px; color: var(--text-muted);
}
.assistant-status-new { color: var(--ai-text); border-color: var(--ai-glass-border); background: var(--ai-cyan-soft); }
.assistant-status-done { color: var(--green); }
.assistant-item-title { margin: 4px 0; font-size: 1rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.assistant-body {
  margin: 4px 0; font-size: 0.875rem; line-height: 1.5; color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.assistant-more {
  background: none; border: none; padding: 2px 0; font: inherit; font-size: 0.8125rem;
  color: var(--ai-text); cursor: pointer; text-decoration: underline;
}
.assistant-links { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.assistant-links li { min-width: 0; max-width: 100%; }
.assistant-links a { font-size: 0.8125rem; color: var(--ai-text); overflow-wrap: anywhere; }
.assistant-empty, .assistant-hint { margin: 4px 0; font-size: 0.875rem; color: var(--text-muted); }
.assistant-checked {
  margin: 0 0 8px; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.75rem; color: var(--text-muted);
}
.assistant-checked:empty { display: none; }
.assistant-error { color: var(--red-text, var(--red)); }
.assistant-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.assistant-item {
  --agent: var(--ai-cyan);
  padding: 10px 12px 10px 14px; border: 1px solid var(--border); border-left: 3px solid var(--agent);
  border-radius: 8px; background: rgba(8, 18, 36, 0.55); min-width: 0;
}
.assistant-item-new { box-shadow: -4px 0 14px -6px var(--agent); }
.assistant-item-done, .assistant-item-dismissed { border-left-color: var(--border); }
.assistant-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.assistant-closed { margin-top: 12px; }
.assistant-closed > summary { cursor: pointer; font-size: 0.875rem; color: var(--text-muted); padding: 4px 0; }
.assistant-closed .assistant-items { margin-top: 8px; }

/* -- Agent tiles -- */
.agent-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.agent-tile {
  --agent: var(--ai-cyan);
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(8, 18, 36, 0.55);
}
.agent-tile[data-status="new"] { border-color: var(--agent); box-shadow: 0 0 12px -4px var(--agent); }
.agent-tile-icon {
  flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 1px solid var(--agent); color: var(--agent); font-size: 1rem;
  box-shadow: inset 0 0 10px -4px var(--agent);
}
.agent-tile[data-status="off"] .agent-tile-icon { opacity: 0.55; }
.agent-tile-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agent-tile-name { font-size: 0.875rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.agent-tile-state { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); overflow-wrap: anywhere; }
.agent-tile-dot { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--text-muted); opacity: 0.6; }
.agent-tile[data-status="idle"] .agent-tile-dot { background: var(--green); opacity: 1; }
.agent-tile[data-status="new"] .agent-tile-dot { background: var(--agent); opacity: 1; box-shadow: 0 0 6px var(--agent); }
.agent-tile-count {
  flex: none; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.75rem; font-weight: 600; color: var(--ai-text);
}
/* Each agent's colour: its tile, and its items' left line. */
.ai-agent-cyan { --agent: #22d3ee; }
.ai-agent-violet { --agent: #a78bfa; }
.ai-agent-green { --agent: #34d399; }
.ai-agent-amber { --agent: #fbbf24; }
.ai-agent-slate { --agent: #94a3b8; }

/* -- Home's Assistant card -- */
.home-assistant { border-color: var(--ai-glass-border); }
.home-assistant .home-card-head { justify-content: flex-start; }
.home-assistant .home-open { margin-left: auto; }

@media (min-width: 900px) {
  .assistant { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .assistant-hero { grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr); gap: 24px; }
  .assistant-team { grid-column: 1 / -1; }
  .assistant-inbox { grid-column: 1; grid-row: 3; }
  .assistant-hub { grid-column: 2; grid-row: 3; align-self: start; }
}
@media (pointer: coarse) {
  .assistant-mark, .assistant-refresh, .assistant-more { min-height: 44px; }
  .assistant-closed > summary { min-height: 44px; display: flex; align-items: center; }
}
@media (pointer: fine) {
  .assistant-mark, .assistant-refresh, .assistant-more { min-height: 24px; }
}

/* With the Assistant's tab the strip can outgrow a tablet too (820px):
   above the phone width it scrolls sideways the same way, with the
   same edge fade, instead of widening the page. Where it fits, nothing
   changes. */
@media (min-width: 769px) {
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; min-width: 0; max-width: 100%; scrollbar-width: none; padding-block: 2px; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-bar.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
  .tab-bar.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 2.5rem), transparent); }
  .tab-bar.more-left.more-right {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  }
}

/* Agent keys (Settings → Advanced; views/agent-keys.js). */
.agent-key-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.agent-key { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.agent-key-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agent-key-name { font-weight: 600; overflow-wrap: anywhere; }
.agent-key-detail { font-size: 0.75rem; color: var(--text-muted); overflow-wrap: anywhere; }
.agent-key-form { display: flex; flex-direction: column; gap: 4px; }
.agent-key-form .settings-label { font-size: 0.75rem; color: var(--text-muted); }
.agent-key-field { display: flex; gap: 8px; }
.agent-key-field input { flex: 1; min-width: 0; }
.agent-key-new { margin-top: 8px; padding: 10px; border: 1px solid var(--accent); border-radius: 8px; }
.agent-key-token {
  display: block; margin: 6px 0; padding: 6px 8px; border-radius: 6px; background: var(--surface2);
  font-size: 0.8125rem; overflow-wrap: anywhere; word-break: break-all; user-select: all;
}

/* ==== 5 Year Plan: ⋯ on every goal, category and year; Archived;
   category colours; Earlier years ==== */
.fy-menu { display: inline-flex; }
.plan-year-header .fy-menu { font-weight: 400; }
.plan-category-coloured { border-left: 3px solid var(--fy-cat-colour); padding-left: 10px; }
.plan-cat-row .plan-cat-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.plan-cat-fold, .fy-archived-toggle, .plan-earlier-toggle {
  font-family: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 10px; min-height: 24px;
}
.plan-cat-fold:hover, .fy-archived-toggle:hover, .plan-earlier-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.fy-archived { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--border); }
.fy-archived-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fy-archived-list[hidden] { display: none; }
.fy-archived-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.8125rem; padding: 6px 10px; border-radius: 6px; background: var(--surface2);
}
.fy-archived-name { flex: 1 1 50%; min-width: 0; overflow-wrap: anywhere; }
.fy-archived-meta { font-size: 0.75rem; }
.fy-archived-item .add-btn { margin: 0; padding: 3px 10px; font-size: 0.75rem; min-height: 24px; }
.plan-earlier { display: flex; flex-direction: column; gap: 12px; }
.plan-earlier-toggle { align-self: flex-start; font-size: 0.8125rem; padding: 6px 12px; }
.plan-earlier-body { display: flex; flex-direction: column; gap: 16px; }
.plan-earlier-body[hidden] { display: none; }
.fy-cat-scope { border: none; padding: 0; margin: 4px 0 0; }
.fy-cat-scope legend { font-size: 0.75rem; color: var(--text-muted); padding: 0; }
.fy-category-edit input:disabled, .fy-category-edit select:disabled { opacity: 0.55; }
@media (pointer: coarse) {
  .fy-menu, .plan-cat-fold, .fy-archived-toggle, .plan-earlier-toggle, .fy-archived-item .add-btn {
    min-height: 44px; min-width: 44px;
  }
}
/* ==== Money Master (money-master.js): the plan's steps on its
   objective, the check-in's money questions, the plan picker ==== */
.mm-steps {
  margin: 4px 0 12px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--ai-glass-border, var(--accent-border));
  background: var(--ai-cyan-soft, var(--accent-bg));
}
.mm-now { margin: 0 0 8px; font-size: 0.8125rem; color: var(--text); font-weight: 600; }
.mm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mm-step {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(48px, 120px) 3rem;
  align-items: center; gap: 8px; font-size: 0.75rem; color: var(--text-muted);
}
.mm-name { min-width: 0; overflow-wrap: anywhere; }
.mm-step.mm-current .mm-name { color: var(--text); font-weight: 600; }
.mm-step.mm-done .mm-name { color: var(--text); }
.mm-bar { height: 6px; border-radius: 3px; background: var(--surface-border, rgba(255,255,255,0.12)); overflow: hidden; }
.mm-fill { display: block; height: 100%; background: var(--ai-cyan, var(--accent)); }
.mm-step.mm-done .mm-fill { background: var(--green); }
.mm-count { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .mm-step { grid-template-columns: minmax(0, 1fr) 2.75rem; }
  .mm-bar { grid-column: 1 / -1; grid-row: 2; }
}
.checkin-money { border: 1px solid var(--surface-border, var(--border)); border-radius: 8px; margin: 4px 0 0; padding: 8px 12px 0; min-width: 0; }
.checkin-money-title { padding: 0 4px; font-size: 0.75rem; font-weight: 600; color: var(--text); }
.plan-template-options { margin: 8px 0; }
.plan-template-options[hidden] { display: none; }

/* ==== Finance (views/finance.js; docs/FINANCE_MERGE_PLAN.md §5) ==== */
/* Finance's own page links: a row like the main tabs, wrapping on a
   phone rather than scrolling (five short names). */
.finance { display: grid; gap: 16px; min-width: 0; }
/* The Goals tab's sub tabs (goals-section.js): the goals pages, at the
   top of the page while one is open, like Finance's pages. */
/* Lined up with the page (the intro, the strip and .main): the same
   width and side padding. */
.goals-nav { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; max-width: 1200px; margin: 14px auto 0; padding: 0 28px; }
@media (max-width: 768px) { .goals-nav { padding: 0 14px; } }
.goals-nav[hidden] { display: none; }
.goals-nav .goals-subtab { border-color: var(--surface-border); }
@media (pointer: fine) { .goals-nav .goals-subtab { min-height: 24px; } }
@media (pointer: coarse) { .goals-nav .goals-subtab { min-height: 44px; } }
/* A goal's year (Long term goals): pick another to move it there. */
select.goal-year-sel { min-width: 0; max-width: 7.5rem; }
.plan-someday .plan-year-label { font-style: italic; }
.finance-nav { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.finance-nav-link {
  display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 6px;
  font-size: 0.8125rem; font-weight: 600; text-decoration: none;
  color: var(--text-muted); border: 1px solid var(--surface-border);
}
.finance-nav-link:hover { color: var(--text); background: var(--surface2); }
.finance-nav-link.active { background: var(--accent); color: #fff; border-color: transparent; }
@media (pointer: fine) { .finance-nav-link { min-height: 24px; } }
@media (pointer: coarse) { .finance-nav-link { min-height: 44px; } }
.finance-page { min-width: 0; }
.finance-page-title { margin: 0 0 8px; font-size: 1.125rem; }
.finance-soon { color: var(--text-muted); margin: 0; }

/* Finance → Overview (views/finance-overview.js). */
/* align-items: start: a short card beside a tall one keeps its own height
   (no empty stretch under the BHAG or the summary). */
.fin-overview { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; min-width: 0; }
@media (min-width: 900px) { .fin-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fin-kpis-card, .fin-overview > .finance-soon { grid-column: 1 / -1; } }
.fin-card { min-width: 0; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--surface-border); }
.fin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fin-card-title { margin: 0 0 8px; font-size: 1rem; overflow-wrap: anywhere; }
.fin-big { margin: 4px 0; font-size: 1.75rem; font-weight: 700; overflow-wrap: anywhere; }
.fin-sub { margin: 0 0 8px; color: var(--text-muted); font-size: 0.875rem; }
.fin-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 8px 0; }
.fin-facts dt { color: var(--text-muted); }
.fin-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.fin-band { padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; border: 1px solid currentColor; }
.fin-band-red { color: var(--red-text); }
.fin-band-amber { color: var(--amber); }
.fin-band-green { color: var(--green-text); }
.fin-streak { margin: 8px 0 0; font-size: 0.875rem; }
.fin-bar { height: 8px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.fin-bar-fill { height: 100%; background: var(--accent); }
.fin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 12px; margin: 0; }
.fin-kpi { min-width: 0; }
.fin-stages { margin: 8px 0 0; padding-left: 1.25rem; color: var(--text-muted); font-size: 0.875rem; }
.fin-stages .fin-stage-current { color: var(--text); font-weight: 700; }
.fin-barefoot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fin-barefoot-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; min-width: 0; }
.fin-barefoot-name { font-weight: 600; }
.fin-barefoot-figures { color: var(--text-muted); overflow-wrap: anywhere; }
.fin-light-danger .fin-barefoot-figures { color: var(--red-text); }

/* Finance pages (views/finance-kit.js and the pages built on it). */
.fin-page-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.fin-table-wrap { overflow-x: auto; max-width: 100%; }
.fin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.fin-table th, .fin-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--surface-border); overflow-wrap: anywhere; }
.fin-table thead th { color: var(--text-muted); font-weight: 600; }
.fin-table tbody th { font-weight: 600; }
.fin-table .num { text-align: right; white-space: nowrap; }
.fin-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin: 8px 0; }
.fin-field { display: grid; gap: 4px; min-width: 0; font-size: 0.875rem; }
.fin-field-label { color: var(--text-muted); }
.fin-input { min-width: 0; width: 100%; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--surface-border); background: var(--surface2); color: var(--text); font: inherit; }
@media (pointer: coarse) { .fin-input { min-height: 44px; } }
.fin-assumption { color: var(--amber); font-size: 0.75rem; }
.fin-field-suffix { color: var(--text-muted); font-size: 0.75rem; }
.fin-book-example { color: var(--amber); font-size: 0.8125rem; font-weight: 600; }
.fin-list { margin: 4px 0 0; padding-left: 1.25rem; font-size: 0.875rem; overflow-wrap: anywhere; }
.fin-book-models { margin-top: 12px; }
/* The sound button in the header (sounds.js): a speaker, crossed when
   muted. */
.sound-btn {
  width: 2rem; height: 2rem; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: var(--surface2);
}
@media (pointer: coarse) { .sound-btn { min-width: 44px; min-height: 44px; } }
.sound-icon { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-icon .sound-body { fill: currentColor; }
.sound-icon .sound-mute { display: none; }
.sound-btn.sound-off .sound-waves { display: none; }
.sound-btn.sound-off .sound-mute { display: inline; }
.sound-btn.sound-off { color: var(--text-muted); }
.settings-volume { flex-direction: row; align-items: center; gap: 8px; }
.settings-volume input[type="range"] { flex: 1; min-width: 8rem; accent-color: var(--accent); }
.settings-volume output { font-variant-numeric: tabular-nums; min-width: 3em; text-align: right; }
.settings-sound-preview { margin: 4px 0 8px; }
.settings-sound-preview summary { cursor: pointer; font-size: 0.8125rem; color: var(--text-muted); }
.sound-preview-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sound-preview-btn { font-size: 0.75rem; }
/* A phone's header has no room: the account menu has the same switch. */
@media (max-width: 480px) { .sound-btn { display: none; } }

/* The period's theme colour (look.js tintWith): a band along the top of
   the header, and on that period's board pill its edge and a light
   tint. The label keeps --text, so it reads whatever the colour. */
.header.header-tinted { border-top: 3px solid var(--period-colour); }
.okr-board-btn.okr-board-tinted { border-color: color-mix(in srgb, var(--period-colour) 55%, var(--border)); }
.okr-board-btn.okr-board-tinted.active {
  border-color: var(--period-colour); color: var(--text);
  background: color-mix(in srgb, var(--period-colour) 16%, transparent);
}
.okr-board-btn.okr-board-tinted:hover { border-color: var(--period-colour); }
.okr-board-icon { font-size: 0.875rem; line-height: 1; }
