/* Family Money screens. Every number comes from tokens.css. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: var(--t-b); line-height: 1.45; font-feature-settings: 'tnum' 1; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-d); }
h1, h2, h3 { margin: 0; font-weight: var(--w-title); letter-spacing: -.01em; }
h1 { font-size: var(--t-2xl); font-weight: var(--w-title); letter-spacing: -.02em; line-height: 1.15; } h2 { font-size: var(--t-l); } h3 { font-size: var(--t-b); }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Frame (Prolija's spine, our colours). Phone: a top bar with the mark, search and the eye; a tab bar below.
   Computer: a sidebar that folds to a rail (remembered on the device, Cmd or Ctrl B), a top bar with the search pill and the eye. */
.frame { min-height: 100vh; min-height: 100dvh; }
.side { display: none; }
.col { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--e-4); height: calc(var(--barh) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--e-8) 0 var(--e-16); background: var(--ground); border-bottom: 1px solid var(--line); }
.bar-gap { flex: 1; }
.wordmark { display: inline-flex; align-items: center; gap: var(--e-10); font-size: var(--t-xl); font-weight: 680; letter-spacing: -.03em; color: var(--ink); }
.wordmark .mark { flex: none; display: block; }
.bar-brand, .side-brand { text-decoration: none; border-radius: var(--r-m); }
.icon-btn { flex: none; width: var(--h-ctl); height: var(--h-ctl); display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink2); }
.icon-btn svg { width: var(--e-20); height: var(--e-20); }
.icon-btn:hover { background: var(--tint); color: var(--ink); }
.icon-btn:active { background: var(--tint2); }
.eye[aria-pressed="true"] { color: var(--accent); }
.find-pill { display: none; }
/* Room at the bottom for the tab bar and the round talk button, so the last amounts scroll clear of it. */
.main { padding: var(--e-8) var(--e-16) calc(var(--tabbar) + var(--e-32) + env(safe-area-inset-bottom)); max-width: calc(var(--base) * 46); margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: var(--ground); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a, .tab-more { display: flex; border: 0; background: none; font: inherit; width: 100%; flex-direction: column; align-items: center; justify-content: center; gap: var(--e-2); height: var(--tabbar); color: var(--soft); text-decoration: none; font-size: var(--t-xs); font-weight: var(--w-control); -webkit-tap-highlight-color: transparent; }
.tabs a svg, .tab-more svg { width: var(--e-24); height: var(--e-24); }
.tabs a[aria-current="page"], .tab-more[data-on] { color: var(--accent); }
.tabs a:active, .tab-more:active { background: var(--tint); }
/* The talk button sits in the middle of the tab bar on a phone: the one thing done most, always one tap away. */
.tab-talk { display: grid; place-items: center; height: var(--tabbar); border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
.tt-c { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.tt-c svg { width: 24px; height: 24px; }
.tab-talk:active .tt-c { background: var(--accent-d); }
@media (min-width: 900px) {
  .frame { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  :root[data-side="folded"] .frame { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: var(--e-2); position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 0 var(--e-12) var(--e-16); background: var(--side-bg); border-right: 1px solid var(--line); overflow: hidden auto; }
  .side-top { display: flex; align-items: center; justify-content: space-between; gap: var(--e-8); height: var(--barh); padding-left: var(--e-6); flex: none; }
  .side-group { color: var(--soft); font-size: var(--t-xs); font-weight: var(--w-control); padding: var(--e-16) var(--e-10) var(--e-6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-nav { display: flex; flex-direction: column; gap: var(--e-2); }
  .side-nav a { display: flex; align-items: center; gap: var(--e-12); height: var(--h-nav); padding: 0 var(--e-10); border-radius: var(--r-m); color: var(--ink2); text-decoration: none; font-weight: var(--w-control); white-space: nowrap; }
  .side-nav a svg { flex: none; width: var(--e-20); height: var(--e-20); color: var(--soft); }
  .side-nav a:hover { background: var(--tint); color: var(--ink); }
  .side-nav a:active { background: var(--tint2); }
  .side-nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
  .side-nav a[aria-current="page"] svg { color: var(--on-accent); }
  .side-who { margin-top: auto; display: flex; align-items: center; gap: var(--e-10); padding: var(--e-8) var(--e-6); border-radius: var(--r-m); color: var(--ink); text-decoration: none; font-weight: var(--w-control); white-space: nowrap; min-width: 0; }
  .side-who:hover { background: var(--tint); }
  .side-who .nl { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .side-who .av { flex: none; width: var(--e-32); height: var(--e-32); border-radius: 50%; background: var(--tint2); display: grid; place-items: center; font-size: var(--t-s); color: var(--ink); }
  .side-who small { display: block; color: var(--soft); font-weight: 400; font-size: var(--t-xs); }
  /* The rail: icons only, the mark stays, the fold button sits under it. */
  :root[data-side="folded"] .side { padding: 0 var(--e-12) var(--e-16); align-items: center; }
  :root[data-side="folded"] .side .nl, :root[data-side="folded"] .side .wm-t, :root[data-side="folded"] .side-group { display: none; }
  :root[data-side="folded"] .side-top { flex-direction: column; justify-content: center; height: auto; padding: var(--e-16) 0 var(--e-8); gap: var(--e-8); }
  :root[data-side="folded"] .side-nav a { width: var(--h-nav); padding: 0; justify-content: center; }
  :root[data-side="folded"] .side-who { padding: var(--e-4); }
  .topbar { height: var(--barh); padding: 0 var(--e-48); gap: var(--e-8); }
  .bar-brand, .find-icon { display: none; }
  .find-pill { display: flex; align-items: center; gap: var(--e-10); width: min(100%, calc(var(--base) * 26)); height: calc(var(--base) * 2.5); padding: 0 var(--e-8) 0 var(--e-16); border: 0; border-radius: var(--r-pill); background: var(--tint); color: var(--soft); font-size: var(--t-s); text-align: left; }
  .find-pill:hover { color: var(--ink2); }
  .find-pill svg { flex: none; width: var(--e-16); height: var(--e-16); }
  .fp-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .find-pill kbd { flex: none; font: inherit; font-size: var(--t-xs); color: var(--soft); background: var(--tint); border-radius: var(--r-s); padding: 0 var(--e-6); line-height: 1.6; }
  .tabs { display: none; }
  /* The page uses the whole window, sidebar open or folded (Jerry 19 Nov): no width cap. */
  .main { padding: var(--e-32) var(--e-48) var(--e-88); max-width: none; margin: 0; }
}

/* Search: one box for pages, categories, people and entries. A centred box on a computer, the whole screen on a phone. */
.find { position: fixed; z-index: 51; inset: 0; display: flex; flex-direction: column; background: var(--paper); padding-top: env(safe-area-inset-top); }
.find-veil { z-index: 50; }
.find-in { display: flex; align-items: center; gap: var(--e-10); padding: var(--e-8) var(--e-8) var(--e-8) var(--e-16); flex: none; }
.find-in > svg { flex: none; width: var(--e-20); height: var(--e-20); color: var(--soft); }
.find-in input { flex: 1; min-width: 0; border: 0; background: transparent; height: calc(var(--base) * 3); padding: 0; font-size: max(16px, var(--t-l)); }
.find-in input:focus { box-shadow: none; }
.find-in input::-webkit-search-cancel-button { display: none; }
.find-list { flex: 1; overflow: auto; padding: 0 var(--e-8) var(--e-16); overscroll-behavior: contain; }
.find-g { color: var(--soft); font-size: var(--t-xs); font-weight: var(--w-control); padding: var(--e-16) var(--e-10) var(--e-6); }
.find-row { display: flex; align-items: center; gap: var(--e-12); width: 100%; min-height: var(--h-row); padding: var(--e-6) var(--e-10); border: 0; border-radius: var(--r-m); background: none; color: var(--ink); text-align: left; }
.find-row.on { background: var(--tint); }
.find-row:active { background: var(--tint2); }
.fr-i { flex: none; width: var(--e-32); height: var(--e-32); border-radius: var(--r-m); background: var(--tint); display: grid; place-items: center; color: var(--ink2); }
.fr-i svg { width: var(--e-16); height: var(--e-16); }
.fr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: var(--w-control); }
.fr-t > span, .fr-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-t small { color: var(--soft); font-weight: 400; font-size: var(--t-s); }
.find-row .amt { flex: none; }
.find-none { color: var(--soft); padding: var(--e-24) var(--e-10); }
.find-hint { display: none; }
@media (min-width: 900px) {
  .find { inset: 12vh auto auto 50%; transform: translateX(-50%); width: min(calc(100vw - var(--e-48)), 640px); max-height: 72vh; border-radius: var(--r-l); box-shadow: var(--shadow); padding-top: 0; }
  .find-in { padding: var(--e-6) var(--e-8) var(--e-6) var(--e-20); }
  .find-hint { display: block; flex: none; color: var(--soft); font-size: var(--t-xs); padding: var(--e-10) var(--e-20); background: var(--ground); border-radius: 0 0 var(--r-l) var(--r-l); }
}

/* Blocks */
.head { display: flex; align-items: center; justify-content: space-between; gap: var(--e-12); margin-bottom: var(--e-16); flex-wrap: wrap; }
.head .sub { color: var(--soft); font-size: var(--t-s); }
/* A heading with a link beside it: the link sits on the heading's line, not below it. */
.sheet .head { align-items: baseline; margin-bottom: var(--e-12); }
.sheet .head h2 { margin-bottom: 0; }
/* A panel, built the way Prolija builds them (Jerry 19 Nov, his screenshots 09:40): the same white as the page, a
   faint hairline, a large radius, room inside. No fill, no shadow: the page stays one calm white sheet. */
.sheet, .talk-box, .insight, .set-sec { background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--e-20) calc(var(--base) * 1.375); }
.sheet + .sheet, .stack > * + * { margin-top: var(--gap-p); }
/* A panel inside a panel is only its contents: one hairline box per part, never a box in a box. */
:is(.sheet, .talk-box, .insight, .set-sec) :is(.sheet, .talk-box, .insight, .set-sec) { border: 0; border-radius: 0; padding: 0; }
/* On a phone Prolija drops the panel lines: the page is one white column and space separates the parts. */
@media (max-width: 719.98px) { .sheet, .talk-box, .insight, .set-sec { border: 0; border-radius: 0; padding: 0; } :root { --gap-p: var(--e-32); } }
.sheet h2 { margin-bottom: var(--e-12); }
.muted { color: var(--soft); }
.small { font-size: var(--t-s); }
.row { display: flex; align-items: center; gap: var(--e-8); flex-wrap: wrap; }
.grid2 { display: grid; gap: var(--gap-p); }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2 > .sheet + .sheet { margin-top: 0; } }

/* Money */
.amt { font-weight: var(--w-amount); white-space: nowrap; letter-spacing: -.02em; }
.amt .c { font-size: .6em; vertical-align: baseline; line-height: 0; margin-left: .02em; }
.in { color: var(--good); }
.neg { color: var(--bad); }
.hero { font-size: var(--t-hero); font-weight: var(--w-figure); letter-spacing: -.025em; line-height: 1.05; }
.hero-label { color: var(--soft); font-size: var(--t-s); font-weight: var(--w-control); margin-bottom: var(--e-4); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-12); margin-top: var(--e-24); }
.split .lab { color: var(--soft); font-size: var(--t-s); }
.split .amt { font-size: var(--t-xl); }

/* The talk button: one solid shape, no glow */
.talk-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--e-12); padding: var(--e-24) 0 var(--e-8); }
.talk { width: calc(var(--base) * 6.5); height: calc(var(--base) * 6.5); border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform var(--fade), background var(--fade); }
.talk svg { width: var(--e-40); height: var(--e-40); }
.talk:active, .talk.on { transform: scale(.96); background: var(--accent-d); }
.talk.on { box-shadow: 0 0 0 var(--e-8) var(--accent-l); }
.talk:disabled { background: var(--faint); }
.talk-label { font-weight: var(--w-control); }
.talk-heard { min-height: 1.45em; color: var(--soft); text-align: center; max-width: 30ch; }
.lang-pick { display: inline-flex; gap: var(--e-4); font-size: var(--t-s); color: var(--soft); align-items: center; }
.typebox { display: flex; gap: var(--e-8); margin-top: var(--e-12); }
.typebox input { flex: 1; min-width: 0; }

/* Controls */
input[type=text], input[type=email], input[type=search], input[type=number], input[type=date], input:not([type]), select { height: calc(var(--base) * 2.75); padding: 0 var(--e-12); border: 1px solid var(--line2); border-radius: var(--r-m); background: var(--paper); font-size: max(16px, var(--t-b)); width: 100%; } /* 16px or Safari on the iPhone zooms in on tap and stays zoomed */
/* Safari on the iPhone gives a date box a fixed inner width that pushes past a half-width cell; let it shrink */
input[type=date] { min-width: 0; -webkit-appearance: none; appearance: none; display: block; text-align: start; }
input[type=date]::-webkit-date-and-time-value { text-align: start; }
/* iPhone only (-webkit-touch-callout exists on iOS Safari alone): with appearance none the date value sits at the top of
   the box. A line as tall as the box inside its border centers it; desktop browsers keep their own centering. */
@supports (-webkit-touch-callout: none) {
  input[type=date] { line-height: calc(var(--base) * 2.75 - 2px); padding-top: 0; padding-bottom: 0; }
  input[type=date]::-webkit-date-and-time-value { margin: 0; line-height: inherit; min-height: 0; }
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-l); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%235F645E' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right var(--e-12) center; padding-right: var(--e-32); }
label.f { display: block; margin-top: var(--e-12); }
label.f > span { display: block; font-size: var(--t-s); font-weight: var(--w-control); margin-bottom: var(--e-4); color: var(--ink2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--e-8); height: var(--h-ctl); padding: 0 var(--e-20); border-radius: var(--r-pill); border: 0; background: var(--tint); font-weight: var(--w-control); text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn.main-btn { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.main-btn:hover { background: var(--accent-d); }
.btn:hover { background: var(--tint2); }
.btn:active { background: var(--tint2); }
.btn.danger { color: var(--bad); background: var(--bad-l); }
.btn.wide { width: 100%; margin-top: var(--e-16); }
.btn.plain { background: transparent; color: var(--accent-d); padding: 0 var(--e-8); }
.btn:disabled { opacity: .55; cursor: default; }
.pill { display: inline-flex; align-items: center; gap: var(--e-6); height: var(--h-pill); padding: 0 var(--e-12); border-radius: var(--r-pill); border: 1px solid transparent; background: var(--tint); font-size: var(--t-s); font-weight: var(--w-control); color: var(--ink2); }
.pill[aria-pressed="true"], .pill.sel { background: var(--ink); color: var(--paper); }
.pill.good { background: var(--good-l); border-color: transparent; color: var(--good); }
.pill.look { background: var(--look-l); border-color: transparent; color: var(--look); }
.pill.bad { background: var(--bad-l); border-color: transparent; color: var(--bad); }
.pills { display: flex; flex-wrap: wrap; gap: var(--e-6); }
.check { display: flex; gap: var(--e-10); align-items: flex-start; margin-top: var(--e-12); }
.check input { width: var(--e-20); height: var(--e-20); margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.err { color: var(--bad); font-size: var(--t-s); margin-top: var(--e-8); min-height: 1.2em; }
.ok-msg { color: var(--good); font-size: var(--t-s); margin-top: var(--e-8); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
/* Rows split by a faint hairline, none after the last (Prolija's lists). */
.list > li + li { border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 1fr auto; gap: var(--e-2) var(--e-12); min-height: var(--h-row); padding: var(--e-10) 0; align-items: center; }
.item .t { font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .m { color: var(--soft); font-size: var(--t-s); grid-column: 1; }
.item .amt { grid-row: 1 / span 2; grid-column: 2; text-align: right; align-self: start; } /* on the title's line, one-line row or two */
.item .amt small { display: block; color: var(--soft); font-weight: 400; font-size: var(--t-xs); }
.day-head { font-size: var(--t-s); color: var(--soft); font-weight: var(--w-control); padding: var(--e-16) 0 var(--e-4); }
.tag { display: inline-block; font-size: var(--t-xs); font-weight: var(--w-control); padding: 0 var(--e-6); border-radius: var(--r-s); background: var(--tint); color: var(--ink2); margin-left: var(--e-6); vertical-align: 1px; }
.tag.look { background: var(--look-l); color: var(--look); }

/* Bars by category */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { padding: var(--e-8) 0; }
.bars .top { display: flex; justify-content: space-between; gap: var(--e-12); font-size: var(--t-m); }
.bars .top .ch { color: var(--soft); font-size: var(--t-s); margin-left: var(--e-6); }
.bar { height: var(--e-6); border-radius: var(--r-pill); background: var(--tint); margin-top: var(--e-6); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--bar); border-radius: inherit; }
.bars li.inc .bar i { background: var(--good); }

/* Month line */
.chart { width: 100%; height: auto; display: block; margin-top: var(--e-8); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .last { fill: none; stroke: var(--chart-last); stroke-width: 2; stroke-dasharray: 4 4; }
.chart .now { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); }
.chart text { fill: var(--soft); font-size: 11px; font-family: inherit; }
.legend { display: flex; gap: var(--e-16); font-size: var(--t-s); color: var(--soft); margin-top: var(--e-8); }
.legend i { display: inline-block; width: var(--e-16); height: 0; border-top: 2.5px solid var(--accent); vertical-align: middle; margin-right: var(--e-6); }
.legend i.l { border-top: 2px dashed var(--chart-last); }

/* Month header and sentences */
.month-nav { display: flex; align-items: center; gap: var(--e-4); }
.month-nav button { width: calc(var(--base) * 2.5); height: calc(var(--base) * 2.5); border-radius: var(--r-pill); border: 0; background: var(--tint); color: var(--ink); display: grid; place-items: center; }
.month-nav button:hover { background: var(--tint2); }
.month-nav button:disabled { opacity: .4; cursor: default; }
.month-nav button svg { width: var(--e-16); height: var(--e-16); }
.words { font-size: var(--t-l); line-height: 1.5; }
.by { color: var(--soft); font-size: var(--t-xs); margin-top: var(--e-12); }
.note { padding: var(--e-10) 0; }
.note:first-of-type { padding-top: 0; }
/* Notes that matter: coloured text, no tinted box (Prolija's "En mora" in red, Jerry 19 Nov: no boxes). */
.line-good, .line-look, .line-bad { padding: 0; }
:is(.line-good, .line-look, .line-bad) + :is(.line-good, .line-look, .line-bad) { margin-top: var(--e-8); }
.line-good { color: var(--accent); }
.line-look { color: var(--ink); }
.line-bad { color: var(--bad); }

/* Closing the month */
.seal { margin-top: var(--e-16); }
.seal .code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .08em; font-size: var(--t-m); }
.stamp { display: inline-flex; align-items: center; gap: var(--e-6); font-weight: var(--w-title); color: var(--good); }
.stamp svg { width: var(--e-20); height: var(--e-20); }
.sealing { animation: settle .5s ease-out; }
@keyframes settle { from { transform: scale(1.04); opacity: 0; } to { transform: none; opacity: 1; } }

/* Sheets that slide up: the saved card and the entry editor */
.veil { position: fixed; inset: 0; background: var(--veil); z-index: 40; }
.panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--paper); border-radius: var(--r-l) var(--r-l) 0 0; padding: var(--e-20) var(--e-16) calc(var(--e-20) + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; box-shadow: var(--shadow); animation: up .18s ease-out; }
@media (min-width: 900px) { .panel { left: 50%; right: auto; bottom: auto; top: 10vh; width: calc(var(--base) * 30); transform: translateX(-50%); border-radius: var(--r-l); animation: none; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel .x { float: right; }
.toast { position: fixed; left: var(--e-12); right: var(--e-12); bottom: calc(var(--tabbar) + var(--e-12) + env(safe-area-inset-bottom)); z-index: 30; background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow); padding: var(--e-16); max-width: calc(var(--base) * 30); margin: 0 auto; animation: up .18s ease-out; }
@media (min-width: 900px) { .toast { bottom: var(--e-24); left: calc(var(--side) + var(--e-24)); right: auto; width: calc(var(--base) * 28); } }
/* Moved up while it would cover the input line and its Save button (app.js placeToast). */
.toast.at-top { bottom: auto; top: calc(var(--e-12) + env(safe-area-inset-top)); }
.toast .confirm-q { font-size: var(--t-l); font-weight: var(--w-title); }
.toast .confirm-big { font-size: var(--t-xl); font-weight: var(--w-title); margin: 0 0 var(--e-4, 4px); }
.toast .confirm-s { font-size: var(--t-b); margin: 0; }
.toast .saved { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e-12); }
.toast .saved .what { font-weight: var(--w-title); font-size: var(--t-l); }
.toast .saved .amt { font-size: var(--t-xl); }
.toast .fields { display: flex; flex-wrap: wrap; gap: var(--e-6); margin-top: var(--e-10); }
.toast .fields .pill.unsure { border-style: dashed; border-color: var(--look); color: var(--look); }
.toast .acts { display: flex; justify-content: space-between; align-items: center; margin-top: var(--e-12); }
.toast .rate { color: var(--soft); font-size: var(--t-xs); margin-top: var(--e-8); }
.choice { display: flex; flex-wrap: wrap; gap: var(--e-6); margin-top: var(--e-8); }

/* Sign in */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--e-24) var(--e-16); }
.gate .sheet { width: 100%; max-width: calc(var(--base) * 26); padding: var(--e-32) var(--e-24); }
.gate h1 { margin-bottom: var(--e-8); }
.gate .lead { color: var(--soft); margin-bottom: var(--e-8); }
.gate .brand { font-weight: var(--w-title); margin-bottom: var(--e-24); color: var(--soft); }
.gate .code-in { font-size: var(--t-2xl); letter-spacing: .3em; text-align: center; font-weight: var(--w-amount); }
.gate .langs { display: flex; justify-content: center; gap: var(--e-8); margin-top: var(--e-20); font-size: var(--t-s); }
.dev { margin-top: var(--e-16); padding: var(--e-12); border-radius: var(--r-m); background: var(--look-l); color: var(--look); font-size: var(--t-s); }

/* Settings */
.kinds { display: grid; gap: var(--e-8); }
.kind { display: grid; grid-template-columns: auto 1fr auto; gap: var(--e-2) var(--e-12); align-items: start; padding: var(--e-12); border-radius: var(--r-m); background: var(--tint); cursor: pointer; }
.kind input { margin-top: 3px; accent-color: var(--accent); }
.kind .n { font-weight: var(--w-control); }
.kind .v { font-weight: var(--w-amount); }
.kind .h { grid-column: 2 / span 2; color: var(--soft); font-size: var(--t-s); }
.kind:has(input:checked) { background: var(--accent-l); }
.meter { height: var(--e-8); border-radius: var(--r-pill); background: var(--tint); overflow: hidden; margin-top: var(--e-8); }
.meter i { display: block; height: 100%; background: var(--accent); }
.empty { color: var(--soft); padding: var(--e-24) 0; }
.loading { color: var(--soft); padding: var(--e-40) 0; text-align: center; }

/* Pieces the screens use that the first pass missed. */
.item .amt-col { grid-row: 1 / span 2; grid-column: 2; align-self: start; display: flex; flex-direction: column; align-items: flex-end; gap: var(--e-2); text-align: right; }
.item .amt-col .amt { grid-row: auto; grid-column: auto; }
.item .amt-col small { color: var(--soft); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
/* A row you press: the tint reaches a little past the text, so the press reads as the whole row. */
button.item { width: calc(100% + var(--e-20)); margin: 0 calc(var(--e-10) * -1); padding-left: var(--e-10); padding-right: var(--e-10); border: 0; border-radius: var(--r-m); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.item:hover { background: var(--tint); }
button.item:active { background: var(--tint2); }
button.item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-s); }
.chart .fill { fill: var(--chart-fill); stroke: none; }
.split .lab { color: var(--soft); font-size: var(--t-s); margin-bottom: var(--e-4); }
.filters { display: flex; gap: var(--e-8); flex-wrap: wrap; margin-bottom: var(--e-16); }
.filters input { flex: 1 1 14rem; }
.filters input { flex-basis: 100%; }
.filters select { flex: 1 1 7rem; min-width: 0; }
.filters select:first-of-type { flex-basis: 11rem; }
.ent-total { display: flex; flex-direction: column; gap: var(--e-4); margin: var(--e-8) 0 var(--e-20); }
.ent-total:empty { display: none; }
.ent-big .amt { font-size: var(--t-fig); font-weight: var(--w-amount); }
.ent-sub { color: var(--ink2); font-size: var(--t-s); }
.ent-note { color: var(--soft); font-size: var(--t-s); }
.ent-sub .dot { color: var(--faint); }
.plain-set { border: 0; padding: 0; margin: var(--e-12) 0 0; display: flex; flex-direction: column; gap: var(--e-8); }
.plain-set legend { color: var(--soft); font-size: var(--t-s); margin-bottom: var(--e-6); padding: 0; }
.flabel { display: block; color: var(--soft); font-size: var(--t-s); margin-bottom: var(--e-6); }
.grid2.tight { gap: var(--e-12); }
.talk-sheet { padding-top: var(--e-32); }
.add-person { margin-top: var(--e-24); }
.panel .head .x { width: var(--h-ctl); height: var(--h-ctl); padding: 0; display: inline-grid; place-items: center; }

/* Panels sit --gap-p apart: 18 px on a computer (Prolija), 32 on a phone where the lines are gone. */
.sheet + .sheet, .stack > * + *, .grid2 + .sheet, .sheet + .grid2, .top + *, .main > * + .sheet, .main > * + .grid2, .narrow > * + .sheet { margin-top: var(--gap-p); }
.grid2 { gap: var(--gap-p); }
/* Section titles small and semibold, as in Prolija; the figures carry the weight. */
.sheet h2 { margin-bottom: var(--e-12); font-size: calc(var(--base) * 1.0625); font-weight: var(--w-title); }
@media (min-width: 900px) { .grid2 { gap: var(--gap-p); } .sheet + .sheet, .stack > * + *, .grid2 + .sheet, .sheet + .grid2, .top + *, .main > * + .sheet, .main > * + .grid2, .narrow > * + .sheet { margin-top: var(--gap-p); } }

/* Today: who, where, and three figures. Nothing else competes. */
.top { padding-bottom: var(--e-16); }
.kicker { color: var(--soft); font-size: var(--t-s); font-weight: var(--w-control); }
.top h1 { margin-top: var(--e-2); }
.top .sub { color: var(--soft); margin-top: var(--e-2); }
.top-grid { display: grid; gap: var(--e-24); margin-top: var(--e-24); align-items: start; }
@media (min-width: 900px) { .top-grid { grid-template-columns: minmax(0, 1fr) calc(var(--base) * 22); gap: var(--e-40); } }
.hero-btn { display: block; background: none; border: 0; padding: 0; text-align: left; color: inherit; border-radius: var(--r-m); }
.hero-btn .hero-label { display: block; }
.hero-btn .hero { display: block; margin-top: var(--e-4); }
.hero-btn:hover .hero { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; text-decoration-color: var(--line2); }
.hero { font-weight: var(--w-figure); letter-spacing: -.035em; line-height: 1; }
.hero .amt { font-weight: inherit; }
/* A very long figure wraps inside the screen instead of pushing the page sideways. */
.hero, .hero .amt, .figure .amt { white-space: normal; overflow-wrap: anywhere; }
.hero-ctx { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-6) var(--e-10); margin-top: var(--e-12); color: var(--ink2); }
.hero-ctx .dot { color: var(--faint); }
.hero-ctx .nowrap { white-space: nowrap; }
.hero-ctx .nowrap .dot { margin-right: var(--e-4); }
.chip { display: inline-flex; align-items: center; height: calc(var(--base) * 1.625); padding: 0 var(--e-10); border-radius: var(--r-pill); font-size: var(--t-s); font-weight: var(--w-control); }
.chip.good { background: var(--good-l); color: var(--good); }
.chip.look { background: var(--look-l); color: var(--look); }
.chip.bad { background: var(--bad-l); color: var(--bad); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--base) * 10), 1fr)); gap: var(--e-16) var(--e-32); margin-top: var(--e-32); }
.figure { display: flex; flex-direction: column; align-items: flex-start; gap: var(--e-4); background: none; border: 0; padding: 0; text-align: left; color: inherit; border-radius: var(--r-s); }
.figure .lab { color: var(--soft); font-size: var(--t-s); font-weight: var(--w-control); }
.figure .amt { font-size: var(--t-fig); font-weight: var(--w-amount); }
.figure .fsub { color: var(--soft); font-size: var(--t-s); max-width: 28ch; }
.figure .fsub:has(.ch-progw) { align-self: stretch; } /* a bar needs the full width of its figure */
button.figure:hover .amt { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: .15em; }

/* The talk box: a panel like the others; the round green button is what stands out. */
/* Compact: the button beside its words, so Today's numbers stay above the fold on a phone. */

.talk-box .talk-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: start; gap: var(--e-4) var(--e-16); padding: 0; }
.talk-box .talk { grid-row: 1 / span 2; width: 64px; height: 64px; }
.talk-box .talk-wrap { padding-bottom: var(--e-4); }
.talk-box .talk svg { width: var(--e-28, 28px); height: var(--e-28, 28px); }
.talk-box .talk-label { align-self: end; }
.talk-box .talk-heard { align-self: start; text-align: left; min-height: 0; font-size: var(--t-s); }
.or-type { color: var(--soft); font-size: var(--t-s); margin-top: var(--e-16); }
.typebox { margin-top: var(--e-6); }

/* One-tap explanations: the sum behind a figure, line by line */
.explain { display: flex; flex-direction: column; gap: var(--e-10); }
.explain > p.line-good, .explain > p.line-bad, .explain > p.line-look { margin-bottom: var(--e-6); }
.sum-row { display: flex; justify-content: space-between; gap: var(--e-12); padding: var(--e-6) 0; }
.sum-row .amt { font-weight: var(--w-amount); }
.sum-row.total { margin-top: var(--e-6); padding: var(--e-8) var(--e-10); margin-left: calc(var(--e-10) * -1); margin-right: calc(var(--e-10) * -1); border-radius: var(--r-m); background: var(--tint); font-weight: var(--w-strong); }
.explain .btn { align-self: flex-start; margin-top: var(--e-6); }
.panel:focus { outline: none; }

/* ---------- charts: one system for the whole app (public/lib/charts.js) ----------
   Paper, ink, one green; red only for a real problem. Labels on the data, tabular figures, light grid, motion on first draw only. */
.ch-wrap { position: relative; margin-top: var(--e-12); }
.ch { width: 100%; height: auto; display: block; overflow: visible; font-variant-numeric: tabular-nums; touch-action: pan-y; }
.ch text { font-family: inherit; fill: var(--soft); font-size: 12px; }
.ch .ch-ax { font-size: 12px; fill: var(--soft); paint-order: stroke; stroke: var(--ground); stroke-width: 4px; stroke-linejoin: round; }
.ch .ch-lab { paint-order: stroke; stroke: var(--ground); stroke-width: 4px; stroke-linejoin: round; }
.ch .ch-ax.cur { fill: var(--ink); font-weight: var(--w-strong); }
.ch .ch-grid { stroke: var(--line); stroke-width: 1; }
.ch .ch-base { stroke: var(--line2); stroke-width: 1; }
.ch .ch-l { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.ch .ch-l.now { stroke: var(--accent); stroke-width: 2.5; }
.ch .ch-l.last { stroke: var(--chart-last); stroke-width: 1.75; }
.ch .ch-l.ref { stroke: var(--ink2); stroke-width: 1.75; }
.ch .ch-l.proj { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 5; }
.ch .ch-fill { fill: var(--chart-fill); }
.ch .ch-dot { fill: var(--accent); stroke: var(--ground); stroke-width: 2; }
.ch .ch-dot.hollow { fill: var(--ground); stroke: var(--accent); stroke-width: 2; }
.ch .ch-mark { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: .45; }
.ch .ch-limit { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 6 4; }
.ch .ch-rule { stroke: var(--ink); stroke-width: 1; opacity: .3; }
.ch .ch-lab { font-size: 12px; font-weight: var(--w-strong); fill: var(--ink2); }
.ch .ch-lab.now, .ch .ch-lab.proj { fill: var(--accent); }
.ch .ch-lab.last { fill: var(--soft); font-weight: var(--w-control); }
.ch .ch-lab.mark { fill: var(--ink); font-weight: var(--w-control); }
.ch .ch-lab.limit { fill: var(--bad); }
.ch .ch-lab.a { fill: var(--accent); }
.ch .ch-lab.b { fill: var(--ink); }
.ch .ch-bar.a { fill: var(--accent); }
.ch .ch-bar.b { fill: var(--ink); }
.ch .ch-pg.cur .ch-bar { opacity: .5; }
.ch .ch-pg { cursor: default; }
.ch .ch-v { font-size: 11px; font-weight: var(--w-strong); fill: var(--ink2); }
.ch .ch-v.neg { fill: var(--bad); }
.ch-tip { position: absolute; top: calc(var(--e-8) * -1); min-width: 150px; padding: var(--e-8) var(--e-10); background: var(--paper); border-radius: var(--r-m); font-size: var(--t-xs); line-height: 1.5; pointer-events: none; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); z-index: 2; }
.ch-tip-h { color: var(--soft); }
.ch-tip b { font-weight: var(--w-amount); }
.ch-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); margin-right: 6px; vertical-align: -1px; }
.ch-key.last { background: var(--chart-last); height: 3px; vertical-align: 3px; }
.ch-key.now, .ch-key.proj { height: 3px; vertical-align: 3px; }
.ch-key.b { background: var(--ink); }
.ch-keys { display: flex; flex-wrap: wrap; gap: var(--e-6) var(--e-16); margin-top: var(--e-8); color: var(--soft); font-size: var(--t-xs); }
.ch-note { margin-left: 0; }
/* labelled horizontal bars */
.ch-hbars { list-style: none; margin: var(--e-16) 0 0; padding: 0; display: grid; gap: var(--e-16); }
.ch-hbars + .ch-hbars { margin-top: var(--e-24); }
.ch-hbtn { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ch-hbtn:hover .ch-hl > span:first-child, .ch-hbtn:focus-visible .ch-hl > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.ch-hrow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--e-4) var(--e-12); margin-bottom: var(--e-6); }
.ch-hl { font-weight: var(--w-control); min-width: 0; overflow-wrap: anywhere; }
.ch-hv { margin-left: auto; }
.ch-hl small { margin-left: var(--e-8); color: var(--soft); font-size: var(--t-xs); font-weight: var(--w-control); font-variant-numeric: tabular-nums; }
.ch-hv { display: inline-flex; align-items: center; gap: var(--e-10); font-weight: var(--w-amount); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-hbar { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--line); }
.ch-hbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--ink); transform-origin: left; animation: ch-grow .6s cubic-bezier(.2, .7, .2, 1) both; }
.ch-hbar i.in { background: var(--accent); }
.ch-ref { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--soft); }
.ch-spark { width: 64px; height: 20px; flex: none; }
.ch-spark .ch-l { fill: none; stroke: var(--soft); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-spark .ch-dot { fill: var(--ink); }
/* progress toward a number */
.ch-progw { margin: var(--e-10) 0 var(--e-6); }
.ch-prog { position: relative; height: 8px; border-radius: 4px; background: var(--line); }
.ch-prog i { position: absolute; top: 0; bottom: 0; background: var(--ink); transform-origin: left; animation: ch-grow .6s cubic-bezier(.2, .7, .2, 1) both; }
.ch-prog i:first-child { border-radius: 3px 0 0 3px; }
.ch-prog i.bad { background: var(--bad); }
.ch-prog i.emg { background: var(--soft); }
.ch-pmark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.ch-pl { position: relative; height: 1.4em; font-size: var(--t-xs); color: var(--soft); }
.ch-pl span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.ch-pl span.r { transform: translateX(-100%); } .ch-pl span.l { transform: none; }
/* motion on first draw only */
.ch .ch-l.now { animation: ch-draw .9s cubic-bezier(.3, .6, .2, 1) both; }
.ch .ch-fill, .ch .ch-l.proj, .ch .ch-dot, .ch .ch-lab { animation: ch-fade .4s ease-out .5s both; }
.ch .ch-bar { transform-box: fill-box; transform-origin: bottom; animation: ch-rise .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes ch-draw { from { stroke-dasharray: 0 1; } to { stroke-dasharray: 1 0; } }
@keyframes ch-fade { from { opacity: 0; } }
@keyframes ch-grow { from { transform: scaleX(0); } }
@keyframes ch-rise { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) { .ch *, .ch-hbar i, .ch-prog i { animation: none !important; } }

/* ---------- Overview additions ---------- */
.sheet-sub { color: var(--soft); font-size: var(--t-xs); margin-top: var(--e-4); }
.figure .fsub .ch-progw { margin-top: var(--e-8); }

.insight .kicker { margin-bottom: var(--e-6); }
.insight.good .kicker { color: var(--accent); }
.insight.bad .kicker { color: var(--bad); }
.ins-btn { display: flex; align-items: center; justify-content: space-between; gap: var(--e-16); width: 100%; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: var(--t-l); font-weight: 440; line-height: 1.45; text-align: left; cursor: pointer; text-wrap: pretty; }
.ins-btn svg { flex: none; width: var(--e-20); height: var(--e-20); color: var(--soft); }
.ins-btn:hover > span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (min-width: 900px) { .grid2.ov { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
/* the talk button stays in reach */
.fab { position: fixed; right: var(--e-16); bottom: calc(var(--tabbar) + var(--e-16) + env(safe-area-inset-bottom)); z-index: 25; width: 56px; height: 56px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); cursor: pointer; transition: opacity var(--fade), transform var(--fade), visibility var(--fade); }
.fab svg { width: 26px; height: 26px; }
/* One talk button at a time: hidden while the talk box itself is on screen, at every width. */
body.talk-seen .fab { opacity: 0; transform: scale(.85); pointer-events: none; visibility: hidden; }
.fab-t { display: none; }
/* On a computer it lives in the sidebar with its words, so it never covers a number. */
@media (min-width: 900px) {
  .fab { left: var(--e-12); right: auto; bottom: calc(var(--e-64) + var(--e-12)); width: calc(var(--side) - var(--e-24)); height: 44px; border-radius: var(--r-pill); display: flex; justify-content: flex-start; gap: var(--e-10); padding: 0 var(--e-20); box-shadow: none; font: inherit; font-weight: var(--w-control); }
  .fab svg { width: 20px; height: 20px; }
  .fab-t { display: inline; }
  .fab:hover { background: var(--accent-d); }
  :root[data-side="folded"] .fab { left: calc((var(--rail) - 44px) / 2); width: 44px; padding: 0; justify-content: center; }
  :root[data-side="folded"] .fab-t { display: none; }
}
.narrow { max-width: none; }

/* ---------- Settings and sign-in (design/dset) ---------- */
/* Sign-in: open on the page, no outlined card. */
.gate .sheet { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: var(--e-24) 0; }
/* "Test copy only": a flat neutral tint, not a warning colour. */
.dev { background: var(--tint); color: var(--ink2); }

/* Settings sections: each one a panel whose title line opens and closes it. */
.set-sec { padding-top: 0; padding-bottom: 0; }
.set-sec + .set-sec { margin-top: var(--e-12); }
.set-sec > summary { display: flex; align-items: center; gap: var(--e-12); min-height: var(--h-row); padding: var(--e-16) 0; cursor: pointer; list-style: none; }
.set-sec > summary::-webkit-details-marker { display: none; }
.set-sec > summary svg { width: var(--e-20); height: var(--e-20); flex: none; color: var(--soft); transition: transform .15s; }
.set-sec[open] > summary svg { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .set-sec > summary svg { transition: none; } }
.set-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--e-2); }
.set-t h2 { font-size: var(--t-l); font-weight: var(--w-title); margin: 0; }
.set-s { color: var(--soft); font-size: var(--t-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-body { padding: 0 0 var(--e-24); }
.set-body > .sheet { background: none; border-radius: 0; padding: var(--e-8) 0 var(--e-16); margin: 0; }
.set-body > .sheet + .sheet, .set-body > * + .sheet { padding-top: var(--e-24); margin-top: 0; }
.set-body .sheet > h2, .set-body > .sheet > h3:not(.acc-sub) { font-size: var(--t-b); font-weight: var(--w-title); margin: 0 0 var(--e-8); }
.set-out { margin-top: var(--e-4); }
.set-del { margin-top: var(--e-20); }
.set-src { margin-top: var(--e-12); }
.acc-saved:empty { display: none; }

/* The dollar used for pesos: flat rows and a radio; the chosen one by its radio and weight, no box. */
.set-rates .kinds { border: 0; padding: 0; margin: var(--e-12) 0 0; gap: 0; min-width: 0; }
.set-rates .kind { border: 0; border-radius: 0; padding: var(--e-10) 0; background: none; }
.set-rates .kind:has(input:checked) { background: none; }
.set-rates .kind .n { font-weight: var(--w-control); color: var(--ink2); }
.set-rates .kind .v { font-variant-numeric: tabular-nums; color: var(--ink2); }
.set-rates .kind:has(input:checked) .n, .set-rates .kind:has(input:checked) .v { font-weight: var(--w-amount); color: var(--ink); }
.set-rates .kind input { width: var(--e-20); height: var(--e-20); margin: 1px 0 0; }
@media (min-width: 720px) { .acc-name input, .set-house input:not([type]), .set-house select { max-width: calc(var(--base) * 26); } }

/* Phone: the talk button lives in the tab bar, so the floating one only shows on a computer. */
@media (max-width: 899.98px) { .fab { display: none; } }

/* The person at the bottom of the sidebar, and the menu it opens. */
.side-who { border: 0; background: none; font: inherit; text-align: left; width: 100%; }
.who-up { margin-left: auto; color: var(--soft); display: grid; }
.who-up svg { width: var(--e-16); height: var(--e-16); }
.prof-menu { position: fixed; z-index: 45; width: calc(var(--base) * 15); background: var(--paper); border-radius: var(--r-l); box-shadow: var(--shadow); padding: var(--e-6); }
.pm-who { display: flex; align-items: center; gap: var(--e-10); padding: var(--e-10) var(--e-10) var(--e-12); min-width: 0; }
.pm-who > span:last-child, .ms-who > span:last-child { min-width: 0; font-weight: var(--w-control); overflow: hidden; text-overflow: ellipsis; }
.pm-who small, .ms-who small { display: block; color: var(--soft); font-weight: 400; font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-who .av, .ms-who .av { flex: none; width: var(--e-32); height: var(--e-32); border-radius: 50%; background: var(--tint2); display: grid; place-items: center; font-size: var(--t-s); }
.pm-i { display: flex; align-items: center; gap: var(--e-12); width: 100%; min-height: var(--h-nav); padding: 0 var(--e-10); border: 0; border-radius: var(--r-m); background: none; color: var(--ink); font: inherit; font-weight: var(--w-control); text-align: left; }
.pm-i svg { flex: none; width: var(--e-20); height: var(--e-20); color: var(--soft); }
.pm-i:hover, .pm-i:focus-visible { background: var(--tint); outline: none; }
.pm-out, .pm-out svg { color: var(--bad); }

/* Phone "More": the other pages as a grid of tiles, then the person and the account actions. */
.ms-pages { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-8); }
.ms-p { display: flex; align-items: center; gap: var(--e-10); min-height: calc(var(--base) * 3.5); padding: var(--e-8) var(--e-12); border-radius: var(--r-m); background: var(--ground); color: var(--ink); text-decoration: none; font-weight: var(--w-control); }
.ms-p[aria-current="page"] { background: var(--accent-l); color: var(--accent-d); }
.ms-p .fr-i { background: var(--paper); }
.ms-who { display: flex; align-items: center; gap: var(--e-10); margin-top: var(--e-20); padding: 0 var(--e-10); min-width: 0; }
.ms-acts { margin-top: var(--e-8); }

/* Page lead, the saving line card, the rates rows. */
.lead { color: var(--ink2); margin: calc(var(--e-8) * -1) 0 var(--e-16); max-width: 60ch; }
.sav-line .hero-btn { margin: var(--e-4) 0 var(--e-12); }
.sav-line .line-good, .sav-line .line-bad, .sav-line .line-look { margin-top: var(--e-12); }
.sav-sum { margin-top: var(--e-12); }
.ex-rows { margin-top: var(--e-8); }
.ex-row { display: flex; justify-content: space-between; align-items: center; gap: var(--e-12); min-height: var(--h-row); padding: var(--e-6) var(--e-10); margin: 0 calc(var(--e-10) * -1); border-radius: var(--r-m); }
.ex-row > span:first-child { font-weight: var(--w-control); }
.ex-row small { display: block; color: var(--accent-d); font-weight: 400; font-size: var(--t-xs); }
.ex-row.on { background: var(--accent-l); }
.ex-src { margin-top: var(--e-12); }
.more-panel .explain { margin-top: var(--e-8); }

/* Speed (J20, 19 Nov). Every press answers in the same frame; a page that takes longer than a moment dims while the
   next one comes instead of going blank; charts grow in only the first time a page is shown, not on every visit. */
a, button, summary, select, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.month-nav button:active, .find-pill:active, .side-who:active, .side-fold:active, .pill:active { background: var(--tint2); }
.hero-btn:active, .figure:active, .side-brand:active, .bar-brand:active { opacity: .7; }
.fab:active { transform: scale(.96); }
#main[aria-busy="true"] { opacity: .55; transition: opacity .18s ease-out; }
.still .ch *, .still .ch-hbar i, .still .ch-prog i { animation: none !important; }
@media (prefers-reduced-motion: reduce) { #main[aria-busy="true"] { transition: none; } }

/* Lines from Siri or an emailed receipt waiting for their card on Today (app.js waitingBlock) */
.waiting + .top { margin-top: var(--gap-p); }
.waiting .wait-list { list-style: none; margin: var(--e-12) 0 0; padding: 0; }
.waiting .wait-card { padding: var(--e-12) 0; border-top: 1px solid var(--line); }
.waiting .confirm-q { font-size: var(--t-l); font-weight: var(--w-title); margin: 0 0 var(--e-4, 4px); overflow-wrap: anywhere; }
.waiting .confirm-s { font-size: var(--t-b); margin: 0; }
.waiting .confirm-s.muted { color: var(--soft); font-size: var(--t-xs); margin-top: var(--e-4, 4px); }
.waiting .acts { display: flex; justify-content: space-between; align-items: center; gap: var(--e-12); margin-top: var(--e-12); }
