/* ═══════════════════════════════════════════════════════════════
   Moon Chat — design tokens
   Ink-blue navigation, quiet surfaces, and one loud thing: the ledger slip
   used for financial messages.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --num: 'IBM Plex Sans Arabic', 'Segoe UI', system-ui, sans-serif;

  --bg: #E9EDF2;
  --surface: #FFFFFF;
  --surface-2: #F4F6F9;
  --surface-3: #EBEFF4;
  --line: #DEE3EA;
  --line-strong: #C9D1DC;
  --ink: #152033;
  --ink-2: #485468;
  --ink-3: #7F8BA0;
  --rail: #142038;
  --rail-ink: #C6D0E4;
  --rail-hover: #1F2D4C;
  --accent: #2F5BD3;
  --accent-ink: #FFFFFF;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-softer: color-mix(in srgb, var(--accent) 7%, transparent);
  --bubble-me: color-mix(in srgb, var(--accent) 14%, #FFFFFF);
  --bubble-them: #FFFFFF;
  --chat-bg: #E4E9F0;
  --credit: #13805A;
  --debit: #C0392F;
  --gold: #C98A1B;
  --paper: #FFFDF7;
  --paper-line: #EDE5D2;
  --danger: #C0392F;
  --success: #13805A;
  --shadow-1: 0 1px 2px rgba(20, 32, 56, .06), 0 1px 1px rgba(20, 32, 56, .04);
  --shadow-2: 0 8px 28px rgba(20, 32, 56, .16), 0 2px 6px rgba(20, 32, 56, .08);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --fs: 15px;
  --rail-w: 72px;
  --side-w: 360px;
  --panel-w: 360px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0A101D;
  --surface: #111A2C;
  --surface-2: #16203A;
  --surface-3: #1C2746;
  --line: #22304F;
  --line-strong: #2E3E63;
  --ink: #E6EBF5;
  --ink-2: #AAB5CA;
  --ink-3: #6E7B95;
  --rail: #080D18;
  --rail-ink: #93A0BA;
  --rail-hover: #141E34;
  --accent-ink: #0A101D;
  --bubble-me: color-mix(in srgb, var(--accent) 26%, #111A2C);
  --bubble-them: #172238;
  --chat-bg: #0D1424;
  --credit: #3CC48D;
  --debit: #F2766B;
  --gold: #E3AE4C;
  --paper: #18233A;
  --paper-line: #2A3757;
  --danger: #F2766B;
  --success: #3CC48D;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 10px 34px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

:root[data-text="small"] { --fs: 14px; }
:root[data-text="large"] { --fs: 17px; }

/* ═══════════════════════════ base ═══════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { display: inline-flex; flex: none; }
.ic svg { display: block; }
[dir="rtl"] .flip-rtl svg, [dir="rtl"] .ic.flip svg { transform: scaleX(-1); }
.num, .amount, .badge, .stamp-time { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ═══════════════════════════ controls ═══════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--r-sm);
  font-weight: 600; font-size: .95em; background: var(--surface-3); color: var(--ink);
  transition: background .15s, transform .1s; position: relative; white-space: nowrap;
}
.btn:hover { background: var(--line); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.outline { background: transparent; border: 1px solid var(--line-strong); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: .88em; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.loading { color: transparent !important; }
.btn.loading::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--accent-ink) transparent var(--accent-ink) transparent;
  animation: spin .8s linear infinite;
}
.btn:not(.primary):not(.danger).loading::after { border-color: var(--ink-2) transparent var(--ink-2) transparent; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--ink-2); transition: background .15s, color .15s; flex: none; position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.on { color: var(--accent); }
.icon-btn.accent { background: var(--accent); color: var(--accent-ink); }
.icon-btn.accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: var(--accent-ink); }
.link { color: var(--accent); font-weight: 600; }
.link:hover { text-decoration: underline; }

.input {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[readonly] { background: var(--surface-2); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
[dir="rtl"] select.input { background-position: 18px 50%, 13px 50%; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label { font-size: .86em; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .8em; color: var(--ink-3); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.input-wrap { position: relative; }
.input-wrap .icon-btn { position: absolute; inset-inline-end: 2px; top: 2px; }

.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 10px 0; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; flex: none; transition: background .15s; }
.toggle .thumb { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: inset-inline-start .15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track .thumb { inset-inline-start: 21px; }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-text { display: grid; }
.toggle-text small { color: var(--ink-3); font-size: .82em; }

.segmented { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: .9em; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
.badge.muted { background: var(--ink-3); color: var(--surface); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--surface-3);
  color: var(--ink-2); font-weight: 600; font-size: .86em; white-space: nowrap; flex: none; }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.chip .badge { height: 18px; min-width: 18px; font-size: 10.5px; background: var(--ink-2); color: var(--surface); }
.chip.on .badge { background: var(--accent-ink); color: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: .76em; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.tag.danger { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.avatar { border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden; font-weight: 700;
  color: hsl(var(--h) 45% 30%); background: hsl(var(--h) 60% 88%); position: relative; user-select: none; }
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 70% 82%); background: hsl(var(--h) 35% 26%); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence-dot { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--success); border: 2px solid var(--surface); }

.spinner { display: inline-block; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sentinel { display: grid; place-items: center; padding: 18px; }
.list-error { padding: 16px; text-align: center; color: var(--ink-3); }
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 48px 24px; color: var(--ink-3); }
.empty strong { color: var(--ink-2); font-size: 1.02em; }
.empty p { margin: 0; max-width: 34ch; font-size: .9em; }
.empty .btn { margin-top: 10px; }

/* ═══════════════════════════ modal / menu / toast ═══════════════════════════ */
.modal-back { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px;
  background: rgba(8, 13, 24, .45); opacity: 0; transition: opacity .18s; }
.modal-back.in { opacity: 1; }
.modal-card { width: 100%; min-width: 0; max-height: min(88vh, 860px); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; transform: translateY(10px) scale(.985); transition: transform .18s; }
.modal-back.in .modal-card { transform: none; }
.modal-card.sm { max-width: 420px; } .modal-card.md { max-width: 520px; } .modal-card.lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 8px 22px; }
[dir="rtl"] .modal-head { padding: 16px 22px 8px 16px; }
.modal-title { font-size: 1.12em; font-weight: 700; margin: 0; flex: 1; }
.modal-body { padding: 8px 22px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 22px 18px; border-top: 1px solid var(--line); }
.confirm-text { margin: 0 0 4px; color: var(--ink-2); }

.menu { position: fixed; z-index: 310; min-width: 210px; max-width: 300px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-2);
  border: 1px solid var(--line); padding: 6px; opacity: 0; transform: scale(.97); transform-origin: top; transition: opacity .12s, transform .12s; }
.menu.in { opacity: 1; transform: none; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 8px; text-align: start; font-size: .94em; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); }
.menu-item .ic { color: var(--ink-3); }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.emoji-bar { display: flex; gap: 2px; padding: 4px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.emoji-bar button { width: 36px; height: 36px; border-radius: 50%; font-size: 20px; display: grid; place-items: center; transition: transform .1s, background .1s; }
.emoji-bar button:hover { background: var(--surface-3); transform: scale(1.15); }
.emoji-bar button.on { background: var(--accent-soft); }

.toasts { position: fixed; z-index: 320; top: calc(14px + env(safe-area-inset-top)); right: 14px; display: grid; gap: 10px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.toast { position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 14px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  color: var(--ink); border: 1px solid var(--line); box-shadow: 0 14px 38px rgba(10, 18, 36, .18), 0 2px 6px rgba(10, 18, 36, .08);
  font-size: .92em; pointer-events: auto; cursor: default; touch-action: pan-y;
  opacity: 0; transform: translateX(calc(100% + 24px)) scale(.96); transition: transform .42s cubic-bezier(.2, 1.3, .35, 1), opacity .25s; }
[dir="rtl"] .toast { padding: 12px 14px 14px 10px; }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: translateX(calc(100% + 24px)) scale(.96); transition: transform .3s ease-in, opacity .3s; }
.toast-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.toast.success .toast-ic { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.toast.error .toast-ic { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.toast.warn .toast-ic { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.toast-text { flex: 1; min-width: 0; display: grid; gap: 2px; padding-top: 5px; line-height: 1.4; }
.toast-text strong { font-weight: 700; }
.toast-text span { color: var(--ink-2); overflow-wrap: anywhere; }
.toast-text strong + span { font-size: .94em; }
.toast-act { align-self: center; padding: 6px 12px; border-radius: 8px; font-weight: 700; color: var(--accent); background: var(--accent-soft); flex: none; }
.toast-x { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.toast-x:hover { background: var(--surface-3); color: var(--ink); }
.toast-bar { position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; background: var(--accent); opacity: .55; transform-origin: left; animation: toastbar linear forwards; }
.toast.success .toast-bar { background: var(--success); } .toast.error .toast-bar { background: var(--danger); }
.toast.paused .toast-bar { animation-play-state: paused; }
@keyframes toastbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ═══════════════════════════ boot / auth ═══════════════════════════ */
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); color: var(--accent); z-index: 100; transition: opacity .25s; }
.boot .logo-mark { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; transform: scale(.94); } }

.code-input { letter-spacing: .5em; text-align: center; font-size: 1.4em; font-variant-numeric: tabular-nums; direction: ltr; }
.qa-block { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 12px; }
.qa-block .q { font-weight: 600; margin-bottom: 8px; }

/* ═══════════════════════════ app layout ═══════════════════════════ */
.app { height: 100%; display: grid; grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); background: var(--bg); }
.app.with-panel { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr) var(--panel-w); }

/* rail */
.rail { background: var(--rail); display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; gap: 6px; min-height: 0; overflow: hidden; }
.rail .logo { color: #fff; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.rail-list { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; overflow-y: auto; scrollbar-width: none; padding: 2px 0; }
.rail-list::-webkit-scrollbar { display: none; }
.rail-item { position: relative; width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--rail-ink);
  background: var(--rail-hover); transition: border-radius .15s, background .15s, color .15s; font-weight: 700; font-size: 15px; flex: none; }
.rail-ini { display: grid; place-items: center; flex: none; }
.rail-name { display: none; }
.rail-item:hover { border-radius: 14px; color: #fff; background: color-mix(in srgb, var(--accent) 35%, var(--rail-hover)); }
.rail-item.on { background: var(--accent); color: var(--accent-ink); border-radius: 14px; }
.rail-item.on::before { content: ''; position: absolute; inset-inline-start: -12px; width: 4px; height: 26px; border-radius: 0 4px 4px 0; background: #fff; }
[dir="rtl"] .rail-item.on::before { border-radius: 4px 0 0 4px; }
.rail-item .badge { position: absolute; top: -4px; inset-inline-end: -4px; border: 2px solid var(--rail); }
.rail-item .acc-dot { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 16px; height: 16px; border-radius: 50%; background: var(--gold);
  border: 2px solid var(--rail); display: grid; place-items: center; color: var(--rail); }
.rail-sep { width: 28px; height: 2px; border-radius: 2px; background: var(--rail-hover); margin: 4px 0; flex: none; }
.rail-item.ghost { background: transparent; border: 1.5px dashed #2E3D60; }
.rail-item.ghost:hover { border-style: solid; border-color: transparent; }
.rail-toggle { width: 34px; height: 28px; border-radius: 8px; color: var(--rail-ink); display: grid; place-items: center; flex: none; opacity: .75; }
.rail-toggle:hover { background: var(--rail-hover); opacity: 1; color: #fff; }
.rail-me { margin-top: 6px; border-radius: 50%; outline: 2px solid transparent; transition: outline-color .15s; display: flex; align-items: center; gap: 10px; color: #fff; }
.rail-me:hover, .rail-me.on { outline-color: var(--accent); }
.rail-tip { position: fixed; z-index: 80; background: var(--ink); color: var(--surface); padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; pointer-events: none; white-space: nowrap; }

/* wide rail: page names next to their letters */
.app.rail-wide { --rail-w: 232px; }
.rail.wide { align-items: stretch; padding-inline: 10px; }
.rail.wide .logo { padding-inline: 8px; }
.rail.wide .logo .rail-name { display: block; font-weight: 700; font-size: 1.05em; }
.rail.wide .rail-list { align-items: stretch; }
.rail.wide .rail-item { width: 100%; justify-content: flex-start; gap: 10px; padding: 0 6px; background: transparent; border-radius: 12px; height: 46px; text-align: start; }
.rail.wide .rail-item .rail-ini { width: 34px; height: 34px; border-radius: 10px; background: var(--rail-hover); font-size: 13px; }
.rail.wide .rail-item.on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #fff; }
.rail.wide .rail-item.on .rail-ini { background: var(--accent); color: var(--accent-ink); }
.rail.wide .rail-item.on::before { inset-inline-start: -10px; }
.rail.wide .rail-item:hover { background: var(--rail-hover); }
.rail.wide .rail-item.ghost { border: 0; }
.rail.wide .rail-item.ghost .rail-ini { background: transparent; border: 1.5px dashed #2E3D60; }
.rail.wide .rail-name { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .92em; }
.rail.wide .rail-item .badge { position: static; border: 0; }
.rail.wide .rail-item .acc-dot { position: static; border: 0; width: 18px; height: 18px; }
.rail.wide .rail-sep { width: auto; margin: 4px 8px; }
.rail.wide .rail-toggle { align-self: flex-end; }
.rail.wide .rail-me { border-radius: 99px; padding: 4px 10px 4px 4px; outline: 0; }
[dir="rtl"] .rail.wide .rail-me { padding: 4px 4px 4px 10px; }
.rail.wide .rail-me:hover, .rail.wide .rail-me.on { background: var(--rail-hover); }
.rail.wide .rail-me .rail-name { font-size: .9em; }

/* sidebar (chat list / settings) */
.side { background: var(--surface); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; overflow: hidden; }
.side-head { padding: 14px 16px 8px; display: flex; align-items: center; gap: 6px; }
.side-title { font-size: 1.28em; font-weight: 700; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sub { font-size: .8em; color: var(--ink-3); font-weight: 500; display: block; }
.search-box { margin: 4px 16px 10px; position: relative; }
.search-box .ic { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 12px; color: var(--ink-3); pointer-events: none; }
.search-box input { width: 100%; height: 40px; border-radius: 99px; border: 0; background: var(--surface-3); padding-inline: 40px 14px; outline: none; }
.search-box input:focus { box-shadow: 0 0 0 2px var(--accent); background: var(--surface); }
.chips { display: flex; gap: 8px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.side-body { flex: 1; min-height: 0; }
.page-banner { margin: 0 12px 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); display: flex; align-items: center; gap: 10px; }
.page-banner .t { flex: 1; min-width: 0; }
.page-banner .t strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-banner .t span { font-size: .8em; color: var(--ink-3); }
.fab { position: absolute; bottom: 20px; inset-inline-end: 20px; width: 54px; height: 54px; border-radius: 18px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; box-shadow: var(--shadow-2); transition: transform .15s; z-index: 2; }
.fab:hover { transform: translateY(-2px); }

/* chat list rows */
.chat-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 8px; border-radius: var(--r-md); cursor: pointer; position: relative; user-select: none; }
.chat-row:hover { background: var(--surface-2); }
.chat-row.on { background: var(--accent-soft); }
.chat-row .meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-row .top, .chat-row .bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-row .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.chat-row .name .ic { color: var(--ink-3); }
.chat-row .time { font-size: .76em; color: var(--ink-3); flex: none; }
.chat-row.unread .time { color: var(--accent); font-weight: 600; }
.chat-row .preview { flex: 1; min-width: 0; font-size: .88em; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .preview b { color: var(--ink-2); font-weight: 600; }
.chat-row .preview .amt { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.chat-row .flags { display: flex; align-items: center; gap: 4px; color: var(--ink-3); flex: none; }
.chat-row .page-label { font-size: .72em; color: var(--ink-3); font-weight: 600; }
.chat-row.pending { opacity: .75; }
:root[data-compact="1"] .chat-row { padding-block: 5px; }
:root[data-compact="1"] .chat-row .avatar { width: 36px !important; height: 36px !important; }
.list-section { padding: 12px 20px 6px; font-size: .78em; font-weight: 700; color: var(--ink-3); }

/* main conversation */
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--chat-bg); position: relative; }
.main-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--ink-3); padding: 24px; }
.main-empty .logo-mark { color: var(--line-strong); margin: 0 auto 14px; }
.main-empty h2 { color: var(--ink-2); font-size: 1.15em; margin: 0 0 6px; }
.main-empty p { margin: 0; }
.chat-head { height: 64px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 3; }
[dir="rtl"] .chat-head { padding: 0 14px 0 10px; }
.chat-head .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 6px; border-radius: 10px; }
.chat-head .who:hover { background: var(--surface-2); }
.chat-head .who-text { min-width: 0; }
.chat-head .who-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .who-sub { font-size: .8em; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .who-sub.typing { color: var(--accent); }
.balance-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; background: var(--paper);
  border: 1px solid var(--paper-line); font-weight: 700; font-variant-numeric: tabular-nums; flex: none; cursor: pointer; }
.balance-chip small { font-weight: 600; color: var(--ink-3); font-size: .75em; }
.balance-chip.neg { color: var(--debit); }
.balance-chip.pos { color: var(--credit); }
.back-btn { display: none; }

.pinned-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; z-index: 2; }
.pinned-bar .ic { color: var(--accent); }
.pinned-bar .t { flex: 1; min-width: 0; font-size: .88em; }
.pinned-bar .t strong { display: block; color: var(--accent); font-size: .9em; }
.pinned-bar .t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.chat-search { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-search input { flex: 1; height: 38px; border-radius: 99px; border: 0; background: var(--surface-3); padding: 0 16px; outline: none; }

.messages { flex: 1; min-height: 0; position: relative; padding: 10px 0 6px; overflow-anchor: none;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
.messages-inner { max-width: 880px; margin: 0 auto; padding: 0 18px; display: flex; flex-direction: column; }
.day-sep { align-self: center; margin: 14px 0 8px; padding: 4px 12px; border-radius: 99px; background: var(--surface);
  font-size: .78em; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-1); }
.unread-sep { align-self: stretch; text-align: center; margin: 12px 0; font-size: .8em; font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 12px; }
.unread-sep::before, .unread-sep::after { content: ''; flex: 1; height: 1px; background: color-mix(in srgb, var(--accent) 40%, transparent); }
.history-start { align-self: center; margin: 18px 0; color: var(--ink-3); font-size: .85em; }

/* message bubbles */
.msg { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; max-width: 100%; position: relative; }
.msg.cont { margin-top: 2px; }
.msg.me { flex-direction: row-reverse; }
.msg .avatar-slot { width: 34px; flex: none; }
.msg.me .avatar-slot { display: none; }
.bubble { position: relative; max-width: min(560px, 78%); padding: 7px 11px 6px; border-radius: 16px; background: var(--bubble-them); box-shadow: var(--shadow-1);
  overflow-wrap: anywhere; min-width: 70px; }
.msg.me .bubble { background: var(--bubble-me); }
.msg:not(.cont):not(.me) .bubble { border-end-start-radius: 6px; }
.msg.me:not(.cont) .bubble { border-end-end-radius: 6px; }
.msg.flash .bubble { animation: flash 1.2s; }
@keyframes flash { 30% { box-shadow: 0 0 0 3px var(--accent); } }
.sender { font-size: .82em; font-weight: 700; color: hsl(var(--h) 55% 42%); margin-bottom: 2px; display: flex; gap: 6px; align-items: center; }
:root[data-theme="dark"] .sender { color: hsl(var(--h) 70% 72%); }
.sender .tag { font-size: .85em; }
.text { white-space: pre-wrap; line-height: 1.45; }
.text a { word-break: break-all; }
.text code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.text .mention { color: var(--accent); font-weight: 600; }
.text.jumbo { font-size: 2.2em; line-height: 1.2; }
.meta-line { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; font-size: .72em; color: var(--ink-3); float: inline-end; margin-inline-start: 12px; position: relative; top: 5px; }
.meta-line .ic { color: var(--ink-3); }
.meta-line .read .ic, .meta-line .ic.read { color: var(--accent); }
.msg .clearfix { clear: both; }
.fwd { font-size: .8em; color: var(--ink-3); font-style: italic; display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.quote { display: block; text-align: start; width: 100%; border-inline-start: 3px solid var(--accent); background: var(--accent-softer); border-radius: 6px; padding: 5px 9px; margin: 2px 0 5px; font-size: .86em; cursor: pointer; }
.quote strong { display: block; color: var(--accent); font-size: .92em; }
.quote span { display: block; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; clear: both; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--surface-3); font-size: .85em; border: 1px solid transparent; }
.reaction.mine { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.reaction b { font-weight: 600; font-size: .9em; font-variant-numeric: tabular-nums; }
.msg-actions { position: absolute; top: -14px; inset-inline-end: 8px; display: none; gap: 2px; background: var(--surface); border-radius: 99px; box-shadow: var(--shadow-2); padding: 2px; z-index: 2; }
.msg.me .msg-actions { inset-inline-end: auto; inset-inline-start: 8px; }
.msg-actions .icon-btn { width: 30px; height: 30px; }
@media (hover: hover) { .msg:hover .msg-actions { display: flex; } }
.msg.pending .bubble { opacity: .7; }
.msg.failed .bubble { box-shadow: 0 0 0 1.5px var(--danger); }

/* media inside messages */
.media-img { display: block; margin: -3px -7px 4px; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--surface-3); max-width: 340px; }
.media-img img { width: 100%; max-height: 380px; object-fit: cover; }
.media-video { margin: -3px -7px 4px; border-radius: 12px; overflow: hidden; max-width: 360px; }
.media-video video { width: 100%; display: block; max-height: 380px; background: #000; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 5%, transparent); margin: 2px 0 4px; text-decoration: none; color: inherit; min-width: 220px; }
.file-card .fi { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.file-card .fn { font-weight: 600; font-size: .9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file-card .fs { font-size: .76em; color: var(--ink-3); }
.audio { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 4px 0; }
.audio .play { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.audio .bar { flex: 1; height: 28px; position: relative; cursor: pointer; display: flex; align-items: center; gap: 2px; }
.audio .bar i { flex: 1; background: var(--line-strong); border-radius: 2px; min-width: 2px; }
.audio .bar i.on { background: var(--accent); }
.audio .dur { font-size: .76em; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 36px; }
.upload-progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 6px 0 2px; }
.upload-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }

/* ── the ledger slip: financial messages ── */
.slip { position: relative; min-width: 260px; max-width: 340px; background: var(--paper); color: var(--ink); border-radius: 6px 6px 12px 12px;
  padding: 16px 16px 12px; box-shadow: var(--shadow-1); margin: 2px 0;
  -webkit-mask: radial-gradient(circle 6px at 9px 0, #0000 98%, #000) -9px 0 / 18px 100% repeat-x; mask: radial-gradient(circle 6px at 9px 0, #0000 98%, #000) -9px 0 / 18px 100% repeat-x; }
.bubble.has-slip { background: transparent; box-shadow: none; padding: 0; min-width: 0; }
.slip-head { display: flex; align-items: center; gap: 8px; font-size: .78em; font-weight: 700; color: var(--ink-3); letter-spacing: .01em; }
.slip-head .kind { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; }
.slip.in .kind { background: color-mix(in srgb, var(--credit) 14%, transparent); color: var(--credit); }
.slip.out .kind { background: color-mix(in srgb, var(--debit) 13%, transparent); color: var(--debit); }
.slip.move .kind { background: var(--accent-soft); color: var(--accent); }
.slip-amount { font-size: 1.9em; font-weight: 700; letter-spacing: -.01em; margin: 8px 0 2px; font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }
[dir="rtl"] .slip-amount { text-align: end; }
.slip.in .slip-amount { color: var(--credit); }
.slip.out .slip-amount { color: var(--debit); }
.slip-type { font-weight: 600; color: var(--ink-2); font-size: .9em; }
.slip-route { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .86em; font-weight: 600; color: var(--accent); }
.slip-remarks { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--paper-line); white-space: pre-wrap; font-size: .93em; }
.slip-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .74em; color: var(--ink-3); }
.slip-foot .grow { flex: 1; }
.slip-by { font-weight: 700; color: var(--ink-2); }
.stamp { position: absolute; top: 12px; inset-inline-end: 12px; transform: rotate(-9deg); border: 2px solid currentColor; border-radius: 6px; padding: 2px 8px;
  font-size: .72em; font-weight: 800; letter-spacing: .04em; opacity: .85; cursor: pointer; background: transparent; }
.stamp.open { color: var(--gold); }
.stamp.done { color: var(--credit); }
.task-pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: 99px; font-size: .8em; font-weight: 700; cursor: pointer; }
.task-pill.open { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.task-pill.done { background: color-mix(in srgb, var(--credit) 14%, transparent); color: var(--credit); }

.jump-btn { position: absolute; bottom: 92px; inset-inline-end: 22px; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-2);
  display: grid; place-items: center; color: var(--ink-2); z-index: 4; transition: transform .15s, opacity .15s; }
.jump-btn.hide { opacity: 0; transform: translateY(10px); pointer-events: none; }
.jump-btn .badge { position: absolute; top: -6px; inset-inline-end: -4px; }
.typing-dots { display: inline-flex; gap: 3px; margin-inline-end: 6px; vertical-align: middle; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; } .typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* composer */
.composer-wrap { flex: none; padding: 8px 16px 14px; position: relative; z-index: 3; }
.composer-inner { max-width: 880px; margin: 0 auto; }
.compose-ctx { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-radius: 14px 14px 0 0; border-bottom: 1px solid var(--line); font-size: .86em; }
.compose-ctx .ic:first-child { color: var(--accent); }
.compose-ctx .t { flex: 1; min-width: 0; }
.compose-ctx .t strong { color: var(--accent); display: block; font-size: .92em; }
.compose-ctx .t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.composer { display: flex; align-items: flex-end; gap: 6px; background: var(--surface); border-radius: 22px; padding: 5px 6px; box-shadow: var(--shadow-1); }
.compose-ctx + .composer { border-radius: 0 0 22px 22px; }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; padding: 9px 6px; max-height: 180px; line-height: 1.45; min-height: 40px; }
.composer .send { width: 42px; height: 42px; }
.composer .money-btn { color: var(--gold); }
.composer-note { text-align: center; color: var(--ink-3); font-size: .86em; padding: 10px; }
.compose-hint { font-size: .74em; color: var(--ink-3); padding: 4px 14px 0; display: flex; gap: 10px; }
.compose-hint .copyto { color: var(--accent); font-weight: 600; }
.recorder { flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 8px; min-height: 40px; color: var(--danger); font-weight: 600; font-variant-numeric: tabular-nums; }
.recorder .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
.recorder .grow { flex: 1; }
.pop { position: absolute; bottom: calc(100% - 4px); inset-inline-start: 16px; z-index: 5; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-2); border: 1px solid var(--line); }
.emoji-panel { width: min(340px, calc(100vw - 32px)); padding: 10px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 240px; overflow-y: auto; }
.emoji-grid button { font-size: 22px; height: 38px; border-radius: 8px; }
.emoji-grid button:hover { background: var(--surface-3); }
.emoji-tabs { display: flex; gap: 2px; margin-bottom: 6px; }
.emoji-tabs button { flex: 1; height: 32px; border-radius: 8px; font-size: 18px; opacity: .55; }
.emoji-tabs button.on { background: var(--surface-3); opacity: 1; }
.mention-pop { min-width: 240px; max-height: 260px; overflow-y: auto; padding: 6px; }
.mention-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: start; }
.mention-pop button.on, .mention-pop button:hover { background: var(--surface-3); }
.drop-zone { position: absolute; inset: 0; z-index: 10; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 3px dashed var(--accent); display: grid; place-items: center;
  font-weight: 700; color: var(--accent); font-size: 1.1em; pointer-events: none; }
.read-only-bar { flex: none; text-align: center; padding: 14px; color: var(--ink-3); background: var(--surface); border-top: 1px solid var(--line); font-size: .9em; }
.join-bar { flex: none; display: flex; justify-content: center; padding: 14px; background: var(--surface); border-top: 1px solid var(--line); }

/* right panel */
.panel { background: var(--surface); border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panel-head { height: 64px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 1.05em; flex: 1; }
.panel-hero { display: grid; justify-items: center; gap: 6px; padding: 24px 20px 16px; text-align: center; border-bottom: 8px solid var(--surface-2); }
.panel-hero h2 { margin: 6px 0 0; font-size: 1.25em; }
.panel-hero .sub { color: var(--ink-3); font-size: .88em; }
.panel-hero .about { color: var(--ink-2); font-size: .92em; white-space: pre-wrap; max-width: 34ch; }
.panel-actions { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.panel-actions button { display: grid; justify-items: center; gap: 4px; min-width: 70px; padding: 8px; border-radius: 12px; color: var(--accent); font-size: .78em; font-weight: 600; background: var(--surface-2); }
.panel-actions button:hover { background: var(--accent-soft); }
.panel-section { padding: 6px 0; border-bottom: 8px solid var(--surface-2); }
.panel-section h4 { margin: 10px 20px 6px; font-size: .82em; color: var(--ink-3); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-section h4 .grow { flex: 1; }
.tabs { display: flex; padding: 0 12px; border-bottom: 1px solid var(--line); gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs button { padding: 12px 10px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; font-size: .9em; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-color: var(--accent); }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; }
.media-grid a { aspect-ratio: 1; background: var(--surface-3); overflow: hidden; display: block; }
.media-grid img { width: 100%; height: 100%; object-fit: cover; }

/* generic list items (members, settings, admin) */
.item { display: flex; align-items: center; gap: 14px; padding: 10px 20px; width: 100%; text-align: start; min-height: 52px; }
button.item:hover, a.item:hover, .item.click:hover { background: var(--surface-2); }
.item > .ic { color: var(--ink-3); }
.item .t { flex: 1; min-width: 0; display: grid; }
.item .t strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.item .t span { font-size: .82em; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .end { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: .86em; flex: none; }
.item.danger, .item.danger .ic { color: var(--danger); }
.item-value { color: var(--ink-3); font-size: .9em; }

/* settings */
.settings-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 8px solid var(--surface-2); cursor: pointer; }
.settings-hero:hover { background: var(--surface-2); }
.settings-hero .t strong { display: block; font-size: 1.12em; }
.settings-hero .t span { color: var(--ink-3); font-size: .88em; direction: ltr; unicode-bidi: plaintext; }
.settings-group { border-bottom: 8px solid var(--surface-2); padding: 4px 0; }
.settings-pad { padding: 16px 20px; }
.settings-pad > p.lead { margin: 0 0 16px; color: var(--ink-2); font-size: .92em; }
.slide-in { animation: slideIn .2s ease-out; }
@keyframes slideIn { from { transform: translateX(14px); opacity: 0; } }
[dir="rtl"] .slide-in { animation-name: slideInR; }
@keyframes slideInR { from { transform: translateX(-14px); opacity: 0; } }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line-strong); display: grid; place-items: center; color: #fff; }
.swatch.on { box-shadow: 0 0 0 2.5px var(--ink); }
.qr-box { display: grid; justify-items: center; gap: 10px; padding: 16px; background: #fff; border-radius: var(--r-md); margin: 10px 0 16px; }
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: .9em; letter-spacing: .08em; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; direction: ltr; text-align: center; word-break: break-all; color: var(--ink); }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--ink); font-size: .9em; margin-bottom: 16px; }
.notice .ic { color: var(--gold); }
.notice.info { background: var(--accent-softer); } .notice.info .ic { color: var(--accent); }

/* admin */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px 20px; }
.stat { padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.stat b { display: block; font-size: 1.5em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8em; color: var(--ink-3); font-weight: 600; }

/* finance */
.money-input { font-size: 1.6em; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; direction: ltr; min-height: 58px; }
.balance-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: var(--r-sm); background: var(--paper); border: 1px solid var(--paper-line); margin-bottom: 16px; font-weight: 600; }
.balance-line b { font-variant-numeric: tabular-nums; font-size: 1.1em; direction: ltr; }
.process-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 16px; }
.process-picker button { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: var(--r-md); border: 1.5px solid var(--line); font-size: .84em; font-weight: 600; color: var(--ink-2); }
.process-picker button .ic { color: var(--ink-3); }
.process-picker button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.process-picker button.on .ic { color: var(--accent); }
.group-total { margin: 16px; padding: 18px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--paper-line); }
.group-total span { color: var(--ink-3); font-weight: 600; font-size: .86em; }
.group-total b { display: block; font-size: 2em; font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }
[dir="rtl"] .group-total b { text-align: end; }
.acc-card { display: flex; align-items: center; gap: 12px; margin: 6px 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); border-inline-start: 4px solid var(--c, var(--accent)); }
.acc-card .t { flex: 1; min-width: 0; }
.acc-card .t strong { display: block; }
.acc-card .t span { font-size: .8em; color: var(--ink-3); }
.acc-card .bal { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.acc-card .bal.neg { color: var(--debit); } .acc-card .bal.pos { color: var(--credit); }
.acc-card.off { opacity: .55; }
/* the whole account card opens the account (v2.10.4) */
.acc-card.clickable { cursor: pointer; transition: transform var(--t-fast, .15s), box-shadow var(--t-fast, .15s), background .15s; }
.acc-card.clickable:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.acc-card.clickable:active { transform: scale(.99); }
.acc-card.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acc-card .acc-report { color: var(--ink-3); }
.acc-card .acc-report:hover { color: var(--accent); }
.code-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
pre.code { margin: 0 0 12px; padding: 14px; border-radius: var(--r-md); background: #0E1526; color: #D7E0F2; font-size: 12.5px; line-height: 1.55; overflow-x: auto; direction: ltr; text-align: left; white-space: pre; }
.key-box { display: flex; gap: 8px; align-items: center; margin: 8px 0 14px; }
.key-box .secret { flex: 1; text-align: start; }

/* link page (public + editor preview) */
.lt-page { min-height: 100%; display: grid; justify-items: center; padding: 44px 16px 56px; background: var(--lt-bg); color: var(--lt-ink); overflow-y: auto; height: 100%;
  --lt-bg: #0E1526; --lt-ink: #F1F4FA; --lt-card: #18233A; --lt-line: #26355A; --lt-ring: #7393F7; }
.lt-page.light { --lt-bg: #F3F5F9; --lt-ink: #152033; --lt-card: #FFFFFF; --lt-line: #DEE3EA; --lt-ring: #2F5BD3; }
.lt-page.gradient { --lt-bg: linear-gradient(165deg, #1E2F6B, #6B2F7A 60%, #C2365F); --lt-ink: #fff; --lt-card: rgba(255, 255, 255, .14); --lt-line: rgba(255, 255, 255, .22); --lt-ring: #fff; }
.lt-page.ocean { --lt-bg: linear-gradient(170deg, #062A3F, #0B5C73 55%, #12907F); --lt-ink: #EFFBFF; --lt-card: rgba(255, 255, 255, .12); --lt-line: rgba(255, 255, 255, .2); --lt-ring: #7FE3D2; }
.lt-page.forest { --lt-bg: linear-gradient(170deg, #0F2A1D, #1E4D33); --lt-ink: #F0F7F1; --lt-card: rgba(255, 255, 255, .1); --lt-line: rgba(255, 255, 255, .18); --lt-ring: #9BD7A8; }
.lt-page.sunset { --lt-bg: linear-gradient(170deg, #FF9A62, #E8577A 55%, #6B3FA0); --lt-ink: #fff; --lt-card: rgba(255, 255, 255, .18); --lt-line: rgba(255, 255, 255, .3); --lt-ring: #fff; }
.lt-page.sand { --lt-bg: #F4EDE1; --lt-ink: #3B2F22; --lt-card: #FFFBF4; --lt-line: #E5D8C3; --lt-ring: #B26A00; }
.lt-page.mono { --lt-bg: #FFFFFF; --lt-ink: #111111; --lt-card: #FFFFFF; --lt-line: #111111; --lt-ring: #111111; }
.lt-inner { width: 100%; max-width: 520px; display: grid; gap: 12px; justify-items: center; align-content: start; }
.lt-avatar { padding: 4px; border-radius: 50%; background: var(--lt-bg); box-shadow: 0 0 0 2px var(--lt-ring); }
.lt-inner h1 { margin: 8px 0 0; font-size: 1.5em; text-align: center; line-height: 1.25; }
.lt-bio { text-align: center; opacity: .82; max-width: 42ch; white-space: pre-wrap; margin: 0; line-height: 1.55; }
.lt-socials { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lt-socials a { padding: 6px 14px; border-radius: 99px; background: var(--lt-card); border: 1px solid var(--lt-line); color: inherit; text-decoration: none; font-size: .84em; font-weight: 600; }
.lt-links { width: 100%; display: grid; gap: 10px; margin-top: 12px; }
.lt-links.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lt-link { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border-radius: 16px; background: var(--lt-card); border: 1px solid var(--lt-line);
  color: inherit; text-decoration: none; font-weight: 600; transition: transform .12s, box-shadow .12s; }
.lt-link:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .14); }
.lt-link:active { transform: scale(.985); }
.lt-link .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lt-link .t small { display: block; font-weight: 400; opacity: .72; font-size: .82em; margin-top: 1px; }
.lt-link > .ic:last-child { opacity: .5; }
.lt-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 12%, transparent); flex: none; }
.lt-thumb { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: none; }
.lt-links.grid .lt-link { flex-direction: column; text-align: center; justify-content: center; padding: 16px 10px; }
.lt-links.grid .lt-link > .ic:last-child { display: none; }
.lt-links.grid .lt-thumb { width: 64px; height: 64px; }
.lt-foot { margin-top: 26px; opacity: .55; font-size: .8em; display: flex; align-items: center; gap: 6px; }

/* link page editor */
.lt-editor { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); }
.lt-left { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.lt-edit { flex: 1; min-height: 0; }
.lt-pad { padding: 14px 18px 28px; max-width: 680px; }
.lt-share { display: flex; align-items: center; gap: 4px; margin: 12px 14px 4px; padding: 10px 8px 10px 14px; border-radius: var(--r-md); background: var(--accent-softer); border: 1px solid var(--accent-soft); }
[dir="rtl"] .lt-share { padding: 10px 14px 10px 8px; }
.lt-share .t { flex: 1; min-width: 0; display: grid; }
.lt-share .t strong { font-size: .86em; color: var(--accent); }
.lt-share .t span { font-size: .84em; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.lt-tabs { padding: 0 8px; }
.lt-tabs button { display: inline-flex; align-items: center; gap: 4px; }
.lt-tabs .only-mobile { display: none; }
.lt-row-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lt-items { display: grid; gap: 8px; }
.lt-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 4px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); transition: box-shadow .15s, opacity .15s; }
[dir="rtl"] .lt-item { padding: 8px 4px 8px 8px; }
.lt-item.off { opacity: .55; }
.lt-item.dragging { box-shadow: var(--shadow-2); border-color: var(--accent); }
.lt-item .t { flex: 1; min-width: 0; display: grid; text-align: start; }
.lt-item .t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-item .t span { font-size: .8em; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.lt-item-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.lt-item-img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none; }
.lt-preview { min-height: 0; background: var(--chat-bg); border-inline-start: 1px solid var(--line); display: grid; justify-items: center; align-content: start; padding: 22px 16px; }
.lt-phone { width: 100%; max-width: 380px; height: min(720px, calc(100vh - 160px)); border-radius: 28px; overflow: hidden; border: 8px solid var(--ink); box-shadow: var(--shadow-2); }
.lt-phone .lt-page { padding-top: 32px; font-size: .92em; }
.lt-preview.lt-view { padding: 0; border: 0; display: block; height: 100%; }
.lt-view .lt-phone { height: 100%; max-width: none; border: 0; border-radius: 0; box-shadow: none; }
.lt-h { margin: 18px 0 10px; font-size: .82em; color: var(--ink-3); font-weight: 700; }
.lt-h:first-child { margin-top: 4px; }
.lt-photo { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.lt-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; max-width: 560px; margin-bottom: 18px; }
.lt-theme { height: 92px; border-radius: 12px; padding: 10px 8px; display: grid; align-content: center; gap: 6px; border: 2px solid var(--line); background: var(--lt-bg); position: relative; }
.lt-theme.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lt-theme .bar { height: 10px; border-radius: 5px; background: var(--lt-card); border: 1px solid var(--lt-line); }
.lt-theme.dark { --lt-bg: #0E1526; --lt-card: #18233A; --lt-line: #26355A; } .lt-theme.light { --lt-bg: #F3F5F9; --lt-card: #fff; --lt-line: #DEE3EA; }
.lt-theme.gradient { --lt-bg: linear-gradient(165deg, #1E2F6B, #6B2F7A 60%, #C2365F); --lt-card: rgba(255,255,255,.25); --lt-line: transparent; }
.lt-theme.ocean { --lt-bg: linear-gradient(170deg, #062A3F, #12907F); --lt-card: rgba(255,255,255,.22); --lt-line: transparent; }
.lt-theme.forest { --lt-bg: linear-gradient(170deg, #0F2A1D, #1E4D33); --lt-card: rgba(255,255,255,.2); --lt-line: transparent; }
.lt-theme.sunset { --lt-bg: linear-gradient(170deg, #FF9A62, #6B3FA0); --lt-card: rgba(255,255,255,.3); --lt-line: transparent; }
.lt-theme.sand { --lt-bg: #F4EDE1; --lt-card: #FFFBF4; --lt-line: #E5D8C3; } .lt-theme.mono { --lt-bg: #fff; --lt-card: #fff; --lt-line: #111; }
.lt-socials-edit { display: grid; gap: 8px; }
.lt-social-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 6px; align-items: center; }
.lt-img-pick { display: flex; align-items: center; gap: 10px; }
.lt-img-pick img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.swatch.none { background: repeating-linear-gradient(45deg, var(--surface-3) 0 4px, var(--surface) 4px 8px) !important; color: var(--ink-2); }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#f43, #fb3, #3c6, #3bf, #a4f, #f43); cursor: pointer; }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drag-handle { cursor: grab; color: var(--ink-3); touch-action: none; display: grid; place-items: center; padding: 6px 2px; flex: none; }
.drag-handle:active { cursor: grabbing; }
.toggle.sm { padding: 0; }
.toggle.sm .track { width: 36px; height: 20px; } .toggle.sm .thumb { width: 14px; height: 14px; }
.toggle.sm input:checked + .track .thumb { inset-inline-start: 19px; }

/* reorder dialog */
.sort-list { display: grid; gap: 6px; }
.sort-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 2px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; }
[dir="rtl"] .sort-row { padding: 6px 2px 6px 6px; }
.sort-row.dragging { background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow-2); }
.sort-row .t { flex: 1; min-width: 0; display: grid; }
.sort-row .t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sort-row .t span { font-size: .8em; color: var(--ink-3); }
.icon-btn.sm { width: 32px; height: 32px; }
.sorting { user-select: none; }

/* image cropper */
.crop { display: grid; justify-items: center; gap: 12px; }
.crop-stage { position: relative; border-radius: 12px; overflow: hidden; touch-action: none; background: #0b1220; }
.crop-canvas { display: block; cursor: grab; touch-action: none; }
.crop-canvas:active { cursor: grabbing; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); border-radius: 12px; }
.crop-stage.round .crop-mask { border-radius: 50%; box-shadow: 0 0 0 999px rgba(5, 8, 15, .55), inset 0 0 0 2px rgba(255, 255, 255, .85); }
.crop-tools { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--ink-3); }
.crop-zoom { flex: 1; accent-color: var(--accent); }
.crop .hint { margin: 0; font-size: .82em; color: var(--ink-3); text-align: center; }

/* locked room */
.lock-card { width: min(340px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; padding: 28px 22px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.lock-card h2 { margin: 0; color: var(--ink); }
.lock-card p { margin: 0 0 4px; }
.lock-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

/* fingerprint */
.fp-hero { display: grid; justify-items: center; text-align: center; gap: 6px; margin-bottom: 8px; }
.fp-ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.fp-slot:not(:empty) { margin-top: 10px; }
.fp-btn { gap: 10px; }

/* integrations */
.integ-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); margin-bottom: 8px; }
.integ-card.off { opacity: .6; }
.integ-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.integ-card .t { flex: 1; min-width: 0; display: grid; gap: 4px; }
.integ-card .t strong { overflow-wrap: anywhere; }
.integ-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.integ-meta { font-size: .8em; color: var(--ink-3); }
details.how { max-width: 100%; min-width: 0; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 12px; }
details.how > summary { cursor: pointer; padding: 12px 0; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; color: var(--ink-2); }
details.how > summary::-webkit-details-marker { display: none; }
details.how[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.code-block { min-width: 0; padding-bottom: 12px; }
.code-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; justify-content: space-between; flex-wrap: wrap; }
.modal-body { min-width: 0; }
pre.code { max-width: 100%; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5, 8, 15, .92); display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 6px; }
.lightbox .bar { position: absolute; top: 12px; inset-inline-end: 12px; display: flex; gap: 6px; }
.lightbox .icon-btn { color: #fff; background: rgba(255, 255, 255, .08); }

.conn-bar { position: absolute; top: 0; inset-inline: 0; z-index: 20; text-align: center; font-size: .8em; font-weight: 600; padding: 3px; background: var(--gold); color: #1a1205; }

/* ═══════════════════════════ responsive ═══════════════════════════ */
@media (max-width: 1280px) { .app.with-panel { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); } .app.with-panel .panel { position: fixed; inset-block: 0; inset-inline-end: 0; width: var(--panel-w); z-index: 30; box-shadow: var(--shadow-2); } }
@media (max-width: 1080px) {
  :root { --side-w: 320px; }
  .lt-editor { grid-template-columns: 1fr; }
  .lt-editor .lt-preview { display: none; }
  .lt-editor.show-preview .lt-preview { display: grid; grid-row: 2; }
  .lt-editor.show-preview .lt-edit { display: none; }
  .lt-editor.show-preview { grid-template-rows: auto minmax(0, 1fr); }
  .lt-tabs .only-mobile { display: inline-flex; }
  .lt-phone { height: auto; min-height: 520px; }
}
@media (max-width: 860px) {
  :root { --rail-w: 0px; }
  .app, .app.with-panel { grid-template-columns: 1fr; }
  .rail { display: none; }
  .side, .main { grid-column: 1; grid-row: 1; }
  .app.chat-open .side { visibility: hidden; }
  .app:not(.chat-open) .main { display: none; }
  .back-btn { display: inline-grid; }
  .app.with-panel .panel { width: 100%; }
  .bubble { max-width: 86%; }
  .messages-inner { padding: 0 10px; }
  .composer-wrap { padding: 6px 8px 10px; }
  .balance-chip small { display: none; }
  .chat-head .who-sub { max-width: 46vw; }
  .modal-back { place-items: end center; padding: 0; }
  .modal-card { border-radius: 20px 20px 0 0; max-height: 92vh; transform: translateY(30px); }
  .modal-card.sm, .modal-card.md, .modal-card.lg { max-width: 100%; }
  .jump-btn { bottom: 84px; inset-inline-end: 14px; }
  .toasts { right: 10px; width: calc(100vw - 20px); }
  .mobile-pages { display: flex !important; }
  .hide-mobile { display: none !important; }
  .chat-head { gap: 4px; padding: 0 6px !important; }
  .balance-chip { padding: 0 10px; height: 34px; font-size: .9em; }
  .msg-actions { display: none !important; }
  .lt-themes { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .lt-theme { height: 78px; }
  .lt-social-row { grid-template-columns: 1fr auto; }
  .lt-social-row input:first-child { grid-column: 1 / -1; }
  .lt-pad { padding: 12px 12px 24px; }
  .lt-share { margin: 10px 10px 2px; }
  .lt-row-head { flex-wrap: wrap; }
  .lt-preview { padding: 0; border: 0; }
  .lt-phone { border: 0; border-radius: 0; max-width: 100%; box-shadow: none; }
  .modal-foot .block-mobile { flex: 1; }
  .integ-modal .modal-body { padding-inline: 14px; }
  .code-bar .segmented button { padding: 6px 10px; }
}
.mobile-pages { display: none; }

/* ═══════════════════════════ v2.2 ═══════════════════════════ */
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.shake { animation: shake .4s; }

/* safe areas (phones with notches / home bars, and the future Android / iOS app) */
.app { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.composer-wrap { padding-bottom: max(10px, env(safe-area-inset-bottom)); }

/* assistant button */
.fab-ai { bottom: 86px; width: 46px; height: 46px; border-radius: 15px; inset-inline-end: 24px; background: linear-gradient(140deg, #7C4DDB, var(--accent)); color: #fff; }
.fab-ai::after { content: ''; position: absolute; inset: -4px; border-radius: 18px; border: 2px solid color-mix(in srgb, #7C4DDB 45%, transparent); animation: aipulse 2.6s ease-out infinite; }
@keyframes aipulse { from { opacity: .9; transform: scale(.92); } to { opacity: 0; transform: scale(1.25); } }

/* assistant sheet */
.as-stage { display: grid; justify-items: center; gap: 14px; padding: 10px 0 18px; }
.as-mic { position: relative; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, #9A7BEA, #6B4BD8 45%, var(--accent)); box-shadow: 0 14px 36px color-mix(in srgb, #6B4BD8 40%, transparent); transition: transform .15s; }
.as-mic:active { transform: scale(.95); }
.as-mic.off { filter: grayscale(.8); opacity: .7; }
.as-wave { position: absolute; inset: 0; border-radius: 50%; }
.as-mic.on .as-wave { animation: wave 1.2s ease-out infinite; box-shadow: 0 0 0 0 color-mix(in srgb, #6B4BD8 55%, transparent); }
@keyframes wave { to { box-shadow: 0 0 0 26px transparent; } }
.as-transcript { min-height: 48px; max-width: 46ch; text-align: center; color: var(--ink-3); font-size: 1.02em; line-height: 1.5; }
.as-transcript.live { color: var(--ink); font-weight: 500; }
.as-row { display: flex; gap: 8px; align-items: center; }
.as-row .input { flex: 1; }
.as-examples { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.as-examples .chip { white-space: normal; height: auto; min-height: 32px; padding: 6px 12px; text-align: start; }
.as-thinking { display: flex; align-items: center; gap: 10px; padding: 18px 4px; color: var(--ink-3); }
.as-card { margin-top: 14px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2); animation: slideIn .2s ease-out; }
.as-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.as-card-head strong { font-size: 1.08em; }
.as-card-head p { margin: 2px 0 0; color: var(--ink-2); font-size: .9em; }
.as-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.as-card.expense .as-ic, .as-card.withdraw .as-ic { background: color-mix(in srgb, var(--debit) 14%, transparent); color: var(--debit); }
.as-card.income .as-ic { background: color-mix(in srgb, var(--credit) 14%, transparent); color: var(--credit); }
.as-card.unknown { display: flex; gap: 12px; align-items: flex-start; }
.as-card.unknown p { margin: 4px 0 0; color: var(--ink-3); font-size: .9em; }

/* update notice */
.update-pill { position: fixed; z-index: 96; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -90px); display: flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 16px; border-radius: 99px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-2); font-weight: 600; font-size: .9em; transition: transform .45s cubic-bezier(.2, 1.3, .35, 1); }
[dir="rtl"] .update-pill { padding: 9px 16px 9px 10px; }
.update-pill.in { transform: translate(-50%, 0); }
.update-pill b { background: var(--accent); color: var(--accent-ink); padding: 5px 12px; border-radius: 99px; }

/* app lock */
.app-lock { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); opacity: 0; transition: opacity .25s; }
.app-lock.in { opacity: 1; } .app-lock.out { opacity: 0; }
.al-card { width: min(360px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; padding: 28px 24px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-2); }
.al-card h2 { margin: 4px 0 0; } .al-card p { margin: 0; color: var(--ink-3); }
.al-card > .input, .al-card > .btn { width: 100%; }
.al-logo { color: var(--accent); }
.al-fp-btn { display: grid; justify-items: center; gap: 8px; padding: 16px 22px; border-radius: 20px; color: var(--accent); background: var(--accent-soft); font-weight: 600; font-size: .9em; transition: transform .12s; }
.al-fp-btn:active { transform: scale(.96); }
.al-or { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .82em; }
.al-or::before, .al-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.al-out { font-size: .88em; margin-top: 4px; }

/* help */
.help-head { padding: 12px 4px 4px; }
.help-head .search-box { margin: 0 12px 8px; }
.help-list { padding: 0 12px 24px; display: grid; gap: 8px; }
.help-item { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.help-item > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary strong { flex: 1; }
.help-item[open] > summary > .ic:last-child { transform: rotate(180deg); }
.help-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.help-body { padding: 0 14px 12px 60px; color: var(--ink-2); font-size: .93em; line-height: 1.65; }
[dir="rtl"] .help-body { padding: 0 60px 12px 14px; }
.help-body p { margin: 0 0 6px; white-space: pre-wrap; }

/* chat wallpaper */
.messages.has-bg { background-image: linear-gradient(color-mix(in srgb, var(--chat-bg) 35%, transparent), color-mix(in srgb, var(--chat-bg) 35%, transparent)), var(--chat-wall); background-size: cover; background-position: center; background-attachment: local; }
.wall-preview { height: 240px; border-radius: var(--r-md); background: var(--surface-3) center / cover no-repeat; border: 1px solid var(--line); }
.wall-preview.empty { background-image: radial-gradient(color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px) !important; background-size: 18px 18px !important; }

/* composer extras */
.cam-btn { color: var(--ink-2); }
.pop-head { padding: 4px 10px 6px; font-size: .78em; font-weight: 700; color: var(--ink-3); }
.live-opts { display: grid; gap: 8px; }

/* location card */
.loc-card { width: min(300px, 70vw); margin: -3px -7px 2px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.loc-map { display: block; position: relative; }
.mini-map { position: relative; overflow: hidden; background: #dfe7ee; }
.mm-layer { position: absolute; width: 768px; height: 768px; }
.mm-layer img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.mm-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -92%); color: #D93025; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.mm-pin svg { fill: #EA4335; stroke: #fff; }
.mm-attr { position: absolute; bottom: 2px; right: 4px; font-size: 9px; color: #333; background: rgba(255, 255, 255, .7); padding: 0 3px; border-radius: 3px; }
.loc-live-dot { position: absolute; top: 8px; inset-inline-start: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: #D93025; color: #fff; font-size: .74em; font-weight: 700; }
.loc-live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: breathe 1.2s infinite; }
.loc-info { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.loc-info .t { flex: 1; min-width: 0; display: grid; }
.loc-info .t strong { font-size: .92em; }
.loc-info .t span { font-size: .78em; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.loc-card.live.active .loc-ic { background: #D93025; color: #fff; }

/* call log card */
.call-card { display: flex; align-items: center; gap: 12px; min-width: 240px; padding: 4px 2px; }
.call-card .t { flex: 1; display: grid; }
.call-card .t span { font-size: .8em; color: var(--ink-3); }
.call-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); flex: none; }
.call-card.missed .call-ic { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.call-card.missed strong { color: var(--danger); }
.call-card.ringing .call-ic { animation: breathe 1.2s infinite; }

/* video note bubble */
.video-note { position: relative; display: block; width: 220px; height: 220px; border-radius: 50%; overflow: hidden; margin: 2px auto 4px; background: #000; }
.video-note video { width: 100%; height: 100%; object-fit: cover; }
.vn-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .25); transition: opacity .2s; }
.video-note.playing .vn-play { opacity: 0; }
.bubble:has(.video-note) { background: transparent !important; box-shadow: none !important; padding: 0 !important; }

/* video note recorder */
.vn-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(5, 8, 15, .82); backdrop-filter: blur(8px); opacity: 0; transition: opacity .2s; }
.vn-overlay.in { opacity: 1; }
.vn-box { display: grid; justify-items: center; gap: 16px; color: #fff; padding: 20px; }
.vn-ring { --p: 0; width: min(300px, 76vw); aspect-ratio: 1; border-radius: 50%; padding: 6px; background: conic-gradient(#EA4335 calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0); }
.vn-ring video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #111; display: block; }
.vn-ring video.mirror { transform: scaleX(-1); }
.vn-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1em; opacity: .9; }
.vn-controls { display: flex; align-items: center; gap: 28px; }
.vn-btn { color: #fff; background: rgba(255, 255, 255, .12); width: 50px; height: 50px; }
.vn-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.vn-rec { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; }
.vn-rec i { width: 52px; height: 52px; border-radius: 50%; background: #EA4335; transition: all .2s; }
.vn-overlay.recording .vn-rec i { width: 28px; height: 28px; border-radius: 7px; }
.vn-hint { margin: 0; opacity: .7; font-size: .86em; text-align: center; max-width: 30ch; }

/* calls */
.call-ring { position: fixed; z-index: 97; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(5, 10, 22, .55); backdrop-filter: blur(10px); opacity: 0; transition: opacity .25s; }
.call-ring.in { opacity: 1; }
.cr-card { width: min(340px, 100%); display: grid; justify-items: center; gap: 8px; text-align: center; padding: 30px 22px 24px; border-radius: 28px; color: #fff;
  background: linear-gradient(160deg, #1B2A4E, #0B1220); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.cr-card strong { font-size: 1.3em; margin-top: 8px; }
.cr-card > span { opacity: .75; font-size: .92em; }
.cr-pulse { border-radius: 50%; animation: ringpulse 1.6s ease-out infinite; }
@keyframes ringpulse { 0% { box-shadow: 0 0 0 0 rgba(60, 196, 141, .55); } 100% { box-shadow: 0 0 0 30px rgba(60, 196, 141, 0); } }
.cr-actions { display: flex; gap: 56px; margin-top: 22px; }
.cr-actions > div { display: grid; justify-items: center; gap: 8px; font-size: .82em; opacity: .9; }
.call-btn { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); transition: transform .12s, background .15s; }
.call-btn:hover { background: rgba(255, 255, 255, .24); }
.call-btn:active { transform: scale(.94); }
.call-btn.accept { background: #22B573; animation: breathe 1.4s infinite; }
.call-btn.end { background: #E5484D; }
.call-btn.off { background: #fff; color: #111; }
.call-screen { position: fixed; inset: 0; z-index: 98; display: flex; flex-direction: column; color: #fff; background: radial-gradient(circle at 50% 0%, #22335E, #070B14 70%);
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); opacity: 0; transform: scale(.98); transition: opacity .25s, transform .25s; }
.call-screen.in { opacity: 1; transform: none; }
.call-top { display: flex; align-items: center; gap: 12px; }
.call-top strong { display: block; font-size: 1.05em; }
.call-status, .call-timer { font-size: .85em; opacity: .75; font-variant-numeric: tabular-nums; }
.call-grid { flex: 1; min-height: 0; display: grid; gap: 10px; margin: 16px 0; grid-template-columns: 1fr; align-content: center; }
.call-grid[data-n="2"] { grid-template-columns: 1fr 1fr; }
.call-grid[data-n="3"], .call-grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
.call-grid[data-n="5"], .call-grid[data-n="6"] { grid-template-columns: repeat(3, 1fr); }
.call-tile { position: relative; border-radius: 20px; overflow: hidden; background: rgba(255, 255, 255, .06); min-height: 160px; display: grid; place-items: center; }
.call-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.call-tile.has-video video { opacity: 1; }
.call-tile.has-video .ct-who { display: none; }
.ct-who { display: grid; justify-items: center; gap: 10px; }
.call-tile[data-state="connecting"] .ct-who .avatar, .call-tile[data-state="new"] .ct-who .avatar { animation: breathe 1.4s infinite; }
.call-self { position: absolute; width: 120px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; bottom: calc(110px + env(safe-area-inset-bottom)); inset-inline-end: 18px; border: 2px solid rgba(255, 255, 255, .5); transform: scaleX(-1); background: #111; }
.call-controls { display: flex; justify-content: center; gap: 18px; }
@media (max-width: 600px) { .call-grid[data-n="2"] { grid-template-columns: 1fr; } .call-self { width: 96px; } }

/* BLACK BOX */
.vault { flex: 1; min-height: 0; background: var(--bg); }
.vault-center { display: grid; place-items: center; min-height: 60%; padding: 30px; }
.vault-lock { width: min(380px, calc(100% - 32px)); margin: 6vh auto; display: grid; gap: 12px; justify-items: center; text-align: center; padding: 30px 24px; border-radius: 24px;
  background: linear-gradient(170deg, #111A2C, #0A0F1C); color: #E8EDF8; box-shadow: var(--shadow-2); }
.vault-lock h2 { margin: 0; color: #fff; }
.vault-lock p { margin: 0 0 4px; color: #9FB0CF; }
.vault-lock .input { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #fff; }
.vault-lock .notice { background: rgba(227, 174, 76, .14); color: #F3D9A4; text-align: start; }
.vault-emblem { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; color: #E3AE4C; background: radial-gradient(circle at 30% 25%, #2A3A62, #121B30); box-shadow: inset 0 0 0 1px rgba(227, 174, 76, .35), 0 12px 30px rgba(0, 0, 0, .4); }
.vault-fine { font-size: .78em !important; display: flex; align-items: center; justify-content: center; gap: 4px; color: #7E90B2 !important; }
.pw-meter { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pw-meter i { height: 4px; border-radius: 4px; background: var(--line-strong); }
.pw-meter[data-s="1"] i:nth-child(-n+1) { background: #E5484D; }
.pw-meter[data-s="2"] i:nth-child(-n+2) { background: #E8770F; }
.pw-meter[data-s="3"] i:nth-child(-n+3) { background: #C99A06; }
.pw-meter[data-s="4"] i { background: #22B573; }
.pw-row { display: flex; gap: 4px; align-items: center; }
.vault-top { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 12px 16px 4px; }
.vault-title { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.vault-title .grow { flex: 1; }
.vault-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: .78em; font-weight: 700; color: #B26A00; background: color-mix(in srgb, var(--gold) 16%, transparent); }
.vault-bar { display: flex; gap: 10px; align-items: center; }
.vault-bar .search-box { flex: 1; margin: 0; }
.vault-chips { padding: 10px 0 6px; }
.vault-list { padding: 6px 16px 40px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); align-items: start; }
.vault-card { background: var(--surface); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-1); border: 1px solid var(--line); display: grid; gap: 8px; }
.vault-head { display: flex; align-items: center; gap: 12px; }
.vault-head .t { flex: 1; min-width: 0; display: grid; text-align: start; }
.vault-head .t strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-head .t span { font-size: .8em; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.vault-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.vault-ic.login { background: var(--accent-soft); color: var(--accent); }
.vault-ic .fav { font-weight: 800; font-size: 1.1em; }
.vault-ic.note { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.vault-ic.img { background: color-mix(in srgb, #0891B2 15%, transparent); color: #0891B2; }
.vault-ic.vid { background: color-mix(in srgb, #7C4DDB 15%, transparent); color: #7C4DDB; }
.vault-line { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 10px; border-radius: 10px; background: var(--surface-2); }
[dir="rtl"] .vault-line { padding: 6px 10px 6px 4px; }
.vault-line .k { font-size: .76em; color: var(--ink-3); min-width: 74px; }
.vault-line .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; font-weight: 600; }
.vault-line .v.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.vault-line .icon-btn { width: 32px; height: 32px; }
.vault-notes { margin: 0; font-size: .88em; color: var(--ink-2); white-space: pre-wrap; max-height: 4.6em; overflow: hidden; }
.vault-notes.long { max-height: 14em; }
.vault-actions { display: flex; gap: 8px; }
.vault-foot { font-size: .74em; color: var(--ink-3); }
.bank-card { position: relative; aspect-ratio: 1.586; border-radius: 16px; padding: 16px 18px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 85% 10%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 12px 26px rgba(10, 18, 36, .28); overflow: hidden; }
.bank-card::after { content: ''; position: absolute; width: 46px; height: 34px; border-radius: 7px; top: 54px; inset-inline-start: 18px; background: linear-gradient(135deg, #E9C46A, #B98A2E); opacity: .9; }
.bc-top { display: flex; align-items: center; justify-content: space-between; }
.bc-top .icon-btn { color: #fff; }
.bc-num { font-family: ui-monospace, Consolas, monospace; font-size: 1.25em; letter-spacing: .14em; direction: ltr; text-align: left; margin-top: 30px; }
.bc-bottom { display: flex; align-items: center; gap: 12px; direction: ltr; font-size: .82em; text-transform: uppercase; opacity: .92; }
.bc-bottom span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-bottom b { font-style: italic; font-size: 1.1em; }

/* ═══════════════════════════════════════════════════════════════
   v2.3 — music rooms, mini player, statuses, smart assistant
   The music room is the one place that leaves the ledger look: a dark stage,
   cover art and an amber waveform — it should feel like a record, not a form.
   ═══════════════════════════════════════════════════════════════ */
:root { --amp: #FF5A1F; --amp-2: #FF8A3D; --stage: #12131A; --stage-ink: #F4F1EC; }

.music { flex: 1; min-height: 0; overflow-y: auto; background: var(--surface); }
.mu-hero { position: relative; overflow: hidden; color: var(--stage-ink); background: var(--stage); isolation: isolate; }
.mu-backdrop { position: absolute; inset: -40px; background: radial-gradient(120% 90% at 0% 0%, #3A2A5C 0%, transparent 60%), radial-gradient(90% 80% at 100% 100%, #5A2414 0%, transparent 65%), var(--stage);
  background-size: cover; background-position: center; filter: blur(38px) saturate(1.3) brightness(.55); z-index: -1; transform: scale(1.1); }
.mu-hero-in { display: flex; gap: 24px; align-items: flex-end; padding: 32px 28px 26px; }
.mu-art { width: 184px; height: 184px; flex: none; border-radius: 6px; overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.45); background: #222; display: grid; }
.mu-art img, .mu-art .mu-gen { width: 100%; height: 100%; object-fit: cover; }
.mu-gen { display: grid; place-items: center; color: rgba(255,255,255,.85); }
.mu-info { min-width: 0; flex: 1; }
.mu-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: .8em; font-weight: 600; color: var(--amp-2); }
.mu-info h1 { font-size: clamp(1.7em, 4vw, 2.6em); line-height: 1.1; margin: 6px 0 8px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.mu-info p { margin: 0 0 16px; color: rgba(244,241,236,.72); font-size: .92em; }
.mu-info .mu-about { margin-top: -8px; max-width: 60ch; }
.mu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mu-big-play { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--amp); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--amp) 45%, transparent); transition: transform .15s; }
.mu-big-play:hover:not(:disabled) { transform: scale(1.06); }
.mu-big-play:disabled { opacity: .45; }
.btn.ghost-light { background: rgba(255,255,255,.1); color: var(--stage-ink); border-color: rgba(255,255,255,.18); }
.btn.ghost-light:hover:not(:disabled) { background: rgba(255,255,255,.18); }
.icon-btn.light { color: var(--stage-ink); }
.icon-btn.light:hover { background: rgba(255,255,255,.12); }

.mu-list { padding: 8px 12px 96px; }
.mu-row { --wave-on: var(--amp); --wave-off: color-mix(in srgb, var(--ink-3) 45%, transparent);
  display: grid; grid-template-columns: 40px 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px 10px; border-radius: var(--r-md); }
.mu-row + .mu-row { border-top: 1px solid var(--line); }
.mu-row:hover { background: var(--surface-2); }
.mu-row.on { background: color-mix(in srgb, var(--amp) 7%, var(--surface)); }
.mu-play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); position: relative; }
.mu-play .mu-idx { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-3); }
.mu-play .ic { display: none; }
.mu-row:hover .mu-play .mu-idx, .mu-row.on .mu-play .mu-idx { display: none; }
.mu-row:hover .mu-play .ic, .mu-row.on .mu-play .ic { display: block; }
.mu-row.on .mu-play { background: var(--amp); color: #fff; }
.mu-thumb { width: 64px; height: 64px; border-radius: 4px; overflow: hidden; display: grid; background: var(--surface-3); }
.mu-thumb img, .mu-thumb .mu-gen { width: 100%; height: 100%; object-fit: cover; }
.mu-main { min-width: 0; display: grid; gap: 4px; }
.mu-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.mu-title strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.mu-title span { color: var(--ink-3); font-size: .84em; }
.mu-wave { width: 100%; height: 44px; cursor: pointer; display: block; }
.mu-foot { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.mu-reacts { display: flex; flex-wrap: wrap; gap: 4px; }
.mu-react { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 99px; background: var(--surface-3); font-size: .86em; }
.mu-react span { font-size: .84em; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mu-react.mine { background: color-mix(in srgb, var(--amp) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amp) 50%, transparent); }
.mu-react.add { color: var(--ink-3); padding: 0 6px; }
.mu-react.add:hover { color: var(--amp); }
.mu-stat { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: .8em; font-variant-numeric: tabular-nums; }

.react-pop { position: fixed; z-index: 315; display: flex; gap: 2px; padding: 6px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-2); animation: popin .16s ease-out; }
.react-pop button { width: 38px; height: 38px; border-radius: 50%; font-size: 22px; transition: transform .12s; }
.react-pop button:hover { transform: scale(1.25); }
@keyframes popin { from { transform: scale(.85); opacity: 0; } }

.mu-up-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.mu-up-head p { margin: 0; color: var(--ink-3); font-size: .9em; }
.mu-up-cover { width: 76px; height: 76px; flex: none; border-radius: 6px; border: 1.5px dashed var(--line-strong); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--ink-3); font-size: .72em; overflow: hidden; }
.mu-up-cover img { width: 100%; height: 100%; object-fit: cover; }
.mu-up-list { display: grid; gap: 10px; max-height: 50vh; overflow-y: auto; }
.mu-up-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); }
.mu-up-row .row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.mu-up-row small { color: var(--ink-3); display: block; margin-top: 4px; }
.mu-up-ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--amp) 14%, transparent); color: var(--amp); flex: none; }
.mu-up-row.done .mu-up-ic { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.mu-up-row.failed { box-shadow: inset 0 0 0 1px var(--danger); }
.up-bar { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 8px; overflow: hidden; visibility: hidden; }
.up-bar.on { visibility: visible; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.mu-up-row .up-bar i { background: var(--amp); }
.share-link { display: grid; gap: 10px; margin-top: 14px; }
.share-link .row { display: flex; flex-wrap: wrap; gap: 8px; }

/* public playlist page */
body.public-pl { background: var(--stage); }
.music.public { height: 100%; }
.music.public .mu-list { max-width: 980px; margin: 0 auto; }
.music.public .mu-hero-in { max-width: 980px; margin: 0 auto; }
.mu-brand { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px 0 110px; color: var(--ink-3); font-weight: 600; }

/* mini player */
.mini-player { position: fixed; z-index: 90; inset-inline: 0; bottom: 0; height: 64px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 0 14px calc(env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--stage) 94%, transparent); color: var(--stage-ink); backdrop-filter: blur(14px);
  box-shadow: 0 -6px 24px rgba(0,0,0,.18); animation: mpin .25s ease-out; }
@keyframes mpin { from { transform: translateY(100%); } }
body.with-player .app, body.with-player .music.public { height: calc(100% - 64px); }
.mp-progress { position: absolute; inset-inline: 0; top: -3px; height: 6px; cursor: pointer; background: rgba(255,255,255,.08); }
.mp-progress i { display: block; height: 3px; margin-top: 3px; width: 0; background: var(--amp); }
.mp-cover { width: 44px; height: 44px; border-radius: 4px; overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.mp-cover img { width: 100%; height: 100%; object-fit: cover; }
.mp-meta { min-width: 0; text-align: start; display: grid; color: inherit; }
.mp-meta strong, .mp-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-meta span { font-size: .8em; color: rgba(244,241,236,.6); }
.mp-time { font-size: .78em; color: rgba(244,241,236,.6); font-variant-numeric: tabular-nums; }
.mp-ctrls { display: flex; align-items: center; gap: 2px; }
.mp-ctrls .icon-btn { color: var(--stage-ink); }
.mp-ctrls .icon-btn:hover { background: rgba(255,255,255,.1); }
.mp-play { width: 42px; height: 42px; border-radius: 50%; background: var(--amp); color: #fff; display: grid; place-items: center; margin: 0 4px; }

/* statuses */
.story-strip { display: flex; gap: 12px; padding: 4px 14px 10px; overflow-x: auto; scrollbar-width: none; }
.story-strip::-webkit-scrollbar { display: none; }
.story { display: grid; justify-items: center; gap: 4px; width: 64px; flex: none; }
.story-name { font-size: .74em; color: var(--ink-2); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-ring { position: relative; width: 62px; height: 62px; display: grid; place-items: center; }
.story-ring .avatar { width: 52px !important; height: 52px !important; }
.story-arcs { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.story-arcs .new { stroke: var(--accent); }
.story-arcs .seen { stroke: var(--line-strong); }
.story-ring.mine { box-shadow: inset 0 0 0 3px var(--accent); border-radius: 50%; }
.story-plus { position: absolute; bottom: 0; inset-inline-end: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; border: 2px solid var(--surface); }

.story-viewer { position: fixed; inset: 0; z-index: 200; background: rgba(5,7,12,.94); display: grid; place-items: center; animation: svin .2s ease-out; outline: none; }
@keyframes svin { from { opacity: 0; transform: scale(.98); } }
.sv-frame { position: relative; width: min(440px, 100vw); height: min(780px, 100dvh); background: #000; border-radius: 14px; overflow: hidden; display: grid; grid-template-rows: auto auto 1fr auto; color: #fff; }
@media (max-width: 520px) { .sv-frame { border-radius: 0; } }
.sv-bars { display: flex; gap: 4px; padding: 10px 10px 0; padding-top: max(10px, env(safe-area-inset-top)); position: relative; z-index: 3; }
.sv-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.3); overflow: hidden; }
.sv-bars i { display: block; height: 100%; background: #fff; width: 100%; transform: scaleX(0); transform-origin: left; will-change: transform; }
[dir=rtl] .sv-bars i { transform-origin: right; }
.sv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; position: relative; z-index: 3; }
.sv-who { flex: 1; min-width: 0; display: grid; }
.sv-who span { font-size: .78em; opacity: .7; }
.sv-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.sv-btn:hover { background: rgba(255,255,255,.12); }
.sv-stage { position: absolute; inset: 0; display: grid; place-items: center; touch-action: none; user-select: none; }
.sv-text { width: 100%; height: 100%; display: grid; place-items: center; padding: 72px 28px; font-size: clamp(1.3em, 5vw, 1.9em); font-weight: 600; line-height: 1.4; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; }
.sv-media { width: 100%; height: 100%; display: grid; place-items: center; position: relative; }
.sv-media img, .sv-media video { max-width: 100%; max-height: 100%; object-fit: contain; }
.sv-caption { position: absolute; bottom: 86px; inset-inline: 16px; text-align: center; background: rgba(0,0,0,.45); padding: 8px 12px; border-radius: 10px; margin: 0; }
.sv-foot { grid-row: 4; position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.sv-reacts { display: flex; gap: 6px; }
.sv-reacts button { width: 46px; height: 46px; border-radius: 50%; font-size: 24px; background: rgba(255,255,255,.12); transition: transform .12s; }
.sv-reacts button:hover, .sv-reacts button.on { transform: scale(1.15); background: rgba(255,255,255,.26); }
.sv-views { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.sv-aud { display: inline-flex; align-items: center; gap: 6px; font-size: .8em; opacity: .75; }
.sv-nav { position: absolute; top: 80px; bottom: 90px; width: 30%; z-index: 2; }
.sv-nav.prev { inset-inline-start: 0; }
.sv-nav.next { inset-inline-end: 0; }
.sv-burst { position: absolute; font-size: 90px; animation: burst .9s ease-out forwards; pointer-events: none; }
@keyframes burst { 0% { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 100% { transform: translateY(-120px) scale(1); opacity: 0; } }
.sv-v-emoji { font-size: 22px; }

.sc-preview { margin: 14px 0; display: grid; gap: 10px; }
.sc-text { width: 100%; min-height: 200px; border-radius: var(--r-lg); color: #fff; font-size: 1.25em; font-weight: 600; text-align: center; padding: 28px 18px; border: 0; resize: none; line-height: 1.45; }
.sc-text::placeholder { color: rgba(255,255,255,.7); }
.sc-colors { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sc-colors button { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.sc-colors button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.sc-pick { width: 100%; min-height: 180px; border-radius: var(--r-lg); border: 1.5px dashed var(--line-strong); display: grid; place-items: center; align-content: center; gap: 6px; color: var(--ink-2); }
.sc-pick small { color: var(--ink-3); }
.sc-media { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; display: grid; place-items: center; max-height: 46vh; }
.sc-media img, .sc-media video { max-width: 100%; max-height: 46vh; }
.sc-change { position: absolute; top: 10px; inset-inline-end: 10px; display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: .85em; }
.sc-aud { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.sc-aud h4 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: .95em; }
.sc-pages { display: grid; gap: 4px; max-height: 200px; overflow-y: auto; }
.sc-check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.sc-check:hover { background: var(--surface-2); }
.sc-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-chips .chip button { display: inline-grid; place-items: center; margin-inline-start: 2px; color: inherit; }
.sc-results { max-height: 220px; overflow-y: auto; }

/* smart assistant */
.as-sub { width: 100%; display: flex; align-items: center; gap: 6px; font-size: .78em; font-weight: 600; color: var(--ink-3); margin-top: 4px; }
.chip.smart { background: color-mix(in srgb, #7C4DDB 12%, var(--surface-3)); color: var(--ink); }
.chip.smart .ic { color: #7C4DDB; }
.as-learned { display: inline-flex; align-items: center; gap: 4px; color: #7C4DDB !important; font-size: .8em; }
.as-balance { display: grid; justify-items: center; gap: 2px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 12px; min-height: 30px; }
.as-balance small { color: var(--ink-3); }
.as-balance strong { font-size: 1.7em; font-variant-numeric: tabular-nums; color: var(--credit); }
.as-balance strong.neg { color: var(--debit); }
.as-danger { display: flex; gap: 8px; align-items: flex-start; color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); padding: 10px 12px; border-radius: var(--r-sm); font-size: .9em; }
.as-people { max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
.as-people .item.on { background: var(--accent-soft); }

@media (max-width: 860px) {
  .mu-hero-in { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px 16px 20px; }
  .mu-art { width: 132px; height: 132px; }
  .mu-row { grid-template-columns: 36px 48px minmax(0, 1fr); gap: 10px; padding: 10px 4px; }
  .mu-thumb { width: 48px; height: 48px; }
  .mu-list { padding: 4px 8px 96px; }
  .mini-player { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .mp-time { display: none; }
  .mu-up-row .row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .story-viewer, .mini-player, .react-pop, .sv-burst { animation: none; }
}

/* ═══ v2.3.1 — account statement viewer: the report as a ledger sheet inside the app ═══ */
.report-modal .modal-foot { flex-wrap: wrap; }
.rv-loading { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: rgba(10,16,29,.35); }
.rv-sheet { position: fixed; inset: 0; z-index: 140; background: rgba(10,16,29,.55); display: grid; place-items: stretch center; padding: 24px; opacity: 0; transition: opacity .18s; }
.rv-sheet.in { opacity: 1; }
.rv-paper { width: min(1180px, 100%); min-height: 0; display: flex; flex-direction: column; background: var(--paper); color: #1F2633; border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden;
  --rv-line: var(--paper-line); --rv-ink-3: #8A8270; --rv-rule: #1F2633; transform: translateY(10px); transition: transform .2s; }
.rv-sheet.in .rv-paper { transform: none; }
:root[data-theme="dark"] .rv-paper { background: #17140F; color: #ECE6D8; --rv-line: #2E281E; --rv-ink-3: #9C927C; --rv-rule: #ECE6D8; }
.rv-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 2px solid var(--rv-line); }
.rv-head .icon-btn { color: inherit; }
.rv-title { flex: 1; min-width: 0; }
.rv-title h2 { margin: 0; font-size: 1.2em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-title p { margin: 2px 0 0; color: var(--rv-ink-3); font-size: .88em; font-variant-numeric: tabular-nums; }
.rv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px 0; }
.rv-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--rv-line); font-size: .8em; color: var(--rv-ink-3); }
.rv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; margin: 14px 20px 0; border: 1px solid var(--rv-line); border-radius: var(--r-md); overflow: hidden; }
.rv-tile { padding: 12px 16px; display: grid; gap: 2px; }
.rv-tile + .rv-tile { border-inline-start: 1px solid var(--rv-line); }
.rv-tile span { font-size: .8em; color: var(--rv-ink-3); }
.rv-tile strong { font-size: 1.35em; font-variant-numeric: tabular-nums; font-family: var(--num); text-align: start; }
.rv-tile.in strong { color: var(--credit); }
.rv-tile.out strong { color: var(--debit); }
.rv-tile.strong { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.rv-tile.neg strong { color: var(--debit); }
.rv-tools { display: flex; align-items: center; gap: 10px; padding: 14px 20px 8px; flex-wrap: wrap; }
.rv-tools .search-box { margin: 0; flex: 0 1 320px; background: color-mix(in srgb, #fff 55%, transparent); }
:root[data-theme="dark"] .rv-tools .search-box { background: rgba(255,255,255,.05); }
.rv-count { color: var(--rv-ink-3); font-size: .84em; font-variant-numeric: tabular-nums; }
.rv-table-box { flex: 1; min-height: 0; overflow: auto; padding: 0 20px 20px; }
.rv-table { width: 100%; border-collapse: collapse; font-size: .92em; }
.rv-table th { position: sticky; top: 0; z-index: 1; background: var(--paper); text-align: start; font-weight: 600; font-size: .82em; color: var(--rv-ink-3); padding: 10px 8px; border-bottom: 2px solid var(--rv-line); white-space: nowrap; }
:root[data-theme="dark"] .rv-table th { background: #17140F; }
.rv-table td { padding: 9px 8px; border-bottom: 1px solid var(--rv-line); vertical-align: top; }
.rv-table tbody tr:hover td { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.rv-table .num { text-align: end; font-variant-numeric: tabular-nums; font-family: var(--num); white-space: nowrap; }
.rv-table th.num { text-align: end; }
.rv-table td.in { color: var(--credit); }
.rv-table td.out { color: var(--debit); }
.rv-table td.neg { color: var(--debit); }
.rv-table .rv-bal { font-weight: 600; }
.rv-ser { color: var(--rv-ink-3); width: 1%; font-variant-numeric: tabular-nums; }
.rv-date { white-space: nowrap; width: 1%; }
.rv-type { color: var(--rv-ink-3); white-space: nowrap; }
.rv-remarks { min-width: 180px; overflow-wrap: anywhere; }
.rv-total td { font-weight: 700; border-top: 2px solid var(--rv-rule); border-bottom: 0; background: color-mix(in srgb, var(--gold) 8%, transparent); }
.rv-total.sub td { font-weight: 600; border-top: 1px solid var(--rv-line); background: transparent; }
.rv-total-l { text-align: end; }
.rv-group td { padding: 16px 8px 6px; border-bottom: 1px solid var(--rv-rule); font-weight: 700; }
.rv-group small { margin-inline-start: 8px; font-weight: 400; color: var(--rv-ink-3); }
.rv-more { margin-top: 12px; }

@media (max-width: 860px) {
  .rv-sheet { padding: 0; }
  .rv-paper { border-radius: 0; width: 100%; padding-top: env(safe-area-inset-top); }
  .rv-head { padding: 10px 12px; flex-wrap: wrap; }
  .rv-actions { width: 100%; }
  .rv-actions .btn { flex: 1; }
  .rv-tiles { margin: 12px 12px 0; grid-template-columns: 1fr 1fr; }
  .rv-tile:nth-child(3) { border-inline-start: 0; }
  .rv-tile:nth-child(n+3) { border-top: 1px solid var(--rv-line); }
  .rv-tools { padding: 12px 12px 6px; }
  .rv-tools .search-box { flex: 1 1 100%; }
  .rv-table-box { padding: 0 12px 24px; }
  /* each transaction becomes a small card */
  .rv-table thead { display: none; }
  .rv-table, .rv-table tbody, .rv-table tfoot, .rv-table tr, .rv-table td { display: block; width: auto; }
  .rv-table tbody tr:not(.rv-group):not(.rv-total) { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--rv-line); }
  .rv-table td { border: 0; padding: 0; }
  .rv-table tbody tr:hover td { background: none; }
  .rv-table tbody tr td.rv-ser { display: none; }
  .rv-table tbody td.rv-remarks { grid-column: 1 / -1; order: -1; font-weight: 600; min-width: 0; }
  .rv-table tbody td.num:empty { display: none; }
  .rv-table tbody td[data-l]:not(.rv-remarks):not(.rv-ser)::before { content: attr(data-l) ' '; color: var(--rv-ink-3); font-size: .78em; font-weight: 400; font-family: var(--font); }
  .rv-table tbody td.num { text-align: start; }
  .rv-table.summary tbody td:first-child + td { grid-column: 1 / -1; font-weight: 600; }
  .rv-total { display: flex !important; flex-wrap: wrap; gap: 4px 14px; padding: 10px; border-radius: var(--r-sm); }
  .rv-total td { border: 0 !important; background: none !important; padding: 0; }
  .rv-total td.rv-empty { display: none; }
  .rv-total td[data-l]:not(.rv-total-l)::before { content: attr(data-l) ' '; font-weight: 400; color: var(--rv-ink-3); font-size: .8em; }
  .rv-total-l { width: 100% !important; text-align: start; }
}

@media print {
  body.printing-report > *:not(.rv-sheet) { display: none !important; }
  body.printing-report { background: #fff; }
  .rv-sheet { position: static; padding: 0; background: none; opacity: 1; display: block; }
  .rv-paper { box-shadow: none; border-radius: 0; background: #fff; color: #000; width: 100%; transform: none; }
  .rv-actions, .rv-head .icon-btn, .rv-tools .search-box, .rv-tools .chip, .rv-more { display: none !important; }
  .rv-table-box { overflow: visible; }
  .rv-table th { position: static; background: #fff; }
  .rv-table tr { break-inside: avoid; }
}

/* ═══ v2.4 — offline, saved songs, smoother statuses, PDF viewer, report sharing ═══ */
.offline-bar { position: fixed; z-index: 96; top: 0; inset-inline: 0; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: calc(4px + env(safe-area-inset-top)) 12px 4px; background: #3A3F4B; color: #fff; font-size: .8em; font-weight: 600; text-align: center; animation: obin .25s ease-out; }
.offline-bar.syncing { background: var(--accent); }
.offline-bar.syncing .ic { animation: spin 1s linear infinite; }
.offline-bar b { background: rgba(255,255,255,.18); padding: 1px 8px; border-radius: 99px; }
@keyframes obin { from { transform: translateY(-100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
body:has(.offline-bar) .app { padding-top: calc(26px + env(safe-area-inset-top)); }
.msg.pending .ic, .msg .ic[aria-label="queued"] { opacity: .8; }

/* saved songs */
.mu-love { min-width: 32px; height: 28px; padding: 0 8px; border-radius: 99px; display: inline-grid; place-items: center; color: var(--ink-3); font-size: 17px; line-height: 1; transition: transform .15s, color .15s; }
.mu-love:hover { color: #E5395B; }
.mu-love.on { color: #E5395B; background: color-mix(in srgb, #E5395B 12%, transparent); }
.mu-love.on span { animation: lovepop .35s ease-out; }
@keyframes lovepop { 50% { transform: scale(1.45); } }
.mu-stat.saved { color: var(--success); font-weight: 600; }
.btn.ghost-light.mu-lib.on { background: rgba(255,255,255,.26); }
.saved-songs-btn { margin-top: 16px; gap: 8px; }
.saved-songs-btn span { color: #E5395B; font-size: 1.1em; }

/* statuses: smoother viewer */
.story-viewer.out { opacity: 0; transition: opacity .18s; }
body.sv-open { overflow: hidden; }
.sv-frame { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.sv-frame.paused .sv-bars { opacity: .55; }
.sv-stage { touch-action: none; cursor: pointer; }
.sv-media img, .sv-media video { pointer-events: none; }
.sv-loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.sv-sound { position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 4; display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-weight: 600; font-size: .85em; }
.sv-sheet { position: absolute; inset-inline: 0; bottom: 0; z-index: 6; max-height: 72%; display: flex; flex-direction: column; background: var(--surface); color: var(--ink);
  border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .26s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -10px 30px rgba(0,0,0,.35); }
.sv-sheet.open { transform: none; }
.sv-sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px 16px; position: relative; border-bottom: 1px solid var(--line); }
.sv-sheet-head strong { flex: 1; }
.sv-sheet-head .sv-btn { color: var(--ink-2); }
.sv-grab { position: absolute; top: 5px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line-strong); }
.sv-sheet-body { overflow-y: auto; padding: 6px 8px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.sv-viewer { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-md); }
.sv-viewer .t { flex: 1; min-width: 0; display: grid; }
.sv-viewer .t span { font-size: .8em; color: var(--ink-3); }
.sv-center { display: grid; place-items: center; gap: 6px; padding: 26px 0; color: var(--ink-3); }
.sv-confirm { display: grid; gap: 8px; padding: 10px 8px; }
.sv-views .ic:last-child { opacity: .7; }

/* PDF viewer */
.pv-sheet { position: fixed; inset: 0; z-index: 160; display: flex; flex-direction: column; background: #2B2F36; opacity: 0; transition: opacity .18s; }
.pv-sheet.in { opacity: 1; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); flex-wrap: wrap; }
.pv-title { flex: 1; min-width: 140px; display: grid; }
.pv-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-info { font-size: .78em; color: var(--ink-3); }
.pv-tools { display: flex; align-items: center; gap: 4px; }
.pv-tools b { font-size: 20px; line-height: 1; }
.pv-zoom { min-width: 44px; text-align: center; font-size: .8em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pv-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 0 calc(24px + env(safe-area-inset-bottom)); }
.pv-pages { display: grid; justify-items: center; gap: 12px; transform-origin: top center; min-width: min-content; padding: 0 12px; }
.pv-page { background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); min-height: 120px; }
.pv-page canvas { display: block; }
.pv-wait { display: grid; place-items: center; gap: 12px; padding: 60px 0; color: #ddd; }
@media (max-width: 520px) { .pv-tools { width: 100%; justify-content: flex-end; } }

/* sharing a report */
.share-modal .modal-body { display: grid; gap: 10px; }
.share-opt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); text-align: start; }
.share-opt:hover { background: var(--surface-2); }
.share-opt span:last-child { display: grid; }
.share-opt small { color: var(--ink-3); }
.share-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.share-days { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9em; color: var(--ink-2); }
.share-out { display: grid; gap: 8px; }
.share-out:empty { display: none; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.wa { background: #1FA855; color: #fff; border-color: #1FA855; }
.rv-shared-by { display: inline-flex; align-items: center; gap: 4px; }
.rv-sheet.public { background: var(--bg); padding: 24px; }
@media (max-width: 860px) { .rv-sheet.public { padding: 0; } }

/* ═══ v2.5 — music: the big "now playing" screen, sticky bar, search/sort, phone-first rows ═══ */
.music { position: relative; }
.mu-sticky { position: sticky; top: 0; z-index: 5; height: 0; overflow: visible; pointer-events: none; }
.mu-sticky > * { pointer-events: auto; }
.mu-sticky { display: flex; align-items: center; gap: 10px; }
.mu-sticky.show { height: 52px; padding: 0 14px; background: color-mix(in srgb, var(--stage) 92%, transparent); color: var(--stage-ink); backdrop-filter: blur(12px); box-shadow: 0 4px 14px rgba(0,0,0,.18); margin-bottom: -52px; }
.mu-sticky:not(.show) > * { display: none; }
.mu-sticky strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-sticky span { font-size: .8em; opacity: .65; }
.mu-sticky-play { width: 36px; height: 36px; border-radius: 50%; background: var(--amp); color: #fff; display: grid; place-items: center; flex: none; }
.mu-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px 0; }
.mu-tools .search-box { margin: 0; flex: 1 1 220px; }
.mu-sorts { display: flex; gap: 6px; flex-wrap: wrap; }
.mu-thumb, .mu-title { cursor: pointer; }
.mu-cm { color: var(--ink-3); border-radius: 99px; padding: 2px 6px; }
.mu-cm:hover { color: var(--amp); background: color-mix(in srgb, var(--amp) 10%, transparent); }

/* mini bar: tap opens the big player, swipe = next / previous */
.mini-player { touch-action: pan-y; }
.mp-meta { cursor: pointer; }
.mp-meta::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.mp-ctrls .icon-btn .ic svg path[fill] { stroke: none; }

/* the big player */
.np-sheet { position: fixed; inset: 0; z-index: 160; color: var(--stage-ink); background: var(--stage); transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.np-sheet.in { transform: none; }
body.np-open .mini-player { visibility: hidden; }
.np-backdrop { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(48px) saturate(1.35) brightness(.42); transform: scale(1.15); }
.np-backdrop.gen, .np-backdrop:not([style*="url"]) { background: radial-gradient(90% 60% at 20% 10%, #4B2D7A 0%, transparent 60%), radial-gradient(80% 60% at 90% 90%, #6B2A12 0%, transparent 65%), var(--stage); filter: none; }
.np-inner { position: relative; height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) 22px max(14px, env(safe-area-inset-bottom)); }
.np-head { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.np-from { flex: 1; min-width: 0; text-align: center; display: grid; }
.np-from small { font-size: .72em; opacity: .65; }
.np-from strong { font-size: .92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: inherit; flex: none; transition: background .15s, transform .1s; }
.np-btn:hover { background: rgba(255,255,255,.1); }
.np-btn:active { transform: scale(.92); }
.np-btn .ic svg path[fill] { stroke: none; }
.np-stage { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: 10px 0 18px; }
.np-cover { width: min(100%, 46vh, 420px); aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.5); display: grid; background: #222; transition: transform .25s; }
.np-cover img, .np-cover .mu-gen { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.np-meta { display: flex; align-items: center; gap: 12px; }
.np-names { flex: 1; min-width: 0; }
.np-title { margin: 0; font-size: 1.45em; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { display: block; max-width: 100%; color: rgba(244,241,236,.7); font-size: .95em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; padding: 0; }
.np-love { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: rgba(244,241,236,.8); flex: none; transition: transform .15s, color .15s; }
.np-love.on { color: #FF4D6D; }
.np-love.on svg path { fill: currentColor; }
.np-love:active { transform: scale(.85); }
.np-love:disabled { opacity: .3; }
.np-wave-box { position: relative; margin-top: 18px; --wave-on: var(--amp); --wave-off: rgba(255,255,255,.28); }
.np-wave { width: 100%; height: 64px; display: block; cursor: pointer; touch-action: none; border-radius: 4px; }
.np-wave:focus-visible { outline: 2px solid var(--amp); outline-offset: 4px; }
.np-marks { position: absolute; inset-inline: 0; bottom: -10px; height: 20px; pointer-events: none; }
.np-mark { position: absolute; bottom: 0; transform: translateX(-50%); pointer-events: auto; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--stage); padding: 0; transition: transform .12s; }
[dir="rtl"] .np-mark { transform: translateX(50%); }
.np-mark:hover { transform: translateX(-50%) scale(1.35); z-index: 2; }
[dir="rtl"] .np-mark:hover { transform: translateX(50%) scale(1.35); }
.np-bubble { position: absolute; inset-inline: 0; bottom: 74px; margin: 0 auto; width: max-content; max-width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px;
  border-radius: 99px; background: rgba(255,255,255,.14); backdrop-filter: blur(10px); font-size: .86em; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; pointer-events: none; }
.np-bubble span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-bubble.show { opacity: 1; transform: none; }
.np-times { display: flex; justify-content: space-between; margin-top: 14px; font-size: .78em; color: rgba(244,241,236,.65); font-variant-numeric: tabular-nums; direction: ltr; }
.np-ctrls { display: flex; align-items: center; justify-content: space-between; margin: 10px -6px 0; direction: ltr; }
.np-play { width: 72px; height: 72px; border-radius: 50%; background: var(--stage-ink); color: var(--stage); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .12s; flex: none; }
.np-play:active { transform: scale(.93); }
.np-play .ic svg path[fill], .np-play .ic svg rect { stroke: none; }
.np-mode { color: rgba(244,241,236,.55); position: relative; }
.np-mode.on { color: var(--amp); }
.np-mode.on::after { content: ''; position: absolute; bottom: 5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.np-small { width: 40px; height: 40px; color: rgba(244,241,236,.75); }
.np-tabs { display: flex; justify-content: space-around; gap: 6px; margin-top: 14px; }
.np-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; color: rgba(244,241,236,.75); font-size: .85em; font-weight: 600; }
.np-tab:hover { background: rgba(255,255,255,.08); }
.np-tab.on { background: rgba(255,255,255,.16); color: var(--stage-ink); }
.np-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.np-sheet.with-panel .np-panel { flex: 1 1 0; margin-top: 10px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.1); }
.np-sheet.with-panel .np-stage { flex: 0 0 auto; padding: 6px 0 12px; }
.np-sheet.with-panel .np-cover { width: 92px; border-radius: 6px; }
.np-queue { display: grid; gap: 2px; padding: 6px 0; }
.np-q { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; color: inherit; text-align: start; }
.np-q:hover { background: rgba(255,255,255,.07); }
.np-q.past { opacity: .5; }
.np-q.on { background: rgba(255,255,255,.12); }
.np-q.on strong { color: var(--amp-2); }
.np-q-art { width: 42px; height: 42px; flex: none; border-radius: 4px; overflow: hidden; display: grid; }
.np-q-art img, .np-q-art .mu-gen { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
.np-q-t { flex: 1; min-width: 0; display: grid; }
.np-q-t strong, .np-q-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-q-t small, .np-q-d { color: rgba(244,241,236,.55); font-size: .78em; font-variant-numeric: tabular-nums; }
.np-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.np-eq i { width: 3px; background: var(--amp); border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.np-eq i:nth-child(2) { animation-delay: -.3s; }
.np-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.np-cm-new { display: flex; align-items: center; gap: 8px; padding: 10px 0; position: sticky; top: 0; background: transparent; }
.np-cm-new .input { flex: 1; min-width: 0; background: rgba(255,255,255,.1); border-color: transparent; color: var(--stage-ink); }
.np-cm-new .input::placeholder { color: rgba(244,241,236,.5); }
.np-cm-list { display: grid; gap: 10px; padding-bottom: 10px; }
.np-cm { display: flex; gap: 10px; align-items: flex-start; }
.np-cm-t { flex: 1; min-width: 0; }
.np-cm-t > div { display: flex; align-items: baseline; gap: 8px; font-size: .86em; }
.np-cm-t p { margin: 2px 0 0; font-size: .92em; overflow-wrap: anywhere; }
.np-at { color: var(--amp-2); font-variant-numeric: tabular-nums; font-size: .9em; padding: 0; }
.np-cm .icon-btn { color: rgba(244,241,236,.6); }
.np-empty { color: rgba(244,241,236,.6); text-align: center; padding: 18px 8px; font-size: .9em; }

/* tall phones get more air, short ones lose the ±10 buttons */
@media (max-height: 640px) { .np-small { display: none; } .np-wave { height: 48px; } .np-wave-box { margin-top: 10px; } .np-tabs { margin-top: 8px; } }
@media (max-width: 360px) { .np-inner { padding-inline: 14px; } .np-small { display: none; } .np-play { width: 64px; height: 64px; } }

/* on a computer the list / comments sit next to the player */
@media (min-width: 980px) {
  .np-sheet.with-panel .np-inner { max-width: 1040px; display: grid; grid-template-columns: 480px minmax(0, 1fr); grid-template-rows: auto 1fr auto auto auto auto auto; column-gap: 48px; }
  .np-sheet.with-panel .np-inner > :not(.np-panel) { grid-column: 1; }
  .np-sheet.with-panel .np-panel { grid-column: 2; grid-row: 1 / -1; margin-top: 52px; border-top: 0; padding: 0 4px; }
  .np-sheet.with-panel .np-stage { flex: 1; padding: 10px 0 18px; }
  .np-sheet.with-panel .np-cover { width: min(100%, 46vh, 420px); border-radius: 10px; }
}

/* phone rows: bigger tap areas, calmer waveform */
@media (max-width: 860px) {
  .mu-tools { padding: 12px 12px 0; }
  .mu-wave { height: 36px; }
  .mu-foot { gap: 6px; flex-wrap: wrap; }
  .mu-title strong { font-size: .98em; }
  .mu-react.add { display: none; }
  .mu-row:not(.on) .mu-reacts .mu-react:nth-child(n+3) { display: none; }
  .mini-player { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; padding-inline: 10px; }
  .mp-ctrls .icon-btn { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .np-sheet { transition: none; } .np-eq i { animation: none; height: 10px; } }

/* time runs left → right in every player (also in Arabic), so the waveform, the bars and the buttons match the clock */
.mu-wave, .np-wave-box, .mp-progress { direction: ltr; }
[dir="rtl"] .np-mark, [dir="rtl"] .np-mark:hover { transform: translateX(-50%); }
[dir="rtl"] .np-mark:hover { transform: translateX(-50%) scale(1.35); }

/* ═══════════════════════════════════════════════════════════════
   v2.6 — feels like an installed app on every phone (iPhone and Android):
   no zoom, no page bounce, no text-selection / callout pop-ups, correct notch and home-bar spacing,
   the keyboard resizes the app instead of pushing it.
   ═══════════════════════════════════════════════════════════════ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; overscroll-behavior: none; height: 100%; background: var(--bg); }
body { position: fixed; inset: 0; width: 100%; overscroll-behavior: none; touch-action: manipulation; }
#root { height: var(--app-h, 100%); }
.scroll, .side-body, .messages, .modal-body, .np-panel, .pv-scroll, .rv-table-box { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* phones: no selecting app text by accident, no "copy / look up" bubbles, no blue flashes */
html.touch body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.touch input, html.touch textarea, html.touch [contenteditable="true"], html.touch .selectable, html.touch .selectable * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
html.touch img, html.touch a, html.touch video { -webkit-touch-callout: none; -webkit-user-drag: none; }
/* iPhone zooms into any box with a font smaller than 16px — every box is 16px on phones */
html.touch input, html.touch textarea, html.touch select, html.touch .input, html.touch .composer textarea { font-size: max(16px, 1em); }
/* a small press effect, because phones have no hover */
html.touch .icon-btn:active, html.touch .chip:active, html.touch .item:active, html.touch .menu-item:active { background: var(--surface-3); }
html.touch .chat-row:active { background: var(--surface-3); }
html.touch .btn:active { transform: scale(.98); }
@media (hover: none) { .chat-row:hover:not(.on) { background: transparent; } .icon-btn:hover { background: transparent; } }

/* notch, rounded corners and home bar (iPhone), punch-hole and gesture bar (Android) */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
.app { padding: var(--sat) var(--sar) 0 var(--sal); }
.side-body { padding-bottom: calc(84px + var(--sab)); }
.fab { bottom: calc(20px + var(--sab)); }
.fab-ai { bottom: calc(86px + var(--sab)); }
.composer-wrap { padding-bottom: max(10px, calc(6px + var(--sab))); }
.jump-btn { margin-bottom: var(--sab); }
.lightbox .bar { top: calc(12px + var(--sat)); }
.mini-player { height: calc(64px + var(--sab)); padding-bottom: var(--sab); padding-inline: max(14px, var(--sal)) max(14px, var(--sar)); }
.mp-progress { top: -3px; }
body.with-player .app, body.with-player .music.public { height: calc(100% - 64px - var(--sab)); }
body.with-player .composer-wrap { padding-bottom: 10px; }
/* the keyboard covers the home bar: no extra space while typing */
html.kb-open .composer-wrap { padding-bottom: 8px; }
html.kb-open .mini-player { display: none; }
html.kb-open body.with-player .app { height: 100%; }
html.kb-open .fab, html.kb-open .fab-ai { display: none; }
/* the top bar area under the clock matches the header */
html.standalone .app { background: var(--surface); }
html.standalone .main { background: var(--chat-bg); }

@media (max-width: 860px) {
  .app.with-panel .panel { padding-bottom: var(--sab); }
  /* bottom sheets: full width, above the home bar, never taller than what is visible */
  .modal-back { padding-top: var(--sat); }
  .modal-card { max-height: calc(var(--app-h, 100dvh) - var(--sat) - 10px); }
  .modal-card > :last-child { padding-bottom: calc(16px + var(--sab)); }
  html.kb-open .modal-card > :last-child { padding-bottom: 12px; }
  .modal-head { padding-top: 14px; }
  .chat-head { height: 58px; }
  .side-head { padding-top: 10px; }
  .toasts { top: calc(10px + var(--sat)); }
  .rv-paper { padding-top: var(--sat); }
  .lt-page { padding-top: calc(24px + var(--sat)); padding-bottom: calc(40px + var(--sab)); }
}
/* phones on their side */
@media (max-height: 500px) and (orientation: landscape) {
  .chat-head { height: 50px; }
  .np-stage { display: none; }
  .mini-player { height: calc(54px + var(--sab)); }
  body.with-player .app { height: calc(100% - 54px - var(--sab)); }
}
/* very small phones (iPhone SE / mini) */
@media (max-width: 380px) {
  :root { --fs: 14.5px; }
  .chat-row { padding: 8px 8px; margin: 1px 4px; gap: 10px; }
  .side-head { padding-inline: 10px; }
  .story-strip { gap: 8px; padding-inline: 10px; }
  .chat-head .who-sub { max-width: 40vw; }
}
/* the cover always fits the space left (small phones too) */
.np-stage { container-type: size; }
@supports (width: 1cqh) { .np-cover { width: min(100cqw, 100cqh, 420px); } }
.np-tab { white-space: nowrap; }
@media (max-width: 380px) { .np-tab { padding: 8px 10px; font-size: .8em; } .np-tab .np-sleep { display: none; } }

/* ═══ v2.7 — the mini player as a floating card (like the big music apps) ═══ */
:root { --mp-h: 76px; }
.mini-player { position: fixed; z-index: 90; inset-inline: 0; bottom: 0; height: calc(var(--mp-h) + var(--sab)); padding: 0 max(8px, var(--sal)) calc(8px + var(--sab)) max(8px, var(--sar));
  display: flex; align-items: flex-end; justify-content: center; background: none; box-shadow: none; backdrop-filter: none; pointer-events: none; grid-template-columns: none; gap: 0;
  transform: translateY(110%); opacity: 0; transition: transform .32s cubic-bezier(.2, .9, .25, 1.15), opacity .2s; animation: none; }
.mini-player.in { transform: none; opacity: 1; }
.mini-player.gone { transform: translateY(110%); opacity: 0; }
body.with-player .app, body.with-player .music.public { height: calc(100% - var(--mp-h) - var(--sab)); }
html.kb-open body.with-player .app { height: 100%; }
.mp-card { --mp-tint: #2A2440; pointer-events: auto; position: relative; width: 100%; max-width: 860px; height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 8px;
  border-radius: 14px; color: #fff; overflow: hidden; touch-action: pan-y;
  background: linear-gradient(90deg, var(--mp-tint), color-mix(in srgb, var(--mp-tint) 70%, #000)); box-shadow: 0 10px 30px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.18);
  transition: transform .25s cubic-bezier(.2, .9, .25, 1), background .6s; }
.mini-player .mp-card { --mp-tint: inherit; }
.mini-player { --mp-tint: #2A2440; }
.mp-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 60%); pointer-events: none; }
.mp-art { position: relative; width: 48px; height: 48px; flex: none; border-radius: 9px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.35); transition: transform .3s; }
.mini-player:not(.playing) .mp-art { transform: scale(.92); }
.mp-cover, .mp-cover img, .mp-gen { width: 100%; height: 100%; display: grid; place-items: center; object-fit: cover; }
.mp-gen { color: rgba(255,255,255,.9); }
.mp-eq { position: absolute; inset-inline-end: 4px; bottom: 4px; display: flex; align-items: flex-end; gap: 2px; height: 12px; padding: 2px 3px; border-radius: 4px; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s; }
.mp-eq i { width: 2.5px; height: 4px; background: #fff; border-radius: 1px; }
.mini-player.playing .mp-eq { opacity: 1; }
.mini-player.playing .mp-eq i { animation: eq .9s ease-in-out infinite; }
.mini-player.playing .mp-eq i:nth-child(2) { animation-delay: -.3s; }
.mini-player.playing .mp-eq i:nth-child(3) { animation-delay: -.6s; }
.mp-meta { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; text-align: start; color: inherit; padding: 0; }
.mp-text { min-width: 0; width: 100%; display: grid; gap: 1px; }
.mp-title-wrap { overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 14px), transparent); }
.mp-title { display: inline-block; font-weight: 700; font-size: .95em; white-space: nowrap; }
.mp-title-wrap.scrolling .mp-title { animation: mq var(--mq-t, 8s) ease-in-out 1.5s infinite alternate; }
@keyframes mq { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(var(--mq, 0)); } }
.mp-sub { font-size: .8em; color: rgba(255,255,255,.72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-time { display: none; font-size: .78em; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; }
.mp-ctrls { display: flex; align-items: center; gap: 0; direction: ltr; flex: none; }
.mp-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .12s, background .15s; }
.mp-btn:active { transform: scale(.86); background: rgba(255,255,255,.14); }
.mp-btn .ic svg path[fill] { stroke: none; }
.mp-close { display: none; }
.mp-play { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #15121F; margin: 0 2px; box-shadow: 0 4px 12px rgba(0,0,0,.25); transition: transform .12s; }
.mp-play:active { transform: scale(.88); }
/* play ⇄ pause morph */
.mp-pp { position: relative; width: 22px; height: 22px; display: block; }
.mp-pp .ic { position: absolute; inset: 0; transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), opacity .18s; }
.mp-pp .ic svg rect, .mp-pp .ic svg path { stroke: none; }
.mp-i-pause { opacity: 0; transform: scale(.4) rotate(-90deg); }
.mini-player.playing .mp-i-play { opacity: 0; transform: scale(.4) rotate(90deg); }
.mini-player.playing .mp-i-pause { opacity: 1; transform: none; }
.mp-progress { position: absolute; inset-inline: 10px; bottom: 3px; top: auto; height: 3px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; cursor: pointer; direction: ltr; }
.mp-progress i { display: block; width: 100%; height: 100%; margin: 0; background: #fff; transform-origin: left; transform: scaleX(0); will-change: transform; }
/* a new song slides in */
.mp-card.slide-next .mp-art, .mp-card.slide-next .mp-text { animation: mpNext .38s cubic-bezier(.2, .9, .25, 1); }
.mp-card.slide-prev .mp-art, .mp-card.slide-prev .mp-text { animation: mpPrev .38s cubic-bezier(.2, .9, .25, 1); }
@keyframes mpNext { from { transform: translateX(28px); opacity: 0; } }
@keyframes mpPrev { from { transform: translateX(-28px); opacity: 0; } }
[dir="rtl"] .mp-card.slide-next .mp-art, [dir="rtl"] .mp-card.slide-next .mp-text { animation-name: mpPrev; }
[dir="rtl"] .mp-card.slide-prev .mp-art, [dir="rtl"] .mp-card.slide-prev .mp-text { animation-name: mpNext; }
body.np-open .mini-player { visibility: hidden; }
@media (min-width: 861px) {
  .mp-card { height: 66px; padding-inline: 10px 12px; gap: 14px; }
  .mp-time { display: inline; }
  .mp-close { display: grid; }
  .mp-close .ic { opacity: .7; }
}
@media (max-width: 340px) { .mp-btn { width: 36px; height: 36px; } .mp-play { width: 40px; height: 40px; } .mp-art { width: 42px; height: 42px; } }

/* big player: the cover breathes with the music, songs slide in, play ⇄ pause morph */
.np-cover { transition: transform .45s cubic-bezier(.2, .9, .25, 1.1), box-shadow .45s; }
.np-sheet.paused .np-cover { transform: scale(.86); box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.np-cover.slide-next { animation: npNext .45s cubic-bezier(.2, .9, .25, 1); }
.np-cover.slide-prev { animation: npPrev .45s cubic-bezier(.2, .9, .25, 1); }
@keyframes npNext { from { transform: translateX(60%) scale(.8); opacity: 0; } }
@keyframes npPrev { from { transform: translateX(-60%) scale(.8); opacity: 0; } }
[dir="rtl"] .np-cover.slide-next { animation-name: npPrev; }
[dir="rtl"] .np-cover.slide-prev { animation-name: npNext; }
.np-names.swap { animation: npFade .4s ease-out; }
@keyframes npFade { from { opacity: 0; transform: translateY(6px); } }
.np-play { position: relative; }
.np-pp { position: relative; width: 34px; height: 34px; display: block; }
.np-pp .ic { position: absolute; inset: 0; transition: transform .28s cubic-bezier(.3, 1.4, .5, 1), opacity .18s; }
.np-pp .ic svg rect, .np-pp .ic svg path { stroke: none; }
.np-pp .np-i-pause { opacity: 0; transform: scale(.4) rotate(-90deg); }
.np-sheet:not(.paused) .np-pp .np-i-play { opacity: 0; transform: scale(.4) rotate(90deg); }
.np-sheet:not(.paused) .np-pp .np-i-pause { opacity: 1; transform: none; }
.np-btn:active, .np-play:active, .np-love:active { transform: scale(.86); }
.np-love.on { animation: lovepop .35s ease-out; }
.np-backdrop { transition: background-image .6s, opacity .6s; }
@media (prefers-reduced-motion: reduce) {
  .mini-player, .mp-card, .mp-pp .ic, .np-cover, .np-pp .ic { transition: none !important; animation: none !important; }
  .mp-title-wrap.scrolling .mp-title, .mini-player.playing .mp-eq i { animation: none; }
}
[dir="rtl"] .mp-title-wrap, [dir="rtl"] .mp-sub { text-align: right; }
[dir="rtl"] .mp-title-wrap { -webkit-mask-image: linear-gradient(270deg, transparent 0, #000 6px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(270deg, transparent 0, #000 6px, #000 calc(100% - 14px), transparent); }
.offline-bar.server { background: #7A4A12; }
.off-retry { margin-inline-start: 6px; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.2); color: #fff; font-weight: 700; font-size: .95em; }
.off-retry:active { background: rgba(255,255,255,.35); }

/* ═══════════════════════════════════════════════════════════════
   v2.8 — the watch (Galaxy Watch & other small round screens) + the command list
   Sizes use vmin so the same design fits 40 mm and 46 mm watches; content stays inside the circle.
   ═══════════════════════════════════════════════════════════════ */
/* sign-in on the watch */
html.watch .auth { grid-template-columns: 1fr; }
html.watch .auth-side { display: none; }
html.watch .auth-main { padding: 14vmin 12vmin 18vmin; place-items: start center; height: var(--app-h, 100%); overflow-y: auto; }
html.watch .auth-card h1 { font-size: 1.15em; text-align: center; }
html.watch .auth-card .sub { display: none; }
html.watch .auth-tools { top: 4vmin; inset-inline-end: 50%; transform: translateX(50%); }
html.watch body { font-size: 14px; }
html.watch .toasts { top: 8vmin; right: 10vmin; width: 80vmin; }
html.watch .toast { font-size: .82em; padding: 8px 10px; }

/* the watch home */
html.watch-ui, html.watch-ui body { background: #000; }
.w-screen { height: var(--app-h, 100%); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
  color: #F4F1EC; background: radial-gradient(70vmin 70vmin at 50% 34%, #1B2440 0%, #05070D 70%);
  padding: 7vmin 12vmin 22vmin; display: flex; flex-direction: column; align-items: center; gap: 3vmin; text-align: center; }
.w-top { width: 100%; display: flex; align-items: center; justify-content: center; gap: 3vmin; font-size: 4.6vmin; min-height: 7vmin; }
.w-clock { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.w-net { display: inline-flex; align-items: center; gap: 1.2vmin; font-size: 3.6vmin; opacity: .85; }
.w-net i { width: 2.2vmin; height: 2.2vmin; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 6px #3DDC84; }
.w-net.off i { background: #FFB020; box-shadow: 0 0 6px #FFB020; }
.w-net span { display: none; }
.w-net.off span { display: inline; color: #FFB020; }
.w-pending { font-size: 3.8vmin; color: #FFB020; font-weight: 700; }
.w-main { display: grid; justify-items: center; gap: 2.5vmin; margin-top: 1vmin; }
.w-mic { position: relative; width: 46vmin; height: 46vmin; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #8E6BFF, #5B3BD6 55%, #3A1F9E); box-shadow: 0 8px 26px rgba(91, 59, 214, .55), inset 0 2px 0 rgba(255,255,255,.25);
  transition: transform .15s; touch-action: manipulation; }
.w-mic .ic svg { width: 17vmin; height: 17vmin; }
.w-mic:active { transform: scale(.94); }
.w-mic.no-voice { background: radial-gradient(circle at 35% 30%, #6C7CA8, #3B4A72 60%, #26314F); box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.w-ring { position: absolute; inset: -3vmin; border-radius: 50%; border: .8vmin solid rgba(142, 107, 255, .55); opacity: 0; }
.listening .w-mic { background: radial-gradient(circle at 35% 30%, #FF7A59, #E5395B 55%, #A3173A); box-shadow: 0 8px 30px rgba(229, 57, 91, .6); }
.listening .w-ring { border-color: rgba(255, 99, 99, .6); animation: wPulse 1.4s ease-out infinite; }
.listening .w-ring.r2 { animation-delay: .7s; }
@keyframes wPulse { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.3); opacity: 0; } }
.w-live { min-height: 5vmin; max-width: 72vmin; font-size: 4.8vmin; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.w-hint { font-size: 4vmin; color: rgba(244,241,236,.7); }
.w-kb { display: inline-flex; align-items: center; gap: 1.6vmin; padding: 2vmin 4.5vmin; border-radius: 99px; background: rgba(255,255,255,.1); color: inherit; font-size: 4vmin; font-weight: 600; }
.w-type { display: none; width: 100%; gap: 2vmin; align-items: flex-end; scroll-margin-top: 6vmin; }
.typing .w-type { display: flex; }
.typing .w-kb { display: none; }
/* while typing the big button gets small, so the box sits high and the watch keyboard never covers it */
.typing .w-mic { width: 20vmin; height: 20vmin; }
.typing .w-mic .ic svg { width: 9vmin; height: 9vmin; }
.typing .w-hint { display: none; }
.w-input { flex: 1; min-width: 0; min-height: 15vmin; max-height: 32vmin; resize: none; border-radius: 4vmin; border: .4vmin solid rgba(142,107,255,.6); background: rgba(255,255,255,.08);
  color: #fff; padding: 2.4vmin 3vmin; font: inherit; font-size: max(16px, 4.6vmin); line-height: 1.35; outline: none; }
.w-input::placeholder { color: rgba(255,255,255,.45); font-size: .85em; }
.w-send { width: 13vmin; height: 13vmin; border-radius: 50%; flex: none; display: grid; place-items: center; background: #5B3BD6; color: #fff; }
.w-log-title { display: inline-flex; align-items: center; gap: 1.4vmin; margin-top: 3vmin; font-size: 3.6vmin; color: rgba(244,241,236,.6); text-transform: uppercase; letter-spacing: .04em; }
.w-log { width: 100%; display: grid; gap: 1.6vmin; }
.w-empty { margin: 0; font-size: 3.8vmin; color: rgba(244,241,236,.55); line-height: 1.4; }
.w-item { display: flex; align-items: flex-start; gap: 2vmin; width: 100%; text-align: start; padding: 2.4vmin 3vmin; border-radius: 4vmin; background: rgba(255,255,255,.07); color: inherit; }
.w-item.wait { background: rgba(255,176,32,.12); }
.w-item.review, .w-item.fail { background: rgba(229,57,91,.14); }
.w-item.undone { opacity: .55; }
.w-st { font-size: 4.4vmin; line-height: 1.2; }
.w-tx { flex: 1; min-width: 0; display: grid; gap: .6vmin; }
.w-tx strong { font-size: 4vmin; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.w-tx small { font-size: 3.3vmin; color: rgba(244,241,236,.65); line-height: 1.3; }
.w-full { margin-top: 3vmin; display: inline-flex; align-items: center; gap: 1.4vmin; padding: 2vmin 4vmin; border-radius: 99px; border: 1px solid rgba(255,255,255,.2); color: rgba(244,241,236,.8); font-size: 3.6vmin; }
.w-brand { display: inline-flex; align-items: center; gap: 1.2vmin; font-size: 3.2vmin; color: rgba(244,241,236,.4); margin-top: 1vmin; }
.w-sheet { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 12vmin; animation: fadeIn .15s; }
.w-sheet-in { width: 100%; max-height: 76vmin; overflow-y: auto; display: grid; gap: 2vmin; text-align: center; color: #fff; }
.w-sheet-in strong { font-size: 4.4vmin; overflow-wrap: anywhere; }
.w-sheet-in small { font-size: 3.6vmin; color: rgba(255,255,255,.7); }
.w-act { display: flex; align-items: center; justify-content: center; gap: 2vmin; padding: 3vmin; border-radius: 99px; background: rgba(255,255,255,.12); color: #fff; font-size: 4vmin; font-weight: 600; }
.w-act.danger { background: rgba(229,57,91,.3); }
html.watch-ui .mini-player, html.watch-ui .offline-bar, html.watch-ui .update-pill { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .listening .w-ring { animation: none; opacity: .6; } }

/* the command list inside the assistant (phone / computer) */
.as-queue { display: grid; gap: 6px; margin-top: 12px; }
.as-card.queued { display: flex; gap: 12px; align-items: center; }
.as-card.queued p { margin: 2px 0 0; color: var(--ink-3); font-size: .9em; }
.vq-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); }
.vq-row.review, .vq-row.fail { background: color-mix(in srgb, var(--danger) 8%, var(--surface-2)); }
.vq-row.wait { background: color-mix(in srgb, #FFB020 10%, var(--surface-2)); }
.vq-row.undone { opacity: .6; }
.vq-ic { font-size: 18px; flex: none; }
.vq-t { flex: 1; min-width: 0; display: grid; }
.vq-t strong { font-weight: 600; font-size: .92em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vq-t small { color: var(--ink-3); font-size: .8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vq-acts { display: flex; gap: 4px; flex: none; }
.vq-acts .chip { padding: 4px 8px; }
html.watch .auth-tools { inset-inline-end: auto; left: 50%; right: auto; transform: translateX(-50%); }
html.watch .toasts { top: 12vmin; left: 14vmin; right: 14vmin; width: auto; }
html.watch .toast { padding: 6px 10px; gap: 6px; border-radius: 99px; text-align: center; }
html.watch .toast .toast-ic, html.watch .toast .toast-x, html.watch .toast .toast-bar { display: none; }
html.watch .toast-text { font-size: 3.8vmin; justify-items: center; }
html.watch .auth-tools { top: 3vmin; }
html.watch .auth-tools .lang-btn { font-size: 3.6vmin; padding: 1vmin 3vmin; min-height: 0; }
html.watch .auth-main { padding-top: 16vmin; }
html.watch .auth-card .field > label, html.watch .auth-card label { text-align: center; display: block; }

/* v2.8 — shared song library */
.lib-backdrop { background: radial-gradient(80% 120% at 15% 0%, #7C4DDB 0%, transparent 60%), radial-gradient(70% 100% at 100% 100%, #FF6A2C 0%, transparent 60%), #120F1E !important; filter: none !important; }
.lib-art { background: linear-gradient(135deg, #7C4DDB, #FF6A2C); display: grid; place-items: center; color: #fff; }
.lib-art-in { display: grid; place-items: center; width: 100%; height: 100%; }
.lib-admin { display: contents; }
.lib-tools { align-items: center; }
.lib-tools select.input { width: auto; min-width: 140px; }
.lib-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.lib-cats::-webkit-scrollbar { display: none; }
.lib-cats .badge { margin-inline-start: 6px; opacity: .7; }
.lib-row { grid-template-columns: 40px 56px minmax(0, 1fr); }
.lib-row .mu-thumb { width: 56px; height: 56px; }
.lib-row .mu-foot { margin-top: 6px; }
.lib-copy span { white-space: nowrap; }
.lib-row .btn.sm.done { background: color-mix(in srgb, var(--success, #1B9E5A) 14%, transparent); color: var(--success, #1B9E5A); }
.lib-more { display: grid; place-items: center; min-height: 40px; padding: 10px; }
.lib-chip .ic { color: #7C4DDB; }
.lib-modal .modal-body { padding: 0; }
.lib-modal .modal-card { max-width: 900px; height: min(88vh, 860px); }
.lib-picker { display: flex; flex-direction: column; height: 100%; min-height: 60vh; }
.lib-picker .music { flex: 1; min-height: 0; }
.lib-up-sum { font-weight: 700; margin: 0 0 8px; }
.lib-up-state { flex: none; font-size: .8em; color: var(--ink-3); white-space: nowrap; }
.mu-up-row.dup { opacity: .6; }
.main-empty-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 860px) {
  .lib-row { grid-template-columns: 32px 46px minmax(0, 1fr); }
  .lib-row .mu-thumb { width: 46px; height: 46px; }
  .lib-tools select.input { min-width: 0; flex: 1; }
  .lib-modal .modal-card { height: calc(var(--app-h, 100dvh) - var(--sat) - 10px); }
}

/* v2.8.1 — watch sign-in: the page does not resize or jump under the watch keyboard (that closed it right away) */
html.watch, html.watch body { position: static; height: auto; min-height: 100%; overflow: auto; overscroll-behavior: auto; }
html.watch #root { height: auto; min-height: 100vh; }
html.watch .auth { height: auto; min-height: 100vh; }
html.watch .auth-main { height: auto; overflow: visible; padding-bottom: 30vmin; }
html.watch .w-screen { height: auto; min-height: 100vh; overflow: visible; }
html.watch .auth-card input.input { font-size: 16px; }
/* sign in with a code from the phone */
.pair-card { text-align: center; display: grid; gap: 10px; justify-items: center; }
.pair-ic { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pair-card h1 { font-size: 1.25em; margin: 0; }
.pair-code { font-size: 2.6em; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.1; }
.pair-code.dim { color: var(--ink-3); }
.pair-how { margin: 0; color: var(--ink-2); font-size: .9em; line-height: 1.45; max-width: 34ch; }
.pair-time { color: var(--ink-3); }
html.watch .pair-card { gap: 2.4vmin; }
html.watch .pair-ic { width: 13vmin; height: 13vmin; }
html.watch .pair-card h1 { font-size: 5vmin; }
html.watch .pair-code { font-size: 13vmin; }
html.watch .pair-how { font-size: 3.8vmin; }
html.watch .pair-time { font-size: 3.4vmin; }
html.watch .pair-card .btn { font-size: 3.8vmin; padding: 2vmin 3vmin; min-height: 0; }
.pair-input { font-size: 1.8em !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

/* v2.8.2 — watch: the answer under the button, the button follows your voice */
.w-mic { --lvl: 0; }
.listening .w-mic { box-shadow: 0 0 0 calc(var(--lvl) * 7vmin) rgba(255, 99, 99, .28), 0 8px 30px rgba(229, 57, 91, .6); transition: box-shadow .08s linear, transform .15s; }
.w-answer { display: none; max-width: 76vmin; margin-top: 1vmin; padding: 2.4vmin 3.4vmin; border-radius: 4vmin; align-items: center; gap: 2vmin; text-align: start;
  font-size: 4.4vmin; font-weight: 700; line-height: 1.3; background: rgba(255,255,255,.1); animation: wPop .25s ease-out; }
.w-answer.show { display: flex; }
.w-answer.done { background: rgba(61, 220, 132, .18); color: #B8F5D3; }
.w-answer.wait { background: rgba(255, 176, 32, .16); color: #FFD98A; }
.w-answer.review, .w-answer.fail { background: rgba(229, 57, 91, .2); color: #FFC2CE; font-size: 3.8vmin; }
.w-answer.run { color: rgba(244,241,236,.85); font-weight: 600; }
.w-a-ic { font-size: 5vmin; flex: none; }
.w-a-tx { overflow-wrap: anywhere; }
@keyframes wPop { from { transform: scale(.92); opacity: 0; } }
.balance-line.up b { color: var(--success, #1B9E5A); }
.balance-line.down b { color: var(--danger); }

/* v2.9 share from other apps → pick chats */
.share-prev { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 4px; scrollbar-width: thin; }
.share-th { flex: none; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); }
.share-th img { width: 100%; height: 100%; object-fit: cover; }
.share-th.file span { font-size: 11px; max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-th.more { font-weight: 700; color: var(--ink-2); }
.share-caption { width: 100%; resize: vertical; min-height: 44px; }
.share-list { max-height: min(48vh, 420px); overflow-y: auto; margin: 0 -20px; }
.share-room input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--accent, #2F6FED); }
.share-room > .ic:last-child, .share-room > svg:last-child { color: var(--ink-3); margin-inline-start: auto; }
.share-sheet .modal-foot .btn { min-width: 140px; }

/* v2.9.1 voice: language chip + calculator */
.as-lang { padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line, rgba(127,127,127,.3)); font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); min-width: 52px; }
.as-card.calc .as-calc-val { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: .5px; display: block; }
.as-card.calc .as-calc-expr { color: var(--ink-3); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.as-card.calc .as-ic { font-size: 22px; }
.as-parts { color: var(--ink-3); font-size: .9em; }
.w-lang { font-size: 3.4vmin; font-weight: 700; padding: .6vmin 2vmin; border-radius: 99px; border: 1px solid rgba(255,255,255,.25); color: rgba(244,241,236,.85); background: transparent; }
.w-answer.calc .w-a-tx { font-size: 1.15em; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ═══════════════ v2.9.4 UI Pro Max pass (checklist: contrast · touch targets · type floor · motion tokens) ═══════════════ */
:root {
  /* secondary text and gold now pass 4.5:1 on every surface (was 3.4:1 / 2.6:1) */
  --ink-3: #5A667B;
  --gold: #94600F;
  /* one set of motion timings for the whole app */
  --t-press: 90ms; --t-fast: 150ms; --t-med: 220ms; --t-slow: 320ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
  --hit: 44px;
}
:root[data-theme="dark"] { --ink-3: #8A97B0; --gold: #E3AE4C; }
/* names above bubbles: darker shade of the person's colour (≥4.5:1 on white) */
.sender { color: hsl(var(--h) 62% 32%); }
:root[data-theme="dark"] .sender { color: hsl(var(--h) 72% 74%); }
/* no informational text under ~11px */
.chat-row .page-label { font-size: max(11.5px, .74em); }
.slip-foot { font-size: max(11.5px, .78em); }
.meta-line .stamp-time, .chat-row .time { font-size: max(11px, .74em); }
.stamp { font-size: max(11px, .72em); }
/* numbers line up everywhere money or time is shown */
.amount, .slip-amount, .balance-chip, .as-calc-val, .money-input, .chat-row .time { font-variant-numeric: tabular-nums; }

/* touch screens: every control gets a ≥44×44 hit area without changing how it looks or moves the layout */
html.touch :is(.icon-btn, .chip, .task-pill, .as-lang, .balance-chip, button.link, .w-lang, .stamp, .mp-btn, .np-mode) { touch-action: manipulation; }
html.touch :is(.chip, .task-pill, .as-lang, .balance-chip, button.link) { position: relative; }
html.touch :is(.icon-btn, .chip, .task-pill, .as-lang, .balance-chip, button.link, .stamp)::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, var(--hit)); height: max(100%, var(--hit));
  transform: translate(-50%, -50%); border-radius: inherit;
}
html.touch .btn.loading::after { left: auto; top: auto; width: 18px; height: 18px; transform: none; }
html.touch .chip { min-height: 36px; height: auto; }

/* pressed feedback within ~100 ms on every tappable thing (no layout shift: colour / opacity / scale only) */
html.touch :is(.chip, .task-pill, .as-lang, .balance-chip, .w-item, .lib-row, .track-row):active { filter: brightness(.94); transition: filter var(--t-press) var(--ease-out); }
html.touch[data-theme="dark"] :is(.chip, .task-pill, .as-lang, .balance-chip):active { filter: brightness(1.15); }
.icon-btn, .chip, .btn, .menu-item, .chat-row { transition-timing-function: var(--ease-out); }

/* keyboard users always see where they are (inputs keep their own ring) */
:is(button, a, [role=button], .chip, .chat-row):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* modal scrim strong enough in both themes */
.modal-back.in { background: rgba(10, 16, 29, .52); }
:root[data-theme="dark"] .modal-back.in { background: rgba(0, 0, 0, .62); }

/* calculator card icon (vector, not emoji) */
.as-card.calc .as-ic { color: var(--accent); background: var(--accent-soft); }

/* motion off for people who ask for it — also the long-running loops (pulse, waves, equaliser) */
@media (prefers-reduced-motion: reduce) {
  .fab-ai::after, .as-mic.on .as-wave, .w-ring, .mp-eq i, .np-eq i { animation: none !important; }
  * { scroll-behavior: auto !important; }
}
/* command status marks (vector) */
.st-ic { display: inline-grid; place-items: center; flex: none; }
.st-done, .st-calc { color: var(--success); }
.st-wait { color: var(--gold); }
.st-run svg { animation: spin 1.1s linear infinite; }
.st-review { color: var(--accent); }
.st-fail { color: var(--danger); }
.st-undone { color: var(--ink-3); }
.st-calc { color: var(--accent); }
.w-a-ic .st-ic svg { width: 6vmin; height: 6vmin; }
.w-st .st-ic svg { width: 4.6vmin; height: 4.6vmin; }
html.watch .st-done { color: #3DDC84; } html.watch .st-wait { color: #FFB020; } html.watch .st-fail { color: #FF7A6B; } html.watch .st-review, html.watch .st-calc { color: #9DB8FF; }
@media (prefers-reduced-motion: reduce) { .st-run svg { animation: none; } }
.stamp { opacity: 1; }
.chip .badge { font-size: 11px; font-weight: 700; background: var(--ink); color: var(--surface); }
.chip.on .badge { background: var(--surface); color: var(--ink); }
.mu-love .ic { display: inline-grid; }
.mu-love.on svg { fill: currentColor; }
html.touch :is(.mu-play, .mu-react, .mu-stat, .mu-love, .lib-play, .np-btn, .mp-btn) { position: relative; }
html.touch :is(.mu-play, .mu-react, .mu-stat, .mu-love, .lib-play, .btn.sm)::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, var(--hit)); height: max(100%, var(--hit)); transform: translate(-50%, -50%);
}
html.touch .btn:not(.sm) { min-height: var(--hit); }
/* the last chats are never hidden under the floating buttons */
.chat-list { padding-bottom: calc(150px + var(--sab, 0px)); }

/* ═══════════════ v2.9.6 tabs (chats · updates · settings), Updates tab, announcements, tones ═══════════════ */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(3, 1fr); flex: none; position: relative; z-index: 3;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 6px 8px calc(6px + var(--sab, 0px));
  }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 4px 0; min-height: var(--hit, 44px); color: var(--ink-3); font-size: 12px; font-weight: 600; }
  .tab-ic { position: relative; display: grid; place-items: center; width: 60px; height: 30px; border-radius: 99px; transition: background var(--t-med, .2s) var(--ease-out, ease), color var(--t-fast, .15s); }
  .tab.on { color: var(--ink); }
  .tab.on .tab-ic { background: var(--accent-soft); color: var(--accent); }
  .tab:active .tab-ic { transform: scale(.94); }
  .tab-badge { position: absolute; top: -4px; inset-inline-end: 6px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; border: 2px solid var(--surface); }
  /* the floating buttons sit above the tabs; the list leaves room for both */
  .side .fab { bottom: calc(84px + var(--sab, 0px)); }
  .side .fab-ai { bottom: calc(150px + var(--sab, 0px)); }
  .chat-list { padding-bottom: calc(160px + var(--sab, 0px)); }
}
.tab-dot { position: absolute; top: 3px; inset-inline-end: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--surface); }
.rail-item .tab-dot { top: 6px; inset-inline-end: 8px; box-shadow: 0 0 0 2px var(--rail); }

/* Updates tab */
.side-body.updates { padding: 4px 0 calc(24px + var(--sab, 0px)); }
.up-section { padding: 6px 0 10px; }
.up-section + .up-section { border-top: 8px solid var(--surface-2); }
.up-h { font-size: 1.05em; font-weight: 800; margin: 0; padding: 12px 18px 6px; }
.up-h-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-inline-end: 14px; }
.up-sub { font-size: .8em; font-weight: 700; color: var(--ink-3); padding: 12px 18px 4px; text-transform: none; }
.up-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px 18px; text-align: start; min-height: 68px; transition: background var(--t-fast, .15s); }
.up-row:hover, .up-row:active { background: var(--surface-2); }
.up-ring { width: 58px !important; height: 58px !important; flex: none; }
.up-ring .avatar { width: 50px !important; height: 50px !important; }
.up-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.up-text strong { font-size: 1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-text small { color: var(--ink-3); font-size: .82em; }
.up-add { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: none; }
.up-empty { color: var(--ink-3); font-size: .9em; padding: 6px 18px 4px; margin: 0; }
.up-ann-empty { display: grid; justify-items: center; gap: 6px; padding: 18px; color: var(--ink-3); }
.up-ann-empty p { margin: 0; font-size: .9em; }

/* announcement card */
.ann-card { margin: 8px 14px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-1); }
.ann-img { aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.ann-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ann-in { padding: 12px 14px 14px; display: grid; gap: 6px; }
.ann-top { display: flex; align-items: center; gap: 8px; font-size: .78em; color: var(--ink-3); min-height: 28px; }
.ann-from { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--accent); }
.ann-pin { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.ann-time { margin-inline-start: auto; }
.ann-more-btn { width: 32px; height: 32px; margin-inline-end: -6px; }
.ann-title { margin: 0; font-size: 1.08em; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.ann-body { margin: 0; white-space: pre-wrap; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.ann-body.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ann-more { justify-self: start; font-size: .9em; }
.ann-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.ann-link { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.ann-stats { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ann-edit-img { margin-bottom: 12px; position: relative; }
.ann-edit-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; display: block; }
.ann-img-x { position: absolute; top: 8px; inset-inline-end: 8px; background: rgba(0, 0, 0, .55); color: #fff; }
@media (min-width: 861px) { .ann-card { max-width: 560px; } }

/* tone picker */
.tone-rows .item { padding-inline: 0; }
.tone-list { display: grid; gap: 2px; max-height: min(56vh, 460px); overflow-y: auto; margin: 0 -8px; }
.tone-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; min-height: var(--hit, 44px); text-align: start; }
.tone-row:hover, .tone-row:active { background: var(--surface-2); }
.tone-row.on { background: var(--accent-soft); }
.tone-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; color: var(--accent-ink); }
.tone-row.on .tone-radio { background: var(--accent); border-color: var(--accent); }
.tone-name { flex: 1; font-weight: 600; }
.tone-play { color: var(--ink-3); }

/* v2.9.7 two tabs, swipe between them, close on the mini player */
@media (max-width: 860px) {
  .tabbar { grid-template-columns: repeat(2, 1fr); }
  .tab-ic { width: 64px; }
  .side.tab-swiping > :not(.tabbar):not(.fab), .side.tab-settling > :not(.tabbar):not(.fab) { transform: translateX(var(--swipe, 0px)); }
  .side.tab-settling > :not(.tabbar):not(.fab) { transition: transform var(--t-med, .22s) var(--ease-out, ease); }
  .side.tab-swiping { touch-action: pan-y; }
  .side[data-enter="from-left"] > :not(.tabbar):not(.fab) { animation: tabInL .28s var(--ease-out, ease); }
  .side[data-enter="from-right"] > :not(.tabbar):not(.fab) { animation: tabInR .28s var(--ease-out, ease); }
  .mp-close { display: grid; width: 34px; height: 34px; margin-inline-start: 2px; position: relative; }
  .mp-close .ic { opacity: .75; }
  .mp-close .ic svg { width: 18px; height: 18px; }
  .mp-close::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
}
@keyframes tabInL { from { transform: translateX(-36px); opacity: .4; } }
@keyframes tabInR { from { transform: translateX(36px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .side[data-enter] > * { animation: none !important; } }
.mini-player.gone { transform: translateY(120%); opacity: 0; transition: transform .22s var(--ease-in, ease-in), opacity .22s; }

/* ═══════════════════════════ sign in / sign up (v2.9.8) ═══════════════════════════ */
.auth { height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, 560px); background: var(--surface); }
.auth-side { position: relative; overflow: hidden; isolation: isolate; color: #E8EDF8; padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 38%, var(--rail)) 0%, var(--rail) 58%), var(--rail); }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: -1; pointer-events: none; animation: orb 14s ease-in-out infinite alternate; }
.auth-orb.o1 { width: 420px; height: 420px; background: var(--accent); top: -160px; inset-inline-end: -120px; }
.auth-orb.o2 { width: 320px; height: 320px; background: var(--gold); bottom: -160px; inset-inline-start: -80px; opacity: .22; animation-delay: -6s; }
@keyframes orb { to { transform: translate(-30px, 40px) scale(1.08); } }
.auth-grid { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .07;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 30% 40%, #000, transparent); -webkit-mask-image: radial-gradient(80% 70% at 30% 40%, #000, transparent); }
.auth-side .brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.25em; color: #fff; }
.auth-side .brand .logo-mark { color: #fff; }
.auth-headline { font-size: clamp(30px, 3.3vw, 46px); line-height: 1.15; font-weight: 800; margin: 0 0 22px; max-width: 15ch; color: #fff; letter-spacing: -.01em; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: #C9D2E6; }
.auth-points li { display: flex; gap: 12px; align-items: center; }
.auth-pt-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--gold);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); }
.auth-show { position: relative; margin-top: 34px; display: grid; gap: 10px; max-width: 340px; }
.auth-show .auth-slip { margin: 0; width: 300px; transform: rotate(-2.5deg); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
[dir="rtl"] .auth-show .auth-slip { transform: rotate(2.5deg); }
.auth-bubble { width: max-content; max-width: 270px; padding: 9px 13px; border-radius: 16px; font-size: .9em; box-shadow: 0 8px 22px rgba(0, 0, 0, .25); animation: bubbleIn .6s both; }
.auth-bubble.them { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px); border-end-start-radius: 4px; }
.auth-bubble.me { justify-self: end; background: var(--accent); color: var(--accent-ink); border-end-end-radius: 4px; animation-delay: .5s; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.auth-foot { display: flex; align-items: center; gap: 8px; font-size: .8em; color: rgba(232, 237, 248, .6); }

.auth-pane { position: relative; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; background: var(--surface); }
.auth-main { flex: 1; display: grid; place-items: center; padding: 32px 28px 40px; }
.auth-tools { position: absolute; top: 16px; inset-inline-end: 16px; display: flex; gap: 6px; z-index: 2; }
.auth .lang-btn { color: var(--ink-2); border-radius: 999px; }
.auth-hero { display: none; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card.auth-in { animation: authIn .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes authIn { from { opacity: 0; transform: translateY(12px); } }
.auth-card h1 { font-size: 1.7em; font-weight: 800; margin: 0 0 6px; letter-spacing: -.01em; }
.auth-card .sub { color: var(--ink-3); margin: 0 0 24px; }
.auth-card .field label { font-weight: 600; font-size: .88em; color: var(--ink-2); }
.auth-card .btn.primary.block { height: 50px; border-radius: 14px; font-size: 1.02em; font-weight: 700; margin-top: 4px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.auth-card .btn.outline.block { height: 48px; border-radius: 14px; }
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 26px; border-radius: 14px; background: var(--surface-2); }
.auth-tab { position: relative; z-index: 1; height: 40px; border: 0; background: none; border-radius: 10px; font: inherit; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: color .2s; }
.auth-tab.on { color: var(--ink); }
.auth-tab-ink { position: absolute; top: 4px; bottom: 4px; inset-inline-start: 4px; width: calc(50% - 4px); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.auth-tabs[data-on="signup"] .auth-tab-ink { transform: translateX(100%); }
[dir="rtl"] .auth-tabs[data-on="signup"] .auth-tab-ink { transform: translateX(-100%); }
.auth-input { position: relative; }
.auth-input .input { padding-inline-start: 44px; height: 50px; border-radius: 14px; }
.auth-input.input-wrap .input { padding-inline-end: 48px; }
[dir="rtl"] .auth-input .input[dir="ltr"] { padding-left: 14px; padding-right: 44px; text-align: right; }
.auth-input-ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; display: grid; transition: color .2s; }
.auth-input:focus-within .auth-input-ic { color: var(--accent); }
.auth-input.input-wrap .icon-btn { top: 50%; transform: translateY(-50%); inset-inline-end: 4px; }
.auth-forgot { text-align: end; margin: -6px 0 18px; font-size: .9em; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--ink-3); font-size: .85em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-switch { margin-top: 20px; text-align: center; color: var(--ink-3); font-size: .93em; }
.auth-terms { display: flex; gap: 8px; align-items: flex-start; font-size: .82em; color: var(--ink-3); margin: 4px 0 16px; line-height: 1.5; }
.auth-terms .ic { flex: none; margin-top: 2px; color: var(--success); }
.pw-strength { display: flex; align-items: center; gap: 10px; margin: -6px 0 14px; min-height: 18px; }
.pw-meter { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pw-meter i { height: 5px; border-radius: 3px; background: var(--surface-3); transition: background .25s; }
.pw-label { font-size: .8em; font-weight: 600; min-width: 64px; text-align: end; color: var(--ink-3); }
.pw-strength[data-score=""] { visibility: hidden; }
.pw-strength[data-score="0"] .pw-meter i:nth-child(-n+1) { background: var(--danger); }
.pw-strength[data-score="0"] .pw-label, .pw-strength[data-score="1"] .pw-label { color: var(--danger); }
.pw-strength[data-score="1"] .pw-meter i:nth-child(-n+1) { background: var(--danger); }
.pw-strength[data-score="2"] .pw-meter i:nth-child(-n+2) { background: #E8A33B; }
.pw-strength[data-score="2"] .pw-label { color: #C9821A; }
.pw-strength[data-score="3"] .pw-meter i:nth-child(-n+3) { background: var(--success); }
.pw-strength[data-score="4"] .pw-meter i { background: var(--success); }
.pw-strength[data-score="3"] .pw-label, .pw-strength[data-score="4"] .pw-label { color: var(--success); }
.pw-match { display: flex; align-items: center; gap: 6px; font-size: .82em; margin: -6px 0 12px; min-height: 0; }
.pw-match.ok { color: var(--success); } .pw-match.bad { color: var(--danger); }

@media (max-width: 860px) {
  /* ── sign in / sign up on phones (v2.10.2): immersive night top + a sheet that slides up ── */
  .auth { grid-template-columns: 1fr; background: #070B16; }
  .auth-side { display: none; }
  .auth-pane { background: radial-gradient(130% 70% at 50% 0%, #1A2550 0%, #0B1023 55%, #070B16 100%); color: #fff; overflow-x: hidden; }
  .auth-hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; flex: none;
    padding: calc(52px + env(safe-area-inset-top)) 24px 34px; color: #fff; overflow: hidden; transition: padding .35s var(--ease-out, ease); }
  .auth-aurora { position: absolute; inset: -40% -30% -10%; pointer-events: none; filter: blur(46px); opacity: .9; }
  .auth-aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: auroraMove 16s ease-in-out infinite alternate; }
  .auth-aurora i:nth-child(1) { width: 62%; height: 52%; left: 4%; top: 18%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 85%, #fff), transparent 68%); }
  .auth-aurora i:nth-child(2) { width: 54%; height: 46%; right: 2%; top: 8%; background: radial-gradient(circle, #8B5CF6, transparent 66%); animation-duration: 19s; animation-delay: -6s; }
  .auth-aurora i:nth-child(3) { width: 46%; height: 40%; left: 30%; top: 46%; background: radial-gradient(circle, #14B8A6, transparent 66%); opacity: .55; animation-duration: 22s; animation-delay: -11s; }
  @keyframes auroraMove { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8%, -6%) scale(1.12); } 100% { transform: translate(-6%, 5%) scale(.95); } }
  .auth-stars { position: absolute; inset: 0; pointer-events: none; opacity: .55;
    background-image: radial-gradient(1px 1px at 12% 22%, #fff, transparent), radial-gradient(1px 1px at 28% 68%, #fff, transparent), radial-gradient(1.4px 1.4px at 46% 14%, #fff, transparent),
      radial-gradient(1px 1px at 64% 40%, #fff, transparent), radial-gradient(1.2px 1.2px at 82% 18%, #fff, transparent), radial-gradient(1px 1px at 90% 62%, #fff, transparent),
      radial-gradient(1px 1px at 8% 84%, #fff, transparent), radial-gradient(1.3px 1.3px at 72% 82%, #fff, transparent), radial-gradient(1px 1px at 38% 40%, #fff, transparent);
    animation: starTwinkle 5s ease-in-out infinite alternate; }
  @keyframes starTwinkle { to { opacity: .25; } }
  .auth-hero-atom { position: relative; display: block; line-height: 0; color: #9DB4FF; filter: drop-shadow(0 0 22px rgba(120, 150, 255, .45));
    animation: atomIn .9s cubic-bezier(.2, 1.2, .3, 1) both, atomSpin 16s linear infinite; transition: transform .35s var(--ease-out, ease); }
  .auth-hero-atom svg { display: block; overflow: visible; }
  @keyframes atomIn { from { opacity: 0; transform: scale(.4); } }
  @keyframes atomSpin { to { rotate: 360deg; } }
  .auth-hero-name { position: relative; margin-top: 10px; font-size: 1.9em; font-weight: 800; letter-spacing: -.01em; color: #fff;
    background: linear-gradient(90deg, #fff 0%, #fff 40%, #B9C8FF 50%, #fff 60%, #fff 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: nameShine 3.2s ease-in-out infinite, riseIn .7s .15s both; }
  @keyframes nameShine { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
  @keyframes riseIn { from { opacity: 0; transform: translateY(12px); } }
  .auth-hero small { position: relative; color: rgba(225, 232, 255, .72); max-width: 30ch; line-height: 1.5; animation: riseIn .7s .28s both; }
  .auth-tools { top: calc(12px + env(safe-area-inset-top)); inset-inline-end: 14px; }
  .auth .lang-btn { color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  /* the sheet */
  .auth-main { position: relative; z-index: 1; flex: 1 0 auto; display: block; margin: 0; padding: 26px 20px calc(26px + env(safe-area-inset-bottom));
    background: var(--surface); color: var(--ink); border-radius: 30px 30px 0 0; box-shadow: 0 -18px 50px rgba(0, 0, 0, .35); animation: sheetUp .65s cubic-bezier(.2, .9, .25, 1) both; }
  .auth-main::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line-strong); }
  @keyframes sheetUp { from { transform: translateY(70px); opacity: 0; } }
  .auth-card { max-width: 440px; margin: 0 auto; background: none; box-shadow: none; padding: 0; border-radius: 0; }
  .auth-card h1 { font-size: 1.55em; }
  .auth-card .sub { margin-bottom: 20px; }
  .auth-tabs { margin-bottom: 22px; border-radius: 16px; }
  .auth-tab { height: 42px; }
  .auth-input .input { height: 54px; border-radius: 16px; background: var(--surface-2); border-color: transparent; }
  .auth-input .input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-softer); }
  .auth-card .btn.primary.block { height: 56px; border-radius: 18px; font-size: 1.06em; border: 0; color: #fff;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #8B5CF6)); box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 38%, transparent); }
  .auth-card .btn.primary.block:active { transform: scale(.98); }
  .auth-card .btn.outline.block { height: 52px; border-radius: 16px; }
  /* keyboard open: the top gets small so the form stays in view */
  html.kb-open .auth-hero { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: 14px; }
  html.kb-open .auth-hero-atom { transform: scale(.55); margin: -26px 0; }
  html.kb-open .auth-hero small, html.kb-open .auth-hero-name { display: none; }
  @media (max-height: 640px) { .auth-hero { padding-top: calc(34px + env(safe-area-inset-top)); padding-bottom: 22px; } .auth-hero-atom svg { width: 92px; height: 92px; } .auth-hero-name { font-size: 1.6em; } }
}
.atom-mark .am-ring { fill: none; stroke: currentColor; stroke-opacity: .35; stroke-width: 1.2; }
.atom-mark .am-e { fill: #fff; } .atom-mark .am-e.e2 { fill: #5EEAD4; } .atom-mark .am-e.e3 { fill: #D8B4FE; }
.atom-mark .am-glow { fill: #9DB4FF; opacity: .22; } .atom-mark .am-glow.e2 { fill: #2DD4BF; } .atom-mark .am-glow.e3 { fill: #C084FC; }
.atom-mark .am-trail { fill: #fff; opacity: .35; }
.atom-mark .am-wave { fill: none; stroke: #9DB4FF; stroke-width: 1.2; }
@media (prefers-reduced-motion: reduce) { .auth-aurora i, .auth-stars, .auth-hero-atom, .auth-hero-name, .auth-main { animation: none !important; } }
html.watch .auth-hero { display: none; }
html.watch .auth-main { margin-top: 0; }

/* ═══════════════════════════ first-run setup (v2.9.8) ═══════════════════════════ */
body.welcome-open { overflow: hidden; }
.welcome { position: fixed; inset: 0; z-index: 250; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; opacity: 0; transition: opacity .3s;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.welcome.in { opacity: 1; }
.wl-glow { position: absolute; inset: -30% -10% auto; height: 70%; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); transition: background .4s; }
.wl-top { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; z-index: 1; }
.wl-nav { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.wl-skip { min-width: 42px; height: 42px; padding: 0 14px; border: 0; background: none; color: var(--ink-3); font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px; }
.wl-skip:hover { background: var(--surface-2); color: var(--ink); }
.wl-dots { flex: 1; display: flex; justify-content: center; gap: 6px; }
.wl-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line-strong); transition: width .3s, background .3s; }
.wl-dots i.done { background: color-mix(in srgb, var(--accent) 50%, var(--line-strong)); }
.wl-dots i.on { width: 26px; background: var(--accent); }
.wl-stage { position: relative; flex: 1; min-height: 0; overflow-y: auto; display: grid; place-items: center; padding: 8px 20px 28px; }
.wl-page { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.wl-page.from-next { animation: wlNext .38s cubic-bezier(.2, .8, .2, 1) both; }
.wl-page.from-prev { animation: wlPrev .38s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes wlNext { from { opacity: 0; transform: translateX(40px); } }
@keyframes wlPrev { from { opacity: 0; transform: translateX(-40px); } }
[dir="rtl"] .wl-page.from-next { animation-name: wlPrev; }
[dir="rtl"] .wl-page.from-prev { animation-name: wlNext; }
.wl-hero { width: 104px; height: 104px; border-radius: 32px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent); margin-bottom: 6px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--accent) 35%, transparent); animation: wlFloat 4s ease-in-out infinite; }
.wl-hero .logo-mark { color: var(--accent-ink); }
@keyframes wlFloat { 50% { transform: translateY(-6px); } }
.wl-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.wl-title { font-size: clamp(1.45em, 4.6vw, 1.85em); font-weight: 800; margin: 4px 0 0; letter-spacing: -.01em; }
.wl-sub { color: var(--ink-3); margin: 0 0 8px; max-width: 34ch; line-height: 1.55; }
.wl-next { margin-top: 10px; height: 52px; border-radius: 16px; font-size: 1.04em; font-weight: 700; }
.wl-page .btn.ghost.block { height: 46px; border-radius: 14px; }
.wl-choices { width: 100%; display: grid; gap: 12px; }
.wl-choices.two { grid-template-columns: 1fr 1fr; }
.wl-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px 18px; border-radius: 20px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; transition: border-color .2s, transform .15s, box-shadow .2s; }
.wl-choice:active { transform: scale(.98); }
.wl-choice.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-softer); }
.wl-choice-big { font-size: 2.2em; font-weight: 800; line-height: 1; color: var(--accent); }
.wl-check { position: absolute; top: 10px; inset-inline-end: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.wl-avatar { position: relative; margin: 6px 0; }
.wl-avatar .avatar { box-shadow: 0 0 0 5px var(--surface), 0 0 0 7px var(--accent-soft); }
.wl-cam { position: absolute; bottom: 4px; inset-inline-end: 4px; width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--bg); background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; cursor: pointer; }
.wl-pick { border-radius: 999px; }
.wl-field { width: 100%; display: grid; gap: 6px; text-align: start; margin-top: 6px; }
.wl-field > span { font-size: .86em; font-weight: 600; color: var(--ink-2); }
.wl-field .input { height: 50px; border-radius: 14px; }
.wl-themes { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wl-theme { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .2s, box-shadow .2s; }
.wl-theme.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-softer); }
.wl-theme-l { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: .9em; }
.wl-mock { height: 92px; border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.wl-mock i { display: block; height: 12px; border-radius: 6px; width: 70%; }
.wl-mock i:nth-child(2) { align-self: flex-end; width: 55%; background: var(--accent) !important; }
.wl-mock i:nth-child(3) { width: 45%; }
.wl-mock.light { background: #EEF1F6; } .wl-mock.light i { background: #fff; }
.wl-mock.dark { background: #0F1420; } .wl-mock.dark i { background: #232B3B; }
.wl-mock.system { background: linear-gradient(135deg, #EEF1F6 50%, #0F1420 50%); } .wl-mock.system i { background: rgba(127, 127, 127, .45); }
.wl-swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: 100%; }
.wl-sw { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--sw); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .15s, box-shadow .2s; }
.wl-sw:hover { transform: scale(1.06); }
.wl-sw.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--sw); }
.wl-preview { width: 100%; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: var(--chat-bg); border: 1px solid var(--line); margin-top: 4px; }
.wl-bubble { max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: .92em; text-align: start; }
.wl-bubble.them { align-self: flex-start; background: var(--bubble-them); border-end-start-radius: 4px; }
.wl-bubble.me { align-self: flex-end; background: var(--bubble-me); border-end-end-radius: 4px; }
.wl-notif-demo { width: 100%; display: flex; gap: 12px; align-items: center; text-align: start; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-2);
  animation: wlDrop .6s .2s cubic-bezier(.2, .8, .2, 1) both; }
.wl-notif-demo div { display: grid; gap: 2px; min-width: 0; } .wl-notif-demo span { color: var(--ink-2); font-size: .92em; }
.wl-nd-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.wl-nd-ic .logo-mark { color: var(--accent-ink); }
@keyframes wlDrop { from { opacity: 0; transform: translateY(-24px); } }
.wl-done { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff; animation: wlPop .5s cubic-bezier(.2, 1.4, .4, 1) both;
  box-shadow: 0 0 0 12px color-mix(in srgb, var(--success) 15%, transparent); }
@keyframes wlPop { from { transform: scale(.3); opacity: 0; } }

/* ═══════════════════════════ guided tour (v2.9.8) ═══════════════════════════ */
.tour { position: fixed; inset: 0; z-index: 260; opacity: 0; transition: opacity .25s; cursor: pointer; }
.tour.in { opacity: 1; }
.tour-hole { position: fixed; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(6, 10, 20, .68), 0 0 0 3px var(--accent) inset;
  transition: left .4s cubic-bezier(.2, .8, .2, 1), top .4s cubic-bezier(.2, .8, .2, 1), width .4s cubic-bezier(.2, .8, .2, 1), height .4s cubic-bezier(.2, .8, .2, 1), border-radius .4s; }
.tour.center .tour-hole { box-shadow: 0 0 0 9999px rgba(6, 10, 20, .72); }
.tour-hole::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 2px solid var(--accent); opacity: .7; animation: tourRing 1.6s ease-out infinite; }
.tour.center .tour-hole::after { display: none; }
@keyframes tourRing { from { transform: scale(1); opacity: .7; } to { transform: scale(1.12); opacity: 0; } }
.tour-arrow { position: fixed; width: 34px; height: 34px; color: var(--gold); pointer-events: none; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5));
  transition: left .4s cubic-bezier(.2, .8, .2, 1), top .4s cubic-bezier(.2, .8, .2, 1); animation: tourBob 1s ease-in-out infinite; }
.tour-arrow .ic { width: 34px; height: 34px; stroke-width: 2.6; }
.tour-arrow.up { animation-name: tourBobUp; }
.tour-arrow.up .ic { transform: rotate(180deg); }
.tour.center .tour-arrow { opacity: 0; }
@keyframes tourBob { 50% { transform: translateY(8px); } }
@keyframes tourBobUp { 50% { transform: translateY(-8px); } }
.tour-card { position: fixed; width: 340px; max-width: calc(100vw - 24px); padding: 16px 16px 14px; border-radius: 20px; background: var(--surface); color: var(--ink); cursor: default;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .4); transition: left .4s cubic-bezier(.2, .8, .2, 1), top .4s cubic-bezier(.2, .8, .2, 1); }
.tour.center .tour-card { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-card.tour-anim .tour-title, .tour-card.tour-anim .tour-text { animation: authIn .35s both; }
.tour-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tour-count { font-size: .78em; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; direction: ltr; }
.tour-skip { border: 0; background: none; color: var(--ink-3); font: inherit; font-size: .88em; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.tour-skip:hover { background: var(--surface-2); color: var(--ink); }
.tour-title { margin: 4px 0; font-size: 1.12em; font-weight: 800; }
.tour-text { margin: 0 0 14px; color: var(--ink-2); line-height: 1.55; font-size: .94em; }
.tour-btns { display: flex; justify-content: space-between; gap: 8px; }
.tour-btns .btn { min-width: 92px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .tour-arrow, .tour-hole::after, .auth-orb, .wl-hero { animation: none; } }

/* ═══════════════════════════ admin: who is on now (v2.9.8) ═══════════════════════════ */
.admin-live { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 20px 0; }
.admin-live .live-card { grid-column: 1 / -1; }
.live-card { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 18px 20px; border-radius: var(--r-lg); color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--success) 70%, #0B3B2A), #0E3326); box-shadow: var(--shadow-1); }
.live-card .live-top { display: flex; align-items: center; gap: 8px; font-size: .86em; font-weight: 600; opacity: .9; }
.live-card .live-n { font-size: 2.6em; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #4AE08A; box-shadow: 0 0 0 0 rgba(74, 224, 138, .7); animation: livePulse 1.6s ease-out infinite; flex: none; }
@keyframes livePulse { to { box-shadow: 0 0 0 10px rgba(74, 224, 138, 0); } }
.live-mini { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.live-mini strong { font-size: 1.6em; font-weight: 800; font-variant-numeric: tabular-nums; }
.live-mini span { color: var(--ink-3); font-size: .8em; line-height: 1.3; }
.admin-online { margin: 4px 20px 20px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.admin-online h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1em; }
.admin-online .on-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; }
.admin-online .on-row + .on-row { border-top: 1px solid var(--line); }
.admin-online .on-row .grow { min-width: 0; display: grid; } .admin-online .on-row small { color: var(--ink-3); }
.admin-online .on-av { position: relative; flex: none; }
.admin-online .on-av::after { content: ""; position: absolute; bottom: 0; inset-inline-end: 0; width: 11px; height: 11px; border-radius: 50%; background: #2FC26B; border: 2px solid var(--surface); }
.admin-online .nobody { color: var(--ink-3); text-align: center; padding: 14px; margin: 0; }

/* help: tour again */
.help-tour { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--accent-soft); border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-softer), var(--surface)); color: var(--ink); font: inherit; text-align: start; }
.help-tour:hover { border-color: var(--accent); }
.help-tour-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.help-tour-t { flex: 1; display: grid; gap: 2px; } .help-tour-t small { color: var(--ink-3); }

/* my places: name on its own line, the button full width under it (long English text never cut) */
.place-add .field { margin-bottom: 12px; }
.place-add .input { height: 46px; }
.place-save { height: 46px; gap: 8px; white-space: normal; line-height: 1.25; }
.place-save span { min-width: 0; }

/* ═══════════════════════════ website rooms (type 8, v2.10) ═══════════════════════════ */
.site { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.site-center { flex: 1; display: grid; place-items: center; padding: 24px; }
.site-bar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface); min-height: 48px; }
.site-addr { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 60%; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .88em; }
.site-addr > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-addr small { color: var(--ink-3); white-space: nowrap; }
.site-addr .ic { flex: none; color: var(--success); }
.site-stage { position: relative; flex: 1; min-height: 0; background: #fff; }
.site-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.site-veil { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); transition: opacity .3s; }
.site-veil.gone { opacity: 0; pointer-events: none; }
.site-tip { position: absolute; inset-inline: 12px; bottom: calc(12px + var(--sab, 0px)); display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 14px;
  background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-2); font-size: .86em; max-width: 560px; margin-inline: auto; }
.site-tip > span { flex: 1; min-width: 0; }
.site-tip .ic { flex: none; color: var(--accent); }
.site-tip .link { white-space: nowrap; font-weight: 600; }
.site-msg { max-width: 380px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-2); }
.site-msg h3 { margin: 4px 0 0; color: var(--ink); }
.site-msg p { margin: 0 0 6px; line-height: 1.6; }
.site-msg-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.site-setup { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 20px calc(28px + var(--sab, 0px)); }
.site-hero { max-width: 560px; margin: 0 auto 22px; text-align: center; }
.site-hero-ic { width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 24px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 30%, transparent); }
.site-hero h2 { margin: 0 0 6px; font-size: 1.45em; font-weight: 800; }
.site-hero p { margin: 0; color: var(--ink-3); line-height: 1.6; }
.site-opts { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }
.site-opt { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 12px; }
.site-opt-head { display: flex; gap: 12px; align-items: flex-start; }
.site-opt-head > div { display: grid; gap: 3px; }
.site-opt-head small { color: var(--ink-3); line-height: 1.5; }
.site-opt-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.site-opt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.site-opt-row .input { flex: 1; min-width: 180px; height: 46px; }
.site-opt-row .btn { height: 46px; }
.site-progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; display: none; }
.site-progress.on { display: block; }
.site-progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .2s; }
.site-up-status { font-size: .86em; color: var(--ink-2); min-height: 0; }
.site-up-status:empty { display: none; }
.site-limits { margin: 0; font-size: .8em; color: var(--ink-3); line-height: 1.55; }
/* the public page (?ws=uuid): a slim bar, the site under it */
.ws-page { height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.ws-top { display: flex; align-items: center; gap: 10px; padding: calc(6px + var(--sat, 0px)) 10px 6px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 48px; }
.ws-brand { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--accent); }
.ws-title { flex: 1; min-width: 0; display: grid; }
.ws-title strong, .ws-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-title small { color: var(--ink-3); font-size: .8em; }
@media (max-width: 860px) { .site-addr { max-width: 46vw; } .site-addr small { display: none; } }

/* page password (v2.11) */
.rail-item .lock-dot { position: absolute; bottom: -3px; inset-inline-start: -3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--ink-2); border: 2px solid var(--rail); }
.rail-item .lock-dot.open { color: var(--success); }
.lock-ic { position: relative; }
.lock-ic-badge { position: absolute; bottom: -4px; inset-inline-end: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--surface); }
.chip .ic + * , .chip > .ic { flex: none; }
.page-pref { display: block; }
