/* 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: #ff7a59;
  --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);
  }
}
html, body {
  margin: 0; height: 100%;
  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 {
  flex: none;            /* height set live by JS */
  height: 33vh;
  overflow: hidden;
  background: var(--ch-panel-bg);
  contain: strict;       /* keep the per-frame resize cheap */
  will-change: height;
}
.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, #ff8a5c, #ff5a3c 55%, #fcc448);
}
.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, #ff8a5c, #ff5a3c) 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; }
.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; }

/* 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); }

/* 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; }
.ch-menu svg { width: 22px; height: 22px; }
.ch-menu:active { transform: scale(0.94); }
.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-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: 8px; }
.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). A fixed 320x320 "script area" the model
   composes against; the outer box centers it and scrolls if the panel is smaller. Motion
   (SVG SMIL) is clipped to the stage. ASCII art holds its spacing via <pre>. */
.ch-sandbox { height: 100%; overflow: auto; padding: 12px; color: var(--ch-ink); display: flex; align-items: center; justify-content: center; }
.ch-sandbox-stage { width: 320px; height: 320px; flex: none; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: rgba(127, 127, 127, 0.05); }
.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: #ff8a5c; 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, #ff8a5c, #ff5a3c); 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; }
.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, #ff8a5c, #ff5a3c); }
.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; }
