/* The app frame and the shared components every redesigned screen uses (October 8, 2026).
   Built on tokens.css; linked after it. Plan: docs/plans/OPS_APP_BUILD_PLAN.md. Desktop gets the left rail,
   a phone (under 768px) gets the bottom bar: one language, two densities (systems brief section 3). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--text-body); }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Frame ---------------------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
/* The rail is the old dashboard's blue bar, turned on its side (her preference, October 8, 2026). */
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: var(--s4) var(--s3);
  background: var(--rail-bg); border-right: 1px solid var(--rail-line); display: flex; flex-direction: column; gap: 2px; }
.rail-brand { font: 600 15px/1.4 var(--font); padding: var(--s1) var(--s3) var(--s5); color: var(--rail-ink-strong);
  display: flex; flex-direction: column; }
.rail-brand-sub { font: 400 12px/1.4 var(--font); color: var(--rail-heading); }
.rail-heading { font: 600 11px/1.5 var(--font); color: var(--rail-heading); text-transform: uppercase; letter-spacing: .06em;
  padding: var(--s4) var(--s3) var(--s1); }
/* A function's heading is the link to its landing page (/fn/<key>): the same look, a quiet hover, a clear focus ring. */
.rail-heading-link { color: inherit; text-decoration: none; display: block; border-radius: var(--radius-sm); }
.rail-heading-link:hover, .rail-heading-link.is-active { color: var(--rail-ink-strong); }
.rail-heading-link:focus-visible { outline: 2px solid var(--rail-ink-strong); outline-offset: 2px; }
.rail-link { display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  min-height: 36px; padding: var(--s2) var(--s3); border-radius: var(--radius-sm); color: var(--rail-ink);
  text-decoration: none; font: 500 13.5px/1.4 var(--font); background: none; border: 0; width: 100%; text-align: left;
  cursor: pointer; transition: background .12s, color .12s; }
.rail-link:hover { background: var(--rail-active); color: var(--rail-ink-strong); }
.rail-link.is-active { background: var(--rail-active); color: var(--rail-ink-strong); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--rail-mark); }
.rail-link:focus-visible { outline: 2px solid var(--rail-ink-strong); outline-offset: -2px; }
.rail-fixed { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--rail-line); display: flex;
  flex-direction: column; gap: 2px; }
.rail-badge { font: 600 11px/1.6 var(--font); padding: 0 var(--s2); border-radius: var(--radius-pill); white-space: nowrap;
  background: rgba(255, 255, 255, .92); }
.rail-badge.tone-broken { color: var(--broken); }
.rail-badge.tone-muted { color: var(--ink-muted); }
.rail-badge.tone-needs { color: var(--needs-you); }
.rail-badge.tone-ok { color: var(--working); }
.tab-count { margin-left: .4em; font-weight: 600; }
.rail-error { font: var(--text-small); color: var(--rail-ink); padding: var(--s3); }
.rail-skeleton .sk-row { background: var(--rail-line); }
.app-main { min-width: 0; }
.app-head { padding: var(--s6) var(--s8) 0; }
.app-head:empty { padding: 0; }
.app-content { padding: var(--s6) var(--s8) var(--s12); max-width: 1200px; }
.app-content.is-legacy { max-width: 1240px; }
/* A screen holding a table uses the full width (Aarohi, October 12, 2026): columns are what she compares. */
.app-content:has(.mtable) { max-width: none; }
.bottom-bar { display: none; }

/* ---- Module header -------------------------------------------------------------------------------- */
.mod-path { font: var(--text-small); color: var(--ink-muted); }
.mod-title { font: var(--text-page); margin-top: var(--s1); }
.mod-desc { margin: var(--s1) 0 0; color: var(--ink-muted); max-width: 70ch; }
.mod-state { margin: var(--s3) 0 0; font: var(--text-label); }
.mod-state .refresh-btn { margin-left: var(--s2); padding: 2px 8px; font: var(--text-small); vertical-align: baseline; }
.mod-path-link { color: var(--accent); text-decoration: none; display: inline-block; padding: 10px 0; margin: -10px 0; }
.mod-path-link:hover { text-decoration: underline; }
.app-refresh:not(:has(.view-tools:not(:empty), .refresh-btn)) { display: none; }
.mod-tabs { display: flex; gap: var(--s1); margin-top: var(--s4); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; }
.mod-tab { padding: var(--s2) var(--s3); color: var(--ink-muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font: var(--text-label); }
.mod-tab:hover { color: var(--ink); }
.mod-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Tones: severity has three colours and no others ---------------------------------------------- */
.tone-broken { color: var(--broken); }
.tone-needs { color: var(--needs-you); }
.tone-ok { color: var(--working); }
.tone-muted { color: var(--ink-muted); }

/* ---- Components ----------------------------------------------------------------------------------- */
.page-title { font: var(--text-page); }
.lead { font: var(--text-section); font-weight: 500; margin: var(--s2) 0 0; max-width: 70ch; }
.muted { color: var(--ink-muted); }
.small { font: var(--text-small); }
.section { margin-top: var(--s8); }
.section-title { font: var(--text-badge); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted);
  margin: 0 0 var(--s3); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.card + .card { margin-top: var(--s3); }
.grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line);
  min-height: 48px; }
.row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font: var(--text-label); color: var(--ink); overflow-wrap: anywhere; }
.row-meta { display: block; font: var(--text-small); color: var(--ink-muted); margin-top: 2px; }
.row-mod { font: var(--text-badge); color: var(--ink-muted); white-space: nowrap; }
a.row { color: inherit; text-decoration: none; }
a.row:hover { background: var(--surface-raised); }
.row.row-click { cursor: pointer; }
/* A whole row that is a button (a handled Inbox item opens its details) looks like the other rows, not a button. */
.rows button.row { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); font: inherit; color: inherit; }
.rows button.row:first-child { border-top: 0; }
.row.row-click:hover { background: var(--surface-raised); }
.row.row-click:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stripe-broken { box-shadow: inset 3px 0 0 var(--broken); }
.stripe-needs { box-shadow: inset 3px 0 0 var(--needs-you); }
/* The stopped line on Home is a bare paragraph, not a row: the bar would touch its text without this. */
.home-stopped { padding: var(--s2) var(--s3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.dot-none { visibility: hidden; }
.chip { display: inline-block; font: var(--text-badge); padding: 0 var(--s2); border-radius: var(--radius-pill);
  background: var(--surface-raised); color: var(--ink-muted); }
.chip.tone-broken { background: var(--broken-soft); }
.chip.tone-needs { background: var(--needs-you-soft); }
.chip.tone-ok { background: var(--working-soft); }
/* Not confirmed (Startups: a programme status nobody has confirmed): an outline, so it never reads as a real state. */
.chip.tone-unconfirmed { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); min-height: 36px;
  padding: 0 var(--s4); border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font: var(--text-label); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-raised); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: default; }
.notice { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); background: var(--surface); }
.notice.tone-broken { border-color: var(--broken); background: var(--broken-soft); color: var(--ink); }
.notice.tone-needs { border-color: var(--needs-you); background: var(--needs-you-soft); color: var(--ink); }
.error-line { font: var(--text-small); color: var(--broken); margin-top: var(--s1); }
.loader { color: var(--ink-muted); font: var(--text-small); padding: var(--s4) 0; }
.empty { color: var(--ink-muted); padding: var(--s4); }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
table.data th { text-align: left; font: var(--text-badge); color: var(--ink-muted); padding: var(--s2) var(--s3);
  background: var(--surface-raised); position: sticky; top: 0; }
table.data td { padding: var(--s2) var(--s3); border-top: 1px solid var(--line); vertical-align: top; }
details > summary { cursor: pointer; color: var(--accent); font: var(--text-label); padding: var(--s2) 0; }
.toggle { display: inline-flex; align-items: center; gap: var(--s2); }
.covers { font: var(--text-small); color: var(--ink-muted); margin-top: var(--s2); }

/* ---- Phone sheet ---------------------------------------------------------------------------------- */
.sheet { position: fixed; inset: 0; background: rgba(11, 31, 26, .4); z-index: 50; display: flex; align-items: flex-end; }
.sheet-panel { background: var(--surface); width: 100%; max-height: 80vh; max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--s4) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); }
/* Sticky inside the panel, so Close never scrolls out of view in a long Functions sheet (November 12, 2026). */
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); position: sticky; top: 0;
  z-index: 1; background: var(--surface); padding: var(--s4) 0 var(--s2); margin-top: calc(-1 * var(--s4)); }
.sheet-head h2 { font: var(--text-section); }
.sheet-row { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line);
  color: var(--ink); text-decoration: none; min-height: var(--touch); }
.sheet-name { font: var(--text-label); }
.sheet-desc { grid-column: 1; font: var(--text-small); color: var(--ink-muted); }
.sheet-state { grid-column: 2; grid-row: 1; font: var(--text-badge); }
/* A function in the Functions sheet: its name, then its screens as links that wrap to more lines rather than shrink, each at
   least 44 px tall (November 12, 2026). The label beside a screen is the same one the rail has (shell.js rowLabel). */
.sheet-fn { border-top: 1px solid var(--line); }
.sheet-fn > .sheet-row { border-top: 0; }
.sheet-mods { display: flex; flex-wrap: wrap; gap: 0 var(--s2); padding-bottom: var(--s2); }
.sheet-mod { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--touch); padding: 0 var(--s3);
  border-radius: var(--radius-pill); color: var(--ink-muted); text-decoration: none; font: var(--text-label); }
.sheet-mod:hover { background: var(--surface-raised); color: var(--ink); }
.sheet-mod-label { font: var(--text-badge); }
.sheet-mod-label.tone-broken { color: var(--broken); }
.sheet-mod-label.tone-ok { color: var(--working); }
.sheet-mod-label.tone-muted { color: var(--ink-soft); }

@media (max-width: 767px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .app-head { padding: var(--s4) var(--s4) 0; }
  .app-content { padding: var(--s4) var(--s4) calc(88px + env(safe-area-inset-bottom)); }
  .bottom-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  /* The bar is always on screen and always the way out (Aarohi, November 12, 2026: "it feels like no escape available"):
     above the sheet (50) and the details panel (60), which now stop where the bar starts instead of covering it. */
  .sheet, .panel-wrap { bottom: calc(56px + env(safe-area-inset-bottom)); }
  .tab-btn { min-height: 56px; display: flex; align-items: center; justify-content: center; font: var(--text-label);
    color: var(--ink-muted); background: none; border: 0; text-decoration: none; cursor: pointer; }
  .tab-btn.is-active { color: var(--accent); }
  .row { flex-wrap: wrap; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}


/* ---- Loading: a skeleton after 300 ms, never a sentence (build plan v3, D13) ----------------------------- */
.skeleton { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s2) 0; }
.sk-row { height: 14px; border-radius: var(--radius-sm); background: var(--line);
  animation: sk-pulse 1.2s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: .45; } }
.updating { font: var(--text-small); color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .sk-row { animation: none; } .panel-wrap > .panel { transition: none !important; } }

/* ---- The details panel: slides in from the right (D14) ------------------------------------------------- */
/* Scoped under .panel-wrap (October 26, 2026): bare .panel and .panel-body also style the Settings page's own cards
   (frontend/legacy/settings.html), and this sheet's position, width and slide-out transform hid every one of them off
   the right edge, on a phone and a desktop alike. Pinned by tests/frontend/test_shell_css.py. */
.panel-wrap { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.panel-backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .32); opacity: 0; transition: opacity .2s; }
.panel-wrap > .panel { position: absolute; top: 0; right: 0; height: 100%; width: min(520px, 100vw); background: var(--surface);
  box-shadow: -12px 0 32px rgba(17, 24, 39, .14); transform: translateX(100%); transition: transform .22s ease-out;
  display: flex; flex-direction: column; outline: none; }
.panel-wrap > .panel-wide { width: min(680px, 100vw); }
.panel-wrap.is-open { pointer-events: auto; }
.panel-wrap.is-open .panel-backdrop { opacity: 1; }
.panel-wrap.is-open .panel { transform: translateX(0); }
.panel-wrap .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3);
  padding: var(--s5) var(--s6) var(--s4); border-bottom: 1px solid var(--line); }
.panel-title { font: var(--text-section); overflow-wrap: anywhere; }
.panel-wrap .panel-body { padding: var(--s5) var(--s6) var(--s8); overflow-y: auto; flex: 1; }
.panel-section { margin-top: var(--s6); }
.panel-section:first-child { margin-top: 0; }
.panel-label { font: 600 11px/1.5 var(--font); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: var(--s2); }
.panel-text { white-space: pre-wrap; overflow-wrap: anywhere; font: var(--text-body); color: var(--ink);
  background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3) var(--s4);
  max-height: 420px; overflow-y: auto; }
.panel-facts { display: grid; grid-template-columns: 120px 1fr; gap: var(--s2) var(--s3); font: var(--text-body); }
.panel-facts dt { color: var(--ink-muted); }
.panel-facts dd { margin: 0; overflow-wrap: anywhere; }
.panel-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
/* One control height in the action row (Aarohi, October 12, 2026: the status select sat smaller and unstyled between
   36 px buttons, and Archive floated). The select matches the buttons; Archive, the only step away, sits at the far end. */
.panel-actions .inline-field { font: var(--text-label); color: var(--ink-muted); gap: var(--s2); }
.panel-actions select { min-height: 36px; padding: 0 32px 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink); font: var(--text-label); appearance: none; -webkit-appearance: none; cursor: pointer; }
.panel-actions select:hover { border-color: var(--ink-soft); }
.panel-actions select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.panel-actions [data-do="archive"] { margin-left: auto; color: var(--ink-muted); }
.panel-actions [data-do="archive"]:hover { color: var(--broken); background: var(--broken-soft); }

/* ---- The old dashboard's components (her preference): metrics, chart cards, legend, lists ----------------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric { background: var(--surface); border-radius: 10px; padding: 22px 24px; border: 1px solid var(--line);
  color: inherit; text-decoration: none; }
a.metric:hover { border-color: var(--accent-bright); box-shadow: 0 2px 8px rgba(59, 130, 246, .12); }
.metric-label { font-size: 11px; color: var(--ink-muted); margin-bottom: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.metric-value { font-size: 26px; font-weight: 600; line-height: 1; }
.metric-sub { font-size: 11px; color: var(--ink-soft); margin-top: 6px; }
.green { color: var(--working); }
.red { color: var(--broken); }
.amber { color: var(--needs-you); }
.blue { color: var(--accent); }
.dash-row { display: grid; gap: 18px; margin-bottom: 18px; grid-template-columns: 1.8fr 1fr; align-items: start; }
.dash-row.even { grid-template-columns: 45fr 55fr; }
.dash-card { background: var(--surface); border-radius: 10px; border: 1px solid var(--line); padding: 24px 26px; min-width: 0; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: 18px; }
.dash-card-title { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.open-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--accent);
  background: var(--accent-soft); border: none; border-radius: 5px; padding: 4px 10px; text-decoration: none; cursor: pointer; }
.chart-box { position: relative; height: 220px; }
.donut-row { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.donut-box { position: relative; height: 140px; width: 140px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.donut-box canvas { position: absolute; inset: 0; }
.donut-center { text-align: center; }
.donut-center .big { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1; }
.donut-center .small { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }
.legend { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.legend-item { display: flex; align-items: center; justify-content: space-between; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-label { font-size: 12px; color: var(--ink-muted); margin-left: 8px; flex: 1; padding-right: 12px; }
.legend-val { font-size: 13px; font-weight: 600; color: var(--ink); }
.overdue-item { padding: 10px 12px; background: var(--broken-soft); border-radius: 7px; margin-bottom: 8px; }
.overdue-text { font-size: 12px; color: var(--broken); font-weight: 600; }
.overdue-sub { font-size: 11px; color: var(--broken); margin-top: 2px; opacity: .85; }
.cd-stats { display: flex; gap: 8px; margin-bottom: 18px; }
.cd-stat { flex: 1; text-align: center; padding: 10px 8px; border-radius: 8px; }
.cd-stat.stat-red { background: var(--broken-soft); } .cd-stat.stat-amber { background: var(--needs-you-soft); }
.cd-stat.stat-green { background: var(--working-soft); }
.cd-stat .n { font-size: 22px; font-weight: 700; line-height: 1; }
.cd-stat .l { font-size: 11px; color: var(--ink-muted); margin-top: 3px; }
.cd-section-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin: 14px 0 8px; }
.cd-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--surface-raised); }
.cd-row:last-child { border: none; }
.cd-name { font-size: 12.5px; color: var(--ink); flex: 1; line-height: 1.35; }
.cd-right { font-size: 11px; font-weight: 500; flex-shrink: 0; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--surface-raised); }
.tl-item:last-child { border: none; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.tl-body { flex: 1; min-width: 0; }
.tl-text { font-size: 13px; color: var(--ink); line-height: 1.4; }
.tl-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.act-tag { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 4px; letter-spacing: .03em; }
.tl-meta { font-size: 11px; color: var(--ink-soft); }
.tx { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--surface-raised); gap: 12px; }
.tx:last-child { border: none; }
.tx-desc { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-meta { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.tx-amt { font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* ---- Opportunities: a list whose rows open the panel ---------------------------------------------------- */
.opp-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line);
  cursor: pointer; background: var(--surface); width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0;
  font: inherit; color: inherit; }
.opp-row:first-child { border-top: 0; }
.opp-row:hover { background: var(--surface-raised); }
.opp-row.is-open { background: var(--accent-soft); }
.opp-main { flex: 1; min-width: 0; }
.opp-title { font: var(--text-label); color: var(--ink); overflow-wrap: anywhere; }
.opp-meta { font: var(--text-small); color: var(--ink-muted); margin-top: 2px; display: flex; gap: var(--s3); flex-wrap: wrap; }
.opp-fit { font: 600 12px/1 var(--font); color: var(--ink-muted); min-width: 52px; text-align: right; }

@media (max-width: 1000px) { .dash-row, .dash-row.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) {
  .panel-wrap > .panel, .panel-wrap > .panel-wide { width: 100vw; }
  .panel-facts { grid-template-columns: minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donut-row { flex-direction: column; align-items: stretch; }
}

/* ---- Home and the smaller screens (moved here from their pages, which are views now) ------------------- */
.home-next { margin-top: var(--s6); }
.next-card { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.day-title { font: var(--text-card); margin: var(--s4) 0 var(--s2); }
.log-time { font: var(--text-small); color: var(--ink-muted); min-width: 64px; }
.setup-notice { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s4); }
.section-card { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
a.section-card:hover { border-color: var(--accent-bright); }
.matrix-wrap { overflow-x: auto; }
td.q { font: var(--text-label); min-width: 220px; }
.verdict { font: var(--text-badge); }
.page-title { font: var(--text-page); }

/* ---- Product subscriptions (views/subscriptions.js) ------------------------------------------------------------ */
.product-subs { margin-top: 18px; }
.metrics.compact { margin-bottom: 10px; }
.metrics.compact .metric { padding: 14px 16px; }
.section-sub { margin: var(--s4) 0 var(--s2); font: var(--text-label); }
.rev-splits { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin: 6px 0 14px; align-items: start; }
.rev-table { width: 100%; }
.rev-table th.num, .rev-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Refresh control (company hub plan, phase 1): on every screen, says how fresh the data is ------------------ */
.app-refresh { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 8px var(--s8) 0; }
.app-refresh .updated { font: var(--text-small); color: var(--ink-muted); }
.app-refresh .refresh-btn { padding: 4px 10px; font-size: 13px; }
@media (max-width: 767px) { .app-refresh { padding: 8px var(--s4) 0; } }

/* ---- People (views/people.js) ------------------------------------------------------------------------------------- */
.people-filters { display: grid; gap: 8px; margin: 8px 0 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-filter { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chip-filter.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.people-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.people-tools input[type=search] { min-width: 260px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.person-row { width: 100%; text-align: left; }
.person-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.person-edit { display: grid; gap: 10px; }
.person-edit label { display: grid; gap: 4px; font: var(--text-small); }
.person-edit input, .person-edit select, .person-edit textarea { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.person-facts { display: grid; gap: 2px; margin-bottom: 12px; }
.person-fact { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 5px 0; align-items: baseline; }
.people-pager { display: flex; gap: 8px; margin: 12px 0; }

/* ---- Tables (views/table.js, Tabulator themed to the app's tokens) ------------------------------------------------ */
.content-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 8px; }
/* A screen's own controls beside Updated and Refresh (shell.js viewTools(); Aarohi, November 3, 2026: move them to the
   right so the space above the table shrinks). Ghost buttons sized like Refresh. */
.view-tools { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.view-tools:empty { display: none; }
.view-tools .btn { padding: 4px 10px; font-size: 13px; }
.view-tools .inline-field { white-space: nowrap; }
.app-refresh .view-tools + .updated { padding-left: 12px; border-left: 1px solid var(--line); }
/* A table drawn as cards (up to 1023 px, views/table.js CARDS) has no column filters, so no Clear column filters. On a
   phone the screen's controls take their own line above Updated and Refresh. */
@media (max-width: 1023px) { .view-tools [data-clear] { display: none; } }
@media (max-width: 767px) {
  .app-refresh { flex-wrap: wrap; row-gap: 0; }
  .app-refresh .view-tools { flex: 1 1 100%; justify-content: flex-start; }
  .app-refresh .view-tools + .updated { padding-left: 0; border-left: 0; }
  .app-refresh .updated { white-space: nowrap; }
}
.inline-field { display: inline-flex; gap: 6px; align-items: center; font: var(--text-small); }
.mtable.tabulator { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: var(--text-body); }
.mtable .tabulator-header { background: var(--surface-raised); border-bottom: 1px solid var(--line-strong); color: var(--ink-soft); }
.mtable .tabulator-header .tabulator-col { background: var(--surface-raised); border-right: 1px solid var(--line); }
.mtable .tabulator-header .tabulator-col .tabulator-col-content { padding: 8px 10px; }
.mtable .tabulator-header .tabulator-col .tabulator-col-title { font-weight: 600; }
.mtable .tabulator-header-filter input, .mtable .tabulator-header-filter select { width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: var(--text-small); }
.mtable .tabulator-tableholder { background: var(--surface); }
.mtable .tabulator-row { background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; min-height: 40px; }
.mtable .tabulator-row.tabulator-row-even { background: var(--surface); }
.mtable .tabulator-row:hover { background: var(--accent-soft); }
.mtable .tabulator-row .tabulator-cell { padding: 10px; border-right: 1px solid transparent; }
.mtable .tabulator-row .tabulator-frozen { background: inherit; }
.mtable .tabulator-placeholder .tabulator-placeholder-contents { color: var(--ink-muted); font: var(--text-body); }
.mtable .tabulator-col-resize-handle:hover { background: var(--accent-soft); }
/* Tabulator sets its own text and header colours; every one is taken from the tokens so the dark look works. */
.mtable .tabulator-row, .mtable .tabulator-row .tabulator-cell { color: var(--ink); }
.mtable .tabulator-header, .mtable .tabulator-header .tabulator-col, .mtable .tabulator-header .tabulator-col .tabulator-col-content { background: var(--surface-raised); color: var(--ink); }
.mtable .tabulator-header .tabulator-col.tabulator-sortable:hover { background: var(--accent-soft); }
.mtable .tabulator-row:focus { outline: none; }
.mtable .tabulator-row:focus-visible, .mtable.tabulator .tabulator-header .tabulator-col:focus-visible { background: var(--accent-soft); outline: 2px solid var(--focus); outline-offset: -2px; }
.mtable.tabulator .tabulator-header, .mtable.tabulator .tabulator-header .tabulator-col,
.mtable.tabulator .tabulator-header .tabulator-col .tabulator-col-content { background: var(--surface-raised); color: var(--ink); }
.mtable.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover { background: var(--accent-soft); }
/* Page controls (October 14, 2026): Tabulator's footer in the Ledger look. */
.mtable.tabulator .tabulator-footer { background: var(--surface-raised); border-top: 1px solid var(--line-strong); color: var(--ink-soft); font: var(--text-small); padding: 6px 10px; }
.mtable.tabulator .tabulator-footer .tabulator-footer-contents { gap: 12px; flex-wrap: wrap; }
.mtable.tabulator .tabulator-footer .tabulator-page-counter { color: var(--ink-soft); }
.mtable.tabulator .tabulator-footer .tabulator-page { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 3px 9px; margin: 0 2px; }
.mtable.tabulator .tabulator-footer .tabulator-page:not(:disabled):hover { background: var(--accent-soft); color: var(--ink); }
.mtable.tabulator .tabulator-footer .tabulator-page.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.mtable.tabulator .tabulator-footer .tabulator-page:disabled { opacity: .45; }
.mtable.tabulator .tabulator-footer .tabulator-page-size { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 3px 6px; }
.mtable.tabulator .tabulator-footer .tabulator-page:focus-visible, .mtable.tabulator .tabulator-footer .tabulator-page-size:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ---- A draft, read as a document (views/markdown.js) -------------------------------------------------------------- */
/* An email exactly as composed (Outreach > Sending): its own line breaks, wrapped, never re-flowed as prose. */
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; margin: 0; padding: var(--s3);
  font: var(--text-body); line-height: 1.55; background: var(--surface-raised); border-radius: var(--radius-sm); }
.doc { max-width: 72ch; font: var(--text-body); line-height: 1.65; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px 24px; }
.doc > :first-child { margin-top: 0; }
.doc p { margin: 0 0 0.9em; }
.doc h2 { font-size: 1.35em; line-height: 1.3; margin: 1.2em 0 0.5em; }
.doc h3 { font-size: 1.15em; margin: 1.2em 0 0.4em; }
.doc h4, .doc h5, .doc h6 { font-size: 1em; margin: 1em 0 0.3em; }
.doc blockquote { margin: 0 0 1em; padding: 8px 14px; border-left: 3px solid var(--line-strong); background: var(--surface-raised); color: var(--ink-soft); }
.doc blockquote p { margin: 0 0 0.4em; }
.doc ul, .doc ol { margin: 0 0 1em 1.4em; padding: 0; }
.doc li { margin: 0.2em 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 1.4em 0; }
.doc code { font: var(--text-code); background: var(--surface-raised); padding: 1px 4px; border-radius: 4px; }
.doc a { color: var(--accent); }
.btn-small { padding: 2px 8px; font: var(--text-small); }

/* ---- Draft panel: request, draft and notes as three separate boxes (October 12, 2026) ------------------------------ */
.panel-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.request-box { margin: 0; padding: 12px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--text-body); line-height: 1.6;
  color: var(--ink); background: var(--surface-raised); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: var(--text-small); cursor: pointer; text-transform: none; letter-spacing: 0; }
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-raised); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel-more > summary { cursor: pointer; list-style: revert; }
.panel-more[open] > summary { margin-bottom: 8px; }
.doc-quiet { background: var(--surface-raised); font-size: 0.95em; }

/* ---- Tables, modern pass (Aarohi, October 12, 2026: "not looking modern and not using full width") ---------------
   Scoped under .app-content so it outranks Tabulator's own sheet, which loads after this one. Flat header with small
   caps-style labels, no vertical rules, roomier rows, a soft card edge. */
.app-content .mtable.tabulator { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); background: var(--surface); font: var(--text-body); }
.app-content .mtable.tabulator .tabulator-header { border-bottom: 1px solid var(--line); background: var(--surface-raised); }
.app-content .mtable.tabulator .tabulator-header .tabulator-col { border-right: 0; background: var(--surface-raised); }
.app-content .mtable.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 10px 14px 8px; }
.app-content .mtable.tabulator .tabulator-header .tabulator-col .tabulator-col-title { font: 600 11px/1.5 var(--font);
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-muted); }
.app-content .mtable.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter { right: 8px; }
/* Sort arrows (Aarohi, November 3, 2026: "very light, almost invisible, unless that column is the active sort"). A faint
   arrow on every column says "sortable" without eleven arrows competing with the labels; hover or keyboard focus shows it
   half way, and the column the table is sorted by shows it in full. Tabulator sets aria-sort on the column. The arrow sits
   tighter to the label so a short label keeps its letters. */
.app-content .mtable.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title { padding-right: 12px; }
.app-content .mtable.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter { right: 4px; opacity: .15; transition: opacity 120ms; }
.app-content .mtable.tabulator .tabulator-header .tabulator-col:hover .tabulator-col-sorter,
.app-content .mtable.tabulator .tabulator-header .tabulator-col:focus-visible .tabulator-col-sorter { opacity: .55; }
.app-content .mtable.tabulator .tabulator-header .tabulator-col[aria-sort="ascending"] .tabulator-col-sorter,
.app-content .mtable.tabulator .tabulator-header .tabulator-col[aria-sort="descending"] .tabulator-col-sorter { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .app-content .mtable.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter { transition: none; } }
/* A short marker after a value (a column's note(row), views/table.js): the Due column's "repost". */
.mtable .cell-note { font: 600 11px/1.4 var(--font); color: var(--ink-muted); text-transform: lowercase; letter-spacing: .02em; }
.app-content .mtable.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover { background: var(--accent-soft); }
.app-content .mtable.tabulator .tabulator-header-filter { margin-top: 6px; }
.app-content .mtable.tabulator .tabulator-header-filter input, .app-content .mtable.tabulator .tabulator-header-filter select {
  height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); font: var(--text-small); box-sizing: border-box; }
.app-content .mtable.tabulator .tabulator-header-filter input:focus, .app-content .mtable.tabulator .tabulator-header-filter select:focus {
  border-color: var(--accent-bright); outline: 2px solid var(--accent-soft); }
.app-content .mtable.tabulator .tabulator-row { min-height: 48px; border-bottom: 1px solid var(--line); background: var(--surface); }
.app-content .mtable.tabulator .tabulator-row:last-child { border-bottom: 0; }
.app-content .mtable.tabulator .tabulator-row.tabulator-row-even { background: var(--surface); }
.app-content .mtable.tabulator .tabulator-row.tabulator-selectable:hover, .app-content .mtable.tabulator .tabulator-row:hover { background: var(--accent-soft); }
.app-content .mtable.tabulator .tabulator-row .tabulator-cell { padding: 14px; border-right: 0; vertical-align: middle; }
.app-content .mtable.tabulator .tabulator-row .tabulator-cell:first-child { font-weight: 500; }
/* A column of several chips (table.js `chips`) wraps them onto more lines rather than cutting the last one off. */
.app-content .mtable.tabulator .tabulator-row .tabulator-cell.cell-chips { white-space: normal; line-height: 2; }
.app-content .mtable.tabulator .tabulator-col-resize-handle { width: 6px; }
.app-content .mtable.tabulator .tabulator-col-resize-handle:hover { background: var(--accent-bright); opacity: .35; }
.app-content .mtable.tabulator .tabulator-tableholder .tabulator-table { min-width: 100%; }
.app-content .mtable .chip { font: var(--text-badge); padding: 2px 10px; border-radius: var(--radius-pill); }

/* ---- Strategy map (views/strategy.js, October 12, 2026) ------------------------------------------------------------ */
.sm-tools { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.sm-legend { display: flex; gap: var(--s3); flex-wrap: wrap; font: var(--text-small); color: var(--ink-muted); }
.sm-key { display: inline-flex; align-items: center; gap: 6px; }
.sm-actions { display: flex; gap: var(--s2); }
.sm-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--s4); align-items: start; }
@media (max-width: 1100px) { .sm-wrap { grid-template-columns: minmax(0, 1fr); } }
.sm-canvas { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }
.sm-stage { position: relative; min-width: 760px; }
.sm-svg { position: absolute; inset: 0; }
.sm-line { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; }
.sm-line-main { stroke: var(--ink-soft); stroke-width: 2.25; }
.sm-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ink-soft); flex: none; display: inline-block; }
.st-planned .sm-dot { background: var(--accent-bright); }
.st-active .sm-dot { background: var(--needs-you); }
.st-done .sm-dot { background: var(--working); }
/* Done is green on the map itself, not only in the dot (Aarohi: "showing green for done items"). */
.sm-node.st-done { background: var(--working-soft); border-color: var(--working); }
.sm-branch.st-done { border-width: 1.5px; }
.st-paused .sm-dot { background: transparent; border: 1.5px solid var(--ink-soft); }
.st-question .sm-dot { background: #8B5CF6; }
.sm-center { position: absolute; display: grid; place-items: center; gap: 2px; padding: 18px 26px;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; text-align: center;
  box-shadow: 0 6px 24px rgba(16, 24, 40, .10); z-index: 2; }
.sm-center-name { font: 700 22px/1.1 var(--font); letter-spacing: .08em; text-transform: uppercase; }
.sm-theme { font: 600 13px/1.3 var(--font); color: var(--accent); }
.sm-node { position: absolute; display: grid; gap: 2px; justify-items: center; max-width: 200px; width: max-content; padding: 6px 10px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: var(--text-body); cursor: pointer;
  text-align: center; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); z-index: 1; }
.sm-node:hover { border-color: var(--accent-bright); box-shadow: 0 0 0 3px var(--accent-soft); z-index: 3; }
.sm-node:focus-visible, .sm-center:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; z-index: 3; }
.sm-node.st-question { border-style: dashed; border-color: #8B5CF6; }
.sm-node.st-paused { opacity: .65; }
.sm-label { display: inline-flex; align-items: center; gap: 6px; line-height: 1.3; }
.sm-branch { padding: 9px 14px; border: 1.5px solid var(--ink-soft); background: var(--surface-raised); }
.sm-branch .sm-label { font: var(--text-card); font-size: 15px; }
.sm-reading { font: var(--text-small); color: var(--ink-muted); }
.sm-reading.tone-ok { color: var(--working); }
.sm-reading.tone-needs { color: var(--needs-you); }
.sm-reading.unmeasured { font-style: italic; }
.sm-has-note { position: absolute; top: -7px; right: -7px; font-size: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px;
  width: 18px; height: 18px; display: grid; place-items: center; color: var(--ink-muted); }
.sm-channels { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); display: grid; gap: var(--s4); }
.sm-channels h2 { font: var(--text-section); margin: 0; }
.sm-chgroup { display: grid; gap: var(--s2); }
.sm-chgroup h3 { font: 600 11px/1.5 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); margin: 0; }
.sm-channels .sm-node, .sm-outline .sm-node { position: static; transform: none; max-width: none; justify-items: start; text-align: left; width: 100%; }
.sm-outline { padding: var(--s4); display: grid; gap: var(--s4); }
.sm-outline ul { list-style: none; margin: var(--s2) 0 0 var(--s4); padding-left: var(--s3); border-left: 1.5px solid var(--line); display: grid; gap: var(--s2); }
.sm-center-o { font: 700 18px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; }
.sm-center-o span { font: 600 13px var(--font); color: var(--accent); text-transform: none; letter-spacing: 0; margin-left: 8px; }
.sm-empty { padding: 64px 24px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.sm-form { display: grid; gap: var(--s3); }
.sm-field { display: grid; gap: 4px; font: var(--text-label); color: var(--ink-muted); }
.sm-field input, .sm-field select, .sm-field textarea { font: var(--text-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 8px 10px; }
.sm-inline { display: flex; gap: var(--s2); }
.sm-inline input { flex: 1; min-width: 0; font: var(--text-body); padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.sm-sub { margin-top: var(--s6); }
.sm-now { font: var(--text-section); margin: 0; }
.sm-now.tone-ok { color: var(--working); } .sm-now.tone-needs { color: var(--needs-you); }
.sm-foot { margin-top: var(--s3); }

/* Live items under a node (read, never stored) and the introduction of anything new since the last look. */
.sm-node.sm-auto { padding: 4px 8px; font: var(--text-small); max-width: 170px; text-decoration: none; border-radius: 8px; }
.sm-node.sm-auto .sm-label { line-height: 1.25; }
.sm-node.sm-more { border-style: dashed; color: var(--ink-muted); }
.sm-new-tag { position: absolute; top: -9px; left: -8px; font: 700 10px/1 var(--font); letter-spacing: .04em; text-transform: uppercase;
  background: var(--accent); color: var(--on-accent); padding: 3px 6px; border-radius: 99px; }
.sm-node.sm-new { box-shadow: 0 0 0 3px var(--accent-soft); }
@media (prefers-reduced-motion: no-preference) {
  .sm-node.sm-new { animation: sm-pop .5s cubic-bezier(.2, .9, .3, 1.3) both; }
}
@keyframes sm-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
.sm-check { display: flex; gap: 8px; align-items: center; font: var(--text-body); color: var(--ink); }
.sm-measuring { visibility: hidden; }
.sm-measuring .sm-node, .sm-measuring .sm-center { left: 0; top: 0; }
.sm-line-sub { stroke-width: 1.25; stroke-linejoin: round; }
.sm-stage .sm-node { text-align: left; justify-items: start; }
.sm-stage .sm-branch { justify-items: center; text-align: center; }
/* Full-width nodes (phone outline, channel list) keep their badges inside the edge: outside it, they widened the page. */
.sm-outline .sm-has-note, .sm-channels .sm-has-note { top: 6px; right: 6px; }
.sm-outline .sm-new-tag, .sm-channels .sm-new-tag { top: 6px; left: auto; right: 30px; }
.sm-toggle { justify-self: center; margin-top: 2px; font: 600 11px/1 var(--font); padding: 3px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
.sm-toggle:hover { background: var(--accent); color: var(--on-accent); }
/* ---- Visibility > Search (views/search.js) ---------------------------------------------------------------------- */
.search-connect { max-width: 620px; display: grid; gap: var(--s3); justify-items: start; padding: var(--s6); }
.search-connect h2 { margin: 0; font: var(--text-section); }
.search-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.search-site { margin: 0; font: var(--text-section); }
.search-h { font: var(--text-card); margin: var(--s6) 0 var(--s2); }
/* A tooltip never catches the pointer, and never sits over an open panel. */
.tabulator-tooltip { pointer-events: none; }
.panel-wrap.is-open ~ .tabulator-tooltip, body:has(.panel-wrap.is-open) .tabulator-tooltip { display: none; }
/* ---- Mark submitted: what was sent (views/content.js submitView) -------------------------------------------------- */
.shot-drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); padding: var(--s4); min-height: 72px; display: grid; gap: var(--s2);
  place-items: center; text-align: center; color: var(--ink-muted); font: var(--text-body); background: var(--surface-raised); }
.shot-drop:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.shot-drop img { max-width: 100%; max-height: 320px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.link-like { color: var(--accent); cursor: pointer; text-decoration: underline; }
/* The four numbers wrap inside the panel (November 12, 2026): a number input's own width kept every cell wider than its column, so they
   ran past the panel on a desktop and over each other on a 390 px phone. min(…, 100%) lets one column fit a narrow panel. */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: var(--s3); }
.stat-grid .sm-field { min-width: 0; }
.stat-grid .sm-field input { width: 100%; min-width: 0; box-sizing: border-box; }
.shot-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin: var(--s2) 0; }
.shot-thumb { width: 180px; max-height: 120px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* The refresh bar inside the tab row or the header (shell.js placeRefresh), so it takes no row of its own. */
.app-head { position: relative; }
.app-refresh.in-tabs { margin-left: auto; padding: 0 0 0 var(--s4); align-self: center; flex: none; }
.app-refresh.in-head { position: absolute; top: var(--s6); right: var(--s8); padding: 0; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; font: var(--text-code); background: var(--surface-raised); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: var(--s3); margin: 0; }

/* ---- People: the who-card (views/people.js, October 26, 2026) -------------------------------------------------- */
.who-card { display: grid; gap: var(--s3); padding-bottom: var(--s4); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.who-top { display: flex; gap: var(--s4); align-items: flex-start; }
.who-photo { width: 72px; height: 72px; flex: none; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--surface-raised); }
.who-initials { display: grid; place-items: center; font: 600 24px/1 var(--font); color: var(--accent); background: var(--accent-soft); }
.who-head { display: grid; gap: 2px; min-width: 0; }
.who-name { font: var(--text-section); color: var(--ink); overflow-wrap: anywhere; }
.who-role { font: var(--text-body); color: var(--ink); overflow-wrap: anywhere; }
.who-photo-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s2); }
.who-photo-actions .btn { min-height: 36px; cursor: pointer; }
.who-state { margin-bottom: 0; }
.cell-thumb { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; border: 1px solid var(--line); }
@media (max-width: 600px) {
  .person-fact { grid-template-columns: 1fr; gap: 2px; }
  .who-photo-actions .btn { min-height: var(--touch); }
}

/* ---- The phone pass (Aarohi, October 26, 2026: "none of the screens there are mobile friendly") ---------------------
   Shared rules, so every screen gets them: tables become cards up to 1023 px (views/table.js), every control is a 44 px target, no
   field is under 16 px, and the frame keeps clear of the iPhone's rounded corners and home bar. Audited at 390 px and
   768 px in a real browser; the walk is tools/mobile_audit.py. */
.mcards-tools { display: flex; gap: var(--s2); margin: 0 0 var(--s3); }
.mcards-search { flex: 1; min-width: 0; min-height: var(--touch); padding: 0 var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: var(--text-body); }
.mcards-sort { flex: 1; min-width: 0; min-height: var(--touch); padding: 0 28px 0 var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); color: var(--ink); font: var(--text-label); appearance: none; -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.app-content .mtable.is-cards.tabulator .tabulator-row .tabulator-cell { padding: 12px 14px; white-space: normal; font-weight: 400; }
.mcard { display: grid; gap: 4px; }
.mcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }
.mcard-title { min-width: 0; font: var(--text-label); color: var(--ink); overflow-wrap: anywhere; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard-top .chip { flex: none; white-space: nowrap; }
.mcard-meta { font: var(--text-small); color: var(--ink-muted); overflow-wrap: anywhere; }

@media (max-width: 767px) {
  /* The frame: clear of the notch and the rounded corners in landscape, and of the status bar in a full-screen PWA. */
  .app-main { padding-top: env(safe-area-inset-top); }
  .app-head, .app-content { padding-left: max(var(--s4), env(safe-area-inset-left)); padding-right: max(var(--s4), env(safe-area-inset-right)); }
  .app-refresh.in-head { right: max(var(--s4), env(safe-area-inset-right)); }

  /* Every control a thumb can hit (UX design system: 44 px minimum; --touch). */
  .btn, .icon-btn, .open-btn, .chip-filter, .mod-tab { min-height: var(--touch); }
  .open-btn, .chip-filter, .mod-tab { display: inline-flex; align-items: center; }
  details > summary { padding: var(--s3) 0; }
  .sm-node { min-height: var(--touch); }
  .panel-actions select { min-height: var(--touch); }
  .mtable.tabulator .tabulator-footer .tabulator-page { min-height: 40px; min-width: 44px; }
  .mtable.tabulator .tabulator-footer .tabulator-footer-contents { justify-content: center; }

  /* No field under 16 px: iOS Safari zooms the whole page into a focused field smaller than that, and leaves it zoomed.
     !important because the hosted older pages (views/legacy.js) size their own fields at a higher specificity. */
  body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  body select, body textarea { font-size: 16px !important; }

  /* The details panel is the whole screen, its header clear of the status bar and its end clear of the home bar. */
  .panel-wrap .panel-head { padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s4) var(--s3); }
  .panel-wrap .panel-body { padding: var(--s4) var(--s4) calc(var(--s8) + env(safe-area-inset-bottom)); }
  .panel-text { max-height: none; }
}

/* ---- Talking points (views/talking-points.js, October 28, 2026) ---------------------------------------------------------
   Read on a phone just before a conversation: the LINE is the largest text, the cue a small label above it, the tip
   muted below. One readable column, never a table. */
.tp { max-width: 760px; }
.tp-tools { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: var(--s2) 0; }
.tp-tools .mcards-search { width: 100%; }
.tp-status:empty { display: none; }
.tp-status { font: var(--text-small); color: var(--ink-muted); margin: var(--s2) 0 0; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.tp-jump { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0 var(--s2); }
.tp-jump-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); padding: var(--s1) var(--s3);
  background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.tp-jump-link:hover { border-color: var(--line-strong); }
.tp-count { color: var(--ink-muted); }
.tp-group { margin-top: var(--s8); scroll-margin-top: 72px; }
.tp-group-title { font: var(--text-section); font-size: 18px; }
.tp-group-sub { margin: 2px 0 var(--s3); color: var(--ink-muted); font: var(--text-body); }
.tp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s4); }
.tp-card + .tp-card { margin-top: var(--s3); }
.tp-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }
.tp-cue { margin: var(--s2) 0 0; font: 600 13px/1.4 var(--font); color: var(--ink-muted); overflow-wrap: anywhere; }
.tp-edit { flex: none; min-height: 32px; padding: 0 var(--s2); }
.tp-line { margin: var(--s1) 0 0; font: 500 17px/1.5 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.tp-tip { margin: var(--s2) 0 0; font: 400 13.5px/1.5 var(--font); color: var(--ink-muted); overflow-wrap: anywhere; }
.tp-source { margin: var(--s2) 0 0; font: var(--text-small); color: var(--ink-muted); overflow-wrap: anywhere; }
.tp-none { color: var(--ink-muted); margin: 0; }
.tp-add { margin-top: var(--s2); padding-left: 0; }
.tp-card mark { background: var(--needs-you-soft); color: inherit; border-radius: 2px; }
.tp-archived { margin-top: var(--s10); }
.tp-card.is-archived { opacity: .75; }
.tp-form { display: grid; gap: var(--s3); }
.tp-form label { display: grid; gap: 4px; font: var(--text-label); }
.tp-hint { font: var(--text-small); color: var(--ink-muted); }
.tp-form input, .tp-form select, .tp-form textarea { padding: var(--s2) var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: var(--text-body); color: var(--ink); background: var(--surface); }
@media (max-width: 767px) {
  .tp-line { font-size: 19px; line-height: 1.45; }
  .tp-cue { font-size: 13.5px; }
  .tp-tip { font-size: 15px; }
  .tp-edit, .tp-jump-link { min-height: var(--touch); display: inline-flex; align-items: center; }
  /* One swipeable row of groups on a phone, so the first line is on the first screen. */
  .tp-jump { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4));
    padding: 0 var(--s4); }
  .tp-form input, .tp-form select { min-height: var(--touch); }
}

/* ---- Startups (views/startups.js, November 20, 2026) ------------------------------------------------------------------
   The details panel: People, Clients, Programmes, one quiet block per programme; its form reuses the talking points'. */
.su-h { font: var(--text-label); color: var(--ink-muted); margin: var(--s4) 0 var(--s2); }
.su-h:first-child { margin-top: 0; }
.su-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); overflow-wrap: anywhere; }
.su-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); margin-bottom: var(--s2); }
.su-block-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.su-block-title { font: var(--text-body); font-weight: 600; margin: 0; }
.su-line { margin: var(--s1) 0 0; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .su .su-block-top .btn, .su [data-add] { min-height: var(--touch); }
  .su .su-person a { display: inline-flex; align-items: center; min-height: var(--touch); }
}

/* ---- Events (views/events.js, October 29, 2026) ----------------------------------------------------------------------
   Grouped by month so months compare at a glance: each month's head carries its count and high-fit count. The event
   name is the largest text; what to check first (access caveat) and the next deadline stand out; the rest is quiet.
   One column on a phone, two cards a row from 1024 px. Reuses the talking points' jump chips, archive and form. */
.ev { max-width: 1080px; }
.ev-tools { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: var(--s2) 0; display: flex; gap: var(--s2);
  flex-wrap: wrap; align-items: center; justify-content: space-between; }
.ev-filters { display: flex; gap: var(--s2); flex-wrap: wrap; flex: 1 1 auto; }
.ev-filter select { min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: var(--text-body); }
.ev-status:empty { display: none; }
.ev-status { font: var(--text-small); color: var(--ink-muted); margin: var(--s2) 0 0; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.ev-deadlines { margin: var(--s3) 0 var(--s2); border: 1px solid var(--line); border-left: 3px solid var(--needs-you);
  border-radius: var(--radius); background: var(--surface); padding: var(--s3) var(--s4); }
.ev-dl-title { font: var(--text-label); margin: 0 0 var(--s2); }
.ev-deadlines ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.ev-dl-item { all: unset; cursor: pointer; display: grid; gap: 2px; padding: var(--s1) 0; width: 100%; box-sizing: border-box; }
.ev-dl-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ev-dl-when { font: 600 13px/1.4 var(--font); color: var(--ink-muted); }
.ev-dl-when.is-soon { color: var(--needs-you); }
.ev-dl-what { font: var(--text-body); color: var(--ink); overflow-wrap: anywhere; }
.ev-dl-item:hover .ev-dl-what { text-decoration: underline; }
.ev-jump { margin-top: var(--s3); }
.ev-group { margin-top: var(--s8); scroll-margin-top: 72px; }
.ev-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: var(--s2); }
.ev-group-title { font: var(--text-section); font-size: 18px; margin: 0; }
.ev-group-count { margin: 0; font: var(--text-small); color: var(--ink-muted); }
.ev-group-sub { margin: var(--s2) 0 0; color: var(--ink-muted); font: var(--text-body); }
.ev-cards { display: grid; gap: var(--s3); margin-top: var(--s3); }
.ev-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s4);
  min-width: 0; }
.ev-card.is-archived { opacity: .75; margin-top: var(--s3); }
.ev-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }
.ev-name { margin: var(--s1) 0 0; font: 600 17px/1.35 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.ev-edit { flex: none; min-height: 32px; padding: 0 var(--s2); }
.ev-when { margin: var(--s1) 0 0; font: 500 14px/1.4 var(--font); color: var(--ink); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.ev-where { margin: 2px 0 0; font: var(--text-small); color: var(--ink-muted); overflow-wrap: anywhere; }
.ev-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.ev-chips .chip, .ev-when .chip { white-space: nowrap; }
.ev-chip-soft { background: var(--bg); border: 1px solid var(--line); color: var(--ink-muted); }
.ev-fit-high { background: var(--working-soft); }
.ev-fit-medium { background: var(--needs-you-soft); }
.ev-fit-low { background: var(--bg); border: 1px solid var(--line); color: var(--ink-muted); }
.ev-note { margin: var(--s2) 0 0; font: 400 14px/1.5 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.ev-line { margin: var(--s2) 0 0; font: 400 13.5px/1.5 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.ev-k { font-weight: 600; color: var(--ink-muted); margin-right: 4px; }
.ev-caveat { margin: var(--s2) 0 0; font: 400 13.5px/1.5 var(--font); padding: var(--s2) var(--s3); border-radius: var(--radius-sm);
  background: var(--needs-you-soft); color: var(--ink); overflow-wrap: anywhere; }
.ev-caveat .ev-k { color: var(--ink); }
.ev-deadline { color: var(--ink-muted); }
.ev-deadline.is-open { color: var(--ink); }
.ev-meta { color: var(--ink-muted); }
.ev-foot { margin: var(--s8) 0 var(--s4); font: var(--text-small); color: var(--ink-muted); }
.ev-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.ev-purposes { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); display: flex;
  flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0; }
.ev-purposes legend { font: var(--text-label); padding: 0 4px; }
.tp-form .ev-check { display: inline-flex; align-items: center; gap: 6px; font: var(--text-body); }
.ev-hosts { display: grid; gap: var(--s2); }
.ev-hosts-label { font: var(--text-label); }
.ev-host { display: inline-flex; align-items: center; gap: 4px; margin: 0 var(--s2) var(--s1) 0; padding-left: var(--s3);
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); font: var(--text-body); }
.ev-hosts input { padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: var(--text-body); color: var(--ink); background: var(--surface); }
.ev-host-pick { display: flex; width: 100%; justify-content: flex-start; gap: var(--s2); text-align: left; }
@media (min-width: 1024px) {
  .ev-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .ev-tools { flex-direction: column; align-items: stretch; }
  .ev-filters { display: grid; grid-template-columns: 1.3fr .9fr 1.2fr; gap: 6px; }   /* sized to "Any purpose" and "Any status" */
  .ev-filter select { width: 100%; min-height: var(--touch); font-size: 16px; padding: 0 4px 0 6px; }
  .ev-add { min-height: var(--touch); }
  .ev-name { font-size: 18px; }
  .ev-edit, .ev-dl-item { min-height: var(--touch); }
  .ev-edit { display: inline-flex; align-items: center; }
  .ev-form-row { grid-template-columns: 1fr; }
  .ev-hosts input, .ev-form input, .ev-form select { min-height: var(--touch); font-size: 16px; }
}

/* ---- Inbox (views/inbox.js, October 31, 2026) ----------------------------------------------------------------------------
   Read on a phone: one sentence for the morning's check whose counts are links, then at most five things that need her, each
   one sentence with two big buttons. A count is a 44 px target although it sits inside a sentence (the padding is taken
   back by a negative margin, so the line height does not change). */
.say-link { display: inline-block; padding: 12px 2px; margin: -12px 0; min-width: 32px; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
/* A name inside a sentence ("Inbound, Outbound and Ops") must not leave a gap before its comma: no side padding (November 12, 2026). */
.functions-look .say-link, .functions-unknown .say-link { padding-left: 0; padding-right: 0; min-width: 0; }
/* A heading that script focuses on arrival (tabindex -1) is not a control: it takes focus without drawing a ring. */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, .mod-title:focus { outline: none; }
.ib { max-width: 760px; }
.ib-line { margin: 0 0 var(--s4); }
.ib-handled { margin-top: var(--s6); }
/* The Inbox list's filters (November 4, 2026): wrap on a phone; the check chip's x sits with its words. */
.ib-filters { margin: 0 0 var(--s3); }
.ib-chip-x { white-space: normal; text-align: left; }
.ib-broken { display: grid; gap: var(--s2); margin: 0 0 var(--s4); }
.ib-broken a.notice { display: block; color: var(--ink); text-decoration: none; min-height: var(--touch); }
.ib-when { margin: var(--s2) 0 0; }
.ib-items { display: grid; gap: var(--s3); }
.ib-item { display: grid; gap: var(--s2); }
.ib-item .row-title { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ib-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.ib-pair .btn { min-height: var(--touch); width: 100%; }
.ib-more { display: inline-flex; align-items: center; min-height: var(--touch); }
.ib-folders { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0; }
.ib-folders .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ib textarea, .panel-wrap .panel-body textarea { width: 100%; box-sizing: border-box; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: var(--text-body); color: var(--ink); background: var(--surface); }
.ib-foot { margin-top: var(--s6); }
.ib-foot a { display: inline-block; padding: 14px 0; margin: -14px 0; }
.ib textarea, .panel-wrap .panel-body textarea { font-size: 16px; }
.ib-item p:empty { display: none; }
/* An agent's question (views/inbox.js askCard): the question reads first and is never clamped (it is the whole point);
   who asks is small above it; the recommendation and the no-answer line are full sentences, the overdue one in red. */
.ib-askcard .row-title.ib-ask-q { -webkit-line-clamp: unset; display: block; font: var(--text-card); }
.ib-ask-who { font: var(--text-small); color: var(--ink-muted); }
.ib-ask-line, .ib-ask-ctx { margin: 0; font: var(--text-body); color: var(--ink); overflow-wrap: anywhere; }
.ib-ask-late strong { color: var(--broken); }
.ib-ask-note summary { cursor: pointer; min-height: var(--touch); display: flex; align-items: center; color: var(--ink-muted); font: var(--text-small); }
.ib-ask-note textarea { margin-top: var(--s2); }

/* Outreach > Replies (November 3, 2026): each card and the detail say which words are theirs, which are ours, and
   which are our unsent draft, with the label beside the words it names. */
.reply-card .row-main { display: grid; gap: var(--s2); }
.reply-card .row-main > *, .reply-line > * { min-width: 0; overflow-wrap: anywhere; }
.reply-theirs > .mail-text { max-height: 360px; overflow: auto; }
.reply-card-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.reply-line { display: grid; grid-template-columns: 96px 1fr; gap: var(--s3); align-items: baseline; }
.reply-tag { font: 600 11px/1.5 var(--font); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.reply-snippet { display: block; margin-left: calc(96px + var(--s3)); color: var(--ink-muted); font: var(--text-small);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.reply-drafts { list-style: none; margin: var(--s1, 4px) 0 0; padding: 0; display: grid; gap: var(--s1, 4px); }
.reply-drafts li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.reply-drafts .row-meta { flex-basis: 100%; margin-top: 0; }
.reply-draft-name { font: var(--text-label); color: var(--ink); }
.reply-block { margin-top: var(--s5, 20px); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); }
.reply-block:first-child { margin-top: 0; }
.reply-block > .panel-label { margin-bottom: var(--s3); }
.reply-theirs { border-left: 3px solid var(--ink-muted); }
.reply-draft { border-left: 3px solid var(--accent); }
.reply-ours > summary { color: var(--ink); }
.reply-switch { margin: 0 0 var(--s3); }
@media (max-width: 767px) {
  .reply-line { grid-template-columns: 1fr; gap: 2px; }
  .reply-snippet { margin-left: 0; }
  .reply-card { flex-wrap: wrap; }
  .reply-card > .panel-actions { flex-basis: 100%; }
  .reply-card > .row-main { flex-basis: 100%; max-width: 100%; }
}

/* ---- Published (views/published.js, November 4, 2026): a thread to read, week by week, newest first ---------------- */
.pub { max-width: 760px; }
.pub-nav { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin: var(--s2) 0 0; }
.pub-nav:empty { display: none; }
.pub-nav-btn { text-decoration: none; }
.pub-nav-btn[rel="next"] { margin-left: auto; }
.pub-status:empty { display: none; }
.pub-status { font: var(--text-small); color: var(--ink-muted); margin: var(--s2) 0 0; }
.pub-week { margin-top: var(--s6, 24px); }
.pub-week + .pub-week { margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid var(--line-strong); }
.pub-week-title { font: var(--text-section); font-size: 18px; margin: 0; }
.pub-counts { margin: var(--s1) 0 0; font: var(--text-body); color: var(--ink-muted); }
.pub-day { margin-top: var(--s4); }
.pub-day-title { font: var(--text-label); color: var(--ink-muted); margin: 0 0 var(--s2); }
.pub-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--s2); }
.pub-item.is-open { border-color: var(--line-strong); }
.pub-sum { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 4px; width: 100%; padding: var(--s3) var(--s4); }
.pub-sum:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--radius); }
.pub-sum:hover .pub-heading { text-decoration: underline; }
.pub-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.pub-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-chips .chip { white-space: nowrap; }
.pub-chip-channel { background: var(--accent-soft); color: var(--ink); }
.pub-chip-soft { background: var(--bg); border: 1px solid var(--line); color: var(--ink-muted); }
.pub-time { font: var(--text-small); color: var(--ink-muted); white-space: nowrap; }
.pub-heading { font: 600 15px/1.4 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.pub-snippet { font: 400 14px/1.5 var(--font); color: var(--ink-muted); overflow-wrap: anywhere; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pub-item.is-open .pub-snippet { display: none; }
.pub-body { padding: 0 var(--s4) var(--s4); border-top: 1px solid var(--line); }
.pub-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s2) var(--s4); margin: var(--s3) 0 0; }
.pub-fact dt { font: var(--text-small); color: var(--ink-muted); }
.pub-fact dd { margin: 0; font: var(--text-body); color: var(--ink); overflow-wrap: anywhere; }
.pub-sec { margin-top: var(--s4); }
.pub-sec h4 { font: var(--text-label); margin: 0 0 var(--s1); }
.pub-req-title { margin: 0 0 var(--s1); font: 500 14px/1.5 var(--font); }
.pub-text { margin: 0; font: 400 14.5px/1.6 var(--font); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.pub-sec .pub-text { padding: var(--s2) var(--s3); background: var(--surface-raised); border-radius: var(--radius-sm); }
.pub-line { margin: var(--s2) 0 0; font: var(--text-body); overflow-wrap: anywhere; }
.pub-muted, .pub-missing { color: var(--ink-muted); font: var(--text-body); }
.pub-sec p + p { margin-top: var(--s2); }
.pub-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s4); }
.pub-open, .pub-actions .btn { text-decoration: none; }
.pub-more { margin: var(--s6, 24px) 0 var(--s8); }
.pub-load { width: 100%; }
.pub-end, .pub-foot { margin: var(--s3) 0 0; font: var(--text-small); color: var(--ink-muted); }
@media (max-width: 767px) {
  .pub-sum { padding: var(--s3); }
  .pub-body { padding: 0 var(--s3) var(--s3); }
  .pub-nav-btn, .pub-actions .btn, .pub-load { min-height: var(--touch); }
  .pub-actions .btn { flex: 1 1 auto; }
  .pub-facts { grid-template-columns: 1fr 1fr; }
}

/* ---- Focus (views/focus.js and views/focus_card.js; plan docs/plans/FOCUS_PLAN.md section 10.8, the v9 design, November 12, 2026) --
   Light and calm: option cards that are all one size, one filled button each, the count outside the cards. Phone first: every
   control is 44 px (the dots are 24 px wide, 44 px tall). Everything below consumes only the tokens declared on `.focus` just
   after this comment and the platform's own spacing and type tokens; no value here carries a fallback. */
/* TEMPORARY: Focus-scoped pastel tokens until tokens.css lands app-wide (AUTOMATIONS, Nov 2026). Delete this block then. */
.focus {
  --bg: #FFFBF8; --surface: #FFFFFF; --surface-raised: #FFF7F3;
  --ink: #3B1A1C; --ink-soft: #6F5956; --ink-muted: #B19C97;   /* ink-soft is the secondary TEXT colour: 5.05:1 on the strongest page bloom, 6.5:1 on white. ink-muted (2.5:1): decoration only, never text */
  --line: #F3E6E0;
  --accent: #F26A57; --accent-hover: #E4553F; --accent-soft: #FFF1EC;
  --on-accent: #3B1A1C;   /* dark ink on the coral gradient: 5.16:1 at its darkest stop, 7.52:1 at its lightest; white would be 3.01:1 and 2.07:1 */
  --working: #3E9C6C; --working-soft: #EEF7F1;
  --needs-you: #F0A37A; --needs-you-soft: #FFEFE3;
  --broken: #B3213A; --broken-soft: #FDE8EC;   /* crimson, clearly not the coral accent */
  --radius-lg: 28px; --radius: 18px; --radius-pill: 999px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --accent-gradient: linear-gradient(135deg, #FF9A7A, #F26A57);
  --shadow-card: 0 2px 6px rgba(242, 106, 87, .05), 0 18px 44px rgba(242, 106, 87, .10);
  --shadow-accent: 0 8px 22px rgba(242, 106, 87, .26);
  --bloom-rose: rgba(255, 196, 208, .60); --bloom-peach: rgba(255, 220, 196, .65); --bloom-lilac: rgba(226, 214, 255, .55);
  --page-bg-image: radial-gradient(70% 45% at 100% 0%, var(--bloom-rose), transparent 70%),
    radial-gradient(65% 40% at 0% 45%, var(--bloom-peach), transparent 70%),
    radial-gradient(70% 45% at 100% 100%, var(--bloom-lilac), transparent 70%);
  --pill-bg: #FFF1EC; --pill-ink: #A9402F;
}
.focus { max-width: 440px; margin: 0 auto; padding-bottom: var(--s12); font-family: var(--font); color: var(--ink-soft); position: relative; isolation: isolate; }
/* Focus draws no module header, heading, explainer or Refresh (Aarohi, November 12, 2026): the view marks its root `.focus` and
   the frame around it hides the header and the freshness bar, so shell.js needs no opt-out. */
.app-main:has(.focus) .app-head, .app-main:has(.focus) .app-refresh { display: none; }
/* the page bloom covers the whole screen behind the view; body is global, so the view's own pseudo-element draws it */
.focus::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-color: var(--bg);
  background-image: var(--page-bg-image); }
.focus-body { display: flex; flex-direction: column; }
.focus-top-area > * + * { margin-top: var(--s3); }
/* the opener line sits above the first card with the same gap the removed done strip used to leave (November 23, 2026) */
.focus-top-area:not(:empty) { margin-bottom: var(--s4); }
.focus-status, .focus-safe { margin: var(--s2) 0 0; text-align: center; font: var(--text-small); color: var(--ink-soft); }
.focus-status:empty { display: none; }

.focus-fchip:focus-visible, .focus-dot:focus-visible, .focus-quiet-btn:focus-visible, .focus-quietlink:focus-visible,
.focus-primary:focus-visible, .focus-ask-q:focus-visible, .focus-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* the option cards: one constant size, so nothing below jumps when she swipes or filters and the button stays under the thumb */
.focus-track { display: flex; align-items: flex-start; gap: var(--s4); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: calc(var(--s6) * -1) calc(var(--s4) * -1) calc(var(--s8) * -1 - var(--s3)); padding: var(--s6) var(--s4) calc(var(--s8) * 2); scroll-padding-inline: var(--s6); }
.focus-track::-webkit-scrollbar { display: none; }
.card.focus-option { flex: 0 0 calc(100% - 20px); scroll-snap-align: center; margin: 0; display: flex; flex-direction: column; min-width: 0;
  min-height: 340px; padding: var(--s5); border: 0; border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-card); }
.card.focus-option + .card.focus-option { margin-top: 0; }
.focus-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s4); min-height: var(--s6); }
.pill.focus-pill { background: var(--pill-bg); color: var(--pill-ink); font: var(--text-badge); letter-spacing: .14em;
  text-transform: uppercase; padding: 7px 10px; border-radius: var(--radius-pill); }
.focus-time { font: var(--text-small); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.focus-step { font: var(--text-page); font-size: 22px; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); margin: 0 0 var(--s2);
  text-wrap: balance; overflow-wrap: anywhere; font-family: var(--font-head); }
/* Only a card taller than 70% of the viewport clamps its title (views/focus_card.js equaliseCards); the full words are in Ask about this. */
.card.focus-option[data-clamp] .focus-step { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.focus-why-line { margin: 0 0 var(--s4); color: var(--ink-soft); font: var(--text-body); flex: 1; overflow-wrap: anywhere; }
.btn.btn-primary.focus-primary { width: 100%; min-height: var(--touch); display: flex; align-items: center; justify-content: center; text-decoration: none;
  border: 0; border-radius: var(--radius); padding: var(--s4); font: var(--text-section); font-family: var(--font-head); color: var(--on-accent);
  background: var(--accent-gradient); box-shadow: var(--shadow-accent); cursor: pointer; }
.card.focus-option.is-done .btn.btn-primary.focus-primary { background: var(--working-soft); color: var(--ink); box-shadow: none; }
.card.focus-option.is-done .btn.btn-primary.focus-primary:disabled { opacity: 1; }      /* a done card reads at full strength: ink on soft green, 14:1 */
/* the action slot: the button, then one line of a fixed height for the quiet link or the Undo, on every card, so the button never moves */
.focus-secondary { flex: none; min-height: var(--touch); display: flex; align-items: center; justify-content: center; }
.focus-secondary .focus-quietlink { margin: 0; }
/* what the button really opens, in the record's own words (F26): one quiet line under it, so a step tied to the wrong record shows */
.focus-recordtitle { margin: var(--s1) 0 0; color: var(--ink-soft); font: var(--text-label); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-quietlink, .focus-quiet-btn { display: block; margin: var(--s1) auto 0; background: none; border: 0; padding: 0 var(--s3); min-height: var(--touch);
  font: var(--text-label); color: var(--ink-soft); cursor: pointer; text-align: center; text-decoration: none; line-height: var(--touch); }
.focus-quietlink:hover, .focus-quiet-btn:hover { color: var(--pill-ink); }

/* the dots, with the count on the right of the same row, outside the cards */
.focus-navrow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: calc(var(--s2) * -1) 0 0; }
.focus-dots { display: flex; justify-content: center; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.focus-dots.is-single { visibility: hidden; }
.focus-dot { width: var(--s6); height: var(--touch); border: 0; padding: 0; background: none; cursor: pointer; position: relative; }
.focus-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-radius: var(--radius-pill);
  background: var(--line); transform: translate(-50%, -50%); transition: width .25s ease, background .25s ease; }
.focus-dot[aria-current="true"]::before { width: 22px; background: var(--accent); }
.focus-count { justify-self: end; font: var(--text-small); color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: .04em; }

/* the function row */
.focus-fns { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding: var(--s4) 0 var(--s1); }
.focus-fns::-webkit-scrollbar { display: none; }
.chip.focus-fchip { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: var(--touch); padding: 0 var(--s3); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); font: var(--text-label); border-radius: var(--radius-pill); cursor: pointer; }
.chip.focus-fchip[aria-pressed="true"] { border-color: var(--pill-ink); background: var(--accent-soft); color: var(--pill-ink); font-weight: 600; }
/* a right-edge fade while the row has more to scroll to (set by views/focus.js) */
.focus-fns[data-more="1"] { -webkit-mask-image: linear-gradient(to right, black calc(100% - 36px), transparent); mask-image: linear-gradient(to right, black calc(100% - 36px), transparent); }
.focus-fdot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-muted); }
.chip-fine .focus-fdot { background: var(--working); }
.chip-look .focus-fdot { background: var(--needs-you); }
.chip-stopped .focus-fdot { background: var(--broken); }
.chip-unknown .focus-fdot { background: var(--ink-muted); }
.focus-fnhint { text-align: center; font: var(--text-small); color: var(--ink-soft); margin: var(--s2) 0 0; }

/* Ask about this: the platform's own sheet */
.sheet.focus-ask-sheet .sheet-panel { padding: var(--s5) var(--s6) calc(var(--s6) + env(safe-area-inset-bottom, 0px)); max-width: 440px; margin: 0 auto; }
.focus-sheet-title { font: var(--text-section); color: var(--ink); font-family: var(--font-head); margin: 0; }
.focus .btn-ghost { color: var(--ink); }
.focus .sheet { color: var(--ink-soft); }
.focus .btn-primary { background: var(--accent-gradient); border-color: transparent; color: var(--on-accent); }
.focus .btn-primary:hover:not(:disabled) { background: var(--accent-gradient); filter: brightness(1.06); color: var(--on-accent); }   /* lighter than at rest, so at least 5.16:1 */
.focus .btn-primary:disabled { opacity: .6; }
.focus [hidden] { display: none !important; }
.focus-calm { margin: var(--s6) 0 var(--s2); text-align: center; font: var(--text-section); color: var(--ink); }
.focus-calm:empty { display: none; }
.focus-changed { justify-content: center; margin-top: var(--s2); }
.focus-changed-area { min-height: 112px; resize: vertical; font-family: inherit; }
.btn.focus-resort-send { width: 100%; min-height: var(--touch); border-radius: var(--radius); font-family: var(--font-head); }
.focus-changed-area::placeholder { color: var(--ink-soft); opacity: 1; }
.focus-ask-input { width: 100%; box-sizing: border-box; min-height: var(--touch); margin: var(--s3) 0 var(--s2); padding: var(--s3) var(--s4);
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); color: var(--ink); font: var(--text-body); font-size: 16px; }
.focus-ask-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.focus-ask-sugg { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.focus-ask-q { border: 0; background: var(--pill-bg); color: var(--pill-ink); font: var(--text-label); min-height: var(--touch);
  padding: 0 var(--s3); border-radius: var(--radius-pill); cursor: pointer; }
.focus-ask-answer { margin: var(--s3) 0 0; font: var(--text-body); color: var(--ink-soft); min-height: 1.5em; }

/* Home's card and the See everything panel keep these (views/focus_card.js, the panel in views/focus.js) */
.focus-instant, .focus-body-text { font: var(--text-section); color: var(--ink); margin: 0; }
.focus-now-text { font: var(--text-page); color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.focus-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.focus-quiet { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); margin-top: var(--s2); }
.focus-link { background: none; border: 0; padding: 0; font: var(--text-label); color: var(--ink-soft); cursor: pointer;
  min-height: var(--touch); text-decoration: underline; text-underline-offset: 3px; }
.focus-link:hover { color: var(--ink); }
.focus-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.focus-paste { margin-top: var(--s4); justify-content: center; }
.focus-paste-area { width: 100%; box-sizing: border-box; font-size: 16px; /* 16 px: iOS does not zoom a focused field */
  font-family: inherit; color: var(--ink); background: transparent; border: 1px solid var(--ink-soft);
  border-radius: 8px; padding: var(--s2) var(--s3); min-height: 120px; }
.focus-paste-status { margin: var(--s2) 0 0; }
.focus-paste-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s2); }
.focus-group { font: var(--text-label); margin: var(--s4) 0 var(--s2); }
.focus-everything { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.focus-queue-text { font: var(--text-label); overflow-wrap: anywhere; }
.focus-failed { font: var(--text-section); margin: 0; }
.focus-box { display: grid; gap: var(--s2); }
.focus-note { width: 100%; box-sizing: border-box; min-height: 112px; padding: var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: var(--text-body); resize: vertical; }
.focus-box-actions { display: flex; }
.focus-send { min-height: var(--touch); }
.focus-error { font: var(--text-small); margin: 0; }
.focus-error:empty { display: none; }
.focus-open { font: var(--text-label); color: var(--accent); min-height: var(--touch); display: inline-flex; align-items: center; }
.focus-card .focus-now-text, .focus-card .focus-instant { margin-bottom: var(--s1); }
/* The opener: one quiet, warm line above everything else (plan section 8). Muted ink at body size, not a heading; a
   question's answers are small outline chips, never filled, so Done / Help me start stay the one filled control. */
.focus-opener { margin: 0; text-align: center; }
.focus-opener-text { font: var(--text-body); color: var(--ink-soft); margin: 0; overflow-wrap: anywhere; }
.focus-opener-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); margin-top: var(--s2); }
.focus-chip { font: var(--text-badge); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill); min-height: var(--s8); padding: 0 var(--s3); cursor: pointer; }
.focus-chip:hover { background: var(--accent-soft); }
.focus-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.focus-opener-ack { margin: var(--s2) 0 0; }
@media (max-width: 767px) {
  .focus-chip { min-height: var(--touch); }
  .focus-send, .focus-box-actions { width: 100%; }
  .focus-actions .btn { flex: 1 1 auto; min-height: var(--touch); }
}
@media (prefers-reduced-motion: reduce) {
  .focus-track { scroll-behavior: auto; }
  .focus-dot::before { transition: none; }
}

/* Everything inside Focus that is secondary text uses ink-soft, never ink-muted (Fable UX review, U9) */
.focus .muted, .focus .small, .focus .focus-paste-status { color: var(--ink-soft); }

/* F24 (November 14, 2026): a done card fades out and leaves; its Undo stays a few seconds more as a small toast above the bottom bar */
.card.focus-option.is-leaving { opacity: 0; flex-basis: 0; padding-inline: 0; overflow: hidden; pointer-events: none;
  transition: opacity .35s ease, flex-basis .4s ease .1s, padding .4s ease .1s; }
.focus-card-step.is-leaving { opacity: 0; transition: opacity .35s ease; }
.focus-toasts { position: fixed; z-index: 65; left: var(--s3); right: var(--s3); bottom: calc(56px + env(safe-area-inset-bottom) + var(--s3));
  display: flex; flex-direction: column; gap: var(--s2); align-items: center; pointer-events: none; }
.focus-toast { pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s4); row-gap: 0; width: 100%; max-width: 420px;
  box-sizing: border-box; padding: var(--s3) var(--s4) var(--s1);
  background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-card); font: var(--text-body); }
.focus-toasts.is-hidden { display: none; }       /* never over a sheet */
/* The words take the whole first line (two lines at most), the buttons sit under them: in one row a long title was squeezed to a
   one-word column beside "Undo" and "Turn on shake to undo" (her report, November 16, 2026). */
.focus-toast-text { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.focus-donetoday { margin-top: 0; }
/* F28 (November 20, 2026): the small celebration when a Done card leaves (views/focus_celebrate.js), on Focus and on Home's card. A fixed,
   click-through overlay that clips its own pieces, so it can never make the page scroll sideways. Its colours are four full-strength tokens
   that .focus and the app's tokens.css both define, so the one block serves both screens (the translucent blooms exist only under .focus
   and barely show on cream, so they are not used). */
.focus-burst { position: fixed; inset: 0; z-index: 66; overflow: hidden; pointer-events: none; }
.focus-confetti { position: absolute; border-radius: 2px; opacity: 0; animation-name: focus-confetti; animation-timing-function: ease-out; animation-fill-mode: both; }
.focus-confetti-0 { background: var(--accent); }
.focus-confetti-1 { background: var(--needs-you); }
.focus-confetti-2 { background: var(--working); }
.focus-confetti-3 { background: var(--accent-hover); }
@keyframes focus-confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  35% { opacity: 1; transform: translate(calc(var(--dx) * .7), var(--up)) rotate(calc(var(--rot) * .4)); }
  100% { opacity: 0; transform: translate(var(--dx), var(--fall)) rotate(var(--rot)); }
}
/* Reduced motion: no flying pieces; a still check mark where the card was (it works with the count empty, too) */
.focus-cheer { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--working); color: var(--surface); font-size: 32px; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .focus-confetti { display: none; } }
.focus-toast .focus-quietlink { margin: 0; flex: none; text-decoration: underline; text-underline-offset: 3px; }
.focus-card-step .focus-toast { max-width: none; padding: 0; box-shadow: none; background: none; }
/* F23: Focus's reply inside the sheet, and F25's shake confirm */
.focus-reply-understood { margin: var(--s3) 0 0; font: var(--text-body); color: var(--ink); overflow-wrap: anywhere; }
.focus-reply-head { margin: var(--s4) 0 var(--s2); font: var(--text-label); color: var(--ink-soft); }
.focus-reply-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.focus-change { font: var(--text-body); color: var(--ink); overflow-wrap: anywhere; }
.focus-reply-ask { margin-top: var(--s4); }
.focus-reply-question { margin: 0; font: var(--text-body); color: var(--ink); overflow-wrap: anywhere; }
.focus-confirm { display: grid; gap: var(--s2); margin-top: var(--s4); }
.focus-undo-change:focus-visible, .focus-toast .focus-quietlink:focus-visible, .focus-answer-area:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .card.focus-option.is-leaving, .focus-card-step.is-leaving { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .focus-track { scroll-behavior: auto; }
  .focus-dot::before { transition: none; }
}


/* ---- What she has done (November 12, 2026) ------------------------------------------------------------ */
.scoreboard { margin-top: var(--s4); }
.scoreboard .chart-short { height: 140px; }
.best-news { margin-top: var(--s3); }
.token-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }
.token-label { font: var(--text-small); color: var(--ink-muted); min-width: 5.5em; }
.tokens { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.token { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--working); background: var(--working-soft);
  color: var(--working); font: 600 13px/1 var(--font); cursor: pointer; padding: 0; }
.token:hover { background: var(--surface); }
.token-caption { min-height: 1.5em; margin: var(--s2) 0 0; }
.done-line { margin-top: var(--s3); }
.done-line .done-link { color: inherit; text-decoration-color: currentColor; }
.done-today > summary { cursor: pointer; }
.done-today > .rows { margin-top: var(--s2); }
.functions-look { margin: var(--s2) 0 0; }
.runs { margin-top: var(--s6); }
#runs-body { margin-top: var(--s3); }

/* ---- The acknowledgement toast. Above the phone's bottom bar (z-index 70), never over it ---------------- */
.toast-region { position: fixed; z-index: 65; right: var(--s4); bottom: var(--s4); display: flex; flex-direction: column;
  gap: var(--s2); align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s3); max-width: 420px; padding: var(--s3) var(--s4);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-left: 3px solid var(--working);
  border-radius: var(--radius); box-shadow: 0 4px 16px rgba(26, 31, 54, .12); font: var(--text-body); }
.toast-close { background: none; border: 0; color: var(--ink-muted); font: var(--text-small); cursor: pointer; min-height: var(--touch); padding: 0 var(--s2); }

@media (max-width: 767px) {
  .toast-region { left: var(--s3); right: var(--s3); bottom: calc(56px + env(safe-area-inset-bottom) + var(--s3)); align-items: stretch; }
  .toast { max-width: none; }
  .token { width: 44px; height: 44px; }   /* a finger, not a cursor */
  .app-refresh.no-refresh-phone .refresh-btn { display: none; }   /* a function page refreshes on open and on return */
}

/* ---- Trip (views/trips.js, November 22, 2026) -------------------------------------------------------------------------
   One column on a phone: the trip and its countdown, the open checks (a tick, the words, the due date), then a card per stop
   and per booking. Overdue reads in the app's broken colour. Reuses the events' chips, host chips and the talking points' form. */
.tr { max-width: 900px; }
.tr-status:empty { display: none; }
.tr-status { font: var(--text-small); color: var(--ink-muted); margin: var(--s2) 0 0; }
.tr-name { font: var(--text-section); font-size: 22px; margin: 0; overflow-wrap: anywhere; }
.tr-when { margin: var(--s1) 0 0; font: 500 14px/1.4 var(--font); color: var(--ink); }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.tr-note { margin: var(--s2) 0 0; font: 400 14px/1.5 var(--font); color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.tr-line { margin: var(--s2) 0 0; font: 400 13.5px/1.5 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.tr-k { margin: var(--s3) 0 var(--s1); font: var(--text-label); color: var(--ink-muted); }
.tr-section { margin-top: var(--s8); }
.tr-title { font: var(--text-section); font-size: 18px; margin: 0; }
.tr-title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.tr-checks { list-style: none; margin: var(--s2) 0 0; padding: 0; display: grid; gap: var(--s1); }
.tr-check { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) 0; }
.tr-tick { flex: none; width: 28px; height: 28px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); cursor: pointer; padding: 0; line-height: 1; }
.tr-tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tr-check-text { flex: 1 1 auto; font: var(--text-body); color: var(--ink); overflow-wrap: anywhere; }
.tr-check.is-done .tr-check-text { color: var(--ink-muted); text-decoration: line-through; }
.tr-due { flex: none; font: 600 13px/1.4 var(--font); color: var(--ink-muted); text-align: right; }
.tr-due.is-overdue { color: var(--broken); }
.tr-add { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); align-items: center; }
.tr-add input, .tr-add select { min-height: 36px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: var(--text-body); }
.tr-add input[name="text"] { flex: 1 1 200px; }
.tr-done { margin-top: var(--s3); }
.tr-done summary { cursor: pointer; font: var(--text-label); color: var(--ink-muted); min-height: 32px; }
.tr-cards { display: grid; gap: var(--s3); margin-top: var(--s3); }
.tr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s4); }
.tr-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }
.tr-city { margin: var(--s1) 0 0; font: 600 17px/1.35 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.tr-edit { flex: none; min-height: 32px; padding: 0 var(--s2); }
.tr-links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); font: var(--text-body); overflow-wrap: anywhere; }
.tr-foot { margin: var(--s4) 0 0; font: var(--text-small); color: var(--ink-muted); }
.tr-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.tr-check-field { display: flex; align-items: center; gap: 6px; font: var(--text-body); }
.tr-links-edit { display: grid; gap: var(--s2); border-top: 1px solid var(--line); padding-top: var(--s3); }
.tr-links-edit input[type="search"] { padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: var(--text-body); }
@media (min-width: 1024px) { .tr-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) {
  .tr-tick { width: var(--touch); height: var(--touch); }
  .tr-edit, .tr-add input, .tr-add select, .tr-add .btn, .tr-form input, .tr-form select { min-height: var(--touch); font-size: 16px; }
  .tr-edit { display: inline-flex; align-items: center; }
  .tr-row { grid-template-columns: 1fr; }
}
