/* hihihi chat-home SHELL — the motion prototype. Dark, app-like; the feel is the point.
   Placeholder colors/content; tune freely. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --ch-bg: #111111;
  --ch-panel-bg: #17191e;
  --ch-chat-bg: #111111;
  --ch-surface: #20242c;
  --ch-ink: #eef1f5;
  --ch-muted: #8b93a1;
  --ch-line: rgba(255, 255, 255, 0.08);
  --ch-divider-line: rgba(255, 255, 255, 0.14);
  --ch-grip: rgba(255, 255, 255, 0.26);
  --ch-grip-strong: rgba(255, 255, 255, 0.5);
  --ch-accent: #4f9068;
  /* persona-cast face colors (C13): each face's identity hue — used for the
     speaking bubble's 1px border + its name chip so the user can tell, at a
     glance, which face is talking. */
  --persona-bebert: #aaff00;   /* the companion — electric neon lime, max heat (clear of wendy's teal) */
  --persona-peachy: #e8927c;   /* depth/emotional — peach */
  --persona-wendy:  #16b8a2;   /* the business front desk — teal */
  --persona-frank:  #f4494f;   /* the work session — bright red (kept clear of bebert's peach) */
  --composer-h: 64px;
}
@media (prefers-color-scheme: light) {
  :root {
    --ch-bg: #eeeeee;
    --ch-panel-bg: #f5f5f7;
    --ch-chat-bg: #eeeeee;
    --ch-surface: #ffffff;
    --ch-ink: #14171d;
    --ch-muted: #6b7280;
    --ch-line: rgba(0, 0, 0, 0.10);
    --ch-divider-line: rgba(0, 0, 0, 0.14);
    --ch-grip: rgba(0, 0, 0, 0.22);
    --ch-grip-strong: rgba(0, 0, 0, 0.42);
    /* darker persona hues so the border + name read on the light room */
    --persona-bebert: #5fbf00;
    --persona-peachy: #d9795f;
    --persona-wendy:  #0f9d8b;
    --persona-frank:  #d62b34;
  }
}
html, body {
  margin: 0; height: 100%;
  /* Lock the document so ONLY the shell (.ch-root) moves under the iOS keyboard
     — matches game.css. The shell follows the visual viewport via JS
     (js/lib/shell-viewport.js); the body must not also drift. */
  position: fixed; inset: 0; width: 100%; overflow: hidden;
  background: var(--ch-bg); color: var(--ch-ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.ch-root {
  position: fixed; inset: 0;
  height: 100dvh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ── TOP panel ─────────────────────────────────────────────────────────────── */
.ch-panel {
  position: relative;    /* containing block for the brain tab */
  flex: none;            /* height set live by JS */
  height: 66vh;          /* pre-JS default = ⅔ panel (matches detentIdx=2); JS takes over on boot */
  overflow: hidden;
  background: #eef3ec;
  contain: strict;       /* keep the per-frame resize cheap */
  will-change: height;
}
/* teeny corner label — a few px in from the top-left, ~a quarter across, so the
   panel always reads as "the AI's brain" without stealing space (KP 2026-07-04). */
.ch-brain-tab {
  position: absolute; top: 5px; left: 11px; z-index: 4;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--ch-muted); opacity: 0.5; pointer-events: none;
  text-transform: lowercase; max-width: 25%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-panel-inner {
  height: 100%; overflow-y: auto;
  padding: 16px 14px; display: flex; flex-direction: column; gap: 12px;
}
/* a mounted view (e.g. the calendar) goes full-bleed — drop the card padding */
.ch-panel-inner.ch-space-mounted { padding: 0; gap: 0; overflow: hidden; }
/* the calendar mounts #daybook inside a bare wrapper div; that wrapper must carry a
   definite height so #daybook's height:100% resolves — otherwise .db-scroll (flex:1)
   and the absolute % day-grid collapse to 0 and the paper page renders blank. */
#ch-panel .ch-cal-mount { height: 100%; }
#ch-panel #daybook { height: 100%; max-height: none; min-height: 0; border: none; border-radius: 0; }
/* generic list views in the space (to-dos, people) — the shared vocabulary EVERY
   panel view speaks. Styled once here = every view lifts together: headline with a
   little persimmon swoosh, cards with soft depth, rows that light up under a
   finger, a friendlier empty state. */
.ch-space-view { height: 100%; overflow-y: auto; padding: 18px 16px 22px; animation: ch-space-in 0.22s ease; }
@keyframes ch-space-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.ch-space-h { margin: 0 0 6px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.ch-space-h::after {
  content: ""; display: block; width: 34px; height: 4px; margin-top: 7px; border-radius: 999px;
  background: linear-gradient(90deg, #5a9d76, #3f7d5a 55%, #6fb87f);
}
.ch-space-sub { margin: 8px 0 14px; color: var(--ch-muted); font-size: 13px; line-height: 1.4; }
.ch-space-row {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 10px;
  margin: 0 -10px; border-radius: 12px;
  border-bottom: 1px solid var(--ch-line);
  transition: background 130ms ease;
}
.ch-space-row:last-child { border-bottom: none; }
.ch-space-row:hover { background: rgba(255, 110, 77, 0.06); border-bottom-color: transparent; }
.ch-space-row .dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--ch-panel-bg, var(--ch-surface)), var(--ch-panel-bg, var(--ch-surface))) padding-box,
    linear-gradient(135deg, #5a9d76, #3f7d5a) border-box;
}
.ch-space-name { font-size: 15px; font-weight: 500; }
.ch-space-meta { color: var(--ch-muted); font-size: 13px; margin-top: 2px; }
.ch-space-empty {
  margin: 10px 0; padding: 22px 16px; text-align: center;
  color: var(--ch-muted); font-size: 14px; line-height: 1.5;
  border: 1.5px dashed var(--ch-line); border-radius: 16px;
}
.ch-space-empty::before { content: "✨"; display: block; font-size: 22px; margin-bottom: 8px; opacity: 0.85; }
.ch-hint { margin: 0 2px 2px; color: var(--ch-muted); font-size: 13.5px; line-height: 1.45; }
.ch-card {
  background: var(--ch-surface); border: 1px solid var(--ch-line); border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(42, 27, 61, 0.04), 0 4px 14px rgba(42, 27, 61, 0.06);
}
.ch-card + .ch-card { margin-top: 10px; }
.ch-card h4 { margin: 0 0 10px; font-size: 12px; color: var(--ch-muted); font-weight: 600; letter-spacing: 0.04em; text-transform: lowercase; }

/* ── quadrant landing-page link tiles — same card language as the 101-questions
   ceremony card (.ch-ceremony: rounded, peach border, soft shadow), but a plain
   tappable nav tile (whole card is the tap target) instead of a ceremony beat. */
.ch-link-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin: 0 0 10px; padding: 14px 16px; border-radius: 18px; text-align: left;
  border: 1.5px solid rgba(255, 110, 77, 0.25); background: var(--ch-surface);
  box-shadow: 0 4px 16px rgba(42, 27, 61, 0.06);
  font: inherit; color: var(--ch-ink); cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.ch-link-card:active { transform: scale(0.98); }
.ch-link-card:hover { border-color: rgba(255, 110, 77, 0.45); box-shadow: 0 4px 18px rgba(255, 110, 77, 0.12); }
.ch-link-card .ch-lc-icon { font-size: 22px; line-height: 1; flex: none; }
.ch-link-card .ch-lc-body { flex: 1; min-width: 0; }
.ch-link-card .ch-lc-title { font-size: 15.5px; font-weight: 650; }
.ch-link-card .ch-lc-desc { font-size: 13px; color: var(--ch-muted); margin-top: 2px; line-height: 1.4; }
.ch-link-card .ch-lc-chev { flex: none; color: var(--ch-muted); font-size: 15px; opacity: 0.6; }
.ch-link-card.ch-lc-stub { opacity: 0.6; cursor: default; }
.ch-link-card.ch-lc-stub:hover { border-color: rgba(255, 110, 77, 0.25); box-shadow: 0 4px 16px rgba(42, 27, 61, 0.06); }

/* ── same warm card language as .ch-link-card, for pages of multi-content .ch-card
   blocks that aren't single-tap nav tiles (channels.js: Telegram/Signal/notifications
   setup cards) — border + shadow + radius only, keeps .ch-card's block layout. */
.ch-card.ch-card-warm {
  border: 1.5px solid rgba(255, 110, 77, 0.25);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(42, 27, 61, 0.06);
}
.ch-week { display: flex; justify-content: space-between; }
.ch-week span { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; color: var(--ch-muted); }
.ch-week span.on { background: var(--ch-accent); color: #fff; font-weight: 600; }
.ch-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: var(--ch-accent); border-radius: 999px; }
.ch-todo { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 15px; }
.ch-todo + .ch-todo { border-top: 1px solid var(--ch-line); }
.ch-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ch-muted); flex: none; }

/* ── the draggable margin ──────────────────────────────────────────────────── */
.ch-divider {
  flex: none; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ch-chat-bg);
  border-top: 1px solid var(--ch-divider-line);   /* clear separation: panel | chat */
  touch-action: none;        /* we own the gesture */
  cursor: grab; user-select: none;
}
.ch-grip {
  width: 42px; height: 5px; border-radius: 999px;
  background: var(--ch-grip);
  transition: width 0.16s ease, background 0.16s ease;
}
.ch-divider.is-grabbed { cursor: grabbing; }
.ch-divider.is-grabbed .ch-grip { width: 62px; background: var(--ch-grip-strong); animation: none; }

/* first-run "drag me" nudge — bobs to invite a clueless user, gone after a couple drags */
.ch-hintlabel { display: none; margin-left: 9px; font-size: 11px; letter-spacing: 0.03em; color: var(--ch-muted); user-select: none; }
.ch-divider.show-hint .ch-hintlabel { display: inline; }
.ch-divider.show-hint .ch-grip { animation: ch-bob 1.6s ease-in-out infinite; }
@keyframes ch-bob { 0%, 100% { transform: translateY(2.5px); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ch-divider.show-hint .ch-grip { animation: none; } }

/* ── BOTTOM chat ───────────────────────────────────────────────────────────── */
.ch-chat { flex: 1 1 auto; min-height: 0; background: var(--ch-chat-bg); display: flex; flex-direction: column; contain: strict; }
.ch-log { flex: 1; overflow-y: auto; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ch-bubble { max-width: 82%; padding: 9px 14px; border-radius: 18px; line-height: 1.4; font-size: 15.5px; animation: ch-pop 0.18s ease; }
.ch-bubble.ai { align-self: flex-start; background: var(--ch-surface); border: 1px solid var(--ch-line); border-bottom-left-radius: 6px; }
.ch-bubble.you { align-self: flex-end; background: var(--ch-accent); color: #fff; border-bottom-right-radius: 6px; }
@keyframes ch-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* AI reply markdown */
.ch-bubble.ai p { margin: 0; }
.ch-bubble.ai p + p { margin-top: 7px; }
.ch-bubble.ai ul, .ch-bubble.ai ol { margin: 5px 0; padding-left: 18px; }
.ch-bubble.ai li { margin: 2px 0; }
.ch-bubble.ai code { background: rgba(127, 127, 127, 0.18); padding: 1px 5px; border-radius: 5px; font-size: 0.92em; }
.ch-bubble.ai a { color: var(--ch-accent); }
/* the dealer's mode this reply — a quiet badge under the AI text */
.ch-mode { display: block; margin-top: 5px; font-size: 10px; letter-spacing: 0.05em; text-transform: lowercase; color: var(--ch-muted); opacity: 0.65; }

/* persona cast (C13): the face's name chip — rendered only when the face CHANGES
   ("bebert's here"), for ALL users. Distinct from .ch-mode (the admin x-ray). */
.ch-persona {
  display: inline-block; margin-top: 6px; padding: 2px 9px;
  font-size: 10.5px; letter-spacing: 0.06em; text-transform: lowercase;
  border-radius: 999px; border: 1px solid var(--ch-line);
  color: var(--ch-muted); background: color-mix(in srgb, var(--ch-surface) 82%, transparent);
}
/* per-face bubble identity: the SPEAKING bubble carries the face's hue — a 1px
   border on the bubble + its name chip in-color. data-persona is set per-bubble
   in applyTurn (chathome.js), so scrollback keeps EACH speaker's color (the
   :root data-persona below is a whole-room tint, a separate signal). */
.ch-bubble.ai[data-persona="bebert"] { border-color: color-mix(in srgb, var(--persona-bebert) 55%, var(--ch-line)); }
.ch-bubble.ai[data-persona="bebert"] { border-color: color-mix(in srgb, var(--persona-peachy) 55%, var(--ch-line)); }
.ch-bubble.ai[data-persona="wendy"]  { border-color: color-mix(in srgb, var(--persona-wendy) 55%, var(--ch-line)); }
.ch-bubble.ai[data-persona="frank"]  { border-color: color-mix(in srgb, var(--persona-frank) 55%, var(--ch-line)); }
.ch-bubble.ai[data-persona="bebert"] .ch-persona { color: color-mix(in srgb, var(--persona-bebert) 82%, var(--ch-muted)); border-color: color-mix(in srgb, var(--persona-bebert) 50%, var(--ch-line)); }
.ch-bubble.ai[data-persona="bebert"] .ch-persona { color: color-mix(in srgb, var(--persona-peachy) 82%, var(--ch-muted)); border-color: color-mix(in srgb, var(--persona-peachy) 50%, var(--ch-line)); }
.ch-bubble.ai[data-persona="wendy"]  .ch-persona { color: color-mix(in srgb, var(--persona-wendy) 82%, var(--ch-muted)); border-color: color-mix(in srgb, var(--persona-wendy) 50%, var(--ch-line)); }
.ch-bubble.ai[data-persona="frank"]  .ch-persona { color: color-mix(in srgb, var(--persona-frank) 82%, var(--ch-muted)); border-color: color-mix(in srgb, var(--persona-frank) 50%, var(--ch-line)); }

/* per-face room tint — the ch-biz teal pattern generalized. wendy stays on the
   ch-biz teal (one source of truth for the front-desk look); bebert = no accent.
   Routed through the persona-color vars so frank's room reads maroon like its bubbles. */
:root[data-persona="bebert"] #ch-chat { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--persona-peachy) 22%, transparent); }
:root[data-persona="frank"] #ch-chat { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--persona-frank) 25%, transparent); }

/* typing dots */
.ch-typing { display: inline-flex; gap: 4px; padding: 3px 1px; }
.ch-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ch-muted); animation: ch-blink 1.4s infinite both; }
.ch-typing i:nth-child(2) { animation-delay: 0.2s; }
.ch-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes ch-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

/* the quick-confirm toast (floats over the space when chat is collapsed) */
.ch-toast {
  position: fixed; left: 12px; right: 12px;
  top: calc(env(safe-area-inset-top) + 12px);
  z-index: 50; max-width: 460px; margin: 0 auto; text-align: left;
  background: var(--ch-surface); color: var(--ch-ink);
  border: 1px solid var(--ch-line); border-radius: 16px;
  padding: 12px 14px; box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
  display: flex; flex-direction: column; gap: 3px; font: inherit; cursor: pointer;
  animation: ch-toast-in 0.22s ease;
}
.ch-toast.out { animation: ch-toast-out 0.2s ease forwards; }
.ch-toast-text { font-size: 15px; line-height: 1.35; }
.ch-toast-more { font-size: 11.5px; color: var(--ch-muted); }
@keyframes ch-toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes ch-toast-out { to { opacity: 0; transform: translateY(-10px); } }

.ch-composer {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--ch-chat-bg); border-top: 1px solid var(--ch-line);
}
.ch-input {
  flex: 1; min-width: 0;
  min-height: 44px; max-height: 140px; height: 44px;
  padding: 11px 16px;
  border-radius: 22px; border: 1px solid var(--ch-line);
  background: var(--ch-surface); color: var(--ch-ink);
  font-family: inherit; font-size: 16px; line-height: 1.3;
  outline: none; resize: none; overflow-y: auto;
}
.ch-input::placeholder { color: var(--ch-muted); }
.ch-send {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--ch-accent); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ch-send svg { width: 22px; height: 22px; }
.ch-send:active { transform: scale(0.94); }

/* ── voice notes: the morph button + recording bar ─────────────────────────
   Mic when the box is empty, send arrow with text, check while recording.
   Recording swaps the textarea for a red-tinted bar: cancel ✕ · pulsing dot ·
   timer · hint. Tap the check to stop & send. */
.ch-send[data-mode="rec"] { background: #d64545; animation: ch-rec-pulse 1.4s ease-in-out infinite; }
@keyframes ch-rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.45); }
  50% { box-shadow: 0 0 0 9px rgba(214, 69, 69, 0); }
}
/* `display: flex` on the class beats the UA's [hidden] rule — re-assert it,
   or the bar squats in the composer at boot (KP saw exactly this). */
.ch-rec[hidden] { display: none; }
.ch-rec {
  flex: 1; min-width: 0; height: 44px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 4px;
  border-radius: 22px; border: 1px solid rgba(214, 69, 69, 0.5);
  background: rgba(214, 69, 69, 0.08);
}
.ch-rec-cancel {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid rgba(214, 69, 69, 0.55);
  background: var(--ch-surface); color: var(--ch-ink); font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ch-rec-cancel:active { transform: scale(0.92); background: rgba(214, 69, 69, 0.12); }
.ch-rec-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #d64545; animation: ch-rec-blink 1.1s ease-in-out infinite; }
@keyframes ch-rec-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.ch-rec-time { flex: none; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ch-ink); }
.ch-rec-hint { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ch-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the sent voice-note placeholder (replaced by the transcript once it lands) */
.ch-voicenote { font-style: italic; opacity: 0.85; }

/* left composer button — the "oddball things" menu (all the pages + sign out) */
.ch-menu { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ch-line); background: transparent; color: var(--ch-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: color 0.8s ease; }
.ch-menu svg { width: 22px; height: 22px; transition: filter 0.8s ease; }
.ch-menu:active { transform: scale(0.94); }
/* the AI's mood face: applyFeeling() sets the glyph color (a wheel-family hue) + data-feel;
   a strong feeling gets a soft same-color halo, an intense one a brighter one. */
.ch-menu[data-feel] svg { filter: drop-shadow(0 0 3px currentColor); }
.ch-menu[data-feel="intense"] svg { filter: drop-shadow(0 0 6px currentColor); }
@media (prefers-reduced-motion: reduce) { .ch-menu, .ch-menu svg { transition: none; } }
.ch-menu.is-open { background: var(--ch-ink); color: var(--ch-bg); border-color: transparent; }
.ch-menu-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.34); }
.ch-menu-sheet { position: fixed; z-index: 61; left: 10px; right: 10px; bottom: calc(var(--composer-h) + env(safe-area-inset-bottom) + 8px); max-width: 460px; margin: 0 auto; background: var(--ch-surface); border: 1px solid var(--ch-line); border-radius: 18px; padding: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); max-height: 62vh; overflow-y: auto; animation: ch-sheet-in 0.18s ease; }
@keyframes ch-sheet-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.ch-menu-link { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; border: none; background: transparent; color: var(--ch-ink); font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; }
.ch-menu-link:active { background: var(--ch-line); }
.ch-menu-sep { height: 1px; background: var(--ch-line); margin: 6px 8px; border: none; }
.ch-menu-head { padding: 6px 14px 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ch-muted); }
.ch-menu-signout { color: var(--ch-accent); }

@media (prefers-reduced-motion: reduce) { .ch-bubble { animation: none; } }

/* landscape-PHONE nudge — HELP, not gate. Dismissible; only phones (short even
   sideways) ever see it; tablets and portrait never do. */
.ch-rotate {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: var(--ch-bg); color: var(--ch-ink);
  align-items: center; justify-content: center; padding: 24px; text-align: center;
}
@media (orientation: landscape) and (max-height: 500px) { .ch-rotate { display: flex; } }
body.rotate-ok .ch-rotate { display: none !important; }
.ch-rotate-card { max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ch-rotate-phone {
  width: 42px; height: 74px; border: 3px solid var(--ch-ink); border-radius: 9px;
  position: relative; animation: ch-rot 2.6s ease-in-out infinite;
}
.ch-rotate-phone::after {
  content: ""; position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%);
  width: 12px; height: 3px; border-radius: 2px; background: var(--ch-muted);
}
@keyframes ch-rot { 0%, 35% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0); } }
.ch-rotate-h { margin: 8px 0 0; font-size: 18px; font-weight: 600; }
.ch-rotate-sub { margin: 0; color: var(--ch-muted); font-size: 14px; line-height: 1.45; }
.ch-rotate-dismiss { margin-top: 10px; background: none; border: none; color: var(--ch-accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .ch-rotate-phone { animation: none; transform: rotate(0); } }

/* ── space views (js/spaces/*) ─────────────────────────────────────────────── */

/* catch-up (catchup.js) — missed calls · coming up · what's due */
.ch-catchup-sec + .ch-catchup-sec { margin-top: 22px; }
.ch-catchup-main { flex: 1 1 auto; min-width: 0; }
.ch-catchup-when { flex: none; margin-left: 10px; margin-top: 0; white-space: nowrap; align-self: flex-start; }
.ch-catchup-dot-urgent { border-color: var(--ch-accent); background: var(--ch-accent); }
.ch-catchup-dot-due { border-color: #d9822b; background: #d9822b; }
.ch-catchup-clear { color: var(--ch-muted); font-size: 15px; text-align: center; padding: 40px 12px 0; line-height: 1.5; }
/* interactive missed calls (tap = read the transcript, long-press = select, dismiss = soft-clear) */
.ch-catchup-call { border-bottom: 1px solid var(--ch-line); user-select: none; -webkit-touch-callout: none; }
.ch-catchup-head { cursor: pointer; border-bottom: none; }
.ch-catchup-sum { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ch-catchup-open .ch-catchup-sum { -webkit-line-clamp: unset; overflow: visible; }
.ch-catchup-detail { padding: 2px 0 12px 26px; }
.ch-catchup-tmeta { color: var(--ch-muted); font-size: 12px; margin-bottom: 8px; }
.ch-catchup-transcript { display: flex; flex-direction: column; gap: 7px; max-height: 40vh; overflow-y: auto; margin-bottom: 11px; }
.ch-catchup-tline { font-size: 13px; line-height: 1.4; }
.ch-catchup-twho { display: inline-block; min-width: 44px; color: var(--ch-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: top; }
.ch-catchup-tempty { color: var(--ch-muted); font-size: 13px; margin: 2px 0 11px; }
.ch-catchup-detail-actions { display: flex; gap: 8px; }
.ch-catchup-btn { font: inherit; font-size: 13px; padding: 6px 15px; border-radius: 999px; border: 1px solid var(--ch-line); background: var(--ch-surface); color: var(--ch-ink); cursor: pointer; }
.ch-catchup-btn:active { transform: scale(0.96); }
.ch-catchup-btn:disabled { opacity: 0.4; }
.ch-catchup-btn[data-act="dismiss"], .ch-catchup-bardismiss { color: var(--ch-accent); }
.ch-catchup-contact { background: var(--ch-accent); color: #fff; border-color: transparent; text-decoration: none; }
.ch-catchup-check { display: none; width: 20px; height: 20px; flex: none; margin-top: 2px; border-radius: 50%; border: 2px solid var(--ch-muted); }
.ch-catchup-selecting .ch-catchup-check { display: block; }
.ch-catchup-selecting .ch-catchup-sel .ch-catchup-check { border-color: var(--ch-accent); background: var(--ch-accent); }
.ch-catchup-selecting .ch-catchup-head > .dot { display: none; }
.ch-catchup-sel { background: rgba(255, 122, 89, 0.10); border-radius: 10px; }
.ch-catchup-bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 10px 2px; margin-top: 6px; background: var(--ch-panel-bg); border-top: 1px solid var(--ch-line); }
.ch-catchup-barcount { font-size: 13px; color: var(--ch-muted); }
.ch-catchup-barspacer { flex: 1; }

/* tracking (tracking.js) — the latent goal/progress card (list rows reuse .ch-space-*) */
.ch-tracking-goal { margin-bottom: 12px; }
.ch-tracking-goal .ch-bar { margin-top: 10px; }
.ch-tracking-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

/* the sandbox — the model's canvas (sandbox.js). The stage fills the WHOLE panel, 100%
   width, edge to edge, NO margin (KP standing rule 2026-07-03: the whiteboard is the AI's
   full expressive surface — never reserve a gutter). Payloads are authored full-bleed
   (viewBox 0 0 320 320 with preserveAspectRatio slice, or full-width HTML). Motion (SVG
   SMIL) is clipped to the stage. ASCII art holds its spacing via <pre>. */
.ch-sandbox { height: 100%; overflow: auto; padding: 0; color: var(--ch-ink); display: flex; align-items: center; justify-content: center; }
.ch-sandbox-stage { width: 100%; height: 100%; flex: none; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; border-radius: 0; background: #eef3ec; }
.ch-sandbox-stage svg { width: 100%; height: 100%; }
.ch-sandbox-stage pre { margin: 0; max-width: 100%; max-height: 100%; overflow: auto; text-align: left; white-space: pre; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.15; letter-spacing: 0; }
.ch-sandbox-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--ch-muted); padding: 24px; }
.ch-sandbox-idle { font-size: 34px; opacity: 0.85; animation: ch-sandbox-breathe 3.4s ease-in-out infinite; }
.ch-sandbox-empty p { margin: 0; font-size: 14px; max-width: 240px; line-height: 1.45; }
@keyframes ch-sandbox-breathe { 0%, 100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.12); opacity: 1; } }

/* the model's tappable chips (<button data-say>) — pill buttons that read as "things
   you can say back". Inherit the theme; press-down feedback only (no hover states —
   this is a touch surface first). */
.ch-sandbox-stage button {
  appearance: none; font: inherit; font-size: 14px; line-height: 1.2;
  padding: 8px 14px; margin: 3px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ch-line); background: var(--ch-surface); color: var(--ch-ink);
  transition: transform 120ms ease;
}
.ch-sandbox-stage button:active { transform: scale(0.95); border-color: var(--ch-accent); }
.ch-sandbox-stage a { color: var(--ch-accent); text-underline-offset: 2px; }

/* the hurt home — the tender space the dealer raises on a hard read (hurt.js).
   A breathing guide: the ring swells ~4s in, settles ~4s out (one 8s breath), and the
   in/out cues cross-fade on the same clock. Reduced motion = the still hug + line. */
.ch-hurt { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: 24px; }
.ch-hurt-ring {
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(closest-side, rgba(255, 122, 89, 0.18), rgba(255, 122, 89, 0.05) 70%, transparent);
  box-shadow: 0 0 0 1px var(--ch-line);
  animation: ch-hurt-ring-breathe 8s ease-in-out infinite;
}
.ch-hurt-core { font-size: 56px; line-height: 1; }
.ch-hurt-line { margin: 0; font-size: 15px; color: var(--ch-ink); }
.ch-hurt-breath { position: relative; margin: 0; height: 1.4em; width: 100%; font-size: 14px; color: var(--ch-muted); }
.ch-hurt-breath span { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; opacity: 0; }
.ch-hurt-in { animation: ch-hurt-cue-in 8s ease-in-out infinite; }
.ch-hurt-out { animation: ch-hurt-cue-out 8s ease-in-out infinite; }
@keyframes ch-hurt-ring-breathe { 0%, 100% { transform: scale(0.88); } 45%, 55% { transform: scale(1.14); } }
@keyframes ch-hurt-cue-in { 0% { opacity: 0; } 10%, 38% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes ch-hurt-cue-out { 0%, 50% { opacity: 0; } 60%, 88% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ch-sandbox-idle { animation: none; }
  .ch-hurt-ring { animation: none; }
  .ch-hurt-breath { display: none; }
}

/* ── "your line" as a space view (spaces/line.js) — the receptionist log + settings
   living IN the panel (two-panel principle: chat stays below). .ch-fi = form input
   (the composer already owns .ch-input). */
.ch-fi {
  width: 100%; font: inherit; font-size: 14px; color: var(--ch-ink);
  background: var(--ch-bg); border: 1px solid var(--ch-line); border-radius: 10px;
  padding: 8px 11px;
}
.ch-fi:focus { outline: none; border-color: #5a9d76; box-shadow: 0 0 0 3px rgba(255, 110, 77, 0.15); }
textarea.ch-fi { resize: vertical; line-height: 1.45; }
.ch-line-call { align-items: flex-start; }
.ch-line-call.is-dismissed { opacity: 0.55; }
.ch-line-icon { flex: none; font-size: 18px; margin-top: 1px; }
.ch-line-summary { font-size: 13.5px; line-height: 1.45; margin-top: 2px; }
.ch-line-badge {
  display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 11px;
  background: rgba(255, 110, 77, 0.14); color: var(--ch-accent);
}
.ch-line-x {
  flex: none; width: 26px; height: 26px; border-radius: 50%; border: none;
  background: transparent; color: var(--ch-muted); font-size: 13px; cursor: pointer;
}
.ch-line-x:active { transform: scale(0.92); background: var(--ch-line); }
.ch-line-cleared summary { cursor: pointer; color: var(--ch-muted); font-size: 13px; padding: 10px 0 2px; list-style: none; }
.ch-line-cleared summary::-webkit-details-marker { display: none; }
.ch-line-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 0 12px; font-size: 14.5px; font-weight: 500; }
.ch-line-toggle input { width: 20px; height: 20px; accent-color: var(--ch-accent); }
.ch-line-field { display: block; margin: 0 0 14px; }
.ch-line-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.ch-line-label i { font-style: normal; font-weight: 400; color: var(--ch-muted); font-size: 12px; }
.ch-line-quiet { display: flex; align-items: center; gap: 8px; }
.ch-line-quiet .ch-fi { width: auto; flex: 1; }
.ch-line-quiet span { color: var(--ch-muted); font-size: 13px; }
.ch-line-wl { display: grid; grid-template-columns: 1fr 1.2fr 1fr auto; gap: 6px; margin-bottom: 6px; align-items: center; }
@media (max-width: 480px) { .ch-line-wl { grid-template-columns: 1fr 1.4fr auto; } .ch-wl-note { display: none; } }
.ch-line-add {
  font: inherit; font-size: 12.5px; padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--ch-line); background: transparent; color: var(--ch-muted); cursor: pointer;
}
.ch-line-save {
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 20px; border-radius: 999px;
  border: none; background: linear-gradient(135deg, #5a9d76, #3f7d5a); color: #fff; cursor: pointer;
  box-shadow: 0 3px 10px rgba(255, 110, 77, 0.3); margin-top: 4px;
}
.ch-line-save:active { transform: scale(0.96); }
.ch-line-save:disabled { opacity: 0.6; }
/* secondary save-row button (e.g. "make it a block" on a reminder) */
.ch-line-save.ch-line-save-alt {
  background: transparent; color: var(--ch-muted); border: 1px solid var(--ch-line); box-shadow: none;
}
.ch-line-status { margin-left: 10px; font-size: 13px; color: var(--ch-muted); }

/* the plate as a space view WITH actions (spaces/todos.js) */
.ch-todo-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--ch-line); }
.ch-todo-row:last-child { border-bottom: none; }
.ch-check {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  border: 2px solid var(--ch-muted); background: transparent; color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.ch-check:active { transform: scale(0.92); }
.ch-todo-row.is-done .ch-check { border-color: transparent; background: linear-gradient(135deg, #5a9d76, #3f7d5a); }
.ch-todo-main { flex: 1 1 auto; min-width: 0; font-size: 15px; line-height: 1.4; }
.ch-todo-row.is-done .ch-todo-main { color: var(--ch-muted); text-decoration: line-through; }
.ch-check:disabled, .ch-line-x:disabled { opacity: 0.4; }
/* tap-to-open detail card (KP 2026-07-05: see + edit an item; un-check a done one) */
.ch-todo-main[data-act="toggle"] { cursor: pointer; }
.ch-todo-row.is-open { border-bottom: none; }
.ch-todo-detail { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 12px 33px; border-bottom: 1px solid var(--ch-line); }
.ch-todo-detail .ch-fi { font-size: 14px; }
.ch-todo-detail-row { display: flex; align-items: center; gap: 8px; }
.ch-todo-row.is-done + .ch-todo-detail { opacity: 0.85; }

.ch-cer-yes.ch-cer-ok { background: linear-gradient(135deg, #5a9d76, #3f7d5a); color: #fff; }
.ch-cer-yes.ch-cer-no { opacity: 0.7; }

/* first-run walk chips — the deterministic handrail under the newest reply */
/* centered = the cheap delimiter (KP 2026-07-04): bubbles hug the edges and
   talk; anything centered is the SYSTEM offering buttons. Covers walk chips,
   perm re-ask chips, and the board nudge row (same class). */
.ch-walkchips { display: flex; gap: 8px; flex-wrap: wrap; align-self: center; justify-content: center; padding: 2px 2px 6px; animation: ch-pop 0.18s ease; }
.ch-walkchip {
  font: inherit; font-size: 14px; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(255, 110, 77, 0.45); background: var(--ch-surface); color: var(--ch-ink);
  box-shadow: 0 2px 8px rgba(42, 27, 61, 0.06);
  transition: transform 120ms ease, background 130ms ease;
}
.ch-walkchip:active { transform: scale(0.95); background: rgba(255, 110, 77, 0.10); }

/* ── the permission ceremony card (device_setup walk beat) ─────────────────
   One card, three sequential asks: dots · emoji · title · why · big yes ·
   quiet not-now. Same warm vocabulary as the walk chips. */
.ch-ceremony {
  /* full chat width minus the log's margins — a ceremony OWNS its moment
     (KP 2026-07-06: "use the whole 1/3 bottom except for the margins") */
  align-self: stretch; margin: 2px 0 6px;
  padding: 12px 16px 10px; border-radius: 18px; text-align: center;
  border: 1.5px solid rgba(255, 110, 77, 0.35); background: var(--ch-surface);
  box-shadow: 0 4px 16px rgba(42, 27, 61, 0.08);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  animation: ch-pop 0.18s ease; transition: opacity 0.35s ease, transform 0.35s ease;
}
.ch-ceremony.out { opacity: 0; transform: translateY(6px); }
.ch-cer-dots { display: flex; gap: 6px; margin-bottom: 2px; }
.ch-cer-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 110, 77, 0.25); }
.ch-cer-dots i.cur { background: rgba(255, 110, 77, 0.9); }
.ch-cer-dots i.on { background: rgba(255, 110, 77, 0.55); }
.ch-cer-emoji { font-size: 26px; line-height: 1; }
.ch-cer-title { font-size: 16.5px; font-weight: 650; color: var(--ch-ink); }
.ch-cer-line { font-size: 14px; line-height: 1.45; color: var(--ch-muted); }
.ch-cer-yes {
  font: inherit; font-size: 15px; font-weight: 600; margin-top: 4px;
  width: 100%; padding: 12px 16px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--ch-accent); color: #fff;
}
.ch-cer-yes:active { transform: scale(0.97); }
.ch-cer-yes:disabled { opacity: 0.6; }
.ch-cer-skip {
  font: inherit; font-size: 13px; padding: 6px 12px; border: none; background: transparent;
  color: var(--ch-muted); cursor: pointer;
}
.ch-cer-done { font-size: 14.5px; color: var(--ch-ink); padding: 6px 2px; }

/* the arrival card — the activation-card SHAPE (business ceremony) in PEACH
   (teal stays business-only; the welcome is warm persimmon like the room) */
.ch-ceremony.ch-arrival { border-color: rgba(255, 110, 77, 0.4); box-shadow: 0 4px 18px rgba(255, 110, 77, 0.10); }
.ch-board.ch-arrival {
  margin: 10px auto; max-width: 360px; padding: 16px 18px; border-radius: 18px;
  border: 1.5px solid rgba(255, 110, 77, 0.35); background: rgba(255, 110, 77, 0.06);
}
/* the "you're in" confirmation pill on the arrival card */
.ch-cer-badge {
  align-self: center; font-size: 13px; font-weight: 700; letter-spacing: 0.03em;
  color: #3f7d5a; background: rgba(255, 110, 77, 0.12);
  border: 1px solid rgba(255, 110, 77, 0.35); border-radius: 999px; padding: 4px 12px;
}
/* the welcome message — "this space is my mind", in the SAME peach scheme as the
   arrival card. Centered in the top panel; the richer animated art is parked. */
.ch-welcome-art { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.ch-welcome-art .ch-board.ch-arrival { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ch-mind-hl { font-size: 17px; font-weight: 700; color: var(--ch-ink); margin-top: 8px; }

/* the mic-help diagnostic line — the browser's raw error name, tiny and gray */
.ch-mic-diag { font-size: 11px; color: var(--ch-muted); opacity: 0.7; margin-top: 4px; }

/* the voice-note review bar (tap-mode stop): play back · trash · send */
.ch-review {
  flex: 1; min-width: 0; height: 44px;
  display: flex; align-items: center; gap: 10px; padding: 0 6px;
  border-radius: 22px; border: 1px solid var(--ch-line); background: var(--ch-surface);
}
.ch-rev-play, .ch-rev-trash {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ch-line);
  background: transparent; color: var(--ch-ink); font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ch-rev-dur { flex: 1; font-size: 14.5px; font-variant-numeric: tabular-nums; color: var(--ch-muted); }
.ch-rev-send {
  flex: none; font: inherit; font-size: 14.5px; font-weight: 600; padding: 9px 18px;
  border-radius: 999px; border: none; background: var(--ch-accent); color: #fff; cursor: pointer;
}
/* slide-away-to-cancel armed: the whole bar goes cold */
.ch-composer.rec-cancel-armed .ch-rec { border-color: var(--ch-line); background: transparent; opacity: 0.6; }
/* hold-to-record: the browser must not scroll/select/long-press-menu on the button */
.ch-send { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* spoken reply — Telegram-style voice bubble inside the ai reply
   (round play · progress track · countdown). No autoplay by design. */
.ch-voicemsg {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; padding: 8px 10px;
  border-radius: 14px; background: rgba(255, 122, 89, 0.10);
  border: 1px solid rgba(255, 122, 89, 0.25);
}
.ch-vm-play {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--ch-accent); color: #fff; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ch-vm-play:active { transform: scale(0.93); }
.ch-vm-track {
  flex: 1; height: 5px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 122, 89, 0.25); min-width: 60px;
}
.ch-vm-fill { display: block; height: 100%; width: 0%; background: var(--ch-accent); border-radius: 999px; transition: width 0.2s linear; }
.ch-vm-time { flex: none; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ch-muted); }
.ch-vm-speed {
  flex: none; font: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; border: 1px solid rgba(255, 122, 89, 0.35); background: transparent;
  color: var(--ch-muted); cursor: pointer;
}
/* the user's own clip lives inside their accent-colored bubble — invert the tint */
.ch-voicemsg.mine { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.3); }
.ch-voicemsg.mine .ch-vm-play { background: rgba(255, 255, 255, 0.9); color: var(--ch-accent); }
.ch-voicemsg.mine .ch-vm-track { background: rgba(255, 255, 255, 0.3); }
.ch-voicemsg.mine .ch-vm-fill { background: #fff; }
.ch-voicemsg.mine .ch-vm-time, .ch-voicemsg.mine .ch-vm-speed { color: rgba(255, 255, 255, 0.85); border-color: rgba(255, 255, 255, 0.4); }

/* ── boot splash: the bouncing peach, no words ───────────────────────────── */
#ch-boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--ch-bg); transition: opacity 0.35s ease;
}
#ch-boot.out { opacity: 0; pointer-events: none; }
#ch-boot img { width: 84px; height: 84px; animation: ch-boot-bounce 0.85s cubic-bezier(0.3, 0.6, 0.4, 1) infinite alternate; }
@keyframes ch-boot-bounce {
  from { transform: translateY(10px) scaleY(0.96); }
  to { transform: translateY(-22px) scaleY(1.02); }
}

/* ── the first-open world board (whiteboard-major boot) ──────────────────── */
.ch-board { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.ch-board-greet { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.ch-board-date { color: var(--ch-muted); font-size: 14px; margin-top: -6px; }
.ch-board-wx { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ch-board-temp { font-size: 34px; font-weight: 700; }
.ch-board-cond { font-size: 15px; color: var(--ch-ink); }
.ch-board-hilo, .ch-board-sun { font-size: 13px; color: var(--ch-muted); }

/* the door nudge on the world board — bebert asks first (alpha at the door) */
.ch-board-waiting { margin-top: 14px; }
/* the notification homecoming — warm, calm, no data */
.ch-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 18px 20px; gap: 4px; }
.ch-welcome-art { width: 100%; max-width: 320px; border-radius: 14px; display: block; box-shadow: 0 6px 24px rgba(0,0,0,0.18); }
.ch-welcome-greet { margin-top: 16px; font-size: 22px; font-weight: 700; color: var(--ch-ink); letter-spacing: -0.01em; }
.ch-welcome-sub { font-size: 15px; line-height: 1.5; color: var(--ch-muted); max-width: 30ch; }
.ch-board-nudge { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--ch-line); display: flex; flex-direction: column; gap: 10px; }
.ch-board-ask { font-size: 15.5px; line-height: 1.45; color: var(--ch-ink); }

/* ── THE FRONT DESK LIGHT — business register = a visibly different room ──────
   The dealer's per-turn pick (reply.mode, chathome.js setBizState) drives a
   whole-surface state: while Bebert works the desk the accent goes teal, the
   room takes a cool cast, and the "front desk" pill holds the state legible
   between turns. Warm persimmon = the companion; teal = work. The shift is
   animated — the room changing IS the signal (KP 2026-07-06: "if it LOOKS
   different the user will ACT different"). */
:root.ch-biz {
  --ch-bg: #0c1614;
  --ch-panel-bg: #11221e;
  --ch-chat-bg: #0c1614;
  --ch-surface: #1b2b27;
  --ch-accent: #16b8a2;
}
@media (prefers-color-scheme: light) {
  :root.ch-biz {
    --ch-bg: #e3edea;
    --ch-panel-bg: #eaf4f0;
    --ch-chat-bg: #e3edea;
    --ch-surface: #ffffff;
    --ch-accent: #0f9d8b;
  }
}
/* the daybook paints its own paper over the whole panel (its --db-* tokens, not
   the --ch vars) — without this the "whiteboard" never takes the work color
   (KP 2026-07-06). No live per-stylist theme exists yet (theme.js P1 =
   mechanism only), so a CSS override wins; revisit if applyTheme ever runs. */
:root.ch-biz #daybook { --db-paper: #ecf4f0; --db-paper-sunk: #dfebe6; }
@media (prefers-color-scheme: dark) {
  :root.ch-biz #daybook { --db-paper: #182622; --db-paper-sunk: #121c19; }
}
/* the warm persimmon LITERALS (chips, ceremony trim) follow the room too —
   without these the biz room shows mixed persimmon/teal accents */
:root.ch-biz .ch-ceremony { border-color: rgba(22, 184, 162, 0.35); }
:root.ch-biz .ch-cer-dots i { background: rgba(22, 184, 162, 0.25); }
:root.ch-biz .ch-cer-dots i.cur { background: rgba(22, 184, 162, 0.9); }
:root.ch-biz .ch-cer-dots i.on { background: rgba(22, 184, 162, 0.55); }
:root.ch-biz .ch-walkchip { border-color: rgba(22, 184, 162, 0.45); }
:root.ch-biz .ch-walkchip:active { background: rgba(22, 184, 162, 0.10); }
:root.ch-biz .ch-cer-yes.ch-cer-ok { background: linear-gradient(135deg, #1cc9b0, #0f9d8b); }
/* the WORK LIGHT on the whiteboard: the model's canvas paints carry their own
   baked colors (often warm gradients) that no CSS var can reach — KP 2026-07-06
   still saw the orange board in the teal room. A hue-blend layer re-hues
   WHATEVER is painted (stale pre-flip paints included) into the teal family
   while keeping the art's lightness/legibility (verified with a W3C hue-blend
   simulation before shipping). isolation keeps the blend inside the stage;
   pointer-events:none keeps tap-chips tappable. */
/* opaque backdrop is LOAD-BEARING: the hue layer over a transparent backdrop
   composites as near-SOLID teal (KP 2026-07-06: "WAY too dark") — with the
   panel color underneath, empty canvas reads as the room (a smidge off the
   chat bg) and only painted art gets re-hued. */
:root.ch-biz .ch-sandbox-stage { isolation: isolate; background: var(--ch-panel-bg); }
:root.ch-biz .ch-sandbox-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: #14b8a2; mix-blend-mode: hue;
}
/* let the room-change be felt — everything below resolves from the vars above */
body, .ch-panel, .ch-chat, .ch-composer { transition: background-color 0.6s ease; }
.ch-bubble.ai { transition: background-color 0.6s ease, border-color 0.6s ease; }
.ch-bubble.you { transition: background-color 0.6s ease; }
.ch-input, .ch-send { transition: background-color 0.6s ease; }

.ch-desk-chip {
  position: absolute; top: 8px; right: 12px; z-index: 6;
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: lowercase;
  color: var(--ch-accent);
  background: var(--ch-surface);
  border: 1px solid var(--ch-line);
  border-radius: 999px; padding: 4px 11px;
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease, color 0.45s ease;
}
.ch-desk-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ch-accent); }
:root.ch-biz .ch-desk-chip { opacity: 1; transform: none; }
