/* =====================================================================
   Oroxia design system v2.1 — "a quieter kind of connection" (Design & Build Masterplan, Oct 2026).
   Two complete themes from the design tokens: Day (light) and Evening (dark). Opaque, matte surfaces; colour is a
   signal (selected state, actionable emphasis), not decoration. No glass, glows, gradients or animated wallpaper.
   Type: Geist/Inter (self-hosted). Message body 16px/1.5; secondary 14px; metadata >= 12px.
   Spacing: 4px base (8/12/16/24/32). Radii: controls 10 · bubbles 16 · cards 18.
   Motion: see the "Motion contract" section at the end — 120/90/180/220/240ms, cubic-bezier(.2,.8,.2,1).
   ===================================================================== */

@font-face { font-family: 'Geist'; src: url('/fonts/Geist-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* Day — design tokens (light). Legacy variable names are kept so every existing component follows. */
  /* v2.7 evolution tokens (Evolution & Onboarding spec p6): warm ivory canvas, near-white surface, sage secondary. */
  --canvas: #F4F2EC; --surface: #FFFEFA; --surface-2: #E8EDE7; --ink: #202923; --ink-2: #606C63;
  --accent: #315C4D; --on-accent: #FFFFFF; --line: #CDD5CB;
  --clay: #8E4930;          /* small contextual accent for occasions (plan status, cover fallback) — never for errors */
  --editorial: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif; /* occasions & greetings only */
  --bg: var(--canvas);
  --bg-2: #EEECE6;
  --elevated: var(--surface);
  --card: var(--surface);
  --hover: #EEF1EC;
  --text: var(--ink);
  --text-2: var(--ink-2);
  --muted: #606C63;
  --border: var(--line);
  --border-strong: #879188;
  --iris: var(--accent);
  --iris-text: var(--accent);
  --soft-iris: var(--accent);
  --blue: var(--accent);
  --aqua: var(--accent);
  --orchid: var(--accent);
  --mint: #3B7A5E;
  --success: #2E6B4A;
  --danger: #A3392E;
  --warning: #7A5300;
  --on-iris: var(--on-accent);
  --iris-tint: var(--surface-2);
  --iris-tint-strong: #DCE5DB;
  --grad: linear-gradient(var(--accent), var(--accent));
  --grad-aurora: linear-gradient(var(--accent), var(--accent));
  --grad-cool: linear-gradient(var(--accent), var(--accent));
  --grad-tint: linear-gradient(var(--surface-2), var(--surface-2));
  --glass: var(--surface);
  --glass-strong: var(--surface);
  --glass-border: var(--line);
  --glass-highlight: transparent;
  --glow: none;
  --glow-sm: none;
  --bubble-in: var(--canvas);
  --bubble-out: var(--surface-2);
  --bubble-out-text: var(--ink);
  --bubble-out-border: transparent;
  --scrim: rgba(16, 32, 25, 0.42);
  --shadow: 0 16px 40px rgba(21, 37, 27, 0.10);
  --shadow-sm: 0 2px 8px rgba(21, 37, 27, 0.06);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --r-control: 10px; --r-card: 18px; --r-panel: 18px; --r-bubble: 16px; --r-pill: 999px;
  --font: 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: var(--editorial);   /* occasions and greetings only — never messages, money, dates or controls */
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --fs-meta: 12px; --fs-label: 13px; --fs-compact: 14px; --fs-ui: 15px; --fs-body: 16px; --fs-prominent: 18px; --fs-section: 22px; --fs-screen: 24px; --fs-display: 36px;
  --msg-size: 16px;
  --msg-max: 680px;
  --rail-w: 76px; --side-w: 304px; --info-w: 340px;
  --gap: 0px;
  --t-fast: 120ms; --t-press: 90ms; --t-message: 180ms; --t-panel: 220ms; --t-sheet: 240ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  /* Evening — design tokens (dark): matte, differentiated surfaces; pale sage for the active action. */
  --canvas: #151B18; --surface: #1D2620; --surface-2: #29372E; --ink: #EDF1EB; --ink-2: #ADB9AC;
  --accent: #BDD7C0; --on-accent: #15251B; --line: #506052;
  --clay: #E6B49B;
  --bg-2: #18201B;
  --hover: #243029;
  --muted: #A7B3A6;
  --border-strong: #6E7E71;
  --mint: #9FD5A8;
  --success: #A6D9AE;
  --danger: #F2A49B;
  --warning: #E8C27A;
  --iris-tint-strong: #33443A;
  --scrim: rgba(5, 10, 7, 0.62);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.36);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
[data-contrast="more"] { --border: #8A938B; --border-strong: #5E675F; --text-2: #3E4640; --muted: #3E4640; }
[data-theme="dark"][data-contrast="more"] { --border: #7E8E81; --border-strong: #9AAA9C; --text-2: #D3DCD2; --muted: #D3DCD2; }
[data-size="small"] { --msg-size: 14px; }
[data-size="large"] { --msg-size: 17px; --fs-ui: 16px; --fs-compact: 15px; }
[data-size="xlarge"] { --msg-size: 19px; --fs-ui: 17px; --fs-compact: 16px; --fs-label: 14px; --fs-meta: 13px; }

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-ui)/1.45 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden; overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--iris-text); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 var(--s2); }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--iris-tint-strong); }
.grow { flex: 1 1 auto; min-width: 0; }
.only-light { display: none !important; }
[data-theme="light"] .only-light { display: revert !important; }
[data-theme="light"] .only-dark { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-label); }
.center { text-align: center; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 8px; top: -60px; z-index: 100; background: var(--iris); color: var(--on-iris); padding: 8px 12px; border-radius: var(--r-control); transition: top .15s; }
.skip-link:focus { top: 8px; }
.noscript { padding: 24px; }
.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg, [data-icon] svg, .icon-btn svg, .send-btn svg { width: 100%; height: 100%; display: block; }
.ic.tiny { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
kbd, .kbd { font: 500 11px/1 var(--font); color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 6px; padding: 4px 6px; background: var(--card); white-space: nowrap; }
code { font-family: var(--mono); font-size: .9em; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ Buttons & controls ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-control);
  font-size: var(--fs-compact); font-weight: 550; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn .ic { width: 17px; height: 17px; }
.btn.primary { background: var(--iris); color: var(--on-iris); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover:not(:disabled) { background: var(--hover); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(1.06); }
.btn.sm { min-height: 32px; padding: 0 var(--s3); font-size: var(--fs-label); }
.btn.lg { min-height: 48px; font-size: var(--fs-ui); }
.btn.block { width: 100%; }
.danger-text { color: var(--danger) !important; }
.link-btn { color: var(--iris-text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { text-decoration-thickness: 2px; }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-control); color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s3); border-radius: var(--r-pill);
  border: 1px solid var(--border-strong); color: var(--text-2); font-size: var(--fs-label); font-weight: 500; white-space: nowrap;
}
.chip-btn .ic { width: 15px; height: 15px; }
.chip-btn:hover { color: var(--text); background: var(--hover); }
.chip-btn.active { background: var(--iris-tint-strong); border-color: transparent; color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--border); font-size: var(--fs-meta); color: var(--text-2); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: var(--hover); color: var(--text-2); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }
.badge.warn { background: rgba(255, 202, 99, .14); color: var(--warning); }
.badge.mint { background: rgba(97, 242, 194, .12); color: var(--success); }
.badge.iris { background: var(--iris-tint-strong); color: var(--iris-text); }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r-control);
  background: var(--elevated); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--iris); box-shadow: 0 0 0 3px var(--iris-tint-strong); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--iris); width: 18px; height: 18px; margin: 0; flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field > label, .field > .label { font-size: var(--fs-label); font-weight: 550; color: var(--text-2); }
.field-row { display: flex; gap: var(--s3); align-items: flex-start; }
.field-row .field { min-width: 0; }
.field-row .field:not(.grow) { width: 120px; flex: none; }
.hint { font-size: var(--fs-label); color: var(--text-2); margin: 0; }
.form-error { color: var(--danger); font-size: var(--fs-label); min-height: 0; margin: 0 0 var(--s3); }
.form-error:empty { display: none; }
.notice { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3); border-radius: var(--r-control); background: var(--hover); color: var(--text-2); font-size: var(--fs-label); margin-bottom: var(--s4); }
.notice .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--iris-text); }
.notice.warn { background: rgba(255, 202, 99, .1); color: var(--warning); }
.notice.warn .ic { color: var(--warning); }
.notice.ok { background: rgba(97, 242, 194, .08); color: var(--success); }
.notice.ok .ic { color: var(--success); }
.check-row { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; cursor: pointer; }
.toggle-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .grow { display: flex; flex-direction: column; gap: 2px; }
.toggle-label { font-weight: 500; }
.toggle-row input { position: absolute; opacity: 0; right: 0; width: 44px; height: 26px; cursor: pointer; }
.switch { width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--hover); border: 1px solid var(--border-strong); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; width: 20px; height: 20px; top: 2px; left: 2px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease), background .2s; }
.toggle-row input:checked + .switch { background: var(--iris); border-color: transparent; }
.toggle-row input:checked + .switch::after { transform: translateX(18px); background: #fff; }
.toggle-row input:focus-visible + .switch { outline: 2px solid var(--iris); outline-offset: 2px; }
.choice-set { border: 0; padding: 0; margin: 0 0 var(--s5); }
.choice-set legend { font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.choice-set > .hint { margin-bottom: var(--s2); }
.choice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-control); margin-bottom: var(--s2); cursor: pointer; }
.choice:hover { background: var(--hover); }
.choice:has(input:checked) { border-color: var(--iris); background: var(--iris-tint); }
.choice input { margin-top: 2px; }
.choice > span { display: flex; flex-direction: column; gap: 2px; }
.choice-label { font-weight: 500; }
.radio-list { display: flex; flex-direction: column; gap: var(--s2); margin: var(--s3) 0; }
.radio-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r-control); text-align: left; }
.radio-row:hover { background: var(--hover); }
.radio-row.active { border-color: var(--iris); background: var(--iris-tint); }
.radio-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.radio-row.active .radio-dot { border: 5px solid var(--iris); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--iris); display: inline-block; animation: spin .8s linear infinite; }
.spinner.sm { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Avatars ============ */
.avatar {
  --av: 44px; width: var(--av); height: var(--av); flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; position: relative;
  font-size: calc(var(--av) * .38); font-weight: 600; color: var(--ink); letter-spacing: .01em; user-select: none;
}
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar.xs { --av: 24px; }
.avatar.sm { --av: 36px; }
.avatar.lg { --av: 64px; }
.avatar.xl { --av: 88px; }
.avatar.sq { border-radius: 12px; }
.avatar.sm.sq { border-radius: 10px; }
.avatar svg { width: 50%; height: 50%; }
/* Quiet, distinguishable avatar tints with ink initials (both themes pass 4.5:1). */
.av-0 { background: #DCE5DB; } .av-1 { background: #E4DED2; } .av-2 { background: #D7E2E4; } .av-3 { background: #EAD9D3; }
.av-4 { background: #E0DAE6; } .av-5 { background: #DDE3D0; } .av-6 { background: #EFE3CC; } .av-7 { background: #E2E4E1; }
[data-theme="dark"] .av-0 { background: #33443A; } [data-theme="dark"] .av-1 { background: #45402F; } [data-theme="dark"] .av-2 { background: #2F4246; } [data-theme="dark"] .av-3 { background: #4A3530; }
[data-theme="dark"] .av-4 { background: #3E3747; } [data-theme="dark"] .av-5 { background: #3A4530; } [data-theme="dark"] .av-6 { background: #4A3F28; } [data-theme="dark"] .av-7 { background: #3A3F3B; }
.avatar.room { background: var(--hover); color: var(--text-2); border-radius: 10px; font-weight: 700; }
.avatar.av-saved, .avatar.sm.sq:not([class*="av-"]) { background: var(--iris-tint-strong); color: var(--iris-text); }
.avatar.online::after { content: ''; position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 2px var(--elevated); }

/* ============ Launch reveal ============ */
.boot { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; place-items: center; }
.boot-mark { width: 44px; height: 44px; stroke: var(--accent); }

/* ============ Onboarding steps (the entry page itself is styled in the Aurora section) ============ */
.link-btn.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text-2); margin-bottom: var(--s5); }
.link-btn.back .ic { width: 16px; height: 16px; }
.steps { display: flex; gap: 6px; margin-bottom: var(--s5); }
.steps i { flex: 1; height: 3px; border-radius: 3px; background: var(--border-strong); }
.steps i.on { background: var(--iris); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px !important; }
.pw-toggle { position: absolute; right: 2px; top: 1px; }
.at-wrap { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-control); background: var(--elevated); padding-left: 12px; }
.at-wrap span { color: var(--muted); }
.at-wrap input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 4px !important; }
.at-wrap:focus-within { border-color: var(--iris); box-shadow: 0 0 0 3px var(--iris-tint-strong); }
.avatar-step { display: flex; flex-direction: column; align-items: center; gap: var(--s4); margin: var(--s4) 0 var(--s6); }
.privacy-list { list-style: none; padding: 0; margin: 0 0 var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.privacy-list li { display: flex; gap: var(--s3); color: var(--text-2); }
.privacy-list .ic { color: var(--iris-text); margin-top: 2px; }

/* ============ App layout ============ */
.layout {
  height: 100%; display: grid;
  grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr);
  grid-template-areas: 'rail side main';
}
.layout.info-open { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr) var(--info-w); grid-template-areas: 'rail side main info'; }
.rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s4) 0; background: var(--bg); border-right: 1px solid var(--border); }
.rail-logo { width: 28px; height: 28px; color: var(--iris); margin-bottom: var(--s5); }
.rail-item { position: relative; width: 56px; padding: var(--s2) 0 6px; border-radius: var(--r-control); display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); }
.rail-item > [data-icon] { width: 22px; height: 22px; }
.rail-label { font-size: 11px; font-weight: 550; }
.rail-item:hover { color: var(--text); background: var(--hover); }
.rail-item.active { color: var(--text); }
.rail-item.active > [data-icon] { color: var(--iris-text); }
.rail-item.active::before { content: ''; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--iris); }
.rail-me { border-radius: 50%; padding: 2px; }
.rail-me:hover { box-shadow: 0 0 0 2px var(--border-strong); }
.nav-badge { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--iris); color: var(--on-iris); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sidebar { grid-area: side; display: flex; flex-direction: column; min-height: 0; background: var(--elevated); border-right: 1px solid var(--border); }
.side-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s4) var(--s3) var(--s2) var(--s5); min-height: 64px; }
.side-title { flex: 1; font-size: var(--fs-section); font-weight: 650; }
.side-actions { display: flex; gap: var(--s1); }
.side-search { position: relative; margin: 0 var(--s4) var(--s3); }
.side-search input { padding-left: 38px !important; padding-right: 64px !important; min-height: 40px; background: var(--card) !important; border-color: transparent !important; }
.side-search input:focus-visible { border-color: var(--iris) !important; }
.search-ic { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.side-search .kbd { position: absolute; right: 8px; top: 9px; pointer-events: none; }
/* the shortcut hint only means something with a keyboard: hide it on touch-first screens (phones, tablets) */
@media (hover: none) and (pointer: coarse) { .side-search .kbd { display: none; } .side-search input { padding-right: 12px !important; } }
.side-filters { display: flex; gap: var(--s2); padding: 0 var(--s4) var(--s3); overflow-x: auto; scrollbar-width: none; }
.side-filters::-webkit-scrollbar { display: none; }
.conn-banner { display: flex; align-items: center; gap: var(--s2); margin: 0 var(--s4) var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-control); background: var(--hover); color: var(--text-2); font-size: var(--fs-label); }
.side-list { flex: 1; overflow-y: auto; padding: 0 var(--s2) var(--s4); }
.list-label { font-size: var(--fs-meta); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: var(--s4) var(--s3) var(--s2); }
.list-empty { color: var(--text-2); padding: var(--s4) var(--s3); font-size: var(--fs-compact); }
.list-row {
  width: 100%; display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s3); border-radius: var(--r-control); text-align: left; color: inherit;
}
.list-row:not(.static):hover { background: var(--hover); }
.list-row.active { background: var(--iris-tint); }
.list-row.static { cursor: default; }
.list-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-top, .list-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.list-title { font-weight: 550; font-size: var(--fs-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list-top .list-title { flex: 1; min-width: 0; }
.list-time { font-size: var(--fs-meta); color: var(--muted); flex: none; }
.list-sub { flex: 1; min-width: 0; font-size: var(--fs-compact); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.list-sub.typing { color: var(--success); }
.list-sub .sender { color: var(--text); }
.list-sub .draft { color: var(--danger); }
.has-unread .list-title { font-weight: 650; }
.has-unread .list-time { color: var(--iris-text); }
.unread-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--iris); color: var(--on-iris); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.unread-count.muted { background: var(--hover); color: var(--text-2); }
.row-icon { width: 14px; height: 14px; color: var(--muted); }
.row-action { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s3); border-radius: var(--r-control); color: var(--iris-text); font-weight: 550; }
.row-action:hover { background: var(--hover); }
.row-action .avatar { background: var(--iris-tint); color: var(--iris-text); }
.list-row .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--iris); flex: none; }
.act-text { font-size: var(--fs-compact); color: var(--text-2); line-height: 1.35; }
.act-text b { color: var(--text); font-weight: 600; }
.list-row.activity.unread { background: var(--iris-tint); }
.saved-item { padding: 0; gap: 0; }
.saved-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s3); text-align: left; border-radius: var(--r-control); }
.saved-open:hover { background: var(--hover); }
.list { display: flex; flex-direction: column; gap: 2px; }
.row-with-action { display: flex; align-items: center; gap: var(--s2); }

/* ============ Centre pane ============ */
.conversation { grid-area: main; position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.center-empty { flex: 1; display: grid; place-items: center; padding: var(--s8); }
.empty { max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s6) var(--s4); }
.empty-mark { width: 48px; height: 48px; color: var(--iris); opacity: .9; margin-bottom: var(--s3); }
.empty-mark svg { width: 100%; height: 100%; }
.empty h3 { font-size: var(--fs-section); }
.empty p { color: var(--text-2); }
.empty-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; margin-top: var(--s4); }
.side-list .empty { padding: var(--s8) var(--s4); }
.page-view { flex: 1; overflow-y: auto; min-height: 0; }
.page-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s6); min-height: 64px; background: var(--bg); border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: var(--fs-screen); }
.page-head p { margin: 0; font-size: var(--fs-label); }
.page-head .back-btn { display: none; }
.page-view > .tabs { padding: 0 var(--s6); }
.page-body { padding: var(--s6); max-width: 960px; }
.page-body.narrow { max-width: 680px; }
.page-loading { display: grid; place-items: center; padding: var(--s12); }
.page-section { margin-bottom: var(--s8); }
.page-section > h2, .settings-group > h2 { font-size: var(--fs-prominent); margin-bottom: var(--s3); }
.page-body > .btn { margin-bottom: var(--s4); }
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: var(--s3) var(--s3); color: var(--text-2); font-size: var(--fs-compact); font-weight: 550; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ''; position: absolute; left: var(--s3); right: var(--s3); bottom: -1px; height: 2px; border-radius: 2px; background: var(--iris); }
.tab-count { margin-left: 6px; color: var(--muted); font-weight: 500; }

/* ============ Conversation ============ */
.chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: var(--s1); padding: var(--s2) var(--s3) var(--s2) var(--s4); min-height: 64px; border-bottom: 1px solid var(--border); background: var(--bg); }
.chat-head .back-btn { display: none; }
.chat-head-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); text-align: left; padding: 4px var(--s2); border-radius: var(--r-control); }
.chat-head-info:hover { background: var(--hover); }
.chat-head-info .avatar { --av: 40px; }
.chat-head-text { display: flex; flex-direction: column; min-width: 0; }
.chat-crumb { font-size: var(--fs-meta); color: var(--iris-text); font-weight: 550; }
.chat-title { font-weight: 650; font-size: var(--fs-prominent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-status { font-size: var(--fs-label); color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.chat-status.online { color: var(--success); }
.chat-status.typing { color: var(--success); }
.status-timer { width: 13px; height: 13px; display: inline-flex; }
.banner { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--elevated); border-bottom: 1px solid var(--border); font-size: var(--fs-label); color: var(--text-2); }
.banner.warn { background: rgba(255, 202, 99, .08); color: var(--warning); }
.banner .ic { width: 18px; height: 18px; }
.pinned-bar { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4); background: var(--elevated); border-bottom: 1px solid var(--border); text-align: left; width: 100%; }
.pinned-bar:hover { background: var(--hover); }
.pin-icon { color: var(--iris-text); }
.pinned-bar .grow { display: flex; flex-direction: column; }
.pinned-label { font-size: var(--fs-meta); color: var(--iris-text); font-weight: 600; }
.pinned-text { font-size: var(--fs-label); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinned-x { width: 32px; height: 32px; }
.chat-search-bar { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s4); border-bottom: 1px solid var(--border); background: var(--elevated); }
.chat-search-bar input { flex: 1; }
.messages { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; min-height: 0; }
.messages-inner { max-width: 820px; margin: 0 auto; padding: var(--s4) var(--s5) var(--s3); display: flex; flex-direction: column; }
.msg-loading, .load-more { display: grid; place-items: center; padding: var(--s6); min-height: 40px; }
.convo-start { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s2); padding: var(--s8) var(--s4) var(--s6); }
.convo-start-title { font-weight: 650; font-size: var(--fs-prominent); max-width: 560px; text-wrap: balance; }
.convo-start-sub { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-label); }
.convo-start-sub .ic { width: 14px; height: 14px; color: var(--iris-text); }
.inline-error { text-align: center; color: var(--danger); padding: var(--s4); }
.system-msg { align-self: center; display: inline-flex; align-items: center; gap: 6px; margin: var(--s2) 0; padding: 4px var(--s3); border-radius: var(--r-pill); background: var(--elevated); color: var(--text-2); font-size: var(--fs-label); text-align: center; max-width: 90%; }
.system-msg .ic { width: 14px; height: 14px; }
.date-sep, .unread-sep { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0 var(--s2); color: var(--muted); font-size: var(--fs-meta); font-weight: 600; }
.date-sep::before, .date-sep::after, .unread-sep::before, .unread-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.unread-sep { color: var(--iris-text); }
.unread-sep::before, .unread-sep::after { background: var(--iris-tint-strong); }
.msg-row { display: flex; align-items: flex-end; gap: var(--s2); margin-top: 2px; }
.msg-row.first { margin-top: var(--s3); }
.msg-row.out { justify-content: flex-end; }
.msg-row.enter { animation: msg-in .2s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg-row.highlight .bubble { box-shadow: 0 0 0 2px var(--iris); }
.avatar-slot { width: 28px; flex: none; }
.avatar-slot .avatar { --av: 28px; }
.bubble {
  position: relative; max-width: min(560px, 78%); padding: 8px 12px 6px; border-radius: var(--r-bubble);
  background: var(--bubble-in); border: 1px solid var(--border); font-size: var(--msg-size); line-height: 1.45;
  overflow-wrap: anywhere; min-width: 64px;
}
.msg-row.in .bubble { border-bottom-left-radius: 6px; }
.msg-row.in:not(.last) .bubble { border-bottom-left-radius: 6px; }
.msg-row.in:not(.first) .bubble { border-top-left-radius: 6px; }
.msg-row.out .bubble { background: var(--bubble-out); border-color: var(--bubble-out-border); border-bottom-right-radius: 6px; }
.msg-row.out:not(.first) .bubble { border-top-right-radius: 6px; }
.bubble:focus-visible { outline-offset: 1px; }
.bubble.mention { box-shadow: inset 3px 0 0 var(--iris); }
.bubble.has-card { padding: 6px; min-width: 260px; }
.bubble.has-card > .msg-text { padding: 4px 6px; }
.bubble.has-card > .meta { padding: 0 6px 2px; }
.bubble.image-only { padding: 4px; }
.bubble.emoji-only { background: transparent; border-color: transparent; padding: 0 4px; }
.sender-name { font-size: var(--fs-label); font-weight: 650; color: var(--sender, var(--iris-text)); margin-bottom: 2px; }
.fwd-label { display: flex; align-items: center; gap: 4px; font-size: var(--fs-meta); color: var(--text-2); margin-bottom: 4px; font-style: italic; }
.fwd-label .ic { width: 13px; height: 13px; }
.reply-quote { display: flex; flex-direction: column; width: 100%; text-align: left; padding: 6px 10px; margin-bottom: 6px; border-radius: 8px; background: var(--hover); border-left: 3px solid var(--iris); }
.rq-name { font-size: var(--fs-label); font-weight: 600; color: var(--iris-text); }
.rq-text { font-size: var(--fs-label); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.msg-text { white-space: pre-wrap; }
.msg-text.deleted { color: var(--text-2); font-style: italic; }
.msg-text.big-emoji { font-size: 44px; line-height: 1.1; }
.meta { float: right; display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 -2px 10px; font-size: 11px; color: var(--muted); white-space: nowrap; user-select: none; line-height: 1.2; }
.meta-timer { width: 12px; height: 12px; display: inline-flex; }
.msg-state { display: inline-flex; align-items: center; gap: 3px; }
.msg-state .ic { width: 14px; height: 14px; }
.msg-state.failed { color: var(--danger); font-weight: 600; }
.msg-state.failed .ic { width: 13px; height: 13px; }
.retry-row { clear: both; display: flex; gap: var(--s3); justify-content: flex-end; padding-top: 4px; font-size: var(--fs-label); }
.reactions { clear: both; display: flex; flex-wrap: wrap; gap: 4px; padding-top: 6px; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); background: var(--hover); border: 1px solid var(--border); font-size: 13px; }
.reaction span { font-size: 11px; color: var(--text-2); }
.reaction.mine { border-color: var(--iris); background: var(--iris-tint); }
.typing-row .bubble { min-width: 0; }
.dots { display: inline-flex; gap: 4px; padding: 6px 2px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); opacity: .6; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.blocked-msg { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-bubble); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: var(--fs-label); }
.blocked-msg .ic { width: 14px; height: 14px; }
.ext-link { color: var(--iris-text); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.ext-ic { width: 12px; height: 12px; display: inline-flex; margin-left: 3px; vertical-align: -1px; }
.msg-image { position: relative; border-radius: 12px; overflow: hidden; background: var(--hover); cursor: zoom-in; max-width: 100%; }
.msg-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-image.loading::after { content: ''; position: absolute; inset: 0; background: var(--hover); }
.msg-image.failed { display: grid; place-items: center; color: var(--text-2); font-size: var(--fs-label); min-height: 80px; cursor: default; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.link-preview { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--hover); border-left: 3px solid var(--border-strong); text-decoration: none; color: var(--text); }
.link-preview:hover { border-left-color: var(--iris); }
.lp-host { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-meta); color: var(--text-2); }
.lp-host .ic { width: 12px; height: 12px; }
.lp-title { font-weight: 600; font-size: var(--fs-compact); }
.lp-desc { font-size: var(--fs-label); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- cards inside messages ---------- */
.card { border-radius: 12px; background: var(--elevated); border: 1px solid var(--border); padding: var(--s3); display: flex; flex-direction: column; gap: 6px; }
.msg-row.out .card { background: var(--bg); }
[data-theme="light"] .msg-row.out .card { background: #fff; }
.card + .msg-text, .card + .meta { margin-top: 4px; }
.card-head { display: flex; align-items: center; gap: 6px; font-size: var(--fs-label); font-weight: 600; color: var(--text-2); }
.card-head .ic { width: 16px; height: 16px; color: var(--iris-text); }
.card-head .badge { margin-left: auto; }
.card-amount { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card-note { font-size: var(--fs-compact); }
.card-title { font-weight: 600; font-size: var(--fs-ui); }
.card-meta { font-size: var(--fs-label); color: var(--text-2); }
.card-foot { display: flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--text-2); border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; }
.card-foot .ic { width: 13px; height: 13px; }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: 4px; }
.status-chip { align-self: flex-start; display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-meta); font-weight: 600; background: var(--hover); color: var(--text-2); }
.status-chip .muted { font-weight: 500; margin-left: 2px; }
.st-marked_paid, .st-paid { background: rgba(97, 242, 194, .12); color: var(--success); }
.st-cancelled, .st-declined, .st-expired { background: var(--hover); color: var(--muted); text-decoration: line-through; }
.st-requested, .st-open { background: var(--iris-tint); color: var(--iris-text); }
.payreq.s-cancelled .card-amount { color: var(--muted); text-decoration: line-through; }
.ledger { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.ledger li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.ledger .grow { display: flex; flex-direction: column; }
.ledger-type { font-weight: 550; }
.ledger .plus { color: var(--success); font-variant-numeric: tabular-nums; }
.ledger .minus { color: var(--text-2); font-variant-numeric: tabular-nums; }
.poll-q { font-weight: 600; margin-bottom: 2px; }
.poll-opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: var(--s2); min-height: 38px; padding: 0 var(--s3); border-radius: var(--r-control); border: 1px solid var(--border-strong); text-align: left; }
.poll-opt.mine { border-color: var(--iris); }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--iris-tint); transition: width .3s var(--ease); }
.poll-label { position: relative; flex: 1; }
.poll-pct { position: relative; font-size: var(--fs-label); color: var(--text-2); font-variant-numeric: tabular-nums; }
.poll-edit { display: flex; flex-direction: column; gap: var(--s2); }
.place-name { font-weight: 600; }
.legacy .ic { color: var(--muted) !important; }
.call-log { display: flex; align-items: center; gap: var(--s3); padding: 2px 0; text-align: left; }
.call-log-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--iris-tint); color: var(--iris-text); display: grid; place-items: center; }
.call-log-icon svg { width: 18px; height: 18px; }
.call-log.missed .call-log-icon { background: rgba(255, 100, 124, .12); color: var(--danger); }
.call-log-text { display: flex; flex-direction: column; }
.call-log-title { font-weight: 550; }
.call-log-sub { font-size: var(--fs-label); color: var(--text-2); }
.file-card { display: flex; align-items: center; gap: var(--s3); padding: 6px; text-align: left; width: 100%; max-width: 320px; border-radius: var(--r-control); }
.file-card:hover { background: var(--hover); }
.file-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--iris-tint); color: var(--iris-text); display: grid; place-items: center; }
.file-icon svg, .file-dl svg { width: 20px; height: 20px; }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: var(--fs-label); color: var(--text-2); }
.file-dl { color: var(--text-2); width: 20px; height: 20px; }
.voice { display: flex; align-items: center; gap: var(--s3); min-width: 240px; padding: 2px 0; }
.voice-play { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--iris); color: var(--on-iris); display: grid; place-items: center; }
.voice-play svg { width: 18px; height: 18px; }
.voice-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 26px; }
.voice-wave i { width: 3px; border-radius: 3px; background: var(--border-strong); flex: none; }
.voice-wave i.on { background: var(--iris); }
.voice-time { font-size: var(--fs-meta); color: var(--text-2); font-variant-numeric: tabular-nums; }
.voice-rate { min-width: 40px; height: 26px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); font-size: var(--fs-meta); font-weight: 600; color: var(--text-2); }
.target-progress { display: flex; flex-direction: column; gap: 6px; }
.tp-line { font-size: var(--fs-compact); }
.tp-line b { font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 8px; background: var(--hover); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--iris); transition: width .4s var(--ease); }
.targets { display: flex; flex-direction: column; gap: var(--s3); }
.targets > .btn { align-self: flex-start; }
.target-item { border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s4); background: var(--card); display: flex; flex-direction: column; gap: var(--s3); }
.target-item.focus { border-color: var(--iris); }
.target-item.closed { opacity: .75; }
.target-item header { display: flex; align-items: center; gap: var(--s2); }
.target-item h3 { font-size: var(--fs-prominent); }
.entry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.entry-list li { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-label); color: var(--text-2); }
.entry-list .icon-btn { width: 28px; height: 28px; }
.entry-list .icon-btn svg { width: 14px; height: 14px; }
.ext-host { display: flex; align-items: center; gap: 6px; font-family: var(--mono); padding: var(--s2) var(--s3); background: var(--hover); border-radius: var(--r-control); }

/* ---------- scroll-to-latest, composer ---------- */
.scroll-down { position: absolute; right: var(--s5); bottom: 92px; width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); color: var(--text-2); display: grid; place-items: center; z-index: 3; }
.scroll-down [data-icon] { width: 20px; height: 20px; }
.scroll-down .nav-badge { top: -6px; right: -4px; }
.composer-wrap { position: relative; padding: var(--s2) var(--s4) var(--s4); max-width: 860px; width: 100%; margin: 0 auto; }
.composer {
  display: flex; align-items: flex-end; gap: var(--s1); padding: 6px; border-radius: var(--r-panel);
  background: var(--elevated); border: 1px solid var(--border-strong); transition: border-color .15s;
}
.composer:focus-within { border-color: var(--iris); }
.composer textarea {
  flex: 1; min-height: 40px !important; max-height: 200px; resize: none; border: 0 !important; background: transparent !important; box-shadow: none !important;
  padding: 9px 6px !important; font-size: var(--msg-size); line-height: 1.4;
}
.send-btn { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--iris); color: var(--on-iris); }
.send-btn svg { width: 20px; height: 20px; }
.send-btn.mic { background: transparent; color: var(--text-2); }
.send-btn.mic:hover { background: var(--hover); color: var(--text); }
.composer #send-btn { display: none; }
.composer.has-content #send-btn { display: grid; }
.composer.has-content #mic-btn { display: none; }
.composer-bar, .attach-preview, .composer-locked {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); margin-bottom: var(--s2);
  border-radius: var(--r-control); background: var(--elevated); border: 1px solid var(--border);
}
.bar-icon { width: 20px; height: 20px; color: var(--iris-text); }
.bar-icon svg { width: 100%; height: 100%; }
.bar-title { font-size: var(--fs-label); font-weight: 600; color: var(--iris-text); }
.bar-sub { font-size: var(--fs-label); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-preview img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.composer-locked { color: var(--text-2); font-size: var(--fs-compact); margin-bottom: 0; padding: var(--s3) var(--s4); }
.composer-locked .ic { color: var(--iris-text); }
.emoji-panel { position: absolute; bottom: calc(100% - 4px); right: var(--s4); width: min(360px, calc(100vw - 32px)); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: var(--s2); background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--r-card); box-shadow: var(--shadow); z-index: 5; }
.emoji-panel button, .emoji-grid button { height: 38px; border-radius: 8px; font-size: 22px; }
.emoji-panel button:hover, .emoji-grid button:hover { background: var(--hover); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 2px; }
.recorder { display: flex; align-items: center; gap: var(--s3); padding: 6px 6px 6px var(--s2); border-radius: var(--r-panel); background: var(--elevated); border: 1px solid var(--iris); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
.rec-time { font-variant-numeric: tabular-nums; font-size: var(--fs-compact); min-width: 40px; }
.rec-wave { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 2px; height: 28px; overflow: hidden; }
.rec-wave i { width: 3px; border-radius: 3px; background: var(--iris); flex: none; }
.rec-hint { font-size: var(--fs-meta); color: var(--text-2); }
.recorder.cancelling { border-color: var(--danger); }

/* ============ Details panel ============ */
.info-panel { grid-area: info; overflow-y: auto; background: var(--elevated); border-left: 1px solid var(--border); padding-bottom: var(--s6); }
.info-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s3) var(--s3) var(--s5); min-height: 64px; }
.info-head h2 { flex: 1; font-size: var(--fs-ui); }
.info-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: var(--s2) var(--s5) var(--s4); }
.info-hero h3 { font-size: var(--fs-section); margin-top: var(--s2); }
.status-line { font-size: var(--fs-compact); color: var(--text); }
.group-desc { color: var(--text-2); font-size: var(--fs-compact); white-space: pre-wrap; margin-top: var(--s2); }
.info-hero .chip-btn { margin-top: var(--s2); }
.info-actions { display: flex; justify-content: center; gap: var(--s2); padding: 0 var(--s4) var(--s4); flex-wrap: wrap; }
.info-action { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: var(--s2); border-radius: var(--r-control); font-size: var(--fs-meta); color: var(--text-2); }
.info-action .ic { width: 20px; height: 20px; color: var(--iris-text); }
.info-action:hover { background: var(--hover); color: var(--text); }
.info-panel .tabs { padding: 0 var(--s3); }
.info-section { padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.info-section .btn.block { justify-content: flex-start; }
.info-row { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s2); border-radius: var(--r-control); text-align: left; width: 100%; }
.info-row > .ic { margin-top: 2px; color: var(--text-2); }
.info-btn:hover { background: var(--hover); }
.danger-zone { border-top: 1px solid var(--border); margin-top: var(--s2); padding-top: var(--s4); }
.member { display: flex; align-items: center; gap: var(--s1); }
.member-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--r-control); text-align: left; }
.member-main:hover { background: var(--hover); }
.member-main .grow { display: flex; flex-direction: column; }
.member .name { font-weight: 550; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: var(--s3) var(--s4); }
.media-grid.big { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 0; }
.media-grid button { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--hover); }
.media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.files-list .voice { min-width: 0; }

/* ============ Menus, dialogs, toasts ============ */
.context-menu { position: fixed; z-index: 60; min-width: 220px; max-width: 300px; padding: 6px; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--r-card); box-shadow: var(--shadow); }
.context-menu > button { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: 9px 10px; border-radius: 8px; text-align: left; font-size: var(--fs-compact); }
.context-menu > button:hover, .context-menu > button:focus-visible { background: var(--hover); outline: none; }
.context-menu > button .ic { color: var(--text-2); }
.context-menu > button.danger { color: var(--danger); }
.context-menu > button.danger .ic { color: var(--danger); }
.context-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.menu-section { padding: 8px 10px 4px; font-size: var(--fs-meta); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.menu-reactions { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-reactions button { width: 36px; height: 36px; border-radius: 50%; font-size: 20px; display: grid; place-items: center; }
.menu-reactions button:hover, .menu-reactions button.mine { background: var(--iris-tint-strong); }
.menu-reactions .more-react { color: var(--text-2); }
.menu-reactions .more-react svg { width: 18px; height: 18px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: var(--s4); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 100%); max-height: min(86vh, 860px); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--r-panel); box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.modal.wide { width: min(640px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s4) var(--s3) var(--s2) var(--s5); }
.modal-head h2 { flex: 1; font-size: var(--fs-prominent); }
.modal-body { padding: var(--s2) var(--s5) var(--s4); overflow-y: auto; }
.modal-body > p, .modal-body > div > p { color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s5) var(--s5); border-top: 1px solid var(--border); }
.picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; margin-bottom: var(--s2); }
.picker-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--r-control); text-align: left; width: 100%; }
.picker-item:hover:not(:disabled) { background: var(--hover); }
.picker-item.selected { background: var(--iris-tint); }
.picker-item .grow { display: flex; flex-direction: column; }
.picker-item .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; color: #fff; flex: none; }
.picker-item.selected .check { background: var(--iris); border-color: var(--iris); }
.picker-item .check svg { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s3); }
.chips .chip { height: 30px; color: var(--text); padding-right: 4px; }
.chip-x { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.chip-x svg { width: 14px; height: 14px; }
.evidence-box { border: 1px solid var(--border); border-radius: var(--r-control); padding: var(--s3); margin-bottom: var(--s3); }
blockquote { margin: var(--s2) 0 0; padding: var(--s2) var(--s3); border-left: 3px solid var(--border-strong); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.legal h3 { font-size: var(--fs-ui); margin: var(--s4) 0 var(--s2); }
.legal-list { margin: 0 0 var(--s3); padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.draft-note { font-size: var(--fs-meta); font-weight: 650; letter-spacing: .04em; color: var(--warning); margin-top: var(--s4); }
.safety-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin: var(--s4) 0; font-family: var(--mono); font-size: var(--fs-prominent); text-align: center; }
.safety-grid span { padding: var(--s2); background: var(--hover); border-radius: 8px; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .9); display: grid; place-items: center; padding: var(--s4); cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 80; max-width: min(520px, calc(100vw - 32px)); padding: var(--s3) var(--s4); border-radius: var(--r-control); background: var(--text); color: var(--bg); font-size: var(--fs-compact); font-weight: 500; box-shadow: var(--shadow); animation: pop .18s var(--ease); }
.skeleton-list { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s3); }
.skeleton-row { display: flex; gap: var(--s3); align-items: center; }
.skeleton-row i { width: 36px; height: 36px; border-radius: 50%; background: var(--hover); }
.skeleton-row span { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-row b, .skeleton-row em { display: block; height: 10px; border-radius: 6px; background: var(--hover); }
.skeleton-row b { width: 60%; } .skeleton-row em { width: 85%; }

/* ---------- quick search (Ctrl/Cmd+K) ---------- */
.cmd-overlay { position: fixed; inset: 0; z-index: 55; background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 12vh var(--s4) var(--s4); }
.cmd-box { width: min(600px, 100%); background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--r-panel); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.cmd-field { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
.cmd-icon { width: 20px; height: 20px; color: var(--text-2); }
.cmd-input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 6px 0 !important; font-size: var(--fs-prominent); }
.cmd-list { overflow-y: auto; padding: var(--s2); }
.cmd-group { font-size: var(--fs-meta); font-weight: 600; color: var(--muted); padding: var(--s3) var(--s2) 4px; text-transform: uppercase; letter-spacing: .04em; }
.cmd-item { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s2); border-radius: 8px; text-align: left; }
.cmd-item.active { background: var(--iris-tint-strong); }
.cmd-item .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-2); }
.cmd-item-icon svg { width: 18px; height: 18px; }
.cmd-hint { font-size: var(--fs-meta); color: var(--muted); }
.cmd-empty { padding: var(--s6); text-align: center; color: var(--text-2); }
.cmd-foot { display: flex; gap: var(--s4); padding: var(--s2) var(--s4); border-top: 1px solid var(--border); font-size: var(--fs-meta); color: var(--muted); }
.cmd-foot kbd { margin-right: 2px; }

/* ============ Settings ============ */
.settings-me { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-card); text-align: left; margin-bottom: var(--s3); }
.settings-me:hover { background: var(--hover); }
.settings-me .grow { display: flex; flex-direction: column; }
.me-name { font-weight: 650; font-size: var(--fs-prominent); }
.settings-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--s3); }
.set-row { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s3); border-radius: var(--r-control); text-align: left; }
.set-row:hover { background: var(--hover); }
.set-row.active { background: var(--iris-tint); }
.set-row.danger { color: var(--danger); }
.set-icon { width: 20px; height: 20px; color: var(--text-2); display: inline-flex; }
.set-row.danger .set-icon { color: var(--danger); }
.set-row .grow { display: flex; flex-direction: column; }
.set-label { font-weight: 500; }
.set-sub { font-size: var(--fs-label); color: var(--text-2); }
.set-value { font-size: var(--fs-label); color: var(--text-2); }
.chev { width: 16px; height: 16px; color: var(--muted); display: inline-flex; }
.settings-foot { color: var(--muted); font-size: var(--fs-meta); padding: var(--s3); }
.settings-group { padding: var(--s5) 0; border-bottom: 1px solid var(--border); }
.settings-group:last-child { border-bottom: 0; }
.settings-group > p { color: var(--text-2); }
.settings-group > .btn { margin-top: var(--s2); }
.avatar-row { display: flex; align-items: center; gap: var(--s5); }
.avatar-row > div { display: flex; gap: var(--s2); flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: 0; }
.facts dt { color: var(--text-2); font-size: var(--fs-label); padding-top: 1px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.shortcuts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s3) var(--s4); align-items: center; margin: 0; }
.shortcuts dd { margin: 0; color: var(--text-2); }
.event-log { list-style: none; margin: 0; padding: 0; }
.event-log li { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-compact); }
.invite-box { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); border-radius: var(--r-card); border: 1px solid var(--iris); background: var(--iris-tint); margin: var(--s4) 0; }
.invite-box code { padding: var(--s2); background: var(--elevated); border-radius: 8px; word-break: break-all; }
.invite-box .btn { align-self: flex-start; }
.about-hero { padding: var(--s6) 0 var(--s2); }
.lead { font-size: var(--fs-prominent); }

/* ============ Spaces ============ */
.space-head h1 { font-size: var(--fs-screen); }
.announce { width: 100%; display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-radius: var(--r-card); background: var(--card); border: 1px solid var(--border); text-align: left; }
.announce:hover { border-color: var(--border-strong); }
.announce .ic { color: var(--iris-text); }
.event-list { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s3); }
.event { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s4); border-radius: var(--r-card); background: var(--card); border: 1px solid var(--border); }
.event.cancelled { opacity: .7; }
.event h3 { font-size: var(--fs-ui); margin-bottom: 4px; }
.event p { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.event p.prewrap { display: block; }
.event p .ic { width: 14px; height: 14px; }
.event-date { width: 52px; flex: none; text-align: center; border-radius: 12px; background: var(--iris-tint); padding: 6px 0; display: flex; flex-direction: column; }
.event-date b { font-size: var(--fs-section); line-height: 1.1; }
.event-date span { font-size: var(--fs-meta); color: var(--iris-text); text-transform: uppercase; font-weight: 600; }
.rsvp { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.role-chip { font-size: var(--fs-meta); font-weight: 600; padding: 3px 8px; border-radius: var(--r-pill); background: var(--hover); color: var(--text-2); }
.role-chip.r-owner { background: var(--iris-tint-strong); color: var(--iris-text); }
.role-chip.r-admin { background: var(--iris-tint); color: var(--iris-text); }
.roles-help { margin: var(--s3) 0; color: var(--text-2); font-size: var(--fs-compact); }
.roles-help summary { cursor: pointer; font-weight: 550; color: var(--text); margin-bottom: var(--s2); }

/* ============ Admin ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.stat-tile { display: flex; flex-direction: column; gap: 2px; padding: var(--s4); border-radius: var(--r-card); background: var(--card); border: 1px solid var(--border); text-align: left; }
.stat-tile:hover { border-color: var(--border-strong); }
.stat-tile b { font-size: var(--fs-screen); font-variant-numeric: tabular-nums; }
.stat-tile span { color: var(--text-2); font-size: var(--fs-label); }
.filters { display: flex; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; }
.report-list { display: flex; flex-direction: column; gap: var(--s3); }
.report { padding: var(--s4); border-radius: var(--r-card); background: var(--card); border: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--s3); }
.report header { display: flex; align-items: center; gap: var(--s2); font-weight: 600; }
.report header .badge { margin-left: 0; }
.evidence { padding: var(--s2) var(--s3); background: var(--hover); border-radius: 8px; font-size: var(--fs-compact); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-card); margin-bottom: var(--s4); }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-compact); }
.admin-table th { text-align: left; font-size: var(--fs-meta); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: var(--s3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.cell-user { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; }

/* ============ Calls ============ */
.call-screen { position: fixed; inset: 0; z-index: 65; background: #05060A; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s6); }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.call-local { position: absolute; right: var(--s4); top: var(--s4); width: 28%; max-width: 180px; border-radius: var(--r-card); border: 1px solid rgba(255, 255, 255, .2); z-index: 2; }
.call-info { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; }
.call-name { font-size: var(--fs-screen); font-weight: 650; }
.call-status { display: flex; align-items: center; gap: 6px; color: #C9CED9; }
.call-lock { width: 14px; height: 14px; display: inline-flex; }
.call-controls { position: absolute; bottom: 48px; z-index: 2; display: flex; gap: var(--s4); }
.call-choice { display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.call-btn { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.call-btn svg { width: 24px; height: 24px; }
.call-btn.end { background: #E5484D; }
.call-btn.accept { background: #2FB37F; }
.call-btn.off { background: #fff; color: #111; }
.call-screen.docked { inset: auto var(--s4) var(--s4) auto; width: 280px; height: 200px; border-radius: var(--r-panel); box-shadow: var(--shadow); cursor: grab; gap: var(--s2); overflow: hidden; }
.call-screen.docked .call-name { font-size: var(--fs-ui); }
.call-screen.docked .call-controls { bottom: var(--s3); gap: var(--s2); }
.call-screen.docked .call-btn { width: 40px; height: 40px; }
.call-screen.docked .avatar { --av: 48px; }
.call-screen.docked .call-local { display: none; }

/* ============ Bottom navigation (mobile) ============ */
.bottom-nav { display: none; }

/* ============ Responsive ============ */
@media (max-width: 1279px) {
  :root { --side-w: 320px; --info-w: 340px; }
  .layout.info-open { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); grid-template-areas: 'rail side main'; }
  .info-panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--info-w), 92vw); z-index: 40; box-shadow: var(--shadow); }
}
@media (max-width: 1023px) {
  :root { --side-w: 300px; --rail-w: 64px; }
  .rail-label { font-size: 10px; }
  .rail-item { width: 52px; }
  .page-body { padding: var(--s5); }
  .hide-sm { display: none; }
}
@media (max-width: 767px) {
  body { font-size: var(--fs-ui); }
  .layout, .layout.info-open { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: 'side' 'nav'; height: 100dvh; }
  .rail { display: none; }
  .sidebar { grid-area: side; border-right: 0; }
  .conversation { grid-area: side; display: none; }
  .layout.chat-open .sidebar { display: none; }
  .layout.chat-open .conversation { display: flex; }
  .layout.chat-open { grid-template-rows: minmax(0, 1fr); grid-template-areas: 'side'; }
  .layout.chat-open .bottom-nav { display: none; }
  .bottom-nav { grid-area: nav; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--elevated); border-top: 1px solid var(--border); }
  .bn-item { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: 11px; font-weight: 550; color: var(--muted); border-radius: var(--r-control); }
  .bn-item [data-icon] { width: 22px; height: 22px; }
  .bn-item.active { color: var(--text); }
  .bn-item.active [data-icon] { color: var(--iris-text); }
  .bn-item .nav-badge { top: 0; right: calc(50% - 22px); }
  .side-head { padding-left: var(--s4); padding-top: calc(var(--s3) + env(safe-area-inset-top)); }
  .chat-head .back-btn, .page-head .back-btn { display: inline-flex; }
  .chat-head { padding: calc(var(--s2) + env(safe-area-inset-top)) var(--s2) var(--s2); }
  .chat-head-info .avatar { --av: 36px; }
  #chat-search-btn, #chat-info-btn { display: none; }
  .messages-inner { padding: var(--s3) var(--s3) var(--s2); }
  .bubble { max-width: 86%; }
  .bubble.has-card { min-width: 0; max-width: 92%; }
  .composer-wrap { padding: var(--s2) var(--s2) calc(var(--s2) + env(safe-area-inset-bottom)); }
  .scroll-down { right: var(--s3); bottom: 84px; }
  .page-head { padding: calc(var(--s3) + env(safe-area-inset-top)) var(--s3) var(--s3); }
  .page-head h1 { font-size: var(--fs-section); }
  .page-view > .tabs { padding: 0 var(--s3); }
  .page-body { padding: var(--s4); }
  .info-panel { width: 100vw; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: var(--r-panel) var(--r-panel) 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: var(--s2); }
  .field-row { flex-direction: column; gap: 0; }
  .field-row .field:not(.grow) { width: 100%; }
  .event { flex-direction: column; gap: var(--s2); }
  .call-screen.docked { width: 200px; height: 150px; }
  .toast { bottom: 88px; }
}
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .list-row, .set-row { min-height: 52px; }
}

/* ============ Motion & contrast preferences ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
@media (forced-colors: active) {
  .btn, .chip-btn, .bubble, .card, .composer { border: 1px solid CanvasText; }
  .unread-count, .nav-badge { forced-color-adjust: none; }
}

/* ---------- wallet address on payment requests ---------- */
.wallet-fields { border: 1px solid var(--border); border-radius: var(--r-control); padding: var(--s3); margin: 0 0 var(--s3); min-width: 0; }
.wallet-fields legend { padding: 0 6px; font-size: var(--fs-label); color: var(--text-2); }
.wallet-foot { word-break: break-all; }
.wallet-dialog .wallet-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s3); margin: 0 0 var(--s3); font-size: var(--fs-compact); }
.wallet-dialog .wallet-facts dt { color: var(--text-2); }
.wallet-dialog .wallet-facts dd { margin: 0; }
.wallet-dialog .qr-box { width: min(220px, 70vw); margin: 0 auto var(--s3); border-radius: var(--r-control); overflow: hidden; background: #fff; }
.wallet-dialog .qr-box svg { display: block; width: 100%; height: auto; }
.wallet-dialog .wallet-addr { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-compact); word-break: break-all; user-select: all; padding: var(--s2) var(--s3); border-radius: var(--r-control); background: var(--hover); margin: 0 0 var(--s3); }
.wallet-dialog .wallet-checks { padding-left: 1.2em; display: grid; gap: 4px; }

/* ---------- admin: data retention summary ---------- */
.retention-box { margin-top: var(--s5); }
.retention-box h3 { font-size: var(--fs-compact); margin: 0 0 var(--s2); }
.pw-help { margin-top: var(--s3); font-size: var(--fs-label); color: var(--text-2); }
.pw-help summary { cursor: pointer; }
.pw-help p { margin-top: var(--s2); }

/* ============ Your line (one introduction each) ============ */
.line-hero { padding: var(--s2) 0 var(--s4); }
.kicker { display: inline-block; font-size: var(--fs-meta); font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--iris-text); margin-bottom: var(--s2); }
.line-title { font-size: var(--fs-display); line-height: 1.1; margin: 0 0 var(--s2); }
.intro-card { border: 1px solid var(--border-strong); border-radius: var(--r-panel); padding: var(--s5); margin: 0 0 var(--s5); background: var(--elevated); }
.intro-card h3 { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-prominent); margin: 0 0 var(--s2); }
.intro-card h3 .ic { width: 20px; height: 20px; color: var(--iris-text); }
.intro-card.forfeited h3 .ic { color: var(--warning); }
.intro-card.used h3 .ic { color: var(--success); }
.intro-person { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-card); background: var(--hover); margin: var(--s2) 0; }
.intro-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.intro-link .qr-box { width: min(220px, 70vw); margin: var(--s3) 0; border-radius: var(--r-card); overflow: hidden; background: #fff; padding: 8px; }
.intro-link .qr-box svg { display: block; width: 100%; height: auto; }
.line-section h3 { font-size: var(--fs-prominent); margin: var(--s6) 0 var(--s3); }
.line-thread { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.line-thread::before { content: ''; position: absolute; left: 23px; top: 22px; bottom: 22px; width: 2px; border-radius: 2px; background: var(--border-strong); opacity: .7; }
.line-node { position: relative; display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3) var(--s2) 0; border-radius: var(--r-card); }
.line-node .node-dot { display: none; }
.line-node .avatar { position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.line-node.you { background: var(--iris-tint); }
.line-node.you .avatar { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--iris); }
.line-node.removed { opacity: .6; }
.node-anon { background: var(--hover); color: var(--muted); }
.node-body { display: flex; flex-direction: column; min-width: 0; }
.node-name { font-weight: 600; }
.node-meta { font-size: var(--fs-label); color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.node-meta .badge { margin-left: 2px; }
/* onboarding: "You've been introduced" */
.intro-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s2); margin-bottom: var(--s4); }
.intro-seal { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); padding: 3px; margin-bottom: var(--s2); }
.intro-seal span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-size: 28px; font-weight: 700; letter-spacing: .02em; }
.intro-lead { font-size: var(--fs-prominent); margin: 0; }
.intro-note { margin: var(--s2) 0 0; padding: var(--s3) var(--s4); border-left: 3px solid var(--iris); border-radius: 0 var(--r-control) var(--r-control) 0; background: var(--hover); font-style: italic; text-align: left; }
.intro-note cite { display: block; margin-top: 4px; font-style: normal; font-size: var(--fs-label); color: var(--text-2); }

/* ============ Verify in person & trust status ============ */
.chat-title-row { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.chat-title-row .chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trust-badge { width: 16px; height: 16px; flex: none; display: inline-flex; }
.trust-badge svg { width: 100%; height: 100%; }
.trust-badge.verified { color: var(--success); }
.trust-badge.changed { color: var(--warning); }
.verify-grid { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: var(--s4); align-items: center; margin: var(--s4) 0; }
.verify-dialog .qr-box { border-radius: var(--r-card); overflow: hidden; background: #fff; padding: 8px; }
.verify-dialog .qr-box svg { display: block; width: 100%; height: auto; }
.safety-symbols { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); counter-reset: sym; }
.safety-symbols li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s3) var(--s2); border-radius: var(--r-card); background: var(--hover); font-size: var(--fs-label); counter-increment: sym; position: relative; }
.safety-symbols li::before { content: counter(sym); position: absolute; top: 6px; left: 8px; font-size: 10px; color: var(--muted); }
.safety-symbols .sym { font-size: 30px; line-height: 1.1; }
.verify-numbers { margin-top: var(--s3); }
.verify-numbers summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-label); }
@media (max-width: 767px) {
  .verify-grid { grid-template-columns: 1fr; }
  .verify-dialog .qr-box { width: min(220px, 70vw); margin: 0 auto; }
  .line-title { font-size: var(--fs-screen); }
}

/* =====================================================================
   Private Intelligence (on-device AI): catch-up card, translations, writing help, settings
   ===================================================================== */
.ai-chip-row { display: flex; justify-content: center; margin: calc(-1 * var(--s1)) 0 var(--s3); }
.ai-chip { display: inline-flex; align-items: center; gap: var(--s2); height: 34px; padding: 0 var(--s4); border-radius: var(--r-pill);
  font-size: var(--fs-label); font-weight: 600; color: var(--text); border: 1px solid var(--border); background: var(--surface); min-height: 44px; }
.ai-chip .ic { width: 15px; height: 15px; color: var(--accent); }
.ai-chip:hover { background: var(--hover); }

.ai-card { position: relative; margin: var(--s2) auto var(--s4); width: min(640px, 100%); padding: var(--s4) var(--s5) var(--s3);
  border-radius: var(--r-panel); background: var(--glass-strong); border: 1px solid var(--glass-border);
  overflow: hidden; }
.ai-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s2); }
.ai-badge { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--accent); background: var(--surface-2); }
.ai-badge .ic { width: 16px; height: 16px; }
.ai-head .grow { display: flex; flex-direction: column; }
.ai-title { font-weight: 700; }
.ai-sub { font-size: var(--fs-meta); color: var(--text-2); }
.ai-points { margin: var(--s1) 0 var(--s2); padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; overflow-wrap: anywhere; }
ul.ai-points li { position: relative; padding-left: 18px; }
ul.ai-points li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); }
.ai-status { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: var(--fs-compact); margin: var(--s1) 0 var(--s2); }
.ai-status.error { color: var(--danger); }
.ai-foot { display: flex; align-items: center; gap: 6px; margin: var(--s2) 0 0; padding-top: var(--s2); border-top: 1px solid var(--glass-border); font-size: var(--fs-meta); color: var(--text-2); }
.ai-foot .ic { width: 13px; height: 13px; }
.ai-card .icon-btn.sm { width: 32px; height: 32px; }
.ai-card .icon-btn.sm svg { width: 16px; height: 16px; }

.msg-translation { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--glass-border); }
.tr-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--text-2); }
.tr-label .ic { width: 13px; height: 13px; color: var(--text-2); }
.msg-translation.error .tr-label { color: var(--danger); }
.tr-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.msg-row.out .tr-label, .msg-row.out .tr-label .ic { color: var(--text-2); }

.ai-label { display: inline-flex; align-items: center; gap: 3px; }
.ai-label .ic { width: 11px; height: 11px; color: var(--text-2); }
.msg-row.out .ai-label .ic { color: var(--text-2); }

.ai-write-btn { color: var(--text-2); }
.ai-write-btn:hover { color: var(--text); background: var(--hover); }
.ai-write-btn.busy { color: var(--text-2); }
.ai-bar, .ai-progress { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); padding: var(--s2) var(--s3); border-radius: 14px;
  font-size: var(--fs-label); color: var(--text-2); background: var(--glass-strong); border: 1px solid var(--glass-border); }
.ai-bar[hidden], .ai-progress[hidden] { display: none; }
.ai-bar-icon { width: 16px; height: 16px; color: var(--accent); flex: none; }
.ai-bar .link-btn { font-weight: 600; }
.menu-note { display: flex; align-items: center; gap: 6px; padding: 6px 10px 4px; font-size: var(--fs-meta); color: var(--text-2); max-width: 260px; }
.menu-note .ic { width: 13px; height: 13px; }

.ai-hero { padding: var(--s2) 0 var(--s5); }
.ai-hero h2 { font-size: var(--fs-screen); font-weight: 650; letter-spacing: -0.02em; margin: var(--s2) 0; }
.ai-hero .kicker { font-size: 12px; font-weight: 650; letter-spacing: .24em; text-transform: uppercase; }
.ai-cap { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.ai-cap:last-child { border-bottom: 0; }
.ai-cap .set-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--accent); background: var(--surface-2); }
.ai-cap .set-icon svg { width: 18px; height: 18px; }
.ai-cap.unavailable .set-icon, .ai-cap.unsupported .set-icon { background: var(--hover); color: var(--text-2); box-shadow: none; }
.ai-cap-title { font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.ai-cap .hint { margin-top: 2px; }
.ai-progress-bar { width: 100%; height: 6px; margin-top: var(--s2); appearance: none; border: 0; border-radius: 6px; background: var(--hover); overflow: hidden; }
.ai-progress-bar::-webkit-progress-bar { background: var(--hover); border-radius: 6px; }
.ai-progress-bar::-webkit-progress-value { background: var(--grad-cool); border-radius: 6px; }
.ai-progress-bar::-moz-progress-bar { background: var(--grad-cool); border-radius: 6px; }
[data-transparency="reduce"] .ai-card, [data-transparency="reduce"] .ai-bar, [data-transparency="reduce"] .ai-progress { background: var(--elevated); }
@media (forced-colors: active) { .ai-chip, .ai-card { border: 1px solid CanvasText; } }

/* =====================================================================
   Considerate delivery: send later, quiet hours, offline outbox
   ===================================================================== */
.quiet-hint, .sched-bar { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); padding: var(--s2) var(--s3); border-radius: 14px;
  font-size: var(--fs-label); color: var(--text-2); background: var(--glass-strong); border: 1px solid var(--glass-border); }
.quiet-hint[hidden], .sched-bar[hidden] { display: none; }
.quiet-hint .link-btn, .sched-bar .link-btn { font-weight: 600; white-space: nowrap; }
.quiet-icon .ic, .sched-icon .ic { width: 16px; height: 16px; }
.quiet-icon, .sched-icon { color: var(--accent); }
.quiet-hint { background: var(--surface-2); }
.sched-picker .radio-list { margin-top: var(--s2); }
.sched-option { width: 100%; }
.sched-option .ic { width: 16px; height: 16px; color: var(--text-2); }
.sched-option.active .ic { color: var(--accent); }
.sched-when { font-size: var(--fs-label); color: var(--text-2); font-variant-numeric: tabular-nums; }
.sched-preview { margin: 0 0 var(--s2); padding: var(--s2) var(--s3); border-left: 3px solid var(--accent); background: var(--hover); border-radius: 0 10px 10px 0;
  color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-compact); }
.sched-custom { margin-top: var(--s3); }
.sched-list { display: flex; flex-direction: column; gap: var(--s3); }
.sched-item { padding: var(--s3); border-radius: var(--r-card); border: 1px solid var(--glass-border); background: var(--card); }
.sched-item-head { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: var(--fs-label); }
.sched-item-head b { color: var(--text); }
.sched-item-head .ic { width: 15px; height: 15px; color: #8FB4FF; }
.sched-text { margin: var(--s2) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sched-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.msg-state.queued { display: inline-flex; align-items: center; gap: 3px; }
.msg-state.queued .ic { width: 12px; height: 12px; }
.quiet-times { max-width: 360px; }
.quiet-times .field:not(.grow) { width: 160px; }
.quiet-status:empty { display: none; }
[data-transparency="reduce"] .quiet-hint, [data-transparency="reduce"] .sched-bar { background: var(--elevated); }


/* =====================================================================
   v2.1 — Calm layer: public front door, navigation, conversation hierarchy
   ===================================================================== */
body { background: var(--bg); color: var(--text); }
.kicker { font-size: 11px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
h1, h2, h3 { letter-spacing: -0.015em; }

/* ---------- public front door ---------- */
.entry { position: fixed; inset: 0; z-index: 5; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; }
.entry[hidden] { display: none !important; }
.entry-top { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  padding: calc(24px + env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 0; }
.entry-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.entry-brand .entry-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.entry-mark svg { width: 100%; height: 100%; display: block; }
.entry-word { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.entry-body { width: 100%; max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px);
  align-items: center; padding: clamp(40px, 9vh, 88px) clamp(16px, 4vw, 40px) clamp(32px, 6vh, 56px); }
.entry-kicker { margin: 0 0 var(--s5); }
.entry-title { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.2vw, 62px); line-height: 1.06; letter-spacing: -0.025em; margin: 0 0 var(--s6); color: var(--text); max-width: 13ch; }
.entry-lead { font-size: 17px; line-height: 1.55; color: var(--text-2); max-width: 30em; margin: 0 0 var(--s6); }
.entry-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s3); }
.entry-actions .btn.lg { min-height: 48px; padding: 0 22px; font-size: 16px; }
.entry-note { font-size: var(--fs-compact); color: var(--text-2); margin: 0; }
.entry-crypto:empty { display: none; }
.entry-crypto { margin-top: var(--s4); }
.entry-signin { min-height: 44px; border: 1px solid var(--border); }
.entry-example { margin: 0; justify-self: center; width: min(420px, 100%); padding: 28px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(21, 37, 27, 0.07); transform: rotate(-1.5deg); }
.ex-tag, .ex-kicker { margin: 0 0 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.ex-quote { margin: 0; font-size: 16px; }
.ex-rule { border-top: 1px solid var(--border); margin: 16px 0; }
.ex-title { margin: 0 0 6px; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.ex-when { margin: 0 0 14px; color: var(--text-2); }
.ex-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.ex-badge { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--surface-2); padding: 4px 9px; border-radius: 6px; }
.ex-muted, .ex-caption { font-size: 12px; color: var(--text-2); }
.ex-caption { margin-top: 14px; }
.entry-more { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) var(--s10); }
.entry-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); border-top: 1px solid var(--border); padding-top: var(--s8); }
.entry-feature h3 { font-size: 17px; margin: 0 0 var(--s2); }
.entry-feature p { margin: 0; color: var(--text-2); font-size: var(--fs-compact); line-height: 1.55; }
.entry-access { margin-top: var(--s10); max-width: 720px; }
.entry-access h2 { font-size: 18px; margin: var(--s6) 0 var(--s2); }
.entry-access p { margin: 0; color: var(--text-2); line-height: 1.6; }
.entry-foot { width: 100%; max-width: 1200px; margin: auto auto 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5);
  padding: var(--s5) clamp(16px, 4vw, 40px) calc(var(--s6) + env(safe-area-inset-bottom)); color: var(--text-2); font-size: var(--fs-label); border-top: 1px solid var(--border); }
.entry-links { display: flex; gap: var(--s5); }
.entry-foot .link-btn { color: var(--text-2); }
/* sign-in / join: one calm card in place of the hero */
.entry-card { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: 440px; position: relative; padding: var(--s8); border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.entry-card[hidden] { display: none !important; }
.entry[data-mode="form"] .entry-hero, .entry[data-mode="form"] .entry-example, .entry[data-mode="form"] .entry-more { display: none; }
.entry-emblem { width: 56px; height: 56px; margin: 0 auto var(--s4); border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: var(--surface-2); }
.entry-emblem > .ic { width: 24px; height: 24px; }
.entry-emblem .entry-mark { width: 30px; height: 30px; }
.entry-card .link-btn.back { position: absolute; top: var(--s5); left: var(--s5); margin: 0; }
.entry-card .steps { max-width: 220px; margin: 0 auto var(--s5); }
.entry-h { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; text-align: center; margin: 0 0 var(--s2); }
.entry-sub { color: var(--text-2); text-align: center; margin: 0 auto var(--s5); max-width: 36ch; }
.entry-card > .entry-h:first-child, .entry-card > .link-btn.back + .entry-h { margin-top: var(--s8); }
.entry-form { margin-top: var(--s5); }
.entry-or { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0; color: var(--text-2); font-size: var(--fs-label); }
.entry-or::before, .entry-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.entry-alt { margin: var(--s5) 0 0; color: var(--text-2); text-align: center; font-size: var(--fs-compact); }
.entry-card .pw-help { text-align: center; }
.entry-card .pw-help summary { list-style: none; display: inline-block; color: var(--accent); font-weight: 500; cursor: pointer; }
.entry-card .pw-help summary::-webkit-details-marker { display: none; }
.entry-card .pw-help p { text-align: left; }
.btn.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn.outline:hover:not(:disabled) { background: var(--hover); }
@media (max-width: 899px) {
  .entry-body { grid-template-columns: minmax(0, 1fr); padding-top: var(--s8); }
  .entry-example { transform: none; justify-self: stretch; width: 100%; }
  .entry-features { grid-template-columns: minmax(0, 1fr); }
  .entry-title { font-size: clamp(34px, 9.5vw, 40px); }
}
@media (max-width: 599px) {
  .entry-actions { flex-direction: column; }
  .entry-actions .btn { width: 100%; }
  .entry-card { padding: var(--s6) var(--s5); }
  .entry-foot { justify-content: center; text-align: center; }
}

/* ---------- three destinations ---------- */
.rail { background: var(--surface); }
.rail-logo { width: 30px; height: 30px; color: var(--accent); margin-bottom: var(--s8); }
.rail-item { width: 60px; min-height: 56px; padding: var(--s2) 0; gap: 5px; color: var(--text-2); }
.rail-item:hover { background: var(--hover); color: var(--text); }
.rail-item.active { background: var(--surface-2); color: var(--text); font-weight: 650; }
.rail-item.active > [data-icon] { color: var(--accent); }
.rail-item.active::before { display: none; }
.rail-label { font-size: 12px; }
.sidebar { background: var(--surface); }
.side-search input { background: var(--bg) !important; }
.chat-item.active, .list-row.active { background: var(--surface-2); }
.you-places { margin-bottom: var(--s2); }
.settings-heading { padding: var(--s3) var(--s5) var(--s1); margin: 0; }
.list-heading { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
@media (max-width: 767px) {
  .bottom-nav { background: var(--surface); border-top: 1px solid var(--border); }
  .bn-item { min-height: 56px; }
  .bn-item.active { color: var(--accent); font-weight: 650; }
}

/* ---------- conversation: the clearest thing on the screen ---------- */
.conversation { background: var(--surface); }
.chat-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.messages-inner { max-width: calc(var(--msg-max) + 120px); }
.bubble { max-width: min(var(--msg-max), 82%); border: 0; line-height: 1.5; padding: 9px 14px 7px; }
.msg-row.out .bubble { color: var(--bubble-out-text); }
.msg-row.out .meta, .msg-row.out .meta .ic { color: var(--text-2); }
.meta { font-size: 12px; }
.sender-name { color: var(--text-2) !important; font-weight: 600; }
.reply-quote { border-left-color: var(--accent); background: rgba(0, 0, 0, 0.04); }
[data-theme="dark"] .reply-quote { background: rgba(255, 255, 255, 0.05); }
.unread-sep { color: var(--accent); }
.composer { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-bubble); box-shadow: none; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.send-btn { background: var(--accent); color: var(--on-accent); border-radius: 50%; width: 40px; height: 40px; }
.send-btn.mic { background: transparent; color: var(--text-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: none; }
.msg-row.out .card, [data-theme="light"] .msg-row.out .card { background: var(--surface); color: var(--text); }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.context-menu, .cmd-box { background: var(--surface); border-color: var(--border); }
.toast { background: var(--ink); color: var(--canvas); }
.info-panel { background: var(--surface); }
.badge.iris { background: var(--surface-2); color: var(--accent); }
.nav-badge { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, .btn, .icon-btn, [role="button"] { min-height: 0; }
.btn { min-height: 44px; border-radius: var(--r-control); }
.btn.sm { min-height: 36px; }
.icon-btn { min-width: 40px; min-height: 40px; }
@media (pointer: coarse) { .icon-btn { min-width: 44px; min-height: 44px; } .btn.sm { min-height: 44px; } }

/* =====================================================================
   v2.1 — Motion contract (Masterplan p32–33). A change is made legible, then movement stops.
   Hover/focus 120ms · press 90ms (scale .985) · new message 180ms (opacity + 6px) · context panel 220ms (opacity + 12px)
   · sheet/dialog 240ms (opacity + 12px) · plan state 180ms crossfade + label · loading: static skeleton.
   No looping, parallax, pointer light, glow, blur animation, sound or haptics. Reduced motion (system or app): none.
   ===================================================================== */
.btn, .icon-btn, .send-btn, .chip-btn, .set-row, .chat-item, .list-row, .rail-item, .bn-item, .link-btn, .radio-row, .context-menu > button, .cmd-item {
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-press) var(--ease); }
.btn:active:not(:disabled), .icon-btn:active:not(:disabled), .send-btn:active, .chip-btn:active { transform: scale(.985); }
.msg-row.enter { animation: msg-enter var(--t-message) var(--ease) both; }
@keyframes msg-enter { from { opacity: 0; transform: translateY(6px); } }
.layout.info-open .info-panel { animation: panel-enter var(--t-panel) var(--ease) both; }
@keyframes panel-enter { from { opacity: 0; transform: translateX(12px); } }
.modal-backdrop { animation: fade-enter var(--t-sheet) var(--ease) both; }
.modal { animation: sheet-enter var(--t-sheet) var(--ease) both; }
@keyframes sheet-enter { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-enter { from { opacity: 0; } }
.context-menu:not([hidden]), .cmd-overlay { animation: fade-enter var(--t-fast) var(--ease) both; }
.toast:not([hidden]) { animation: fade-enter var(--t-panel) var(--ease) both; }
.state-swap { animation: fade-enter var(--t-message) var(--ease) both; }
.spinner { animation-duration: 1s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (forced-colors: active) { .entry-example, .entry-card, .card, .modal { border: 1px solid CanvasText; } }

/* =====================================================================
   v2.1 — Receiving addresses (non-custodial): calm cards, no sheen or tilt
   ===================================================================== */
.wcard { --wc-a: var(--accent); display: grid; grid-template-rows: auto 1fr auto; gap: 6px; width: 100%; border-radius: var(--r-card, 18px);
  padding: 16px 18px; color: var(--ink); text-align: left; min-height: 0; background: var(--surface); border: 1px solid var(--line); }
.wcard-top { display: flex; align-items: center; gap: 8px; }
.wcard-glyph { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600;
  background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--wc-a) 55%, transparent); }
.wcard-net { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.wcard-badge { margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.wcard-label { align-self: end; font-size: 18px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcard-addr { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.wcard-hero { max-width: 420px; min-height: 150px; }
.wcard-hero .wcard-label { font-size: 22px; }
.wcard-row { min-height: 96px; }
.wcard-msg { width: min(300px, 100%); }
.wcard.ghost { border-style: dashed; background: transparent; }
.wcard-btn { display: block; width: 100%; padding: 0; border: 0; background: none; border-radius: var(--r-card, 18px); cursor: pointer; transition: transform var(--t-press) var(--ease); }
.wcard-btn:active { transform: scale(.985); }
.wallet-msg .wcard-btn { margin: 8px 0; }
.wallet-modal .wcard-hero { margin: 0 auto var(--s3); }
.wallet-side { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s2) var(--s3) var(--s5); }
.wallet-quick { display: flex; flex-wrap: wrap; gap: var(--s2); }
.wallet-quick .btn { flex: 1 1 auto; }
.wallet-row { display: flex; flex-direction: column; gap: 8px; }
.wcard-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.wallet-empty { display: flex; flex-direction: column; gap: var(--s2); }
.list-heading { margin: var(--s3) 0 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.wallet-principles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); font-size: 14px; color: var(--ink-2); }
.wallet-principles li { display: flex; gap: 10px; align-items: flex-start; }
.wallet-principles b { color: var(--ink); }
.wp-ic { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.wp-ic svg { width: 16px; height: 16px; }
.wallet-home { width: min(820px, 100%); margin: 0 auto; padding: clamp(24px, 5vh, 56px) clamp(16px, 4vw, 48px); display: flex; flex-direction: column; gap: var(--s5); overflow: auto; text-align: left; }
.wh-title { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; margin: 6px 0 10px; color: var(--ink); }
.wh-stage { display: flex; align-items: center; gap: clamp(16px, 4vw, 40px); flex-wrap: wrap; }
.wh-stage .wcard-hero { flex: 1 1 300px; }
.wh-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wh-qr .qr-box { width: 160px; border-radius: 14px; overflow: hidden; background: #fff; padding: 8px; border: 1px solid var(--line); }
.wh-qr .qr-box svg { display: block; width: 100%; height: auto; }
.wh-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.wh-networks { display: flex; flex-wrap: wrap; gap: 8px; }
.net-chip { --wc-a: var(--accent); display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; font-size: 13px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.net-glyph { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--wc-a) 55%, transparent); }
.wcard-pick { display: flex; flex-direction: column; gap: var(--s2); }
.wcard-pick-btn { padding: 0; border: 0; background: none; border-radius: var(--r-card, 18px); cursor: pointer; text-align: left; }
.picker { display: flex; flex-direction: column; gap: var(--s2); }
@media (min-width: 768px) { .wallet-side-hero { display: none; } }
@media (forced-colors: active) { .wcard { border: 1px solid CanvasText; } }

/* =====================================================================
   v2.1 — Plans and shared decisions
   ===================================================================== */
.plan-card { display: flex; flex-direction: column; gap: 4px; min-width: min(280px, 100%); max-width: 340px; }
.plan-card .card-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.plan-card .card-head .ic svg { width: 16px; height: 16px; }
.plan-status { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); transition: background-color var(--t-message) var(--ease), color var(--t-message) var(--ease); }
.plan-status.st-confirmed { background: var(--accent); color: var(--on-accent); }
.plan-status.st-changed { background: #F3E3C4; color: #5A3F0A; }
[data-theme="dark"] .plan-status.st-changed { background: #4A3A1C; color: #F3E3C4; }
.plan-status.st-cancelled, .plan-status.st-completed { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--ink-2); }
.plan-kicker .plan-status { margin-left: 0; }
.plan-title { font-size: 17px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.plan-when, .plan-where { font-size: 14px; color: var(--ink); }
.plan-where { color: var(--ink-2); }
.plan-tally { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.plan-card.s-cancelled .plan-title { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-2); }
.plan-answers { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.plan-answer { min-height: 44px; padding: 0 14px; border-radius: var(--r-control); border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-press) var(--ease); }
.plan-answer:hover:not(:disabled) { background: var(--surface-2); }
.plan-answer:active:not(:disabled) { transform: scale(.985); }
.plan-answer.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.plan-answer.stale { border-style: dashed; }
.plan-answer:disabled { opacity: .6; cursor: default; }
.plan-answers.compact .plan-answer { flex: 1 1 0; padding: 0 6px; white-space: nowrap; font-size: 13.5px; }
.plan-note { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.plan-note.warn { color: var(--ink); background: color-mix(in srgb, #E8B65A 18%, transparent); padding: 6px 10px; border-radius: var(--r-control); }
.plan-open { align-self: flex-start; margin-top: 6px; }
.plan-sheet-body { display: flex; flex-direction: column; gap: var(--s3); }
.plan-sheet-title { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.15; margin: 0; color: var(--ink); }
.plan-kicker { margin: 0; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s3); margin: 0; font-size: 15px; }
.plan-facts dt { color: var(--ink-2); }
.plan-facts dd { margin: 0; overflow-wrap: anywhere; }
.plan-note-text { white-space: pre-wrap; }
.plan-sheet h4, .notebook h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.plan-who ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.plan-group-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.plan-sources { display: flex; flex-direction: column; gap: 4px; }
.source-link { display: inline-flex; align-items: center; gap: 6px; text-align: left; font-size: 14px; color: var(--accent); background: none; border: 0; padding: 6px 0; cursor: pointer; min-height: 32px; }
.source-link .ic svg { width: 14px; height: 14px; }
.plan-history summary { cursor: pointer; font-size: 13px; color: var(--ink-2); min-height: 32px; display: flex; align-items: center; }
.plan-history ol { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: 13.5px; }
.plan-actions { display: flex; flex-wrap: wrap; gap: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.plan-form .field-row { display: flex; gap: var(--s2); }
.plan-form .field-row .grow { min-width: 0; }
.notebook { display: flex; flex-direction: column; gap: var(--s2); }
.nb-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.nb-heading { margin-top: var(--s3) !important; }
.nb-list { display: flex; flex-direction: column; gap: 2px; }
.nb-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 10px; border-radius: var(--r-control); background: none; border: 0; color: var(--ink); cursor: pointer; min-height: 44px; }
.nb-row.static { cursor: default; }
button.nb-row:hover { background: var(--surface-2); }
.nb-row > .ic { margin-top: 2px; color: var(--accent); }
.nb-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.nb-title { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.nb-sub { font-size: 12.5px; color: var(--ink-2); }
.nb-flag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); white-space: nowrap; }
.nb-tools { display: flex; gap: 2px; }
.nb-closed summary { cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 8px 0; }
@media (max-width: 767px) { .modal.sheet.plan-sheet, .modal.sheet.plan-form { max-height: 92vh; } }
@media (forced-colors: active) { .plan-answer.on { outline: 2px solid CanvasText; } .plan-status { border: 1px solid CanvasText; } }

/* ---------- v2.1 — "Since you left" ---------- */
.since-card { max-width: var(--msg-max); margin: 8px auto 12px; width: calc(100% - 24px); padding: 14px 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); animation: fade-in var(--t-message) var(--ease) both; }
.sy-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.sy-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--ink); }
.sy-block h3 { margin: 12px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.sy-block ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sy-item { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; font-size: 14.5px; line-height: 1.4; padding: 4px 0; border-top: 1px solid var(--line); }
.sy-item:first-child { border-top: 0; }
.sy-text { min-width: 0; overflow-wrap: anywhere; }
.sy-item .link-btn { flex: none; white-space: nowrap; min-height: 32px; }
.sy-empty { margin: 8px 0 0; font-size: 14.5px; }
.sy-src { margin: 10px 0 0; }
.sy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 480px) { .sy-item { flex-direction: column; gap: 2px; } }

/* ---------- v2.1 — crypto requests: compact card + review screen ---------- */
.wallet-msg.is-request { min-width: min(260px, 100%); max-width: 340px; display: flex; flex-direction: column; gap: 4px; }
.wallet-msg .card-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.rq-state { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.rq-state.rs-sent, .rq-state.rs-acknowledged { background: var(--accent); color: var(--on-accent); }
.rq-state.rs-cancelled, .rq-state.rs-expired, .rq-state.rs-blocked { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--ink-2); }
.rq-state.rs-changed { background: #F3E3C4; color: #5A3F0A; }
.rq-amount { font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.rq-cancelled .rq-amount, .rq-expired .rq-amount { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-2); }
.rq-meta { font-size: 13px; color: var(--ink-2); }
.rq-by { margin: 4px 0 0; font-size: 13px; color: var(--ink); }
.wallet-msg .card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wallet-msg .card-actions .btn { min-height: 40px; }
.wallet-msg .card-foot { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.wallet-msg .card-foot .ic svg { width: 14px; height: 14px; }
.review-facts { font-size: 15px; }
.review-facts .rv-amount { font-size: 20px; font-weight: 600; }
.rv-addr-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 4px; }
.wallet-modal .wallet-addr { font-size: 14px; line-height: 1.55; letter-spacing: .02em; }
.rv-qr summary { cursor: pointer; font-size: 13.5px; color: var(--accent); min-height: 36px; display: flex; align-items: center; }
.rv-qr .qr-box { width: min(200px, 60vw); margin: 6px auto; background: #fff; padding: 8px; border-radius: 12px; border: 1px solid var(--line); }
.rv-qr .qr-box svg { display: block; width: 100%; height: auto; }
.modal-foot { flex-wrap: wrap; }
.modal { max-width: calc(100vw - 16px); }
.modal-body { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .wallet-modal.review .modal-foot .btn.primary { order: -1; flex: 1 1 100%; } .wallet-modal.review .modal-foot .btn { flex: 1 1 auto; } }

/* =====================================================================
   v2.2 — Trip options on a plan
   ===================================================================== */
.plan-trip { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink); margin-top: 2px; }
.plan-trip .ic svg { width: 14px; height: 14px; color: var(--accent); }
.trip-section { border-top: 1px solid var(--line); padding-top: var(--s3); display: flex; flex-direction: column; gap: var(--s3); }
.trip-section h4 { margin: 0; }
.tp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tp-route { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.tp-sample { margin: 0; font-size: 12.5px; padding: 6px 10px; border-radius: var(--r-control); background: #F3E3C4; color: #5A3F0A; }
[data-theme="dark"] .tp-sample { background: #4A3A1C; color: #F3E3C4; }
.tp-part { display: flex; flex-direction: column; gap: 8px; }
.tp-part-head { display: flex; align-items: center; gap: 10px; }
.tp-part-head h5 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.tp-part-head .link-btn { margin-left: auto; font-size: 13px; }
.tp-booked { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tp-card { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.tp-card.pinned { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tp-cat { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); text-transform: uppercase; }
.tp-price-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tp-price { font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tp-spark { color: var(--accent); display: inline-flex; }
.tp-sub { font-size: 12px; color: var(--ink-2); }
.tp-move { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.tp-move.down, .tp-move.low { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tp-move.up { background: color-mix(in srgb, #C0563B 14%, transparent); color: #A1432B; }
[data-theme="dark"] .tp-move.up { color: #F2A792; }
.tp-name { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 4px; overflow-wrap: anywhere; }
.tp-line { font-size: 12.5px; color: var(--ink-2); }
.tp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-actions .btn { min-height: 36px; }
.tp-actions .ext-ic svg { width: 12px; height: 12px; }
.tp-pinned-by { font-size: 12px; color: var(--accent); font-weight: 600; }
.tp-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; }
.tp-empty { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-size: 14px; }
.tp-empty p { margin: 0; }
.tp-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tp-legal { margin: 0; }
.trip-form .check-row { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0 8px; }
.modal.plan-sheet { width: min(640px, 100%); }
@media (forced-colors: active) { .tp-card.pinned { outline: 2px solid CanvasText; } }
@media (max-width: 560px) {
  .tp-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -4px; padding: 2px 4px 6px; scrollbar-width: thin; }
  .tp-card { flex: 0 0 78%; scroll-snap-align: start; }
}

/* ---------- v2.2.1 — minimised plan (follows the chat in a corner) ---------- */
.chat-view { position: relative; }
.plan-dock { position: absolute; right: 16px; bottom: calc(var(--composer-h, 76px) + 12px); z-index: 30; display: flex; align-items: center; gap: 2px;
  max-width: min(340px, calc(100% - 32px)); padding: 6px 6px 6px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 28px -12px rgba(20, 30, 25, .35); animation: dock-in var(--t-panel) var(--ease) both; touch-action: pan-y; }
.plan-dock.left { right: auto; left: 16px; }
.pd-main { display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; padding: 4px; text-align: left; cursor: pointer; color: var(--ink); border-radius: 12px; }
.pd-main:hover { background: var(--surface-2); }
.pd-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.pd-icon svg { width: 18px; height: 18px; }
.pd-text { display: flex; flex-direction: column; min-width: 0; }
.pd-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-title .plan-status { margin-left: 0; font-size: 10.5px; padding: 1px 6px; }
.pd-sub { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-close { flex: none; }
.plan-dock[data-leaving] { opacity: .85; }
@keyframes dock-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.plan-minimise { margin-left: auto; }
.modal-head .plan-minimise + .icon-btn { margin-left: 0; }
.trip-start-lead { margin: 0 0 10px; }
@media (max-width: 767px) { .plan-dock { right: 10px; bottom: calc(var(--composer-h, 70px) + 10px); } .plan-dock.left { left: 10px; } }

/* =====================================================================
   v2.3 — Activity hub (centre of the screen when no conversation is open)
   ===================================================================== */
.hub { width: min(760px, 100%); margin: 0 auto; padding: clamp(24px, 6vh, 64px) clamp(16px, 4vw, 40px) 40px; display: flex; flex-direction: column; gap: 28px; text-align: left; overflow-y: auto; max-height: 100%; }
.hub-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.hub-kicker { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hub-hello { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; color: var(--ink); }
.hub-lead { margin: 8px 0 0; font-size: 16px; color: var(--ink-2); }
.hub-section h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hub-list { display: flex; flex-direction: column; gap: 8px; }
.hub-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-card, 18px); background: var(--surface); border: 1px solid var(--line);
  animation: fade-in var(--t-message) var(--ease) both; transition: border-color var(--t-fast) var(--ease); }
.hub-card:hover { border-color: var(--border-strong); }
.hub-card.big { padding: 16px 18px; }
.hub-card.unread .hub-title::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: middle; }
.hub-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.hub-ic .avatar { width: 40px; height: 40px; }
.hub-ic svg { width: 20px; height: 20px; }
.hub-card.t-alert .hub-ic { background: #F3E3C4; color: #5A3F0A; }
.hub-card.t-good .hub-ic { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.hub-card.t-money .hub-ic { background: color-mix(in srgb, #3E6A8A 16%, transparent); color: #2F5670; }
.hub-card.t-muted .hub-ic { color: var(--ink-2); }
[data-theme="dark"] .hub-card.t-alert .hub-ic { background: #4A3A1C; color: #F3E3C4; }
[data-theme="dark"] .hub-card.t-money .hub-ic { color: #A9C7DD; }
.hub-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hub-title { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.hub-card.big .hub-title { font-size: 16px; }
.hub-sub { font-size: 13px; color: var(--ink-2); }
.hub-card .btn { flex: none; }
.hub-calm { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--r-card, 18px); border: 1px dashed var(--border-strong); }
.hub-calm > .ic svg { width: 28px; height: 28px; color: var(--accent); }
.hub-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
@media (max-width: 767px) { .hub { padding: 20px 16px 32px; } .hub-head { flex-direction: column; align-items: flex-start; } }
.center-empty.hub-host { display: block; padding: 0; overflow-y: auto; }
.side-list.hub-host { padding: 0; } .side-list.hub-host .hub { padding: 8px 16px 28px; max-height: none; gap: 20px; } .side-list.hub-host .hub-hello { font-size: 28px; }

/* ---------- v2.4 — place picker ---------- */
.pp { position: relative; }
.pp-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 12px 32px -14px rgba(20, 30, 25, .35); }
.pp-opt { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.pp-opt.active, .pp-opt:hover { background: var(--surface-2); }
.pp-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.pp-ic svg { width: 15px; height: 15px; }
.pp-text { display: flex; flex-direction: column; min-width: 0; }
.pp-name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.pp-detail { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-empty { padding: 10px; font-size: 13px; color: var(--ink-2); }
.pp-chosen { margin-top: 4px; min-height: 1em; }
.pp, .pp input { width: 100%; }
.pp-locate { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 2px; min-height: 36px; background: none; border: 0; color: var(--accent); font: 600 13px/1 var(--font); cursor: pointer; }
.pp-locate svg { width: 16px; height: 16px; }
.pp-locate:disabled { opacity: .6; cursor: progress; }
.pp-foot { padding: 6px 10px 4px; font-size: 11px; color: var(--ink-2); border-top: 1px solid var(--border); margin-top: 4px; }
.pp-opt .pp-detail { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- v2.4 — roomier trip view, kinds of stay ---------- */
.modal.plan-sheet { width: min(1040px, calc(100vw - 32px)); }
.tp-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tp-card { padding: 14px 16px; }
.tp-price { font-size: 24px; }
.tp-cat { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tp-type { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 560px) { .tp-card { flex: 0 0 84%; } }

/* =====================================================================
   v2.4 — Wallet | Budget
   ===================================================================== */
.wallet-tabs { display: flex; gap: 4px; padding: 4px; margin: 4px var(--s3) 8px; border-radius: 12px; background: var(--surface-2); }
.wt-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.wt-tab .ic svg { width: 17px; height: 17px; }
.wt-tab.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.budget-mini { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.budget-mini b { font-size: 26px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.wallet-budget-host { padding: 0 var(--s3) var(--s5); }
.center-empty .budget { width: min(760px, 100%); margin: 0 auto; padding: clamp(20px, 5vh, 48px) clamp(16px, 4vw, 36px) 40px; }
.budget { display: flex; flex-direction: column; gap: 22px; text-align: left; }
.budget-hero { padding: 20px 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.bh-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bh-kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.bh-left { font-family: var(--serif); font-size: clamp(40px, 6vw, 56px); line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.bh-left.neg { color: #A1432B; } .bh-left.warn { color: #8A5A0A; }
[data-theme="dark"] .bh-left.neg { color: #F2A792; } [data-theme="dark"] .bh-left.warn { color: #F3D59A; }
.bh-flow { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.bh-flow b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bh-say { margin: 6px 0 0; font-size: 15px; color: var(--ink); }
.bh-one { margin: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.seg-btn { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; min-height: 32px; }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.budget-bar-wrap { display: flex; flex-direction: column; gap: 8px; }
.budget-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.bb-seg { display: inline-block; min-width: 4px; height: 100%; }
.bl-item .bb-seg { width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.budget-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); }
.s0 { background: #315C4D; } .s1 { background: #6E9C86; } .s2 { background: #B9A36A; } .s3 { background: #8E6F9E; }
.s4 { background: #5B7FA6; } .s5 { background: #C07B5A; } .s6 { background: #8A938B; } .s7 { background: #3E6A8A; }
[data-theme="dark"] .s0 { background: #BDD7C0; }
.budget-sec { display: flex; flex-direction: column; gap: 10px; }
.bs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bs-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.bs-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.budget-list { display: flex; flex-direction: column; gap: 4px; }
.budget-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 56px; }
.budget-row:hover { border-color: var(--border-strong); }
.br-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.br-ic svg { width: 17px; height: 17px; }
.br-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.br-title { font-weight: 600; font-size: 14.5px; display: flex; gap: 6px; align-items: center; }
.br-est { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: #F3E3C4; color: #5A3F0A; }
.br-sub { font-size: 12.5px; color: var(--ink-2); }
.br-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.br-amt.in { color: var(--accent); }
.budget-goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.budget-goal { padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.budget-goal.done { border-color: var(--accent); }
.bg-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bg-name { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.bg-name .ic svg { width: 15px; height: 15px; color: var(--accent); }
.bg-amt { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bg-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bg-track span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width var(--t-panel) var(--ease); }
.bg-sub { font-size: 12.5px; color: var(--ink-2); }
.bg-actions { display: flex; gap: 6px; }
.budget-ranges { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; }
.budget-range-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.budget-foot { display: flex; gap: 6px; align-items: flex-start; }
.budget-foot .ic svg { width: 14px; height: 14px; }

/* ---------- v2.4 — call tools ---------- */
.call-screen.peer-screen .call-remote { object-fit: contain; background: #0E1210; }
.call-sharing { margin-top: 6px; display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(189, 215, 192, .18); color: #EDF1EB; font-size: 13px; font-weight: 600; }
.call-btn.on { background: #BDD7C0; color: #15251B; }
@media (max-width: 440px) { .call-screen:not(.docked) .call-controls { gap: 8px; max-width: calc(100vw - 16px); flex-wrap: wrap; justify-content: center; } .call-screen:not(.docked) .call-btn { width: 50px; height: 50px; } }

/* ---------- v2.5 — account recovery ---------- */
.rk { display: flex; flex-direction: column; gap: 12px; }
.rk-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong);
  font: 600 16px/1 var(--mono); letter-spacing: .06em; color: var(--ink); user-select: all; -webkit-user-select: all; }
.rk-g { text-align: center; padding: 6px 0; }
.rk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rk-tips { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.rk-confirm { max-width: 140px; font: 600 16px/1 var(--mono) !important; letter-spacing: .1em; text-transform: uppercase; }
.rk-input { width: 100%; font: 500 15px/1.5 var(--mono); letter-spacing: .04em; text-transform: uppercase; resize: vertical; }
.si-help { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; }
.recovery-card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.recovery-card .grow { flex: 1 1 220px; }
.recovery-card p { margin: 4px 0 0; }
.recovery-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.recovery-card.missing .recovery-ic { color: var(--warning); }
.recovery-ic svg { width: 18px; height: 18px; }
.email-card { display: grid; gap: 10px; }
.email-card p { margin: 0; }
.email-status { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.email-status svg { width: 16px; height: 16px; }
.email-status.ok { color: var(--accent); } .email-status.wait { color: var(--warning); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hub-protect { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-card, 18px); background: var(--surface); border: 1px solid var(--border-strong); flex-wrap: wrap; }
.hub-protect .hub-body { flex: 1 1 220px; }
.hub-protect .hub-ic { color: var(--accent); }
.hub-protect-actions { display: flex; gap: 8px; }
/* v2.6 — email codes */
.code-input { font: 600 22px/1 var(--mono) !important; letter-spacing: .3em; max-width: 200px; text-align: center; }
.code-sent { margin: 0 0 12px; }
.email-code { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); }

/* =====================================================================
   v2.7 — Evolution: plan identity, comparison, member introduction
   ===================================================================== */
/* Plan covers belong to the plan (never behind messages). Space reserved from the stored size; no text on the image. */
.plan-cover { margin: calc(-1 * var(--s2)) 0 var(--s2); border-radius: 14px; overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 6; max-height: 240px; }
.plan-cover img, .plan-card-cover img, .plan-cover-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plan-cover.loading img, .plan-card-cover.loading img { visibility: hidden; }
.plan-cover.small { aspect-ratio: 16 / 7; max-height: 120px; margin: 0; }
.plan-card-cover { margin: -12px -14px 6px; height: 96px; overflow: hidden; background: var(--surface-2); border-radius: 14px 14px 0 0; }
.plan-cover-pick { display: grid; gap: 8px; }
.plan-cover-pick > img { aspect-ratio: 16 / 7; max-height: 140px; border-radius: 12px; }
.field-label { display: block; font-size: var(--fs-label); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.plan-title { font-family: var(--editorial); font-weight: 600; font-size: 18px; letter-spacing: -0.005em; }
.plan-sheet-title { font-family: var(--editorial); font-weight: 600; font-size: 30px; letter-spacing: -0.01em; }
.plan-sub { margin: -4px 0 0; color: var(--ink-2); font-size: var(--fs-compact); }
.plan-status.st-confirmed { color: var(--accent); }
.plan-progress { display: flex; gap: 8px; margin: 4px 0 2px; padding: 0; list-style: none; font-size: 12px; color: var(--ink-2); }
.plan-progress li { flex: 1; min-width: 0; padding-top: 7px; border-top: 2px solid var(--line); overflow-wrap: anywhere; }
.plan-progress li.done { border-top-color: var(--accent); color: var(--ink); }
.plan-progress li.current { font-weight: 600; color: var(--accent); }
@media (max-width: 767px) { .plan-cover { aspect-ratio: 16 / 8; max-height: 160px; } .plan-sheet-title { font-size: 26px; } }
/* Activity: what needs you leads; completed, low-priority items recede. */
.hub-section[aria-label="Recently"] .hub-card { background: transparent; border-color: transparent; }
.hub-section[aria-label="Recently"] .hub-title { font-weight: 500; }
.hub-hello { font-family: var(--editorial); }
/* Motion spec v2.7: changed fields get a brief highlight; the before/after words stay. */
@keyframes field-changed { 0%, 45% { background: var(--surface-2); } 100% { background: transparent; } }
.field-changed { animation: field-changed 800ms ease-out; border-radius: 6px; }
[data-motion="reduce"] .field-changed { animation: none; }
@media (prefers-reduced-motion: reduce) { .field-changed { animation: none; } }
/* v2.7 — member introduction: the welcome, the four-step tour, first-use tips */
.welcome-dialog { width: min(480px, 100%); }
.welcome-dialog .modal-head h2 { font-family: var(--editorial); font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.welcome-mark { display: block; width: 40px; height: 40px; color: var(--accent); margin-bottom: 8px; }
.welcome-mark svg { width: 100%; height: 100%; }
.welcome-eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent) !important; }
.welcome-body p { margin: 0 0 10px; }
.tour-layer { background: rgba(20, 37, 27, .14); place-items: end; padding: 24px; }
.tour-dialog { width: min(400px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px 18px; box-shadow: 0 25px 80px rgba(0, 0, 0, .18); animation: tour-in 240ms var(--ease); }
.tour-layer:has(.tour-dialog.centred) { place-items: center; }
@keyframes tour-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.tour-count { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.tour-title { font-family: var(--editorial); font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; margin: 4px 0 8px; outline: none; }
.tour-text { margin: 0 0 10px; color: var(--ink-2); }
.tour-where { margin: 0 0 6px; }
.tour-example { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin: 4px 0 12px; display: grid; gap: 4px; background: var(--canvas); }
.tour-example-tag { justify-self: start; font-size: 11px; font-weight: 600; color: var(--clay); }
.tour-example .plan-answers { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tour-example .plan-answer { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; }
.tour-progress { display: flex; gap: 6px; margin: 14px 0 0; }
.tour-progress i { height: 3px; flex: 1; border-radius: 2px; background: var(--line); }
.tour-progress i.on { background: var(--accent); }
.tour-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.tour-foot .btn, .tour-head .btn { min-height: 44px; }
.tour-target { outline: 3px solid var(--accent) !important; outline-offset: 3px; background: var(--surface-2) !important; border-radius: var(--r-control); position: relative; z-index: 51; }
@media (max-width: 767px) {
  /* a bottom sheet above the bottom bar, so the highlighted destination stays visible */
  .tour-layer { place-items: end center; padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }
  .tour-layer:has(.tour-dialog.centred) { place-items: end center; }
  .tour-dialog { width: 100%; max-height: calc(100dvh - 120px); padding: 16px 18px 14px; }
  .tour-title { font-size: 22px; }
}
@media (max-height: 520px) { .tour-layer { padding: 8px; place-items: center; } .tour-dialog { width: 100%; max-height: calc(100dvh - 16px); } }
/* first-use tips: inline, one at a time, never covering what they explain */
.ftip { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 8px 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: var(--fs-compact, 14px); }
.ftip > .ic { width: 16px; height: 16px; margin-top: 3px; color: var(--accent); flex: none; }
.ftip .grow { flex: 1; min-width: 0; }
.ftip-ok { flex: none; min-height: 36px; }
/* Help in You */
.help-faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.help-faq summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.help-faq details p { margin: 6px 0 0; color: var(--ink-2); }
/* Compare together */
.compare-dialog { width: min(760px, 100%); }
.compare-scroll { overflow-x: auto; margin: 0 -4px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.compare-table caption { text-align: left; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.compare-table th, .compare-table td { padding: 9px 6px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.compare-table thead th { color: var(--accent); font-weight: 700; }
.compare-table tbody th { color: var(--ink-2); font-weight: 600; width: 26%; }
.compare-table td.unknown { color: var(--ink-2); font-style: italic; }
.cmp-choices { border: 0; padding: 0; margin: 14px 0 6px; display: grid; gap: 6px; }
.cmp-choices legend { font-weight: 700; margin-bottom: 6px; }
.cmp-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.cmp-choice:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.cmp-disclosure { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.cmp-disclosure .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }
.tp-compare-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 14px; margin: 10px 0 2px; }
.tp-prefs { flex: 1 1 220px; font-size: 13px; }
.tp-prefs ul { margin: 2px 0 0; padding-left: 18px; }
.tp-prefs li.needs-review { color: var(--clay); }
.tp-prefs-label { font-weight: 600; font-size: 12px; color: var(--ink-2); }
.tp-unconfirmed { margin-left: 6px; font-size: 11px; color: var(--clay); border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; }
.tp-handoff { margin-top: 4px; font-size: 11px; }
@media (max-width: 420px) { .compare-table { font-size: 12px; } .compare-table th, .compare-table td { padding: 8px 4px; } .compare-table tbody th { width: 30%; } }
[data-motion="reduce"] .tour-dialog { animation: none; }
@media (prefers-reduced-motion: reduce) { .tour-dialog { animation: none; } }
/* Review change: before → after, bound to the current revision */
.plan-change { border-left: 2px solid var(--clay); padding: 4px 0 4px 14px; margin: 8px 0; }
.plan-change h4 { margin: 0 0 2px; }
.plan-diff { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 10px 0; }
.plan-diff dt { color: var(--ink-2); font-weight: 600; }
.plan-diff dd { margin: 0; overflow-wrap: anywhere; }
.plan-diff .before { color: var(--ink-2); }
.plan-diff .after { font-weight: 600; }
.help-faq dt { font-weight: 600; margin-top: 12px; }
.help-faq dd { margin: 4px 0 0; color: var(--ink-2); }
/* v2.8 — admin storage gauge */
.storage-gauge { margin: 10px 0 14px; }
.storage-gauge .sg-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.storage-gauge .bg-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.storage-gauge .bg-track > span { display: block; height: 100%; background: var(--accent); }
.storage-gauge.warn .bg-track > span { background: var(--clay); }
.storage-gauge.danger .bg-track > span { background: var(--danger, #B3261E); }
.storage-box { margin-top: var(--s5); }
.storage-box h3 { font-size: var(--fs-compact); margin: 0 0 var(--s2); }
/* v2.9 — gifted introductions */
.gift-people { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.gift-people li { display: flex; align-items: center; gap: 10px; }
/* v2.11 — readable without JavaScript (and for search engines that don't run it) */
.noscript-about { max-width: 640px; margin: 48px auto; padding: 0 20px; color: var(--ink); }
.noscript-about h1 { font-family: var(--editorial); font-size: 30px; line-height: 1.2; }
.noscript-about p { color: var(--ink-2); line-height: 1.6; }
/* v2.12 — private contact links */
.contact-card { display: grid; gap: 10px; }
.contact-url { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); overflow-wrap: anywhere; font-size: 13px; }
.contact-hint { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; justify-items: start; }
.contact-person { display: grid; justify-items: center; text-align: center; gap: 10px; }
.contact-card .qr-box { max-width: 240px; }
.contact-card .qr-box svg { width: 100%; height: auto; display: block; }
/* v2.13 — group bill splits */
.split-people { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; gap: 6px; }
.split-people li { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; }
.split-who { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.split-amt { width: 110px; text-align: right; }
.split-amt-text { font-variant-numeric: tabular-nums; font-weight: 600; }
.split-sum { font-size: 13px; color: var(--ink-2); margin: 6px 0 10px; }
.split-sum.off { color: var(--clay); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 4px; }
.seg-btn { min-height: 40px; padding: 0 14px; background: transparent; }
.seg-btn[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.split-more { margin-top: 10px; }
.split-more summary { cursor: pointer; font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.card.split .split-progress { font-size: 13px; margin: 4px 0 6px; }
.split-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.split-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.split-list li .status-chip { font-size: 11px; }

/* ---------- Do together (v2.14): Plan · Trip · Split · Crypto above the message box and as tiles in + ---------- */
.together-bar { display: flex; gap: var(--s2); margin-bottom: var(--s2); overflow-x: auto; scrollbar-width: none; }
.together-bar[hidden] { display: none; }
.together-bar::-webkit-scrollbar { display: none; }
.tg-btn { flex: 1 1 0; max-width: 168px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; background: var(--elevated); border: 1px solid var(--border-strong); color: var(--text); font-size: var(--fs-compact); font-weight: 600; white-space: nowrap; }
.tg-btn .ic { width: 18px; height: 18px; color: var(--iris); }
.tg-btn:hover { background: var(--hover); border-color: var(--iris); }
.tg-btn:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; }
.context-menu.add-sheet { max-width: min(380px, calc(100vw - 16px)); width: 380px; }
.tg-tiles .menu-section { margin-top: 0; }
.tg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 2px 2px 4px; }
.tg-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  padding: 12px; min-height: 64px; border-radius: 12px; background: var(--elevated); border: 1px solid var(--border); }
.tg-tile:hover, .tg-tile:focus-visible { border-color: var(--iris); background: var(--hover); outline: none; }
.tg-ic { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--iris); color: var(--on-iris); }
.tg-ic .ic { width: 20px; height: 20px; color: inherit; }
.tg-label { font-weight: 600; font-size: var(--fs-compact); }
.tg-sub { font-size: 12px; color: var(--text-2); }
.menu-note { margin: 4px 10px 6px; font-size: 12px; color: var(--text-2); max-width: 260px; }
@media (max-width: 420px) { .tg-btn { padding: 0 10px; } .tg-tile { padding: 10px; } }

/* v2.15 calls: your own view is mirrored (like a mirror); the other person's name and time sit in a small corner label
   during video instead of across their face. */
.call-local.mirror { transform: scaleX(-1); }
.call-local { background: #111; }
.call-screen.has-video .call-info { position: absolute; top: var(--s4); left: var(--s4); align-items: flex-start; text-align: left; gap: 2px;
  padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, .45); max-width: calc(100% - 2 * var(--s4) - 190px); }
.call-screen.has-video .call-name { font-size: var(--fs-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.call-screen.has-video .call-status { font-size: var(--fs-label); }
.call-screen.docked.has-video .call-info { top: 6px; left: 6px; padding: 4px 8px; max-width: calc(100% - 12px); }
.call-weak { font-size: var(--fs-label); color: #FFD27A; }
@media (max-width: 600px) { .call-screen.has-video .call-info { max-width: calc(100% - 2 * var(--s4) - 30%); } }

/* v2.15 ticks: sent (one), delivered (two), read (two white ticks on a small accent disc so they show on light bubbles) */
.msg-row .meta .msg-state.sent .ic, .msg-row .meta .msg-state.delivered .ic { color: var(--ink-2); opacity: .9; }
.msg-row .meta .msg-state.read .ic { color: #fff; background: var(--iris); border-radius: 999px; padding: 1px 2px; width: 18px; height: 14px; box-sizing: content-box; }
