/* ═══════════════════════════════════════════════════════════════
   RPlay App — companion shell (v1.13, step 1+2)
   Adds the Home launcher + Voice Memo tool + account sheet on top of
   the existing DocScanner .scan flow. Builds on pane.css tokens +
   docscanner.css (.scan/.ms-* idioms). Dark + light. English-only.
   The 8-tile launcher copy + statuses were signed off by Gery 2026-06-07.
   ═══════════════════════════════════════════════════════════════ */

/* ── top-level screen router (Home · Scan tool · Voice Memo) ──
   NB: docscanner.css already owns `.screen` (the demo device frame),
   so the router uses its own `.rp-screen` prefix. */
.rp-screen { flex: 1; min-height: 0; }
.rp-screen:not(.active) { display: none !important; }
.rp-screen.active { display: flex; flex-direction: column; }
@media (prefers-reduced-motion: no-preference) {
  .rp-screen.active { animation: rpIn 0.26s var(--ease, ease); }
}
@keyframes rpIn { from { transform: translateY(8px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* ═════════════════════════════════════════════════════════════
   GLOBAL TOP BAR — same on every screen:
   [ RPlay▸ (→Home) ] [ tool pill ] [ count ] ........... [ GP →settings ]
   ═════════════════════════════════════════════════════════════ */
.rp-topbar {
  flex-shrink: 0; position: relative; z-index: 20;
  height: 54px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.rp-brand { display: inline-flex; align-items: center; border: none; background: transparent; cursor: pointer; padding: 4px; }
.rp-logo { height: 25px; width: auto; display: none; }
[data-theme="dark"] .rp-logo.dark { display: block; }
[data-theme="light"] .rp-logo.light { display: block; }
.rp-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 12px; border-radius: var(--r-full);
  background: var(--chip-tint); border: 1px solid color-mix(in srgb, var(--orb-blue) 24%, transparent);
  color: var(--orb-blue); font-size: var(--t-sm); font-weight: 700; letter-spacing: 0.01em;
  cursor: pointer; font-family: var(--font); transition: filter 0.15s;
}
.rp-pill[hidden] { display: none; }
.rp-pill:hover { filter: brightness(1.06); }
.rp-pill-x { width: 13px; height: 13px; opacity: 0.7; }
.rp-pill:hover .rp-pill-x { opacity: 1; }
.rp-pillcount {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--r-full);
  background: var(--bg-raised); border: 1px solid var(--border); color: var(--text-mid);
  font-size: var(--t-xs); font-weight: 700; font-variant-numeric: tabular-nums;
}
.rp-pillcount[hidden] { display: none; }
.rp-sp { flex: 1; }
.rp-acct {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--bg-raised);
  display: grid; place-items: center; color: var(--text-hi);
  font-size: 12.5px; font-weight: 700; font-family: var(--font); transition: border-color 0.15s, box-shadow 0.15s;
}
.rp-acct svg { width: 17px; height: 17px; }
.rp-acct:hover { border-color: var(--orb-blue); }
/* green ring = signed in + online */
.rp-acct.online { border-color: var(--orb-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orb-blue) 18%, transparent); }

/* HORIZONTAL MOVEMENT IS FORBIDDEN (Gery): whatever ever renders too wide, no
   screen or pane may pan left-right — clip it instead (visible = fixable). */
.rp-screen, .cd, .cd-body, .cpane-list, .home { overflow-x: hidden; }

/* Contacts toolbar (search + New), under the global bar */
.ct-toolbar { display: flex; align-items: center; gap: 10px; padding: 11px 14px 4px; }
/* min-width:0 so the search box (and its input) can shrink — otherwise the
   intrinsic input width pushes the +New / scan buttons off a narrow screen. */
.ct-toolbar .cpane-search { margin: 0; flex: 1; min-width: 0; }
.ct-toolbar .cpane-search input { min-width: 0; }
.ct-toolbar .rp-new { height: 40px; flex-shrink: 0; }
/* iOS auto-zooms the page when a focused input is under 16px — pane.css ships 14px,
   so every list-search box needs this override (the "window resizes on search" bug). */
.cpane-search input { font-size: 16px; }

/* ═════════════════════════════════════════════════════════════
   HOME / LAUNCHER
   ═════════════════════════════════════════════════════════════ */
.home { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 26px; scrollbar-width: thin; display: flex; flex-direction: column; }

/* Home footer — subtle green-tinted "linked + version" pill, pinned to the bottom */
.home-foot {
  margin-top: auto; align-self: center;
  display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: center;
  padding: 8px 15px; border-radius: var(--r-full);
  background: var(--chip-tint); border: 1px solid color-mix(in srgb, var(--orb-blue) 22%, transparent);
  color: var(--orb-blue); font-size: var(--t-xs); font-weight: 600;
}
.home-foot svg { width: 13px; height: 13px; flex-shrink: 0; }
.home-foot .ms-mask { font-family: var(--mono); }
.home-foot .home-foot-ver { color: color-mix(in srgb, var(--orb-blue) 70%, var(--text-low)); font-weight: 500; }
.home::-webkit-scrollbar { width: 5px; }
.home::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* top: logo + account button */
.home-top { display: flex; align-items: center; height: 52px; gap: 9px; }
.home-logo { height: 21px; width: auto; display: none; }
[data-theme="dark"] .home-logo.dark { display: block; }
[data-theme="light"] .home-logo.light { display: block; }
.home-top .sp { flex: 1; }
.home-acct {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--bg-raised);
  display: grid; place-items: center; color: var(--text-hi);
  font-size: 12.5px; font-weight: 700; font-family: var(--font);
  transition: border-color 0.15s;
}
.home-acct:hover { border-color: var(--orb-blue); }

/* greeting + linked chip */
.home-greet { margin: 10px 0 16px; }
.home-greet h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-hi); line-height: 1.15; margin: 0; }
.home-linked {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
  padding: 4px 11px 4px 9px; border-radius: var(--r-full);
  background: var(--chip-tint); border: 1px solid color-mix(in srgb, var(--orb-blue) 26%, transparent);
  color: var(--orb-blue); font-size: var(--t-xs); font-weight: 650; cursor: pointer; font-family: var(--font);
}
.home-linked svg { width: 13px; height: 13px; flex-shrink: 0; }
.home-linked .mask { font-family: var(--mono); font-weight: 600; }

/* ── Home cross-module search (desktop-PWA parity): the ONLY thing above the grid ── */
.hs-wrap { position: relative; margin: 10px 0 14px; flex-shrink: 0; }
.hs-bar {
  display: flex; align-items: center; gap: 11px; height: 48px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--bg-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hs-bar:focus-within { border-color: var(--orb-blue); box-shadow: 0 0 0 3px var(--chip-tint); }
.hs-bar .hs-ico { width: 18px; height: 18px; color: var(--text-mid); flex-shrink: 0; }
/* 16px input — anything smaller makes iOS Safari auto-zoom the whole page on focus */
.hs-bar input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; color: var(--text-hi); font-family: var(--font); font-size: 16px; }
.hs-bar input::placeholder { color: var(--text-low); }
.hs-clear { width: 28px; height: 28px; border: none; background: transparent; color: var(--text-low); border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.hs-clear[hidden] { display: none; } /* explicit display beats the hidden attribute otherwise */
.hs-clear svg { width: 14px; height: 14px; }
.hs-plug {
  width: 34px; height: 34px; border: none; border-radius: var(--r-sm);
  background: var(--grad-orb); color: #fff;
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.hs-plug svg { width: 17px; height: 17px; }
.hs-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, 0.4); padding: 7px;
  max-height: min(440px, 58vh); overflow-y: auto; display: none;
}
.hs-results.open { display: block; }
.res-group-hd { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-mid); padding: 10px 10px 5px; display: flex; align-items: center; gap: 8px; }
.res-group-hd svg { width: 13px; height: 13px; color: var(--orb-blue); }
.res-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; width: 100%; border: none; background: transparent; text-align: left; font-family: var(--font); }
.res-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--bg-raised); color: var(--text-mid); }
.res-ico svg { width: 16px; height: 16px; }
.res-body { flex: 1; min-width: 0; }
.res-title { display: block; font-size: 14px; font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-sub { display: block; font-size: 12px; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.res-empty { padding: 26px; text-align: center; color: var(--text-low); font-size: 13px; }

/* tool grid */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-tile {
  position: relative; text-align: left; cursor: pointer; font-family: var(--font);
  display: flex; flex-direction: column; gap: 11px;
  padding: 16px; border-radius: var(--r-md); min-height: 116px;
  background: var(--bg-surface); border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
/* hover ONLY on real pointers — on iOS :hover sticks after a tap and leaves the last
   tile shaded until the next touch (the "Voice Forms looks selected" bug) */
@media (hover: hover) {
  .tool-tile:hover { border-color: var(--border-strong); background: var(--bg-hover); }
  .tool-tile:hover .tt-badge { box-shadow: 0 0 0 2px var(--bg-hover); }
  .res-row:hover { background: var(--bg-raised); }
  .hs-clear:hover { background: var(--bg-hover); color: var(--text-hi); }
  .hs-plug:hover { box-shadow: 0 3px 10px -2px rgba(45, 209, 167, 0.5); filter: brightness(1.05); }
}
.tool-tile:active { transform: translateY(1px); }
/* icon chip = the desktop treatment: green gradient, white glyph, soft glow */
.tool-tile .tt-ic {
  position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-orb); color: #fff;
  box-shadow: 0 3px 10px -3px rgba(45, 209, 167, 0.45);
}
.tool-tile .tt-ic svg { width: 23px; height: 23px; }
.tool-tile .tt-n { font-size: 17px; font-weight: 700; color: var(--text-hi); }
/* always reserve exactly 2 lines so every tile is the same height (Gery) */
.tool-tile .tt-s {
  font-size: 13px; color: var(--text-mid); line-height: 1.35; min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* live count — green bubble perched on the icon chip's corner, white ring (desktop parity) */
.tool-tile .tt-badge {
  position: absolute; top: -7px; right: -9px;
  min-width: 21px; height: 19px; padding: 0 6px; border-radius: var(--r-full);
  background: var(--grad-orb); color: var(--on-accent);
  border: 1px solid color-mix(in srgb, var(--orb-blue) 38%, transparent);
  box-shadow: 0 0 0 2px var(--bg-surface);
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}

/* Scan = the primary card (mint). White text in BOTH themes (Gery: black-on-green
   read poorly in dark mode). */
.tool-tile.primary { background: var(--grad-orb); border-color: transparent; box-shadow: 0 12px 30px -14px rgba(45,209,167,0.6); }
.tool-tile.primary .tt-ic { background: rgba(255,255,255,0.20); color: #fff; }
.tool-tile.primary .tt-n { color: #fff; }
.tool-tile.primary .tt-s { color: rgba(255,255,255,0.9); }
.tool-tile.primary:hover { background: var(--grad-orb); border-color: transparent; filter: brightness(1.04); }

/* "Soon" tiles — same solid layout as the rest (Gery), just a Soon badge */
.tool-tile.soon .tt-soon {
  position: absolute; top: 12px; right: 12px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--orb-blue); background: var(--chip-tint);
  border: 1px solid color-mix(in srgb, var(--orb-blue) 26%, transparent);
  padding: 2px 7px; border-radius: var(--r-full);
}

/* ═════════════════════════════════════════════════════════════
   VOICE MEMO  (reuses the .scan shell + .ms-hero idioms)
   ═════════════════════════════════════════════════════════════ */
.vm-home {
  width: 32px; height: 32px; border-radius: var(--r-sm); flex-shrink: 0;
  border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-mid);
  display: grid; place-items: center; cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.vm-home:hover { color: var(--orb-blue); border-color: var(--orb-blue); }
.vm-home svg { width: 18px; height: 18px; }

/* ── Voice Memo v2 — recorder surface (toggle · waveform · cancel/record/send) ── */
.vm { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 20px calc(24px + env(safe-area-inset-bottom)); position: relative; }

/* destination toggle — segmented; remembers the last choice */
.vm-dest { align-self: center; display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--border); }
.vm-dest-opt { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border: none; border-radius: 999px; background: transparent; color: var(--text-mid); font-family: var(--font); font-size: var(--t-sm); font-weight: 650; cursor: pointer; transition: color .15s, background .15s; }
.vm-dest-opt svg { width: 16px; height: 16px; }
.vm-dest-opt.on { background: var(--grad-orb); color: var(--on-accent); box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--orb-blue) 60%, transparent); }

/* stage — live waveform + duration */
.vm-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.vm-wave { width: 100%; max-width: 460px; height: 120px; }
.vm-timer { font-family: var(--mono); font-size: 40px; font-weight: 700; color: var(--text-hi); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.vm[data-vm="idle"] .vm-timer { color: var(--text-low); }
.vm-hint { color: var(--text-low); font-size: var(--t-sm); text-align: center; }
.vm-err { color: var(--bad); font-size: var(--t-sm); text-align: center; margin: 0; }
.vm-err[hidden] { display: none; }

/* controls row — cancel · record/pause · send */
.vm-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 320px; width: 100%; align-self: center; padding-top: 8px; }
.vm-side { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-mid); display: grid; place-items: center; cursor: pointer; transition: color .15s, border-color .15s, background .15s, opacity .15s, transform .1s; }
.vm-side svg { width: 22px; height: 22px; }
.vm-side:active { transform: scale(0.95); }
#vmCancel:hover { color: var(--bad); border-color: var(--bad); }
.vm-send { color: var(--orb-blue); border-color: color-mix(in srgb, var(--orb-blue) 40%, var(--border-strong)); }
.vm-send:hover { background: var(--chip-tint); }
.vm[data-vm="idle"] .vm-send { opacity: .4; pointer-events: none; }

.vm-rec { width: 84px; height: 84px; border-radius: 50%; border: none; background: var(--bad); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--bad) 60%, transparent); transition: transform .12s, background .15s; }
.vm-rec:active { transform: scale(0.96); }
.vm-rec svg { width: 34px; height: 34px; }
.vm-rec .vm-ic { display: none; }
/* TWO states only: red mic (idle + recording) · orange pause II (paused). No play, ever. */
.vm[data-vm="idle"] .vm-rec .vm-ic.mic,
.vm[data-vm="recording"] .vm-rec .vm-ic.mic,
.vm[data-vm="paused"] .vm-rec .vm-ic.pause { display: block; }
/* recording = red mic, pulsing red (base .vm-rec is already red) · paused = orange pause II */
.vm[data-vm="recording"] .vm-rec { animation: vmPulseRec 1.6s ease-out infinite; }
.vm[data-vm="paused"] .vm-rec { background: #F97316; box-shadow: 0 8px 24px -6px color-mix(in srgb, #F97316 55%, transparent); }
@keyframes vmPulseRec {
  0% { box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--bad) 60%, transparent), 0 0 0 0 color-mix(in srgb, var(--bad) 45%, transparent); }
  70% { box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--bad) 60%, transparent), 0 0 0 18px transparent; }
  100% { box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--bad) 60%, transparent), 0 0 0 0 transparent; }
}

/* sending overlay (brief, until the upload is accepted) */
.vm-sending { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg-deep) 88%, transparent); backdrop-filter: blur(2px); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--text-mid); font-size: var(--t-md); }
.vm[data-vm="sending"] .vm-sending { display: flex; }

/* ═════════════════════════════════════════════════════════════
   ACCOUNT / LINKED-DEVICE sheet  (self-contained bottom sheet)
   ═════════════════════════════════════════════════════════════ */
.rp-scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(2,6,23,0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.rp-scrim.open { opacity: 1; pointer-events: auto; }
.rp-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 92%; overflow-y: auto;
  background: var(--bg-surface); border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 0.28s var(--ease-spring, cubic-bezier(.2,.9,.3,1.3));
  box-shadow: 0 -18px 50px -20px rgba(0,0,0,0.55);
}
.rp-sheet.open { transform: none; }
.rp-sheet-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 14px; }
.rp-sheet-x { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-mid); display: grid; place-items: center; cursor: pointer; z-index: 2; }
.rp-sheet-x:hover { color: var(--text-hi); border-color: var(--text-low); }
.rp-sheet-x svg { width: 16px; height: 16px; }

.rp-pf { display: flex; align-items: center; gap: 13px; padding: 2px 2px 16px; }
.rp-pf-av { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--bg-raised); border: 1px solid var(--border-strong); color: var(--text-hi); font-size: 16px; font-weight: 700; font-family: var(--font); }
.rp-pf-av svg { width: 21px; height: 21px; }
.rp-pf-tx { display: flex; flex-direction: column; min-width: 0; }
.rp-pf-name { font-size: var(--t-md); font-weight: 700; color: var(--text-hi); }
.rp-pf-verified { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs); color: var(--orb-blue); font-weight: 600; margin-top: 2px; }
.rp-pf-verified svg { width: 13px; height: 13px; }

.rp-set-group { padding: 14px 0; border-top: 1px solid var(--border); }
.rp-set-title { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-mid); margin: 0 0 10px; }
.rp-set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.rp-set-row .label { font-size: var(--t-base); color: var(--text-hi); }
.rp-set-row .val { font-size: var(--t-sm); color: var(--text-mid); font-family: var(--mono); }

.rp-linkdev {
  display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: var(--r-md);
  background: var(--grad-orb-soft, var(--chip-tint)); border: 1px solid color-mix(in srgb, var(--orb-blue) 30%, var(--border));
}
.rp-linkdev .ld-ic { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; background: var(--chip-tint); color: var(--orb-blue); }
.rp-linkdev .ld-ic svg { width: 21px; height: 21px; }
.rp-linkdev .ld-tx { flex: 1; min-width: 0; }
.rp-linkdev .ld-t { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--orb-blue); }
.rp-linkdev .ld-m { font-size: var(--t-md); font-weight: 650; color: var(--text-hi); font-family: var(--mono); margin-top: 2px; overflow-wrap: anywhere; }
.rp-linkdev .ld-s { font-size: var(--t-xs); color: var(--text-mid); margin-top: 3px; line-height: 1.4; }

.rp-unlink {
  width: 100%; justify-content: center; height: 44px; border-radius: var(--r-md); margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent);
  background: color-mix(in srgb, var(--bad) 9%, transparent); color: var(--bad);
  font-family: var(--font); font-size: var(--t-md); font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.rp-unlink:hover { background: color-mix(in srgb, var(--bad) 15%, transparent); }
.rp-unlink svg { width: 16px; height: 16px; }

.rp-theme-seg { display: inline-flex; gap: 4px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-full); padding: 3px; }
.rp-theme-seg button { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; color: var(--text-mid); font-family: var(--font); font-size: var(--t-xs); font-weight: 650; padding: 5px 11px; border-radius: var(--r-full); cursor: pointer; }
.rp-theme-seg button svg { width: 13px; height: 13px; }
.rp-theme-seg button.on { background: var(--bg-surface); color: var(--text-hi); box-shadow: 0 1px 3px rgba(0,0,0,0.18); }

/* ═════════════════════════════════════════════════════════════
   TOOL HEADER (Contacts, and future data tiles) — slim nav bar
   ═════════════════════════════════════════════════════════════ */
#screen-contacts { position: relative; background: var(--bg-deep); } /* scope the .cd detail overlay to this screen */
.rp-hd { flex-shrink: 0; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.rp-hd .rp-title { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.01em; color: var(--text-hi); display: flex; align-items: center; gap: 8px; }
.rp-hd .rp-title svg { width: 19px; height: 19px; color: var(--orb-blue); }
.rp-hd .rp-count { font-size: var(--t-xs); font-weight: 700; color: var(--text-mid); background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--r-full); padding: 2px 8px; font-variant-numeric: tabular-nums; }
.rp-hd .sp { flex: 1; }
.rp-back {
  width: 32px; height: 32px; border-radius: var(--r-sm); flex-shrink: 0;
  border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-mid);
  display: grid; place-items: center; cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.rp-back:hover { color: var(--orb-blue); border-color: var(--orb-blue); }
.rp-back svg { width: 18px; height: 18px; }
.rp-new { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 13px; border: none; border-radius: var(--r-sm); background: var(--grad-orb); color: var(--on-accent); font-family: var(--font); font-size: var(--t-sm); font-weight: 700; cursor: pointer; }
.rp-new svg { width: 15px; height: 15px; }
.rp-note { flex-shrink: 0; display: flex; align-items: center; gap: 7px; padding: 8px 14px; background: var(--bg-deep); font-size: var(--t-xs); color: var(--text-low); border-bottom: 1px solid var(--border); }
.rp-note svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--text-mid); }

/* ═════════════════════════════════════════════════════════════
   CONTACT DETAIL — read-only card (ported from the v1.13 prototype)
   ═════════════════════════════════════════════════════════════ */
.cd { position: fixed; inset: 0; z-index: 58; background: var(--bg-deep); display: none; flex-direction: column; }
.cd.open { display: flex; }
.cd-bar { flex-shrink: 0; display: flex; align-items: center; gap: var(--sm); height: 52px; padding: 0 var(--md); border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.cd-bar .back { display: inline-flex; align-items: center; gap: 4px; border: none; background: transparent; color: var(--text-mid); font-family: var(--font); font-size: var(--t-md); font-weight: 600; cursor: pointer; padding: 4px; }
.cd-bar .back svg { width: 18px; height: 18px; }
.cd-bar .sp { flex: 1; }
.cd-bar .cd-edit { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-raised); color: var(--text-hi); font-family: var(--font); font-size: var(--t-sm); font-weight: 650; cursor: pointer; }
.cd-bar .cd-edit svg { width: 14px; height: 14px; }
.cd-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--lg) var(--lg) calc(var(--xl) + env(safe-area-inset-bottom)); scrollbar-width: thin; }
/* An overfull form column SCROLLS — it never squashes its children. Without this,
   flex eats the height of direct-child buttons first (Save/Generate measured at
   17px on a 560px viewport — Gery's "flat buttons"); inputs survived only because
   their .rp-field wrapper has a content minimum. */
.cd-body > * { flex-shrink: 0; }
.rp-save, .ms-cta { flex-shrink: 0; }
.cd-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 4px 0 var(--lg); }
.cd-av { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-raised); color: var(--text-hi); font-size: 25px; font-weight: 700; position: relative; margin-bottom: 6px; }
.cd-av::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2.5px solid var(--ring, transparent); -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%); mask: radial-gradient(circle, transparent 60%, #000 61%); }
.cd-av.known { --ring: var(--ok); } .cd-av.partial { --ring: var(--warn); } .cd-av.unknown { --ring: var(--bad); }
.cd-name { font-size: var(--t-xl); font-weight: 700; color: var(--text-hi); letter-spacing: -0.01em; }
.cd-role { font-size: var(--t-base); color: var(--text-mid); }
.cd-fields { display: flex; flex-direction: column; gap: 2px; margin-top: var(--md); }
.cd-row { display: flex; align-items: center; gap: var(--md); padding: 11px 2px; border-bottom: 1px solid var(--border); }
.cd-row:last-child { border-bottom: none; }
.cd-row .cd-ic { width: 18px; flex-shrink: 0; color: var(--text-low); display: grid; place-items: center; }
.cd-row .cd-ic svg { width: 16px; height: 16px; }
.cd-row .cd-kv { flex: 1; min-width: 0; }
.cd-row .cd-k { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-low); }
.cd-row .cd-v { display: block; font-size: var(--t-md); color: var(--text-hi); font-weight: 550; margin-top: 2px; overflow-wrap: anywhere; }
.cd-row .cd-copy { width: 30px; height: 30px; border: none; background: transparent; color: var(--text-low); border-radius: var(--r-sm); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.cd-row .cd-copy:hover { color: var(--orb-blue); background: var(--chip-tint); }
.cd-row .cd-copy svg { width: 15px; height: 15px; }

/* detail-bar icon buttons (QR · download vCard) */
.cd-iconbtn { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-mid); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.cd-iconbtn:hover { color: var(--orb-blue); border-color: var(--orb-blue); }
.cd-iconbtn svg { width: 16px; height: 16px; }

/* QR overlay (vCard) — someone else scans it to save the contact */
.cd-qr { position: absolute; inset: 0; z-index: 3; background: var(--bg-deep); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: var(--xl); text-align: center; }
.cd-qr.open { display: flex; }
.cd-qr-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-mid); display: grid; place-items: center; cursor: pointer; }
.cd-qr-x:hover { color: var(--text-hi); }
.cd-qr-x svg { width: 17px; height: 17px; }
.cd-qr-card { background: #fff; border-radius: var(--r-md); padding: 16px; box-shadow: 0 12px 34px -8px rgba(0,0,0,0.45); line-height: 0; }
.cd-qr-card img { display: block; width: 256px; height: 256px; max-width: 68vw; max-height: 68vw; image-rendering: pixelated; }
.cd-qr-name { font-size: var(--t-lg); font-weight: 700; color: var(--text-hi); }
.cd-qr-hint { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-sm); color: var(--text-mid); }
.cd-qr-hint svg { width: 15px; height: 15px; flex-shrink: 0; }

/* search clear (×) */
.ct-clear { flex-shrink: 0; width: 26px; height: 26px; border: none; background: transparent; color: var(--text-low); border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.ct-clear[hidden] { display: none; }
.ct-clear:hover { color: var(--text-hi); background: var(--bg-raised); }
.ct-clear svg { width: 15px; height: 15px; }

/* ═════════════════════════════════════════════════════════════
   FAQ tile — read-only consult (list · search · read)
   ═════════════════════════════════════════════════════════════ */
.faq-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 13px var(--sm); border: none; background: transparent; border-radius: var(--r-md); cursor: pointer; font-family: var(--font); transition: background 0.14s; }
.faq-row:hover { background: var(--bg-hover); }
.faq-row.off { opacity: 0.5; }
.faq-q-badge { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--chip-tint); color: var(--orb-blue); margin-top: 1px; }
.faq-q-badge svg { width: 18px; height: 18px; }
.faq-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.faq-row-q { font-size: var(--t-base); font-weight: 600; color: var(--text-hi); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.faq-row-a { font-size: var(--t-sm); color: var(--text-low); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.faq-row .crow-chev { margin-top: 9px; }
/* (the read-only footer is gone — FAQ is an authoring surface now) */

/* read view (reuses the .cd / .cd-body detail chassis) */
/* editor: link chips above the add-link input + the answer textarea (form chassis) */
.faq-links { display: none; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.faq-link-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px 5px 11px; border-radius: 999px; background: var(--chip-tint); border: 1px solid color-mix(in srgb, var(--orb-blue) 26%, transparent); color: var(--orb-blue); font-size: var(--t-sm); font-weight: 650; max-width: 100%; min-width: 0; }
.faq-link-chip .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faq-link-chip button { width: 18px; height: 18px; border: none; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; opacity: 0.75; flex-shrink: 0; }
.faq-link-chip button:hover { opacity: 1; }
#faqDetail textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-deep); color: var(--text-hi); font-family: var(--font); font-size: 16px; padding: 10px 12px; resize: vertical; outline: none; }
#faqDetail textarea:focus { border-color: var(--orb-blue); }

/* ═════════════════════════════════════════════════════════════
   TASKS tile — list (grouped) + status chips + create/edit form
   ═════════════════════════════════════════════════════════════ */
.tk-chips { display: flex; gap: 7px; padding: 4px 14px 9px; flex-shrink: 0; }
.tk-chips button { padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-mid); font-family: var(--font); font-size: var(--t-sm); font-weight: 650; cursor: pointer; }
.tk-chips button.on { background: var(--grad-orb); border-color: transparent; color: var(--on-accent); }

.tk-group { margin-bottom: var(--md); }
.tk-group-hd { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 2px 5px; border: none; background: var(--bg-deep); font-family: var(--font); font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-mid); position: sticky; top: 0; z-index: 1; text-align: left; }
.tk-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tk-gn { color: var(--text-low); font-weight: 650; }
.tk-done-toggle { cursor: pointer; }
.tk-done-toggle svg { width: 14px; height: 14px; transition: transform .15s; }
.tk-done-toggle svg.open { transform: rotate(180deg); }

.tk-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.tk-row.done .tk-title { text-decoration: line-through; color: var(--text-low); }
.tk-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.tk-check svg { width: 15px; height: 15px; }
.tk-check.doing { border-color: var(--orb-blue); color: var(--orb-blue); background: var(--chip-tint); }
.tk-row.done .tk-check { border-color: var(--ok); color: var(--ok); }
.tk-main { flex: 1; min-width: 0; border: none; background: transparent; text-align: left; padding: 8px 0; cursor: pointer; font-family: var(--font); display: flex; flex-direction: column; gap: 4px; }
.tk-title { font-size: var(--t-base); font-weight: 600; color: var(--text-hi); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tk-chips-row, .tk-main .tk-chips { display: flex; }
.tk-main .tk-chips { flex-wrap: wrap; gap: 6px; padding: 0; align-items: center; }
.tk-tag { padding: 2px 9px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--border); color: var(--text-mid); font-size: var(--t-xs); font-weight: 600; }
.tk-tag.doing { color: var(--orb-blue); border-color: color-mix(in srgb, var(--orb-blue) 32%, transparent); background: var(--chip-tint); }
.tk-due { font-size: var(--t-xs); font-weight: 650; color: var(--text-mid); }
.tk-due.soon { color: #F59E0B; }
.tk-due.overdue { color: var(--bad); }
.tk-n { font-size: var(--t-xs); color: var(--text-low); }
.tk-pips { display: inline-flex; gap: 2.5px; align-items: center; }
.tk-pips i { width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); }
.tk-pips.p1 i:nth-child(1) { background: var(--text-low); }
.tk-pips.p2 i:nth-child(-n+2) { background: #F59E0B; }
.tk-pips.p3 i { background: var(--bad); }
.tk-doneb, .tk-del, .row-del { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-low); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.tk-doneb svg, .tk-del svg, .row-del svg { width: 16px; height: 16px; }
.tk-doneb:hover { color: var(--ok); border-color: var(--ok); }
.tk-del:hover, .row-del:hover { color: var(--bad); border-color: var(--bad); }

/* editor */
.tk-ed-title { font-size: var(--t-md); font-weight: 700; color: var(--text-hi); }
.tk-ed-del { color: var(--bad); }
#tkEditor .cd-body { display: flex; flex-direction: column; gap: 13px; }
#tkEditor textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-surface); color: var(--text-hi); font-family: var(--font); font-size: 16px; padding: 10px 12px; resize: vertical; outline: none; }
#tkEditor textarea:focus { border-color: var(--orb-blue); }
.tk-seg { display: flex; gap: 5px; }
.tk-seg button { flex: 1; min-width: 0; padding: 9px 4px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-mid); font-family: var(--font); font-size: var(--t-sm); font-weight: 650; cursor: pointer; }
.tk-seg button.on { background: var(--grad-orb); border-color: transparent; color: var(--on-accent); }
.tk-ctx { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tk-ctx-row { display: flex; gap: 10px; align-items: baseline; }
.tk-ctx-k { flex-shrink: 0; width: 84px; font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-low); }
.tk-ctx-v { flex: 1; min-width: 0; font-size: var(--t-sm); color: var(--text-mid); display: flex; flex-wrap: wrap; gap: 5px; }

/* delete confirm (destructive house style: trash icon + red confirm) */
.tk-cf { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 24px; }
.tk-cf.open { display: flex; }
.tk-cf-scrim { position: absolute; inset: 0; background: color-mix(in srgb, #000 55%, transparent); }
.tk-cf-box { position: relative; width: min(340px, 100%); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg, 16px); padding: 22px 20px 16px; text-align: center; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 18px 50px -12px rgba(0,0,0,0.5); }
.tk-cf-ico { width: 46px; height: 46px; margin: 0 auto 2px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.tk-cf-ico svg { width: 21px; height: 21px; }
.tk-cf-box h4 { margin: 0; font-size: var(--t-lg); color: var(--text-hi); }
.tk-cf-box p { margin: 0 0 8px; font-size: var(--t-sm); color: var(--text-mid); line-height: 1.5; overflow-wrap: anywhere; }
.tk-cf-del { padding: 12px; border: none; border-radius: var(--r-md); background: var(--bad); color: #fff; font-family: var(--font); font-size: var(--t-md); font-weight: 700; cursor: pointer; }
.tk-cf-keep { padding: 10px; border: none; background: transparent; color: var(--text-mid); font-family: var(--font); font-size: var(--t-sm); font-weight: 650; cursor: pointer; }

/* ═════════════════════════════════════════════════════════════
   MINUTES tile — list + form → AI preview → send
   ═════════════════════════════════════════════════════════════ */
/* ONE row pattern for every simple list (Minutes · Voice Forms · Receipts) — the full
   button-reset lives HERE so a row can never fall back to UA button styling again
   (the Arial / outset-border Minutes bug). Contacts (.crow) and FAQ (.faq-row) carry
   the same reset in their own rules. */
.mn-row, .vf-row, .rc-row {
  display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; margin: 0;
  padding: 12px var(--sm); border: none; border-bottom: 1px solid var(--border);
  background: transparent; color: inherit; font-family: var(--font);
  text-align: left; cursor: pointer;
}
.mn-row:last-child, .vf-row:last-child, .rc-row:last-child { border-bottom: none; }
.mn-ic { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--chip-tint); color: var(--orb-blue); }
.mn-ic svg { width: 18px; height: 18px; }
.mn-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mn-title { font-size: var(--t-base); font-weight: 600; color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-sub { font-size: var(--t-xs); color: var(--text-mid); }
.mn-sent { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); font-weight: 700; color: var(--ok); }
.mn-sent svg { width: 13px; height: 13px; }
#mnEditor textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-deep); color: var(--text-hi); font-family: var(--font); font-size: 16px; padding: 10px 12px; resize: vertical; outline: none; }
#mnEditor textarea:focus { border-color: var(--orb-blue); }
.mn-preview-body { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; color: var(--text-hi); font-size: var(--t-md); line-height: 1.6; overflow-wrap: anywhere; }
.mn-preview-body h2 { margin: 0 0 6px; font-size: var(--t-xl); }
.mn-preview-body h3 { margin: 16px 0 6px; font-size: var(--t-md); color: var(--orb-blue); }
.mn-preview-body p { margin: 0 0 8px; color: var(--text-mid); }
.mn-preview-body ul { margin: 0 0 8px; padding-left: 20px; color: var(--text-mid); }
.mn-back-edit { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: none; background: transparent; color: var(--text-mid); font-family: var(--font); font-size: var(--t-sm); font-weight: 650; cursor: pointer; }
.mn-back-edit svg { width: 15px; height: 15px; }

/* attendees: chips + typed input + from-contacts */
.mn-att-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mn-att-chips:not(:empty) { margin-bottom: 7px; }
.mn-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px 5px 11px; border-radius: 999px; background: var(--chip-tint); border: 1px solid color-mix(in srgb, var(--orb-blue) 26%, transparent); color: var(--orb-blue); font-size: var(--t-sm); font-weight: 650; }
.mn-chip-x { width: 18px; height: 18px; border: none; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; opacity: 0.75; }
.mn-chip-x:hover { opacity: 1; }
.mn-chip-x svg { width: 11px; height: 11px; }
.mn-att-row { display: flex; gap: 8px; }
.mn-att-row input { flex: 1; min-width: 0; }
.mn-from-contacts { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 0 13px; height: 44px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-surface); color: var(--text-mid); font-family: var(--font); font-size: var(--t-sm); font-weight: 650; cursor: pointer; }
.mn-from-contacts svg { width: 16px; height: 16px; }
.mn-from-contacts:hover { color: var(--orb-blue); border-color: var(--orb-blue); }

/* contacts picker sheet */
.mn-pick-list { max-height: 46vh; overflow-y: auto; margin-bottom: 12px; scrollbar-width: thin; }
.mn-pick-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 6px; border: none; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; font-family: var(--font); }
.mn-pick-row:last-child { border-bottom: none; }
.mn-pick-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mn-pick-name { font-size: var(--t-base); font-weight: 600; color: var(--text-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-pick-sub { font-size: var(--t-xs); color: var(--text-mid); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-pick-ck { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
.mn-pick-row.on .mn-pick-ck { border-color: var(--orb-blue); background: var(--chip-tint); color: var(--orb-blue); }
.mn-pick-ck svg { width: 13px; height: 13px; }

/* photo attachments */
.mn-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.mn-photos:not(:empty) { margin-bottom: 8px; }
.mn-ph { position: relative; width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border-strong); }
.mn-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mn-ph-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mn-ph-x svg { width: 10px; height: 10px; }
.mn-ph-btns { display: flex; gap: 8px; }
.mn-ph-add { display: inline-flex; align-items: center; gap: 6px; padding: 9px 13px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); background: transparent; color: var(--text-mid); font-family: var(--font); font-size: var(--t-sm); font-weight: 650; cursor: pointer; }
.mn-ph-add svg { width: 15px; height: 15px; }
.mn-ph-add:hover { color: var(--orb-blue); border-color: var(--orb-blue); }

/* dictation mic on the notes field */
.mn-notes-wrap { position: relative; }
.mn-notes-wrap textarea { padding-right: 52px; }
.mn-dict { position: absolute; right: 10px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--bad); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px -3px color-mix(in srgb, var(--bad) 55%, transparent); }
.mn-dict svg, .mn-dict .d-busy { width: 17px; height: 17px; }
.mn-dict .d-stop, .mn-dict .d-busy { display: none; }
.mn-dict[data-dict="rec"] { animation: vmPulseRec 1.6s ease-out infinite; }
.mn-dict[data-dict="rec"] .d-mic { display: none; }
.mn-dict[data-dict="rec"] .d-stop { display: block; }
.mn-dict[data-dict="busy"] { background: var(--bg-raised); color: var(--orb-blue); pointer-events: none; box-shadow: none; }
.mn-dict[data-dict="busy"] .d-mic { display: none; }
.mn-dict[data-dict="busy"] .d-busy { display: block; }

/* ═════════════════════════════════════════════════════════════
   RECEIPTS tile — hero + camera → review form
   ═════════════════════════════════════════════════════════════ */
/* Receipts — the ledger on the Contacts chassis (toolbar + summary + list + ONE editor).
   Row layout comes from the shared simple-row block (.mn-row/.vf-row/.rc-row). */
.rc-sum { flex-shrink: 0; padding: 2px 16px 7px; font-size: var(--t-xs); font-weight: 650; color: var(--text-mid); font-variant-numeric: tabular-nums; }
.rc-rowic { width: 36px; height: 36px; border-radius: 10px; background: var(--chip-tint); color: var(--orb-blue); display: grid; place-items: center; flex-shrink: 0; }
.rc-rowic svg { width: 18px; height: 18px; }
.rc-rowbody { flex: 1; min-width: 0; }
.rc-rowtitle { display: block; font-size: var(--t-base); font-weight: 600; color: var(--text-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-rowsub { display: block; font-size: var(--t-xs); color: var(--text-mid); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-rowamt { flex-shrink: 0; font-size: var(--t-md); font-weight: 700; color: var(--text-hi); font-variant-numeric: tabular-nums; }
#rcEditor textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-deep); color: var(--text-hi); font-family: var(--font); font-size: 16px; padding: 10px 12px; resize: vertical; outline: none; }
#rcEditor textarea:focus { border-color: var(--orb-blue); }

/* ═════════════════════════════════════════════════════════════
   VOICE FORMS tile — picker → run (fields + record) → review
   ═════════════════════════════════════════════════════════════ */
/* .vf-row layout = the shared simple-row block (see the Minutes section) */
.vf-intro { margin: 0; color: var(--text-mid); font-size: var(--t-sm); line-height: 1.5; }
.vf-say { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-raised); border: 1px dashed var(--border-strong); color: var(--text-mid); font-size: var(--t-sm); line-height: 1.45; }
.vf-say svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--orb-blue); }
.vf-say b { color: var(--text-hi); }
#vfRun textarea, #vfReview textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-deep); color: var(--text-hi); font-family: var(--font); font-size: 16px; padding: 9px 12px; resize: vertical; outline: none; }
#vfReview textarea:focus { border-color: var(--orb-blue); }
.vf-miss { margin-left: 6px; color: #F59E0B; font-weight: 700; font-size: var(--t-xs); }
/* recorder footer — pinned under the scrolling fields, record button dead-centre
   (1fr · auto · 1fr grid: timer right-aligned left of it, hint left-aligned right) */
.vf-foot {
  flex-shrink: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: var(--bg-surface);
}
.vf-foot .vf-timer { justify-self: end; }
.vf-foot .vf-rec-hint { justify-self: start; }
.vf-timer { font-family: var(--mono); font-size: var(--t-lg); font-weight: 700; color: var(--text-hi); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.vf-rec { width: 64px; height: 64px; border-radius: 50%; border: none; background: var(--bad); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vf-rec svg, .vf-rec .vf-ic-busy { width: 26px; height: 26px; }
.vf-rec .vf-ic-stop, .vf-rec .vf-ic-busy { display: none; }
#vfRun[data-rec="rec"] .vf-rec { animation: vmPulseRec 1.6s ease-out infinite; }
#vfRun[data-rec="rec"] .vf-rec .vf-ic-mic { display: none; }
#vfRun[data-rec="rec"] .vf-rec .vf-ic-stop { display: block; }
#vfRun[data-rec="busy"] .vf-rec { background: var(--bg-raised); color: var(--orb-blue); pointer-events: none; }
#vfRun[data-rec="busy"] .vf-rec .vf-ic-mic { display: none; }
#vfRun[data-rec="busy"] .vf-rec .vf-ic-busy { display: block; }
.vf-rec-hint { color: var(--text-low); font-size: var(--t-sm); min-width: 86px; }
#vfRun[data-rec="rec"] .vf-rec-hint::after { content: ""; }

/* ═════════════════════════════════════════════════════════════
   COMPANY FICHE (Bedrijfsfiche) — 🏢 on group headers + the sheet
   ═════════════════════════════════════════════════════════════ */
.cgroup-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cgroup-fiche { flex-shrink: 0; width: 24px; height: 24px; border: none; background: transparent; color: var(--orb-blue); border-radius: var(--r-sm); display: grid; place-items: center; cursor: pointer; opacity: 0.8; }
.cgroup-fiche:hover { opacity: 1; background: var(--chip-tint); }
.cgroup-fiche svg { width: 15px; height: 15px; }

#cfBody { padding: 2px 2px 4px; }
.cf-loading, .cf-empty { padding: 24px 4px; color: var(--text-mid); font-size: var(--t-sm); text-align: center; line-height: 1.5; }
.cf-empty-t { margin-bottom: 2px; }
.cf-fetch { display: inline-flex; align-items: center; gap: 7px; margin: 16px 0 4px; padding: 11px 18px; border: none; border-radius: var(--r-md); background: var(--grad-orb); color: var(--on-accent); font-family: var(--font); font-size: var(--t-sm); font-weight: 700; cursor: pointer; }
.cf-fetch svg { width: 15px; height: 15px; }
.cf-empty-sub { display: block; margin-top: 12px; color: var(--text-low); font-size: var(--t-xs); }
.cf-fetching { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 52px 0; }
.cf-fetching-t { color: var(--text-mid); font-size: var(--t-sm); }
.cf-head { display: flex; align-items: center; gap: 12px; padding: 2px 2px 14px; }
.cf-ic { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; background: var(--chip-tint); color: var(--orb-blue); }
.cf-ic svg { width: 23px; height: 23px; }
.cf-name { font-size: var(--t-lg); font-weight: 700; color: var(--text-hi); }
.cf-domain { font-size: var(--t-xs); color: var(--text-mid); font-family: var(--mono); margin-top: 1px; }
.cf-status { margin-left: auto; align-self: flex-start; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); padding: 3px 8px; border-radius: var(--r-full); }
.cf-desc { font-size: var(--t-base); color: var(--text); line-height: 1.5; margin: 0 2px 14px; }
.cf-rows { display: flex; flex-direction: column; gap: 2px; }
.cf-row { display: flex; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.cf-row:last-child { border-bottom: none; }
.cf-k { flex-shrink: 0; width: 84px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-low); padding-top: 2px; }
.cf-v { flex: 1; min-width: 0; font-size: var(--t-md); color: var(--text-hi); overflow-wrap: anywhere; }
.cf-v a { color: var(--orb-blue); text-decoration: none; }
.cf-ok { color: var(--ok); font-size: var(--t-xs); font-weight: 700; white-space: nowrap; }
.cf-maps { display: inline-flex; align-items: center; gap: 7px; margin: 14px 0 4px; padding: 10px 14px; border-radius: var(--r-md); background: var(--chip-tint); border: 1px solid color-mix(in srgb, var(--orb-blue) 26%, transparent); color: var(--orb-blue); font-size: var(--t-sm); font-weight: 700; text-decoration: none; }
.cf-maps svg { width: 15px; height: 15px; }
.cf-notes { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.cf-notes label { font-size: var(--t-xs); font-weight: 650; color: var(--text-mid); }
.cf-notes textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-deep); color: var(--text-hi); font-family: var(--font); font-size: 16px; line-height: 1.45; resize: vertical; outline: none; }
.cf-notes textarea:focus { border-color: var(--orb-blue); }
.cf-notes .rp-save { margin-top: 2px; }

/* fiche editable "Your info" block */
.cf-edit { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 11px; }
.cf-edit-h { font-size: var(--t-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-mid); }
.cf-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cf-field label { font-size: var(--t-xs); font-weight: 650; color: var(--text-mid); }
.cf-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-deep); color: var(--text-hi); font-family: var(--font); font-size: 16px; outline: none; }
.cf-input:focus { border-color: var(--orb-blue); }
select.cf-input { height: 44px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
textarea.cf-input { resize: vertical; line-height: 1.45; }
.cf-hint { font-size: var(--t-xs); color: var(--ok); font-weight: 600; margin-top: 3px; }
.cf-edit .rp-save { margin-top: 4px; }

/* ═════════════════════════════════════════════════════════════
   Custom dropdown (.rp-dd) — NEVER a native <select> (hard rule).
   Inline-expanding so it isn't clipped inside a scrollable sheet.
   ═════════════════════════════════════════════════════════════ */
.rp-dd { position: relative; }
.rp-dd-trigger { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-deep); color: var(--text-hi); font-family: var(--font); font-size: 16px; font-weight: 500; cursor: pointer; text-align: left; transition: border-color 0.15s; }
.rp-dd-trigger:hover, .rp-dd.open .rp-dd-trigger { border-color: var(--orb-blue); }
.rp-dd-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-dd-val.rp-dd-ph { color: var(--text-low); }
.rp-dd-chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-low); transition: transform 0.15s; }
.rp-dd.open .rp-dd-chev { transform: rotate(180deg); }
.rp-dd-menu { display: none; margin-top: 6px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-surface); overflow: hidden; box-shadow: 0 8px 24px -10px rgba(0,0,0,0.35); }
.rp-dd.open .rp-dd-menu { display: block; }
.rp-dd-search { width: 100%; box-sizing: border-box; height: 42px; padding: 0 12px; border: none; border-bottom: 1px solid var(--border); background: var(--bg-raised); color: var(--text-hi); font-family: var(--font); font-size: 16px; outline: none; }
.rp-dd-search::placeholder { color: var(--text-low); }
.rp-dd-list { max-height: 208px; overflow-y: auto; padding: 4px; scrollbar-width: thin; } /* ~5 rows, scroll for more */
.rp-dd-opt { width: 100%; text-align: left; padding: 9px 11px; border: none; background: transparent; color: var(--text-mid); font-family: var(--font); font-size: var(--t-base); border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-dd-opt:hover { background: var(--bg-raised); color: var(--text-hi); }
.rp-dd-opt.cur { color: var(--orb-blue); font-weight: 650; background: var(--chip-tint); }
.rp-dd-empty { padding: 12px; text-align: center; color: var(--text-low); font-size: var(--t-sm); }
.rp-dd-more { padding: 8px 11px 4px; text-align: center; color: var(--text-low); font-size: var(--t-xs); }

/* ═════════════════════════════════════════════════════════════
   BUSINESS-CARD SCAN → new contact
   ═════════════════════════════════════════════════════════════ */
.ct-scancard { width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-mid); display: grid; place-items: center; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.ct-scancard:hover { color: var(--orb-blue); border-color: var(--orb-blue); }
.ct-scancard svg { width: 20px; height: 20px; }

/* "pulled from card" banner in the add-contact sheet */
.ct-banner { display: flex; align-items: center; gap: 7px; margin: 0 2px 12px; padding: 9px 12px; border-radius: var(--r-sm); background: var(--chip-tint); border: 1px solid color-mix(in srgb, var(--orb-blue) 26%, transparent); color: var(--orb-blue); font-size: var(--t-xs); font-weight: 600; }
.ct-banner[hidden] { display: none; }
.ct-banner svg { width: 14px; height: 14px; flex-shrink: 0; }

/* card-scan busy overlay */
.ct-scan-busy { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: color-mix(in srgb, var(--bg-deep) 88%, transparent); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.ct-scan-busy[hidden] { display: none; }
.ct-scan-busy-t { font-size: var(--t-md); font-weight: 650; color: var(--text-hi); }

/* ═════════════════════════════════════════════════════════════
   ADD / EDIT contact form (in the rp-sheet bottom sheet)
   ═════════════════════════════════════════════════════════════ */
.rp-sheet-title { font-size: var(--t-lg); font-weight: 700; color: var(--text-hi); margin: 2px 2px 14px; }
.rp-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; min-width: 0; }
.rp-field label { font-size: var(--t-xs); font-weight: 650; color: var(--text-mid); }
/* font-size 16px on text inputs prevents iOS Safari from auto-zooming (which
   looked like "the window resizes") when a field gets focus. */
.rp-field input { width: 100%; box-sizing: border-box; height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--bg-deep); color: var(--text-hi); font-family: var(--font); font-size: 16px; outline: none; transition: border-color 0.15s; }
#ctSearch { font-size: 16px; }
.rp-field input:focus { border-color: var(--orb-blue); }
.rp-field input:disabled { opacity: 0.6; cursor: not-allowed; }
.rp-field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Grid cells must never push wider than their column: grid items default to
   min-width:auto, and iOS date inputs carry a LARGE intrinsic minimum — two of
   them side-by-side made the Receipts editor wider than the screen (= the
   "screen moves left-right" report). */
.rp-field-2 > .rp-field { min-width: 0; }
.rp-field input { min-width: 0; }
.rp-save { width: 100%; height: 46px; margin-top: 8px; border: none; border-radius: var(--r-md); background: var(--grad-orb); color: var(--on-accent); font-family: var(--font); font-size: var(--t-md); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.rp-save svg { width: 17px; height: 17px; }

/* ═════════════════════════════════════════════════════════════
   "Coming soon" overlay (tap a soon / not-yet-on-phone tile)
   ═════════════════════════════════════════════════════════════ */
.soon-ov {
  position: fixed; inset: 0; z-index: 55; display: none; flex-direction: column;
  background: radial-gradient(125% 70% at 50% -8%, rgba(45,209,167,0.08), transparent 60%), var(--bg-deep);
}
.soon-ov.open { display: flex; }
.soon-ov .soon-top { flex-shrink: 0; height: 52px; padding: 0 14px; display: flex; align-items: center; }
.soon-ov .soon-x {
  width: 32px; height: 32px; border-radius: var(--r-sm); margin-left: auto;
  border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-mid);
  display: grid; place-items: center; cursor: pointer;
}
.soon-ov .soon-x:hover { color: var(--text-hi); }
.soon-ov .soon-x svg { width: 17px; height: 17px; }

/* ═══ Connect — chat with the org's business data (mirrors the desktop/pane look) ═══ */
#screen-connect { display: none; }
#screen-connect.active { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cn-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cn-head .cn-plug { width: 17px; height: 17px; color: var(--ok); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--orb-blue) 50%, transparent)); flex-shrink: 0; }
.cn-org { font-weight: 700; color: var(--text-hi); font-size: 14px; }
.cn-ro { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); border-radius: 999px; padding: 2px 8px; }
.cn-head .sp { flex: 1; }
.cn-clear:hover { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); border-color: transparent; }
.cn-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background-image: radial-gradient(90% 30% at 50% 0%, color-mix(in srgb, var(--orb-blue) 5%, transparent), transparent 60%); }
.cn-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.55; word-break: break-word; animation: cnRise 0.24s cubic-bezier(0.16, 1, 0.3, 1); }
.cn-msg.user { align-self: flex-end; background: color-mix(in srgb, var(--ok) 16%, var(--bg-raised)); color: var(--text-hi); border-bottom-right-radius: 4px; }
.cn-msg.ai { align-self: flex-start; max-width: 94%; background: var(--bg-surface); border: 1px solid var(--border); border-left: 3px solid var(--orb-blue); border-radius: 10px; color: var(--text-hi); }
@keyframes cnRise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.cn-msg.ai .cn-p { margin: 4px 0; }
.cn-msg.ai .cn-h { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--text-hi); margin: 10px 0 5px; }
.cn-msg.ai .cn-h:first-child { margin-top: 0; }
.cn-msg.ai .cn-h::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--orb-blue); flex-shrink: 0; }
.cn-msg.ai .cn-ul, .cn-msg.ai .cn-ol { margin: 4px 0 8px; padding-left: 19px; display: flex; flex-direction: column; gap: 4px; }
.cn-msg.ai .cn-ul li::marker { color: var(--orb-blue); }
.cn-msg.ai .cn-ol li::marker { color: var(--orb-blue); font-weight: 700; }
.cn-msg.ai li.cn-cont { list-style: none; color: var(--text-mid); font-size: 12.5px; }
.cn-status { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; background: var(--bg-raised); border: 1px solid var(--border); font-size: 11px; color: var(--text-low); animation: cnRise 0.2s ease; }
.cn-status.run { color: var(--orb-blue); border-color: color-mix(in srgb, var(--orb-blue) 30%, transparent); }
.cn-status.run::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--orb-blue); animation: cnPulse 1.1s ease-in-out infinite; }
@keyframes cnPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--orb-blue) 45%, transparent); } 55% { box-shadow: 0 0 0 6px transparent; } }
.cn-status.denied, .cn-status.error { color: var(--warn); }
.cn-notice { align-self: flex-start; font-size: 11.5px; color: var(--text-low); font-style: italic; }
.cn-error { align-self: flex-start; font-size: 12px; color: var(--bad); }
.cn-typing { align-self: flex-start; display: flex; gap: 4px; padding: 6px 2px; }
.cn-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--orb-blue); animation: cnBlink 1.2s infinite; }
.cn-typing span:nth-child(2) { animation-delay: 0.2s; }
.cn-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cnBlink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.cn-empty { margin: 12vh auto 0; max-width: 340px; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.cn-empty p { font-size: 13.5px; color: var(--text-mid); line-height: 1.6; }
.cn-sample, .cn-recipe { border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-hi); border-radius: 10px; padding: 11px 14px; font-size: 13px; cursor: pointer; transition: all 0.16s; }
.cn-sample:active, .cn-recipe:active { border-color: var(--orb-blue); background: var(--chip-tint); color: var(--orb-blue); }
.cn-acts { align-self: center; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cn-act { border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-hi); border-radius: 999px; padding: 6px 13px; font-size: 12px; cursor: pointer; }
.cn-act:disabled { opacity: 0.6; }
.cn-foot { border-top: 1px solid var(--border); padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; position: relative; }
/* ⚡ recipes — a clear popover card above the chips: search on top, ~5 rows, scrolls,
   closes on outside tap. */
.cn-recipes {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; margin: 0 auto;
  width: min(340px, calc(100vw - 24px)); max-height: 46vh; overflow-y: auto;
  background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.55);
  padding: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 60;
  animation: cnRise 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.cn-rsearch { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-raised); color: var(--text-hi); font: inherit; font-size: 16px; padding: 9px 11px; outline: none; } /* 16px: iOS focus-zoom guard */
.cn-rsearch:focus { border-color: var(--orb-blue); }
.cn-rlist { display: flex; flex-direction: column; gap: 6px; }
.cn-rmore { font-size: 11px; color: var(--text-low); padding: 2px 4px; }
.cn-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cn-chip { border: 1px solid var(--border-strong); background: transparent; color: var(--text-mid); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.cn-chip.on { border-color: var(--orb-blue); color: var(--orb-blue); background: var(--chip-tint); }
.cn-inrow { display: flex; align-items: flex-end; gap: 8px; }
.cn-inrow textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 110px; resize: none; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg-surface); color: var(--text-hi); font: inherit; font-size: 16px; padding: 10px 12px; outline: none; } /* 16px: anything smaller makes iOS zoom the whole app on focus */
.cn-inrow textarea:focus { border-color: var(--orb-blue); }
.cn-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-strong); background: transparent; color: var(--text-mid); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.cn-btn svg { width: 18px; height: 18px; }
.cn-send { background: var(--grad-orb); color: var(--on-accent); border-color: transparent; }
.cn-send:disabled { opacity: 0.35; }
.cn-send .s-stop { display: none; }
.cn-send.stop { background: var(--bad); }
.cn-send.stop .s-send { display: none; }
.cn-send.stop .s-stop { display: block; }
.cn-mic .d-stop, .cn-mic .d-busy { display: none; }
.cn-mic[data-dict="rec"] { background: var(--bad); border-color: var(--bad); color: #fff; animation: cnPulse 1.3s ease infinite; }
.cn-mic[data-dict="rec"] .d-mic { display: none; }
.cn-mic[data-dict="rec"] .d-stop { display: block; }
.cn-mic[data-dict="busy"] .d-mic { display: none; }
.cn-mic[data-dict="busy"] .d-busy { display: block; }
.cn-cf { position: fixed; inset: 0; z-index: 120; background: color-mix(in srgb, #000 55%, transparent); display: flex; align-items: center; justify-content: center; padding: 24px; }
.cn-cf-box { width: 100%; max-width: 320px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: 16px; padding: 22px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.cn-cf-ico { width: 46px; height: 46px; border-radius: 50%; background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); display: grid; place-items: center; margin: 0 auto 4px; }
.cn-cf-ico svg { width: 22px; height: 22px; }
.cn-cf-box h4 { font-size: 15.5px; color: var(--text-hi); margin: 0; }
.cn-cf-box p { font-size: 13px; color: var(--text-mid); line-height: 1.55; margin: 0 0 10px; }
.cn-cf-del { height: 42px; border-radius: 11px; border: none; background: var(--bad); color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cn-cf-keep { height: 38px; border-radius: 11px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-mid); font-size: 13px; font-weight: 600; cursor: pointer; }

/* ── Skeleton shimmer — true first loads only (no snapshot yet); see src/cache.ts ── */
.skel-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.skel-av { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.skel-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skel {
  height: 11px; border-radius: 6px; display: block;
  background: linear-gradient(90deg, var(--bg-raised) 25%, var(--border-strong) 37%, var(--bg-raised) 63%);
  background-size: 400% 100%;
  animation: skelShimmer 1.4s ease infinite;
}
@keyframes skelShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
