:root {
  --paper: #f4f6f5;
  --panel: #ffffff;
  --ink: #13202b;
  --ink-2: #4a5a66;
  --ink-3: #5f6d78;
  --rule: #dde3e6;
  --rule-2: #eef1f2;
  --gain: #0e7a4f;
  --gain-bg: #e3f3eb;
  --loss: #b8402b;
  --loss-bg: #fbe9e4;
  --action: #2f5d8a;
  --action-bg: #e6eef6;
  --warn: #7d5600;
  --warn-bg: #fdf3d8;
  --seg-on: #ffffff;
  --seg-ring: transparent;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow: 0 1px 0 rgba(19, 32, 43, 0.04), 0 1px 2px rgba(19, 32, 43, 0.06);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e161d;
    --panel: #152029;
    --ink: #e8eef2;
    --ink-2: #a9b6bf;
    --ink-3: #8a99a4;
    --rule: #24323d;
    --rule-2: #1b2730;
    --gain: #3fbf86;
    --gain-bg: #10301f;
    --loss: #f07a62;
    --loss-bg: #3a1c16;
    --action: #7fb0de;
    --action-bg: #1a2c3d;
    --warn: #e2b54b;
    --warn-bg: #33290f;
    --seg-on: #2b3b48;
    --seg-ring: #3a4c5a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 'Public Sans', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
textarea { resize: vertical; }
.error:empty { display: none; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh;
  border-right: 1px solid var(--rule);
  padding: 20px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.brand { font-weight: 700; font-size: 15px; padding: 4px 10px 18px; letter-spacing: -0.01em; }
.brand span { color: var(--ink-3); font-weight: 500; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover { background: var(--rule-2); color: var(--ink); }
.nav-link[aria-current='page'] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.nav-link .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 10px; font-size: 13px; color: var(--ink-3); }
.side-foot button { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

main { padding: 24px 32px 64px; max-width: 1240px; width: 100%; min-width: 0; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.topbar h1 { font-size: 22px; line-height: 1.2; margin: 0 auto 0 0; letter-spacing: -0.015em; }

.badge {
  display: inline-flex; align-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; font-size: 12px; font-weight: 600; justify-content: center;
  background: var(--warn-bg); color: var(--warn);
}

/* segmented controls (date range, outcomes) */
.seg { display: inline-flex; background: var(--rule-2); border-radius: var(--radius-s); padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: none; padding: 5px 10px; border-radius: 5px;
  font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  transition: background-color 120ms, color 120ms;
}
/* The selected option must stand out in both themes (dark mode gets a lighter fill and a ring). */
.seg button[aria-pressed='true'] { background: var(--seg-on); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--seg-ring); font-weight: 600; }
.seg button:active { transform: scale(0.97); }

/* One-tap prices under a money box (the legacy 1-on-1 prices on the Closed form). */
.quick-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.quick-picks[hidden] { display: none; }
.quick-picks button {
  border: 1px solid var(--rule); background: none; border-radius: 999px; padding: 3px 10px;
  font: inherit; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums;
  transition: background-color 120ms, color 120ms, transform 120ms;
}
.quick-picks button:hover { background: var(--seg-on); color: var(--ink); }
.quick-picks button:active { transform: scale(0.97); }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 32px; height: 18px; border-radius: 9px; background: var(--rule); position: relative; margin: 0; cursor: pointer; transition: background-color 160ms; }
.toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 200ms var(--ease-out); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--action); }
.toggle input:checked::after { transform: translateX(14px); }

.custom-range { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.custom-range input { border: 1px solid var(--rule); background: var(--panel); border-radius: var(--radius-s); padding: 4px 6px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-m);
  background: var(--action-bg); color: var(--ink); font-size: 14px; margin-bottom: 20px;
}
.notice.warn { background: var(--warn-bg); }
.notice p { margin: 0; }
.notice a, .link { color: var(--action); font-weight: 600; text-decoration: none; }
.notice a:hover, .link:hover { text-decoration: underline; }

/* ---------- the funnel tape (the signature piece) ---------- */
.tape {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m);
  overflow: hidden; margin-bottom: 20px;
}
.tape-step { position: relative; padding: 16px 18px 14px; min-width: 0; }
.tape-step + .tape-step { border-left: 1px solid var(--rule); }
.tape-step .label { font-size: 13px; color: var(--ink-2); }
.tape-step .value { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.tape-step .conv { font-size: 12.5px; line-height: 1.35; color: var(--ink-3); margin-top: 2px; min-height: 2.7em; }
.tape-step .conv b { color: var(--ink); font-weight: 600; }
.tape-bar { height: 8px; background: var(--rule-2); margin-top: 12px; border-radius: 2px; overflow: hidden; }
.tape-bar i { display: block; height: 100%; background: var(--ink); border-radius: 2px; transform-origin: left; animation: grow 700ms var(--ease-out) both; }
.tape-step:last-child .tape-bar i { background: var(--gain); }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- KPI grid ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius-m); overflow: hidden; margin-bottom: 20px; }
.kpi { background: var(--panel); padding: 14px 16px 16px; min-width: 0; }
.kpi-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.kpi-head .help {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--rule); background: none;
  font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 0; line-height: 1; position: relative;
}
.kpi-head .help::before { content: ''; position: absolute; inset: -12px; }
.kpi .value { font-size: 24px; font-weight: 650; letter-spacing: -0.015em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value.muted { color: var(--ink-3); }
.kpi.hero { background: var(--gain-bg); }
.kpi.hero .value { font-size: 30px; color: var(--gain); }
.delta .vs { font-weight: 400; color: var(--ink-3); }
.loading-line { color: var(--ink-3); font-size: 14px; padding: 24px 0; }
.plan-info { margin: 0 0 8px; font-size: 13px; color: var(--ink-3); }
.notice .btn { flex: none; margin-left: auto; }
.kpi .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.delta { font-size: 12.5px; font-weight: 600; margin-top: 2px; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.delta.good { color: var(--gain); }
.delta.bad { color: var(--loss); }
.delta.flat { color: var(--ink-3); font-weight: 500; }
.kpi .def { font-size: 12.5px; color: var(--ink-2); background: var(--rule-2); border-radius: var(--radius-s); padding: 8px 10px; margin-top: 8px; }

/* ---------- panels, tables, chart ---------- */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); margin-bottom: 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.panel-head h2 { font-size: 15px; margin: 0; }
.panel-head .aside { font-size: 13px; color: var(--ink-3); }
.panel-body { padding: 12px 16px 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.two-col > .panel { margin-bottom: 0; }
.stack { display: grid; gap: 20px; margin-bottom: 20px; }
.stack > .panel { margin-bottom: 0; }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--ink-3); }
.chart .grid { stroke: var(--rule-2); }
.chart .bar-in { fill: var(--gain); }
.chart .bar-out { fill: var(--loss); }
.chart rect:hover { opacity: 0.8; }
.chart-tip { font-size: 13px; color: var(--ink-2); min-height: 20px; margin-top: 6px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12.5px; padding: 8px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
td .small { display: block; font-size: 12.5px; color: var(--ink-3); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); font-size: 14px; }
.empty p { margin: 0 0 4px; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--rule-2); color: var(--ink-2); white-space: nowrap; }
.pill.gain { background: var(--gain-bg); color: var(--gain); }
.pill.loss { background: var(--loss-bg); color: var(--loss); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.action { background: var(--action-bg); color: var(--action); }

.mini-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule-2); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list span:first-child { color: var(--ink-2); }
.mini-list b { font-weight: 600; }

/* ---------- calls and follow-ups ---------- */
.call { padding: 12px 16px; border-bottom: 1px solid var(--rule-2); }
.call:last-child { border-bottom: 0; }
.call-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
.call-left { min-width: 0; }
.call-who { font-weight: 600; overflow-wrap: anywhere; }
.call-meta { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.call-below:empty { display: none; }
.call-details { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.calls-help { margin: 0; padding: 10px 16px 4px; font-size: 13px; color: var(--ink-3); }
.call .calls-help { padding: 6px 0 0; }
.outcome button { min-height: 32px; }
.outcome button[aria-pressed='true'].yes { background: var(--gain-bg); color: var(--gain); box-shadow: none; }
.outcome button[aria-pressed='true'].no { background: var(--loss-bg); color: var(--loss); box-shadow: none; }
.outcome button[aria-pressed='true'].mid { background: var(--warn-bg); color: var(--warn); box-shadow: none; }
.link-btn { background: none; border: 0; padding: 6px 0 0; color: var(--action); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--loss); }
.call-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-top: 10px; padding: 12px; background: var(--rule-2); border-radius: var(--radius-m); }
.call-form .field { margin: 0; }
.call-form .wide, .call-form .row, .call-form .error { grid-column: 1 / -1; }
.group-title { font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 14px 16px 6px; border-bottom: 1px solid var(--rule); display: flex; gap: 8px; align-items: center; }
.group-count { color: var(--ink-3); font-weight: 500; }
details.history { border-top: 1px solid var(--rule); }
details.history summary { padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }

/* ---------- status of a number vs its target ---------- */
/* Status shows as a stripe on the tile's own left edge (a top stripe read as the tile above's underline). */
.kpi[data-status='low'] { box-shadow: inset 3px 0 0 var(--loss); }
.kpi[data-status='ok'] { box-shadow: inset 3px 0 0 var(--warn); }
.kpi[data-status='good'] { box-shadow: inset 3px 0 0 var(--gain); }
.kpi[data-status='high'] { box-shadow: inset 3px 0 0 var(--action); }
.kpi-check { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 6px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 9px; background: var(--rule-2); color: var(--ink-2); white-space: nowrap; }
.chip-low { background: var(--loss-bg); color: var(--loss); }
.chip-ok { background: var(--warn-bg); color: var(--warn); }
.chip-good { background: var(--gain-bg); color: var(--gain); }
.chip-high { background: var(--action-bg); color: var(--action); }
.target { font-size: 12px; color: var(--ink-3); }
.advice { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); margin: 6px 0 0; }
.quiet-text { font-size: 13.5px; color: var(--ink-2); margin: 0; }
.muted-text { color: var(--ink-3); }
.loss-text { color: var(--loss); }

/* ---------- monthly goal ---------- */
.goal-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); }
.goal-grid > div { padding: 16px 18px; min-width: 0; }
.goal-grid > div + div { border-left: 1px solid var(--rule); }
.goal-label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.goal-label .help { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--rule); background: none; font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 0; position: relative; }
.goal-label .help::before { content: ''; position: absolute; inset: -12px; }
.goal-value { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; color: var(--gain); }
.goal-of { font-size: 16px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.goal-bar { position: relative; height: 10px; background: var(--rule-2); border-radius: 5px; margin: 12px 0 8px; }
.goal-bar i { position: absolute; inset: 0 auto 0 0; background: var(--gain); border-radius: 5px; transform-origin: left; animation: grow 700ms var(--ease-out) both; }
.goal-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.goal-sub { font-size: 12.5px; color: var(--ink-3); }
.goal-done { margin: 0; font-weight: 600; color: var(--gain); }
.chain { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.chain li { margin: 3px 0; }
.chain li::marker { color: var(--ink-3); font-size: 12px; }
.chain .why { color: var(--ink-3); font-size: 12.5px; }
.assumed { display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-bg); padding: 0 6px; border-radius: 8px; }
.levers ol { margin: 4px 0 0; padding: 0; list-style: none; }
.levers li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--rule-2); }
.levers li:last-child { border-bottom: 0; }
.levers li b { color: var(--gain); white-space: nowrap; }
.levers li .advice { grid-column: 1 / -1; margin-top: 2px; }

/* ---------- back end ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); border-top: 1px solid var(--rule-2); margin-top: 12px; border-radius: 0 0 var(--radius-m) var(--radius-m); overflow: hidden; }
.stat { padding: 12px 16px; box-shadow: inset -1px -1px 0 var(--rule-2); }
.stat-label { font-size: 12.5px; color: var(--ink-2); }
.stat-value { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; margin-top: 2px; }
.stat-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- weekly ---------- */
.focus-text { margin: 0; font-size: 15px; }
.four-weeks { padding: 10px 16px 0; font-size: 13.5px; color: var(--ink-2); }
.four-weeks .small { color: var(--ink-3); }
.frac { font-variant-numeric: tabular-nums; }
.frac.muted { color: var(--ink-3); }
tr.current td { background: var(--rule-2); }
.change-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 0.8fr) auto; gap: 10px 12px; align-items: end; }
.change-form .field { margin: 0; }
.change-form .error { grid-column: 1 / -1; min-height: 0; }
.changes { list-style: none; margin: 0; padding: 0 16px 8px; }
.changes li { padding: 12px 0; border-top: 1px solid var(--rule-2); display: grid; gap: 8px; }
.change-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
.changes textarea { font-size: 14px; }
.changes .link-btn { justify-self: start; padding-top: 0; }
.sub-head { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 4px 0 8px; }
.sub-head ~ .sub-head { margin-top: 16px; }
.driver { display: grid; grid-template-columns: 110px minmax(0, 1fr) 90px; gap: 10px; align-items: center; font-size: 13.5px; padding: 3px 0; }
.driver-bar { height: 8px; background: var(--rule-2); border-radius: 4px; overflow: hidden; }
.driver-bar i { display: block; height: 100%; background: var(--gain); }
.driver-val { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- check this sale ---------- */
.check { border-color: var(--warn); }
.check-row { padding: 12px 16px; border-top: 1px solid var(--rule-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
.check-row:first-of-type { border-top: 0; }
.check-row .error { grid-column: 1 / -1; min-height: 0; margin: 0; }
.check-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.price-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.price-label .input { width: 110px; }

/* ---------- content ---------- */
.link-maker { display: grid; gap: 10px; }
.link-row { flex-wrap: nowrap; }
.link-out { flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--radius-s); background: var(--rule-2); font-size: 13px; overflow-wrap: anywhere; }
.content-table td.who { min-width: 200px; }
.content-name { margin-top: 6px; }
.content-name .input { font-size: 13px; padding: 5px 8px; font-weight: 400; }
.input.views { width: 96px; text-align: right; padding: 5px 8px; font-size: 14px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 12px; align-items: start; }
.settings-grid .field { margin: 0; }
.settings-grid + .error, .panel > .error { padding: 0 16px 12px; min-height: 0; }
.targets { padding: 8px 16px 0; }
.target-row { display: grid; grid-template-columns: 150px repeat(3, minmax(0, 150px)); gap: 8px 16px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule-2); font-size: 14px; }
.target-field { display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-3); }
.pct-input { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.pct-input .input { width: 72px; padding: 5px 8px; font-size: 15px; }
.plan-row { border-bottom: 1px solid var(--rule-2); padding: 10px 0; }
.plan-row:last-child { border-bottom: 0; }
.check-line { padding: 6px 0; font-size: 14px; }

/* ---------- added with the weekly review ---------- */
.calls-summary { margin: 0; padding: 12px 16px 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.all-done { margin: 0; padding: 12px 16px; font-size: 13.5px; color: var(--gain); font-weight: 600; border-top: 1px solid var(--rule); }
details.fold { border-top: 1px solid var(--rule); }
details.fold > summary { padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chip-btn { border: 1px solid var(--rule); background: var(--panel); border-radius: 14px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.chip-btn:active { transform: scale(0.97); }
.quick-dates { margin-top: 6px; gap: 6px; }
.follow-actions { flex-wrap: nowrap; }
.follow-actions .btn { text-decoration: none; display: inline-flex; align-items: center; }
.content-tag { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); font-weight: 400; overflow-wrap: anywhere; }
.content-table td.who .input { font-size: 14px; padding: 5px 8px; font-weight: 600; }
.th-aim { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.later { font-size: 12px; color: var(--ink-3); }
.page-foot { font-size: 13px; color: var(--ink-3); margin: 0 0 20px; }

/* ---------- more (phone) ---------- */
.more-link { padding: 14px 16px; border-radius: 0; border-bottom: 1px solid var(--rule-2); }
.more-sub { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.more-foot { padding: 14px 16px; }

/* ---------- forms (login, settings) ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.input { border: 1px solid var(--rule); background: var(--panel); border-radius: var(--radius-s); padding: 8px 10px; width: 100%; font-size: 16px; }
.input:focus { outline: 2px solid var(--action); outline-offset: 0; border-color: transparent; }
.btn { border: 0; border-radius: var(--radius-s); padding: 8px 14px; font-weight: 600; background: var(--ink); color: var(--paper); transition: transform 120ms var(--ease-out), opacity 120ms; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.quiet { background: var(--rule-2); color: var(--ink); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.error { color: var(--loss); font-size: 13.5px; min-height: 20px; margin: 4px 0 0; }

.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; }
.login-box h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.015em; }
.login-box p { color: var(--ink-2); margin: 0 0 20px; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 9px 14px; border-radius: var(--radius-s);
  font-size: 14px; font-weight: 500; z-index: 20; animation: toast-in 220ms var(--ease-out);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } }
.toast { display: flex; align-items: center; gap: 12px; }
.toast-action { background: none; border: 0; padding: 4px 2px; color: var(--paper); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.loading { opacity: 0.55; transition: opacity 150ms; }

/* ---------- phone ---------- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  main { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .topbar h1 { font-size: 20px; flex-basis: 100%; }
  .tape { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tape-step + .tape-step { border-left: 0; }
  .tape-step { border-top: 1px solid var(--rule); }
  .tape-step:nth-child(-n+2) { border-top: 0; }
  .tape-step:nth-child(even) { border-left: 1px solid var(--rule); }
  .tape-step .value { font-size: 26px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px 12px 14px; }
  .kpi .value { font-size: 21px; }
  .kpi.hero .value { font-size: 23px; }
  .goal-value { font-size: 26px; }
  .two-col { grid-template-columns: 1fr; }
  .call-top, .check-row, .change-top { grid-template-columns: 1fr; }
  .call-form { grid-template-columns: 1fr; }
  .goal-grid { grid-template-columns: 1fr; }
  .goal-grid > div + div { border-left: 0; border-top: 1px solid var(--rule); }
  .change-form { grid-template-columns: 1fr 1fr; }
  .change-form .wide { grid-column: 1 / -1; }
  .target-row { grid-template-columns: 1fr 1fr; }
  .target-row > b { grid-column: 1 / -1; }
  .driver { grid-template-columns: 90px minmax(0, 1fr) 80px; }
  .link-row { flex-wrap: wrap; }
  .input.views { width: 110px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--panel); border-top: 1px solid var(--rule);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); text-decoration: none; padding: 4px 0; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current='page'] { color: var(--ink); }
  .tabbar .badge { position: absolute; top: 0; left: calc(50% + 6px); height: 16px; min-width: 16px; font-size: 10.5px; padding: 0 4px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg button { min-height: 40px; padding: 6px 12px; }
  .quick-picks button { min-height: 40px; padding: 6px 14px; }
  .quick-picks > span { flex-basis: 100%; }
  .outcome { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .outcome button { min-height: 44px; padding: 6px 4px; }
  /* iPhone zooms the page when a text box under 16px is tapped: keep them all at 16px. */
  .input, .pct-input .input, .input.views, .content-table td.who .input, .changes textarea, .price-label .input { font-size: 16px; }
  #range button { padding: 6px 8px; }
  .follow-actions { width: 100%; }
  .follow-actions .btn { flex: 1; justify-content: center; min-height: 40px; }
  .custom-range input { font-size: 16px; }
  /* tables become one card per row */
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { padding: 10px 16px; border-bottom: 1px solid var(--rule-2); }
  table.cards tr:last-child { border-bottom: 0; }
  table.cards td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.cards td::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; text-align: left; }
  table.cards td.who { display: block; text-align: left; font-weight: 600; padding-bottom: 4px; word-break: break-all; }
  table.cards td.who::before { content: none; }
  table.cards td .small { display: inline; margin-left: 6px; }
  table.cards td.amount::before { content: 'Amount'; }
  table.cards td.amount { font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (hover: none) { .nav-link:hover { background: none; } }
