/* The four tabs and Ember's conversation (run F-EM1). Linked after app.css.
 *
 * design/ai-first/SPEC.md §2 to §8: the pixel face (Jersey 25) for figures
 * and nothing else; the body face (Figtree, --body-face in app.css) for
 * everything you read. Controls are never pixel-cornered: chips, buttons
 * and the Ask bar are pills; cards and bubbles 12 px; Ember's box 8 px;
 * the sheet 20 px. Amber is the strongest money colour; red only for a
 * failure (the one line under the sheet's head). Dark only, for now. */

/* Figtree (OFL; fonts/Figtree-OFL.txt), self-hosted, one variable file
 * for every weight. */
@font-face {
  font-family: 'Figtree';
  src: url('../fonts/Figtree.ttf') format('truetype');
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --ground: #1C1412; --panel: #2E2320; --edge: #45342E; --ink2: #F4E6D6;
  --softc: #B9A496; --faint: #8E7A6E; --rail: #D9A98A;
  /* What you said (F-CV1). The conversation sheet is always the room's dark,
   * on a light phone as on a dark one, so these are pages.css's Lamplit
   * values written out; where the palette does reach (the sheets), pages.css
   * points them at --lp-mine and --lp-mineInk instead. */
  --mine: #5A4033; --mineInk: #FFF1E0;
}

/* ---- the gear: Settings, in the status row ---- */
.gear {
  flex: none; width: 36px; height: 36px; margin-left: -4px; padding: 8px; border: 0; border-radius: 999px;
  background: none; color: var(--rail); cursor: pointer; display: grid; place-items: center;
}
.gear svg { width: 18px; height: 18px; shape-rendering: crispEdges; }
/* F-EM4 (the review's item 9): drawn 36 px, a 44 px target. */
.gear { position: relative; }
.gear::before { content: ''; position: absolute; inset: -4px; }
.gear[aria-pressed="true"] { color: var(--amber); background: rgba(255, 180, 84, .12); }

/* ---- the four tabs, in H1's style (the second look) ----
 * The body face at 11 px caps; the active one amber. The page dots sit
 * under the lit tab: one per section. */
.tabs { justify-content: space-around; }
.tab {
  flex: 1 1 0; min-width: 0; font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint);
}
.tab[aria-selected="true"] { color: var(--amber); }
.tab .pdots i.on { background: var(--amber); }

/* ---- the Ember button (F-NAV1; ember-and-the-nav.html's C variant, "The
 * Ember button") ----
 * The Ember tab drawn as a lit round button: D-IC1's pixel flame in a
 * glowing disc, ringed when it's the tab in front; a small coral mic badge
 * (coral is the mic's, §9) says a hold talks; a dot until the first hold.
 * The disc's 34 px overlaps the tab's padding (its margins), so the bar
 * keeps its height; the button is 72 px wide and the whole tab's height,
 * past the 44 px target. */
.tab.emberbtn { flex: 0 0 72px; touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.tab.emberbtn .disc {
  position: relative; width: 34px; height: 34px; margin: -5px 0; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 60%, rgba(255, 209, 102, .35), rgba(255, 138, 61, .12) 70%);
  box-shadow: 0 0 14px 2px rgba(255, 160, 70, .3); transition: transform calc(var(--dur-fast) * .75) var(--spring), box-shadow var(--dur-fast) var(--ease);
}
body .tab.emberbtn .disc svg { opacity: 1; }
.tab.emberbtn[aria-selected="true"] .disc { box-shadow: 0 0 0 2px var(--gold), 0 0 18px 4px rgba(255, 160, 70, .4); }
.tab.emberbtn.pressing .disc { transform: scale(.92); }
.tab.emberbtn .mini {
  position: absolute; top: -3px; right: -7px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--knob); color: #2A1E1C; display: grid; place-items: center;
}
body .tab.emberbtn .mini svg { width: 10px; height: 10px; opacity: 1; shape-rendering: geometricPrecision; }
/* On Plaster's light bar the disc's glow is warmer, so it still reads lit. */
body:not([data-tab="ember"]) .tab.emberbtn .disc {
  background: radial-gradient(circle at 50% 60%, rgba(255, 184, 77, .5), rgba(255, 138, 61, .2) 70%);
  box-shadow: 0 0 12px 3px rgba(255, 140, 60, .35);
}
/* The dot until the hold's been tried once (stored per phone): up at the
 * disc's left, clear of the mic badge; gold, as Records' waiting dot is
 * (coral stays on the mic: §9). */
.tab.emberbtn .hint { display: none; position: absolute; top: 4px; left: calc(50% - 22px); width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.tab.emberbtn.untried .hint { display: block; }
.tab.emberbtn .name { white-space: nowrap; }

/* ---- a section: a column that scrolls ---- */
.sectionscreen .secthead {
  margin: 0; padding: 4px 4px 10px; font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; color: var(--rail);
}
/* A screen in a section is drawn as the devices draw it, as a panel the
 * stage's size (its rows fit as they did on a page of their own); its own words and picture size
 * from the panel (a container), so text still never meets the art. */
.section-scroll > .screen.panel {
  position: relative; flex: none; width: auto; height: 100cqh; margin: 0 -16px 12px;
  container-type: size;
}
.section-scroll > .screen.panel:last-child { margin-bottom: 0; }

/* Plans' Your plan, until a plan is saved (SPEC §7's empty state). */
.planempty {
  font-family: var(--body-face); font-size: var(--t-read); line-height: var(--lh-read); color: var(--ink2); background: var(--wall); border: 1px solid var(--edge);
  border-radius: 12px; padding: 12px; display: grid; gap: 10px; justify-items: start;
}
.planempty p { margin: 0; }
.askbtn, .ecard .btn, .settings .keepchoices button {
  min-height: var(--btn-h); font-family: var(--body-face); font-weight: 600; font-size: var(--t-body); line-height: 1; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--edge);
  background: none; color: var(--softc); cursor: pointer;
}
.askbtn { background: var(--amber); border-color: var(--amber); color: var(--ground); }

/* ---- Ember's bubble (chunky.css's .room .bubble): F-EM4's cue ----
 * F-EM1's box on the wall is gone (the owner, 3 Oct): one bubble, on her.
 * Its one change: the wall box's softly blinking coral ▼, no words, says a
 * tap opens the conversation. It still pops up on its own (F-NAV1); a tap
 * on Ember herself talks to her straight away. */
.room .bubble { padding-right: 20px; }
.room .bubble .cue {
  position: absolute; right: 6px; bottom: 5px; width: 0; height: 0; border: 5px solid transparent;
  border-top: 6px solid var(--knob); border-bottom: 0; animation: talkblink 1.4s steps(2) infinite;
}
@keyframes talkblink { 50% { opacity: 0; } }

/* ---- the conversation sheet ---- */
.convo {
  position: absolute; left: 0; right: 0; bottom: 0; top: 42%; z-index: 8;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--ground); color: var(--ink2); border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .35);
  font-family: var(--body-face); font-size: var(--t-read); line-height: var(--lh-read);
  /* F-LP2 (the motion survey): half and full move on the house curve; it
   * opens by rising from below the stage and closes by sinking back, a
   * translateY, and convo.js hides it only once it's down. (It snapped open
   * and shut until then: `hidden` took away the start of the `top`
   * transition.) */
  transition: top var(--dur) var(--ease), bottom var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.convo.away { transform: translateY(calc(100% + 32px)); pointer-events: none; }
/* F-M3b: with a panel or a keyboard laid over the page (Touch to Search,
 * iOS's keyboard; app.js sets --vv-ceil and --vv-cut only then), the sheet
 * stays in the part that's visible: its foot rises above what covers it and
 * its handle never goes above the top, keeping 140 px (the head, a line of
 * the log, the Ask bar) at half. Otherwise these are the snaps as designed. */
.convo {
  top: max(var(--vv-ceil, -100vh), min(42%, calc(100% + var(--tbh, 0px) - var(--vv-cut, -100vh) - 140px)));
  bottom: max(0px, calc(var(--vv-cut, 0px) - var(--tbh, 0px)));
}
body.asking .convo { --tbh: 0px; } /* the tab bar's row is gone */
/* Full (F-EM4): just under the status row, keeping its corners and shadow,
 * so it still reads as a sheet you can drop (the owner's choice 4). */
.convo[data-state="full"] { top: max(0px, var(--vv-ceil, -100vh)); }
.convo.dragging { transition: none; }

/* F-SH1 (the owner's option A, 4 Oct): at full the sheet takes the tab
 * bar's room and the header's second half. The tab bar slides away under
 * it, the header slims to one line (the "as of" pill stays), and both come
 * back as it comes down. Nothing in the layout moves: the bars keep their
 * boxes (so the room never re-lays), the tab bar is translated out, the
 * header is clipped to its slim line, and the sheet runs over the freed
 * space. app.js measures --sh-gain (the header's freed height), --sh-shift
 * (its row's lift to the slim line) and --sh-tabs (the tab bar's height)
 * as the sheet goes full. Reduced motion: app.css's block makes it instant. */
body.sheetfull .convo[data-state="full"] {
  top: max(calc(-1 * var(--sh-gain, 0px)), var(--vv-ceil, -100vh)); bottom: calc(var(--vv-cut, 0px) - var(--sh-tabs, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* The keyboard up (body.asking): the tab bar's row is gone from the layout
 * already, so the sheet's foot is the stage's, at once (no slide: the
 * stage grows by the same amount in the same frame, so the Ask bar stays
 * put above the keyboard). */
body.sheetfull.asking .convo[data-state="full"] { bottom: var(--vv-cut, 0px); padding-bottom: 0; }
body.asking .convo:not(.dragging) { transition: top var(--dur) var(--ease), transform var(--dur) var(--ease); }
/* F-M3b: the page itself never scrolls. The full sheet's tab bar, slid out
 * below the page, made it scrollable by the bar's height, and Android
 * scrolled it to make room for its own panel: the header and the sheet's
 * handle went off the top. The body clips (not hides: a clip can't be
 * scrolled, even by the browser), and the root, not the body, is what the
 * window's overflow comes from. */
html { overflow: hidden; }
body { overflow: clip; }
/* While the sheet's open it may run past the stage (above and below), so
 * the stage doesn't clip; pull to refresh's words stay out of sight. */
.stage.chatting { overflow: visible; }
.stage.chatting .ptr:not(.on) { visibility: hidden; }

/* The tab bar slides away under the sheet, then leaves the tab order. */
body > .tabbar { transition: transform var(--dur) var(--ease), visibility 0s linear 0s; }
body.sheetfull > .tabbar {
  transform: translateY(100%); visibility: hidden; pointer-events: none;
  transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
}

/* The header slims to one thin line (36 px under the safe area): its row
 * lifts to the top, and the rest of the bar is clipped away for the sheet. The stamp keeps
 * its words and colours (live, stale, offline, failed: CLAUDE.md §3). */
body > .bar { transition: clip-path var(--dur) var(--ease); clip-path: inset(0 0 0 0); }
body > .bar > * { transition: transform var(--dur) var(--ease), opacity var(--dur-fast) var(--ease); }
body.sheetfull > .bar { clip-path: inset(0 0 var(--sh-gain, 0px) 0); }
body.sheetfull > .bar > * { transform: translateY(calc(-1 * var(--sh-shift, 0px))); }
/* The wordmark shrinks to the line; the pill and the gear keep their size
 * (the stamp's words stay readable, the gear's target stays 44 px wide and
 * as tall as the line allows). The coals step aside. */
body.sheetfull > .bar .brand { transform: translateY(calc(-1 * var(--sh-shift, 0px))) scale(.72); transform-origin: left center; }
body.sheetfull > .bar .coals { opacity: 0; }

/* F-NAV1: grabber only (talking-to-ember.html, "Grabber only"): no Room ↓
 * and no figure header. The grabber's row is the drag area (F-EM4); the
 * grabber is a button too, drawn 40 x 5 on a 64 x 24 row, its target 88 x
 * 44 (its ::before). */
.convo .chead {
  flex: none; display: flex; align-items: center; justify-content: center; position: relative; height: 24px;
  touch-action: none; cursor: grab;
}
.convo .handle {
  position: relative; width: 88px; height: 24px;
  border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: grab;
}
.convo .handle::before { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -16px; }
.convo .handle i { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--edge); }
.convo .handle:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: 8px; }
/* The keyboard up: the chips hide, and the tabs go under the keyboard. */
.convo.typing .follow { display: none; }
body.asking .tabbar { display: none; }
/* F-TY2: a card's line wraps, as the phone's copy does (§5): app.css's .sub
 * is the devices' one line, and at a larger Text size it ran out of room. */
.ecard .sub { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

/* The one red thing: Hearth couldn't reach Ember. */
.convo .cfail {
  flex: none; display: flex; gap: 10px; align-items: center; justify-content: space-between;
  margin: 0 12px 6px; padding: 6px 0; border-top: 2px solid var(--red); font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink2);
}
.convo .cfail .retry { border: 1px solid var(--edge); background: none; color: var(--amber); border-radius: 999px; padding: 6px 12px; font-family: var(--body-face); font-weight: 600; font-size: var(--t-small); line-height: 1; cursor: pointer; }
.convo .cnote { flex: none; margin: 0 12px 6px; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--cool); }

.convo .clog {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 6px; scrollbar-width: none;
}
/* The half sheet's log fades into the Ask bar over 12 px, rather than
 * cutting a bubble off mid-line (F-EM4, the review's item 10). */
.convo[data-state="half"] .clog {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent);
}
.convo .clog::-webkit-scrollbar { display: none; }
/* F-NAV1 (talking-to-ember.html's "Like Claude"): her words are plain text
 * on the sheet, under a small "Ember" mark (once for a run of hers), and her
 * figures come as cards under them. Yours stay in the quiet raised bubble. */
.convo .em { display: flex; flex-direction: column; gap: 4px; align-items: stretch; max-width: 100%; margin-top: 6px; animation: rise var(--dur-fast) var(--ease); }
.convo .em .col { display: grid; gap: 8px; min-width: 0; }
.convo .bub { justify-self: start; max-width: 34em; min-width: 0; overflow-wrap: anywhere; }
.convo .bub p { margin: 0; }
.convo .bub p + p { margin-top: 8px; }
.convo .face {
  display: flex; align-items: center; gap: 6px; color: var(--faint);
  font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); letter-spacing: .04em;
}
.convo .face i {
  flex: none; display: block; width: 10px; height: 13px; border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 50% 60%, #FFF1B0, #FFD166 35%, #FF8A3D 75%);
}
.convo .em + .em .face { display: none; }
.convo .em + .em { margin-top: 0; }
.convo.asleep .face i { background: var(--cool); }
/* What you said (F-CV1). The Kiln's coral read close to red, which §5 keeps
 * for a sync or backend failure; the owner picked a peach tint of the sheet
 * instead (4 Oct), with no outline, so your words sit back and her answer
 * leads. The coral stays on the mic and send buttons, which are actions. */
.convo .me {
  align-self: flex-end; max-width: 80%; background: var(--mine); color: var(--mineInk);
  padding: 7px 10px; border-radius: 12px 12px 4px 12px; animation: rise var(--dur-fast) var(--ease); overflow-wrap: anywhere;
}
/* The screen a question came from. Kept amber on the quieter bubble (F-CV1):
 * it's a 10 px label naming a screen, not a figure, and amber is the money
 * colour it belongs to. 10.3:1 here, 5.1:1 where the palette reaches. */
.convo .me .ctx {
  display: inline-block; font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: 1; letter-spacing: var(--ls-label); text-transform: uppercase;
  background: var(--amber); color: var(--ground); padding: 3px 6px; border-radius: 999px; margin-right: 6px; vertical-align: 1px;
}
.convo .src { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--faint); }
.convo .blips { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.convo .blips i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); animation: blip 1s infinite; }
.convo .blips i:nth-child(2) { animation-delay: .2s; }
.convo .blips i:nth-child(3) { animation-delay: .4s; }
.convo .still { display: block; color: var(--faint); font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); }
@keyframes blip { 50% { opacity: .25; } }
/* What enters (a bubble, a sheet): fades in and rises var(--rise). Its name was
 * shared with app.css's steam until F-LP2 (now steamrise). */
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise)); } }

/* A receipt chip: a figure Ember said, underlined once it's checked. */
.convo .num {
  display: inline; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; font: inherit;
  color: var(--gold); font-weight: 600; text-decoration: underline dotted rgba(255, 209, 102, .6); text-underline-offset: 3px;
}
.convo .num.stale { color: var(--amber); }
.convo .num.up { color: var(--cream); }
.convo .num.dn { color: var(--peach); }

/* Follow-up chips above the bar: three at most. */
/* F-EM4: drawn 26 px (30 until then); 44 to the finger, with the row's gaps. */
.convo .follow { flex: none; display: flex; gap: 6px; padding: 9px 12px 8px; margin-top: -9px; overflow-x: auto; scrollbar-width: none; }
.convo .follow:empty { display: none; }
.convo .chip {
  position: relative; flex: none; white-space: nowrap; display: inline-flex; align-items: center; height: var(--chip-h);
  font-family: var(--body-face); font-weight: 600; font-size: var(--t-small); line-height: 12px; padding: 0 .75rem; border-radius: 999px;
  border: 1px solid var(--edge); color: var(--ink2); background: var(--wall); cursor: pointer;
}
.convo .chip::before { content: ''; position: absolute; left: -3px; right: -3px; top: -9px; bottom: -9px; }

/* The Ask bar, pinned at the sheet's foot, above the tabs. */
.convo .askbar {
  flex: none; display: flex; gap: 8px; align-items: flex-end; margin: 0 12px 8px;
  background: var(--wall); border: 1px solid var(--edge); border-radius: 20px; padding: 3px 3px 3px 14px; min-width: 0;
}
/* F-EM4: drawn 40 px (46 until then). A field that grows to four lines
 * (the words a voice go leaves), then scrolls. The words stay 16 px: iOS
 * zooms on anything smaller, and it's the one thing you type into. */
.convo .askbar textarea {
  flex: 1 1 auto; min-width: 0; background: none; border: 0; color: var(--ink2); outline: none; resize: none;
  font-family: var(--body-face); font-size: var(--t-input); line-height: var(--lh-input); height: var(--lh-input); max-height: 80px; margin: 6px 0; padding: 0; overflow-y: auto;
  scrollbar-width: none;
}
.convo .askbar textarea::placeholder { color: var(--faint); }
.convo.asleep .askbar textarea::placeholder { color: var(--cool); }
.convo .askbar .mic {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--knob); color: var(--ground);
  display: grid; place-items: center; cursor: pointer;
}
.convo .askbar .mic::before { content: ''; position: absolute; inset: -6px; }
.convo .askbar .mic:disabled { opacity: .45; cursor: default; }
/* Where the mic can't listen (no recogniser, refused): dimmed; a tap still
 * opens the keyboard, whose own mic works. */
.convo .askbar .mic.dim { background: var(--edge); color: var(--softc); }
/* After a voice go: a quiet mic beside ↑, to add to the words. */
.convo .askbar .again {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none;
  color: var(--softc); display: grid; place-items: center; cursor: pointer;
}
.convo .askbar .again::before { content: ''; position: absolute; inset: -6px; }
.convo .askbar .again[hidden] { display: none; }

/* ---- the voice bar (F-EM4, frames 7 and 8): ✕ · waves · ■ · ↑ ----
 * In the Ask bar's place while listening; the words live above the row,
 * settled in cream and the still-changing tail softer. No red anywhere:
 * the send is the mic's coral, the waves cream. */
.convo.voice .askbar, .convo.voice .follow { display: none; }
.convo .vbar {
  flex: none; display: grid; gap: 6px; margin: 0 12px 8px; padding: 8px 3px 3px;
  background: var(--wall); border: 1px solid var(--edge); border-radius: 20px;
}
.convo .vbar[hidden] { display: none; }
.convo .vwords {
  padding: 0 11px; max-height: 80px; overflow-y: auto; scrollbar-width: none;
  font-family: var(--body-face); font-size: var(--t-input); line-height: var(--lh-input); color: var(--cream); overflow-wrap: anywhere;
}
.convo .vwords .tail { color: var(--softc); }
.convo .vwords.empty::before { content: 'Listening…'; color: var(--faint); }
/* F-VX2: till the recogniser can hear, the bar is getting ready: the hint
 * says "One moment…" (blank for the first 150 ms, so a quick start doesn't
 * flicker) and the waves lie flat (voice.js). Nothing new is drawn. */
.convo .vbar[data-phase="pending"] .vwords.empty::before { content: '\00a0'; }
.convo .vbar[data-phase="preparing"] .vwords.empty::before { content: 'One moment…'; }
/* "Listening", said once at ready for a screen reader: never seen. */
.convo .vsay { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.convo .vrow { display: flex; align-items: center; gap: 6px; }
.convo .vrow button {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: none; color: var(--ink2);
}
.convo .vrow button::before { content: ''; position: absolute; inset: -6px; }
.convo .vrow .vsend { background: var(--knob); color: var(--ground); }
.convo .waves {
  flex: 1 1 auto; min-width: 0; height: 24px; display: flex; align-items: center; justify-content: space-between; overflow: hidden;
}
.convo .waves i { flex: none; width: 3px; height: 2px; border-radius: 2px; background: var(--cream); transition: height 80ms linear; }
/* Why the mic's the keyboard's: one plain line, the offline note's cool blue. */
.convo .vnote { flex: none; margin: 0 12px 6px; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--cool); }
.convo .vnote[hidden] { display: none; }
.convo .ctxchip {
  flex: none; display: inline-flex; align-items: center; gap: 2px; max-width: 45%;
  font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: 1; letter-spacing: var(--ls-label); text-transform: uppercase;
  background: var(--amber); color: var(--ground); border-radius: 999px; padding: 4px 4px 4px 8px;
}
.convo .ctxchip .ct { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo .ctxchip .cx { border: 0; background: none; color: var(--ground); font-family: var(--body-face); font-weight: 700; font-size: var(--t-small); line-height: 1; padding: 0 4px; cursor: pointer; }

/* A receipt: where a figure came from, how old, the formula. */
.convo .rpop {
  position: absolute; left: 12px; right: 12px; bottom: 64px; z-index: 3; display: grid; gap: 4px;
  background: var(--panel); border: 1px solid var(--amber); border-radius: 12px; padding: 10px 34px 10px 12px;
  font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); box-shadow: 0 8px 24px rgba(0, 0, 0, .6);
}
.convo .rpop[hidden] { display: none; }
.convo .rpop b { color: var(--amber); font-weight: 600; }
.convo .rpop .x { position: absolute; right: 6px; top: 4px; border: 0; background: none; color: var(--softc); font: 700 18px/1 var(--body-face); padding: 4px 6px; cursor: pointer; }
.convo .rpop .formula { color: var(--softc); }
.convo .age.stale, .ecard .age.stale { color: var(--amber); }
.convo .age.cool, .ecard .age.cool { color: var(--cool); }

/* ---- the cards (SPEC §6) ---- */
.ecard {
  position: relative; display: grid; gap: 6px; min-width: 0; max-width: 100%;
  background: var(--wall); border: 1px solid var(--edge); border-radius: 12px; padding: 10px;
  font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); animation: rise var(--dur-fast) var(--ease);
}
/* A4 (D-TY1): a card on a page (the letter, Your plan, a strategy) insets its
 * words 12 + its edge, as a callout does. */
.lpage .ecard { padding: 12px; }
.ecard.late { animation-delay: 40ms; animation-fill-mode: backwards; }
.ecard .k { font-family: var(--body-face); font-weight: 600; font-size: var(--t-label); line-height: var(--lh-label); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--softc); padding-right: 28px; }
.ecard .fig { display: grid; gap: 2px; }
.ecard .big { font-family: var(--body-face); font-weight: 700; font-size: var(--t-figure); line-height: var(--lh-figure); letter-spacing: var(--ls-figure); color: var(--amber); overflow-wrap: anywhere; }
.ecard .big.p { color: var(--peach); }
.ecard .sub { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.ecard .rc {
  justify-self: start; padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font-family: var(--body-face); font-weight: 400; font-size: var(--t-small); line-height: var(--lh-small); color: var(--faint); text-decoration: underline dotted rgba(142, 122, 110, .7); text-underline-offset: 2px;
}
.ecard .twin { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ecard .twin > div { display: grid; gap: 2px; align-content: start; min-width: 0; }
.ecard .delta { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); border-top: 1px solid var(--edge); padding-top: 6px; }
.ecard .delta .c { color: var(--softc); }
/* Compare stacks its columns on a narrow phone (SPEC §6: under 320 px). */
@media (max-width: 319px) { .ecard .twin { grid-template-columns: 1fr; } }
.ecard .erows { list-style: none; margin: 0; padding: 0; }
.ecard .erows li { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 7px 0; border-top: 1px solid var(--edge); font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); }
.ecard .erows li:first-child { border-top: 0; }
.ecard .erows .l { min-width: 0; overflow-wrap: anywhere; }
.ecard .erows .c { display: block; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.ecard .erows .v { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; color: var(--ink2); text-decoration: underline dotted rgba(244, 230, 214, .4); }
.ecard .more { justify-self: start; border: 0; background: none; color: var(--amber); font-family: var(--body-face); font-weight: 600; font-size: var(--t-small); line-height: 1; padding: 6px 0 0; cursor: pointer; }
.ecard .line { margin: 0; }
.ecard .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ecard .btn.keep { background: var(--amber); border-color: var(--amber); color: var(--ground); }
.ecard .btn:disabled { opacity: .6; cursor: default; }
.ecard .said { margin: 0; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc); }
.ecard .said:empty { display: none; }
.ecard .more-menu { position: absolute; top: 6px; right: 6px; border: 0; background: none; color: var(--softc); font: 700 16px/1 var(--body-face); padding: 4px 8px; cursor: pointer; }
.ecard .menu {
  position: absolute; top: 30px; right: 6px; z-index: 2; display: grid; min-width: 140px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; overflow: hidden;
}
.ecard .menu[hidden] { display: none; }
.ecard .menu button { border: 0; background: none; color: var(--ink2); text-align: left; padding: 10px 12px; font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); cursor: pointer; }
.ecard .menu button + button { border-top: 1px solid var(--edge); }

/* ---- Settings: the Hearth file, Ember's privacy, What Ember was sent ---- */
.settings .efile li { display: grid; gap: 8px; }
.settings .efile .fl { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.settings .efile .sentence { min-width: 0; overflow-wrap: anywhere; }
.settings .efile .when { flex: none; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: rgb(var(--fg) / .8); }
.settings .efile .empty { color: rgb(var(--fg) / .8); }
.settings .efile .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.settings .efile .ask { flex: 1 1 100%; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--peach); }
.settings .efile textarea { width: 100%; font-family: var(--prose); font-size: var(--t-input); line-height: var(--lh-input); }
.settings .keepchoices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.settings .keepchoices button.on { background: var(--amber); border-color: var(--amber); color: var(--ground); }
.settings .capform { display: grid; gap: 8px; margin: 12px 0; justify-items: start; }
.settings .capform input { width: 10em; }
.settings .sentlog { display: grid; gap: 12px; margin-top: 12px; }
.settings .sentlog .sm { display: grid; gap: 4px; border-top: 1px solid rgb(var(--fg) / .08); padding-top: 12px; }
.settings .sentlog .who { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--peach); }
.settings .sentlog .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.settings .sentbox { display: grid; gap: 8px; }
.settings .sentbox pre {
  margin: 4px 0 0; padding: 8px; max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: ui-monospace, Menlo, monospace; font-size: var(--t-small); line-height: var(--lh-small); background: rgba(0, 0, 0, .25); border-radius: 8px;
}
.settings .sentbox summary { cursor: pointer; color: var(--amber); }
