:root {
  --bg: #0c0e12;
  --bg-elev: #14181f;
  --bg-soft: #1a1f28;
  --sidebar: #10141a;
  --ink: #f0f2f5;
  --muted: #939aa8;
  --line: rgba(240, 242, 245, 0.1);
  --ember: #d4a574;
  --ember-deep: #b8844f;
  --teal: #6eb0a8;
  --online: #6eb0a8;
  --sleep: #7d8699;
  --danger: #d47a7a;
  --shadow: 0 20px 50px rgba(8, 10, 14, 0.55);
  --radius: 14px;
  --radius-sm: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Manrope", system-ui, sans-serif;
  --sidebar-w: min(360px, 100vw);
  --page-max: 1180px;
  --chat-max: 920px;
  --bubble-user-bg: linear-gradient(160deg, rgba(212,165,116,.28), rgba(212,165,116,.12));
  --bubble-user-border: rgba(212,165,116,.28);
  --bubble-bot-bg: rgba(255,255,255,.06);
  --pane: rgba(12, 14, 18, 0.55);
  --pane-bar: rgba(12, 14, 18, 0.92);
  --sidebar-bg: rgba(16, 20, 26, 0.94);
  --hover: rgba(255, 255, 255, 0.045);
  --hover-strong: rgba(255, 255, 255, 0.08);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --msg-meta: rgba(240, 242, 245, 0.45);
  --wave: rgba(240, 242, 245, 0.28);
  --on-accent: #14100c;
  --brand-hero-from: #f5ebe0;
  --glow-a: rgba(212, 165, 116, 0.28);
  --glow-b: rgba(110, 176, 168, 0.12);
  --backdrop: rgba(5, 6, 8, 0.58);
  --theme-color: #0c0e12;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef1f4;
  --bg-elev: #f7f9fb;
  --bg-soft: #e2e7ed;
  --sidebar: #f4f6f8;
  --ink: #161a20;
  --muted: #5c6673;
  --line: rgba(22, 26, 32, 0.12);
  --ember: #a86d2f;
  --ember-deep: #8a5620;
  --teal: #2f7f78;
  --online: #2f7f78;
  --sleep: #7a8490;
  --danger: #c04545;
  --shadow: 0 16px 40px rgba(20, 30, 45, 0.1);
  --bubble-user-bg: linear-gradient(160deg, rgba(168,109,47,.18), rgba(168,109,47,.08));
  --bubble-user-border: rgba(168,109,47,.3);
  --bubble-bot-bg: rgba(22, 26, 32, 0.05);
  --pane: rgba(247, 249, 251, 0.78);
  --pane-bar: rgba(247, 249, 251, 0.96);
  --sidebar-bg: rgba(244, 246, 248, 0.97);
  --hover: rgba(22, 26, 32, 0.05);
  --hover-strong: rgba(22, 26, 32, 0.08);
  --surface: rgba(22, 26, 32, 0.04);
  --surface-2: rgba(22, 26, 32, 0.07);
  --msg-meta: rgba(22, 26, 32, 0.48);
  --wave: rgba(22, 26, 32, 0.22);
  --on-accent: #14100c;
  --brand-hero-from: #2a241c;
  --glow-a: rgba(168, 109, 47, 0.14);
  --glow-b: rgba(47, 127, 120, 0.1);
  --backdrop: rgba(30, 40, 50, 0.28);
  --theme-color: #eef1f4;
  color-scheme: light;
}

html[data-theme="sepia"] {
  --bg: #1a1612;
  --bg-elev: #221c16;
  --bg-soft: #2a231b;
  --sidebar: #1e1914;
  --ink: #f0e6d4;
  --muted: #a89880;
  --line: rgba(240, 230, 212, 0.1);
  --ember: #d4a574;
  --ember-deep: #b8844f;
  --teal: #8a9e7e;
  --online: #8a9e7e;
  --sleep: #8a7e6e;
  --danger: #c47a6a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --bubble-user-bg: linear-gradient(160deg, rgba(212,165,116,.28), rgba(212,165,116,.12));
  --bubble-user-border: rgba(212,165,116,.3);
  --bubble-bot-bg: rgba(240, 230, 212, 0.06);
  --pane: rgba(26, 22, 18, 0.62);
  --pane-bar: rgba(26, 22, 18, 0.94);
  --sidebar-bg: rgba(30, 25, 20, 0.96);
  --hover: rgba(240, 230, 212, 0.05);
  --hover-strong: rgba(240, 230, 212, 0.09);
  --surface: rgba(240, 230, 212, 0.04);
  --surface-2: rgba(240, 230, 212, 0.07);
  --msg-meta: rgba(240, 230, 212, 0.45);
  --wave: rgba(240, 230, 212, 0.28);
  --on-accent: #1a120a;
  --brand-hero-from: #f3e6d2;
  --glow-a: rgba(212, 165, 116, 0.28);
  --glow-b: rgba(138, 158, 126, 0.16);
  --backdrop: rgba(10, 8, 6, 0.6);
  --theme-color: #1a1612;
  color-scheme: dark;
}

html[data-theme="ocean"] {
  --bg: #0a1218;
  --bg-elev: #101a22;
  --bg-soft: #15232d;
  --sidebar: #0d161d;
  --ink: #e8f0f4;
  --muted: #8aa0ad;
  --line: rgba(232, 240, 244, 0.1);
  --ember: #6eb8c9;
  --ember-deep: #4a9aab;
  --teal: #5ec4a8;
  --online: #5ec4a8;
  --sleep: #6d8290;
  --danger: #d47a7a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --bubble-user-bg: linear-gradient(160deg, rgba(110,184,201,.28), rgba(110,184,201,.12));
  --bubble-user-border: rgba(110,184,201,.3);
  --bubble-bot-bg: rgba(232, 240, 244, 0.06);
  --pane: rgba(10, 18, 24, 0.58);
  --pane-bar: rgba(10, 18, 24, 0.94);
  --sidebar-bg: rgba(13, 22, 29, 0.96);
  --hover: rgba(232, 240, 244, 0.05);
  --hover-strong: rgba(232, 240, 244, 0.09);
  --surface: rgba(232, 240, 244, 0.04);
  --surface-2: rgba(232, 240, 244, 0.07);
  --msg-meta: rgba(232, 240, 244, 0.45);
  --wave: rgba(232, 240, 244, 0.28);
  --on-accent: #061018;
  --brand-hero-from: #e8f6fa;
  --glow-a: rgba(110, 184, 201, 0.28);
  --glow-b: rgba(94, 196, 168, 0.18);
  --backdrop: rgba(4, 10, 14, 0.62);
  --theme-color: #0a1218;
  color-scheme: dark;
}

html[data-theme="mist"] {
  --bg: #e8eef2;
  --bg-elev: #f7fafc;
  --bg-soft: #dce5eb;
  --sidebar: #f2f6f8;
  --ink: #152028;
  --muted: #5a6b76;
  --line: rgba(21, 32, 40, 0.12);
  --ember: #3d7a8c;
  --ember-deep: #2f6271;
  --teal: #2f8f7a;
  --online: #2f8f7a;
  --sleep: #7a8790;
  --danger: #c04545;
  --shadow: 0 18px 40px rgba(20, 40, 55, 0.1);
  --bubble-user-bg: linear-gradient(160deg, rgba(61,122,140,.18), rgba(61,122,140,.08));
  --bubble-user-border: rgba(61,122,140,.28);
  --bubble-bot-bg: rgba(21, 32, 40, 0.05);
  --pane: rgba(247, 250, 252, 0.78);
  --pane-bar: rgba(247, 250, 252, 0.96);
  --sidebar-bg: rgba(242, 246, 248, 0.97);
  --hover: rgba(21, 32, 40, 0.05);
  --hover-strong: rgba(21, 32, 40, 0.08);
  --surface: rgba(21, 32, 40, 0.04);
  --surface-2: rgba(21, 32, 40, 0.07);
  --msg-meta: rgba(21, 32, 40, 0.48);
  --wave: rgba(21, 32, 40, 0.22);
  --on-accent: #061018;
  --brand-hero-from: #1a3038;
  --glow-a: rgba(61, 122, 140, 0.16);
  --glow-b: rgba(47, 143, 122, 0.12);
  --backdrop: rgba(20, 35, 45, 0.3);
  --theme-color: #e8eef2;
  color-scheme: light;
}

html[data-theme="graphite"] {
  --bg: #121416;
  --bg-elev: #1a1d21;
  --bg-soft: #22262b;
  --sidebar: #15181b;
  --ink: #eceff2;
  --muted: #9aa3ad;
  --line: rgba(236, 239, 242, 0.1);
  --ember: #c4a882;
  --ember-deep: #a88a64;
  --teal: #7aa0a8;
  --online: #7aa0a8;
  --sleep: #7d8690;
  --danger: #d47a7a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --bubble-user-bg: linear-gradient(160deg, rgba(196,168,130,.26), rgba(196,168,130,.12));
  --bubble-user-border: rgba(196,168,130,.28);
  --bubble-bot-bg: rgba(236, 239, 242, 0.06);
  --pane: rgba(18, 20, 22, 0.6);
  --pane-bar: rgba(18, 20, 22, 0.94);
  --sidebar-bg: rgba(21, 24, 27, 0.96);
  --hover: rgba(236, 239, 242, 0.05);
  --hover-strong: rgba(236, 239, 242, 0.09);
  --surface: rgba(236, 239, 242, 0.04);
  --surface-2: rgba(236, 239, 242, 0.07);
  --msg-meta: rgba(236, 239, 242, 0.45);
  --wave: rgba(236, 239, 242, 0.28);
  --on-accent: #141210;
  --brand-hero-from: #f0ebe3;
  --glow-a: rgba(196, 168, 130, 0.22);
  --glow-b: rgba(122, 160, 168, 0.16);
  --backdrop: rgba(6, 7, 8, 0.62);
  --theme-color: #121416;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; height: 100%; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--ember); color: var(--on-accent); font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .42; }
.bg-glow-a {
  width: 55vw; height: 55vw; max-width: 420px; max-height: 420px; left: -18%; top: -12%;
  background: radial-gradient(circle, var(--glow-a), transparent 70%);
}
.bg-glow-b {
  width: 60vw; height: 60vw; max-width: 460px; max-height: 460px; right: -22%; bottom: 5%;
  background: radial-gradient(circle, var(--glow-b), transparent 70%);
}
.bg-noise {
  position: absolute; inset: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.view { position: relative; z-index: 1; min-height: 100%; }
.hidden { display: none !important; }

.brand, .brand-hero, h1, h2, .sheet-title {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.brand { font-size: 1.25rem; font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.brand.sm { font-size: 1.12rem; gap: 9px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  object-fit: contain; object-position: center;
  flex-shrink: 0; display: block;
  background: transparent;
  box-shadow: none;
  filter: none;
}
.brand.sm .brand-logo { width: 40px; height: 40px; border-radius: 11px; }
.brand-hero {
  font-size: clamp(3.2rem, 11vw, 5.2rem);
  line-height: 1.02; margin: 0 0 14px;
  background: linear-gradient(115deg, var(--brand-hero-from) 0%, var(--ember) 72%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fadeUp .65s cubic-bezier(.22,1,.36,1) both;
}

.btn {
  font: inherit; font-weight: 600; border: 0; cursor: pointer;
  border-radius: 999px; padding: 12px 18px;
  transition: transform .18s ease, opacity .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  color: var(--on-accent);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--ember) 28%, transparent);
}
.btn.primary:hover:not(:disabled) {
  box-shadow: 0 14px 34px color-mix(in srgb, var(--ember) 38%, transparent);
  transform: translateY(-1px);
}
.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover:not(:disabled) {
  background: var(--hover-strong);
  border-color: color-mix(in srgb, var(--ember) 35%, var(--line));
}
.btn.sm { padding: 8px 12px; font-size: .86rem; }
.btn.xl { padding: 14px 24px; font-size: 1rem; }
.btn.icon { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
.btn.block { width: 100%; }
.btn.send {
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.15rem;
}
.add-btn { margin-top: 12px; border-radius: var(--radius); }

/* Account sidebar (from hamburger) */
.account-layer {
  position: fixed; inset: 0; z-index: 45;
}
.account-backdrop {
  position: absolute; inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.account-sidebar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: min(300px, 86vw);
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: slideIn .26s cubic-bezier(.22,1,.36,1) both;
  padding-top: var(--safe-t);
}
.account-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.account-head h2 {
  margin: 0; font-size: 1.05rem; font-family: var(--display); font-weight: 700;
  letter-spacing: -0.02em;
}
.account-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 14px;
}
.account-legal {
  flex-shrink: 0;
  margin-top: 0;
  padding: 12px 12px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 96%, transparent);
}
.account-view { animation: fadeView .18s ease both; }
@keyframes fadeView {
  from { opacity: .35; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}
.account-profile {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 12px; padding: 2px 2px 10px;
  border-bottom: 1px solid var(--line);
}
.avatar.xl { width: 48px; height: 48px; font-size: 1.05rem; }
.account-name {
  margin: 0; font-size: .98rem; font-weight: 700; font-family: var(--display);
  letter-spacing: -0.02em;
}
.account-sub { margin: 2px 0 0; color: var(--muted); font-size: .76rem; }
.account-nav {
  display: flex; flex-direction: column; gap: 4px;
}
.account-nav-btn {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  transition: border-color .18s ease, background .18s ease, transform .15s ease;
}
.account-nav-btn:hover {
  border-color: color-mix(in srgb, var(--ember) 40%, var(--line));
  background: color-mix(in srgb, var(--ember) 9%, transparent);
}
.account-nav-btn:active { transform: scale(.99); }
.account-nav-ico {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--ember);
}
.account-nav-ico svg {
  display: block;
  width: 18px;
  height: 18px;
}
.account-nav-text {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.account-nav-text strong {
  font-size: .88rem; font-weight: 650;
}
.account-nav-text small {
  color: var(--muted); font-size: .7rem;
}
.account-nav-chev {
  color: var(--muted); font-size: 1.15rem; line-height: 1;
}
.plan-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.settings-links {
  display: flex; flex-direction: column; gap: 8px;
}

/* Compact centered account sheets (not full-screen) */
.echo-sheet-layer {
  position: fixed; inset: 0; z-index: 52;
  display: grid; place-items: center;
  padding: max(10px, var(--safe-t)) 12px max(10px, var(--safe-b));
}
.echo-sheet-backdrop {
  position: absolute; inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.echo-sheet {
  position: relative;
  width: min(440px, 100%);
  max-height: min(78dvh, 640px);
  height: fit-content;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: sheetPop .24s cubic-bezier(.22,1,.36,1) both;
  overflow: hidden;
}
.echo-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
}
.echo-sheet-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--display);
  letter-spacing: -0.02em;
}
.echo-sheet-body {
  overflow-y: auto; padding: 10px 12px 14px;
  flex: 1 1 auto;
  min-height: 0;
}
.echo-sheet-body .account-view { animation: fadeView .16s ease both; }
.echo-sheet-body .block {
  margin-bottom: 8px;
  padding: 10px 11px;
  border-radius: 10px;
}
.echo-sheet-body .block h3 {
  margin: 0 0 8px;
  font-size: .88rem;
}
.echo-sheet-body .hint {
  font-size: .78rem;
  margin: 0 0 8px;
  line-height: 1.35;
}
.echo-sheet-body .field {
  gap: 4px;
  margin-bottom: 8px;
}
.echo-sheet-body .field span { font-size: .72rem; }
.echo-sheet-body .field input,
.echo-sheet-body .field select,
.echo-sheet-body .field textarea {
  padding: 8px 10px;
  font-size: .88rem;
  border-radius: 8px;
}
.echo-sheet-body .btn.block {
  padding: 9px 12px;
  font-size: .88rem;
}
.echo-sheet-body .status { font-size: .78rem; margin: 6px 0 0; }
@keyframes sheetPop {
  from { transform: translateY(10px) scale(.98); opacity: .45; }
  to { transform: none; opacity: 1; }
}

.wallet-balance-card {
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% -20%, color-mix(in srgb, var(--ember) 18%, transparent), transparent 55%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--ember) 28%, var(--line));
  border-radius: 10px;
  padding: 12px 10px !important;
}
.wallet-balance-label {
  margin: 0; color: var(--muted); font-size: .68rem; letter-spacing: .07em;
  text-transform: uppercase; font-weight: 600;
}
.wallet-balance-value {
  margin: 4px 0 6px;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  font-family: var(--display);
  color: var(--ember);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.topup-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px;
}
.topup-chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 11px;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.topup-chip:hover {
  border-color: color-mix(in srgb, var(--ember) 40%, var(--line));
}
.topup-chip.on {
  border-color: color-mix(in srgb, var(--ember) 55%, transparent);
  background: color-mix(in srgb, var(--ember) 12%, transparent);
  color: var(--ember);
}
.wallet-email-gate {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ember) 35%, var(--line));
  background: color-mix(in srgb, var(--ember) 8%, var(--surface));
  display: grid;
  gap: 8px;
}
.wallet-email-gate strong {
  font-family: var(--display);
  font-size: .95rem;
}
.wallet-email-gate.hidden { display: none !important; }
body.pay-email-locked .topup-chips,
body.pay-email-locked #topup-amount,
body.pay-email-locked #btn-pay,
body.pay-email-locked #btn-topup,
body.pay-email-locked .plan-actions,
body.pay-email-locked .pack-card-action {
  opacity: .45;
  pointer-events: none;
}

.pay-methods-label {
  margin: 10px 0 6px;
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.pay-refund-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.pay-refund-note .text-link {
  font: inherit;
  color: var(--ember);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.pay-method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .15s ease;
}
.pay-method strong { font-size: .8rem; font-weight: 650; }
.pay-method small { color: var(--muted); font-size: .62rem; line-height: 1.2; }
.pay-method:hover {
  border-color: color-mix(in srgb, var(--ember) 40%, var(--line));
  background: color-mix(in srgb, var(--ember) 7%, transparent);
}
.pay-method.on {
  border-color: color-mix(in srgb, var(--ember) 55%, transparent);
  background: color-mix(in srgb, var(--ember) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ember) 18%, transparent);
}
.pay-method.on strong { color: var(--ember); }
.pay-method:active { transform: scale(.98); }

.pay-pending {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--ember) 30%, var(--line));
  background: color-mix(in srgb, var(--ember) 7%, transparent);
}
.pay-pending-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.pay-pending-head .btn {
  min-width: 36px;
  padding: 4px 10px;
  font-size: 1.1rem;
  line-height: 1;
}
.pay-sbp-details {
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--surface);
  text-align: left;
  font-size: .88rem;
  line-height: 1.45;
}
.pay-sbp-details dl {
  margin: 0;
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 6px 10px;
}
.pay-sbp-details dt { color: var(--muted); }
.pay-sbp-details dd { margin: 0; color: var(--ink); font-weight: 600; word-break: break-word; }
.pay-sbp-details .pay-copy {
  margin-top: 8px;
  font-size: .78rem;
  color: var(--muted);
}

.pay-qr-wrap {
  display: grid;
  place-items: center;
  gap: 8px;
  margin: 12px 0;
}
.pay-qr-wrap img {
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}
.pay-pending-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pay-pending-actions .btn,
.pay-pending-actions a.btn {
  flex: 1 1 auto;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 480px) {
  .pay-methods { grid-template-columns: 1fr; }
}

.plan-compare {
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.plan-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.plan-card.is-current {
  border-color: color-mix(in srgb, var(--teal) 55%, var(--line));
  background: color-mix(in srgb, var(--teal) 8%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 25%, transparent);
}
.plan-card.is-soon {
  opacity: 0.78;
  border-style: dashed;
}
.plan-card.is-soon .plan-card-title {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: color-mix(in srgb, var(--muted) 75%, transparent);
}
.plan-card.is-soon .plan-price {
  color: var(--muted);
  opacity: 0.85;
}
.plan-card.is-soon .plan-blurb {
  font-style: italic;
}
.plan-card-badge.soon {
  background: color-mix(in srgb, var(--muted) 22%, transparent);
  color: var(--muted);
}
.plan-soon-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
}
.plan-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px 10px;
}
.plan-card-head > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.plan-card-title {
  font-size: .95rem;
  font-weight: 700;
  font-family: var(--display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.plan-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 650;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 16%, transparent);
}
.plan-card .plan-price {
  flex: 0 0 auto;
  margin-left: auto;
  font-weight: 650;
  font-size: .82rem;
  color: var(--ember);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.plan-card .plan-blurb {
  margin: 0;
  font-size: .75rem;
  line-height: 1.35;
  color: var(--muted);
}
.plan-card-feats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.plan-card-feats li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  font-size: .8rem;
  line-height: 1.3;
  color: var(--ink);
  min-width: 0;
}
.plan-feat-label {
  min-width: 0;
}
.plan-feat-val {
  display: grid;
  place-items: center;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.plan-feat-mark {
  display: grid;
  place-items: center;
}
.plan-card-action {
  margin-top: 2px;
}
.plan-card-action .btn {
  width: 100%;
  white-space: normal;
  line-height: 1.25;
  padding: 9px 12px;
}
.plan-card-action .hint {
  margin: 0;
  font-size: .78rem;
}
.pack-cards { margin-top: 2px; }
.pack-bank-hint { margin: 0 0 10px; }
.pack-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pack-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.pack-card.is-locked,
.pack-card.is-soon {
  opacity: 0.78;
  border-style: dashed;
}
.pack-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
}
.pack-card-title {
  font-size: .9rem;
  font-weight: 700;
  font-family: var(--display);
  letter-spacing: -0.02em;
}
.pack-price {
  font-weight: 650;
  font-size: .82rem;
  color: var(--ember);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: auto;
}
.pack-blurb {
  margin: 0;
  font-size: .75rem;
  line-height: 1.35;
  color: var(--muted);
}
.pack-card-action .btn { width: 100%; }
.pack-lock-hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
}
.plan-check {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 700;
}
.plan-check.yes {
  background: rgba(110,176,168,.2);
  color: var(--teal);
}
.plan-check.no {
  background: var(--surface-2);
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}
.plan-compare-val {
  color: var(--ink);
  font-weight: 550;
  font-size: .72rem;
  text-align: right;
  line-height: 1.2;
}
.plan-feat-val .plan-compare-val {
  white-space: nowrap;
}

/* legacy table cells (unused, keep harmless) */
.plan-compare-cell { display: none; }

@media (max-width: 640px) {
  .echo-sheet {
    width: min(100%, 420px);
    max-height: min(82dvh, 620px);
    border-radius: 14px;
    align-self: end;
  }
  .echo-sheet-layer {
    place-items: end center;
    padding-bottom: max(8px, var(--safe-b));
  }
}

.theme-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
}
@media (min-width: 380px) {
  .theme-choices { grid-template-columns: 1fr 1fr; }
}
.theme-choice {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  font: inherit;
  transition: border-color .18s ease, background .18s ease, transform .15s ease;
}
.theme-choice:hover {
  border-color: color-mix(in srgb, var(--ember) 35%, var(--line));
}
.theme-choice strong { display: block; font-size: .86rem; }
.theme-choice small { color: var(--muted); font-size: .7rem; }
.theme-choice.on {
  border-color: color-mix(in srgb, var(--ember) 55%, transparent);
  background: color-mix(in srgb, var(--ember) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ember) 18%, transparent);
}
.theme-choice:active { transform: scale(.99); }
.theme-swatch {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); flex-shrink: 0;
}
.theme-swatch-dark {
  background: linear-gradient(145deg, #0c0e12, #1a1f28);
}
.theme-swatch-light {
  background: linear-gradient(145deg, #eef1f4, #f7f9fb);
}
.theme-swatch-sepia {
  background: linear-gradient(145deg, #1a1612, #3a2e22);
}
.theme-swatch-ocean {
  background: linear-gradient(145deg, #0a1218, #1a3a48);
}
.theme-swatch-mist {
  background: linear-gradient(145deg, #e8eef2, #f7fafc);
}
.theme-swatch-graphite {
  background: linear-gradient(145deg, #121416, #2a3038);
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 0 22px 18px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.auth-tab {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 10px 12px; font: inherit; font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.on {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  box-shadow: 0 8px 18px color-mix(in srgb, var(--ember) 22%, transparent);
}
.auth-pane { display: flex; flex-direction: column; gap: 0; }
.auth-sheet {
  position: relative;
  text-align: left;
  width: min(420px, 100%);
  max-height: min(92dvh, 720px);
  overflow-y: auto;
  padding: 0 0 22px !important;
  -webkit-overflow-scrolling: touch;
}
.auth-sheet.is-register {
  width: min(440px, 100%);
}
.auth-hero-band {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  margin: 0 0 18px;
  padding: 28px 20px 20px;
  border-radius: calc(var(--radius) + 8px) calc(var(--radius) + 8px) 0 0;
  background:
    radial-gradient(120% 140% at 50% -10%, color-mix(in srgb, var(--ember) 34%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--ember) 10%, var(--bg-elev)), var(--bg-elev));
  border-bottom: 1px solid var(--line);
}
.auth-mark {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  background: linear-gradient(115deg, var(--brand-hero-from), var(--ember) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sheet .sheet-title {
  text-align: center;
  margin: 0 20px 6px;
  font-size: clamp(1.45rem, 4.5vw, 1.7rem);
}
.auth-lede {
  text-align: center;
  margin: 0 auto 16px;
  max-width: 30ch;
  font-size: .94rem;
  padding: 0 20px;
}
.auth-pane { padding: 0 22px; }
.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
  backdrop-filter: blur(8px);
}
.pass-rules {
  list-style: none;
  margin: -2px 0 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.pass-rules li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.3;
  transition: color .18s ease;
}
.pass-rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .35em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--muted) 55%, transparent);
  background: transparent;
  transition: background .18s ease, border-color .18s ease;
}
.pass-rules li.ok { color: var(--ink); }
.pass-rules li.ok::before {
  border-color: var(--ember);
  background: var(--ember);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ember) 18%, transparent);
}
.field .opt {
  font-style: normal;
  font-weight: 500;
  color: color-mix(in srgb, var(--muted) 80%, transparent);
  font-size: .72rem;
  margin-left: 4px;
}
.auth-foot {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
}
.text-link {
  border: 0;
  background: transparent;
  color: var(--ember);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.text-link:hover { opacity: .88; }
.chk {
  display: flex; align-items: center; gap: 8px;
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: .88rem;
  cursor: pointer;
}
.chk input {
  width: 16px; height: 16px; accent-color: var(--ember);
}
@media (max-width: 420px) {
  .pass-rules { grid-template-columns: 1fr; }
}
.account-legal-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
  opacity: .85;
}
.account-legal-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: .72rem;
}
.legal-link {
  border: 0; background: transparent; padding: 0;
  color: var(--muted);
  font: inherit; font-size: .72rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.legal-link:hover { color: var(--ember); }
.account-legal-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .62rem;
  opacity: .55;
  line-height: 1.35;
  word-break: break-word;
}

.legal-layer {
  position: fixed; inset: 0; z-index: 55;
  display: grid; place-items: end center;
}
.legal-backdrop {
  position: absolute; inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(5px);
}
.legal-sheet {
  position: relative;
  width: min(560px, 100vw);
  max-height: min(86dvh, 860px);
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: sheetUp .24s cubic-bezier(.22,1,.36,1) both;
  padding-bottom: var(--safe-b);
}
.legal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.legal-head h2 {
  margin: 0; font-size: 1.05rem; font-weight: 700;
}
.legal-body {
  overflow-y: auto; padding: 14px 16px 22px;
  font-size: .86rem; line-height: 1.5; color: rgba(242,239,232,.88);
}
.legal-body h3 {
  margin: 1.1em 0 .45em; font-size: .95rem; font-weight: 700;
}
.legal-body h3:first-child { margin-top: 0; }
.legal-body p, .legal-body li { margin: 0 0 .55em; color: var(--muted); }
.legal-body ul { margin: 0 0 .7em; padding-left: 1.15em; }
.legal-body .legal-updated {
  margin-top: 1.2em; font-size: .72rem; opacity: .7;
}
@keyframes sheetUp {
  from { transform: translateY(18px); opacity: .5; }
  to { transform: none; opacity: 1; }
}
@keyframes slideIn {
  from { transform: translateX(-16px); opacity: .6; }
  to { transform: none; opacity: 1; }
}

/* Landing */
.landing {
  min-height: 100dvh;
  min-height: 100vh;
  padding-top: var(--safe-t);
  display: flex;
  flex-direction: column;
}
.landing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  min-height: 64px;
}
.landing-nav { display: flex; gap: 8px; }
.landing-hero {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 12px 22px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  min-height: min(72dvh, 640px);
}
.landing-copy { max-width: 34rem; }
.landing-copy h1 {
  font-size: clamp(1.65rem, 3.6vw, 2.55rem);
  line-height: 1.12;
  margin: 0 0 12px;
  animation: fadeUp .7s cubic-bezier(.22,1,.36,1) .06s both;
}
.lede {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 22px;
  max-width: 36ch;
  font-size: 1.02rem;
  text-wrap: pretty;
  animation: fadeUp .75s cubic-bezier(.22,1,.36,1) .1s both;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  animation: fadeUp .8s cubic-bezier(.22,1,.36,1) .14s both;
}
.landing-hook {
  position: relative;
  min-height: clamp(280px, 44vw, 400px);
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 90% 70% at 70% 20%, color-mix(in srgb, var(--ember) 22%, transparent), transparent 55%),
    radial-gradient(ellipse 80% 60% at 15% 85%, color-mix(in srgb, var(--teal) 12%, transparent), transparent 50%),
    color-mix(in srgb, var(--bg-elev) 92%, #000 8%);
  animation: fadeUp .85s cubic-bezier(.22,1,.36,1) .12s both;
}
.landing-hook-glow {
  position: absolute;
  inset: -20%;
  background:
    url("/static/img/landing-echo-hero.png") center 40% / cover no-repeat;
  opacity: .18;
  filter: saturate(0.55) brightness(0.7);
  transform: scale(1.05);
  animation: heroDrift 22s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
.landing-hook-lead,
.landing-hook-who,
.landing-hook-sub,
.landing-hook-wave {
  position: relative;
  z-index: 1;
}
.landing-hook-lead {
  margin: 0;
  font-size: .92rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.landing-hook-who {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--ink);
  min-height: 1.15em;
  transition: opacity .35s ease, transform .35s ease;
}
.landing-hook-who.is-swap {
  opacity: 0;
  transform: translateY(8px);
}
.landing-hook-wave {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  margin: 8px 0 2px;
}
.landing-hook-wave i {
  display: block;
  width: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ember) 75%, var(--ink));
  height: calc(8px + var(--h, 12px));
  animation: hookWave 1.4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  opacity: .85;
}
.landing-hook-wave i:nth-child(1) { --h: 10px; --d: 0s; }
.landing-hook-wave i:nth-child(2) { --h: 18px; --d: .08s; }
.landing-hook-wave i:nth-child(3) { --h: 26px; --d: .16s; }
.landing-hook-wave i:nth-child(4) { --h: 14px; --d: .24s; }
.landing-hook-wave i:nth-child(5) { --h: 30px; --d: .12s; }
.landing-hook-wave i:nth-child(6) { --h: 20px; --d: .2s; }
.landing-hook-wave i:nth-child(7) { --h: 28px; --d: .04s; }
.landing-hook-wave i:nth-child(8) { --h: 12px; --d: .28s; }
.landing-hook-wave i:nth-child(9) { --h: 22px; --d: .1s; }
.landing-hook-wave i:nth-child(10) { --h: 16px; --d: .18s; }
.landing-hook-wave i:nth-child(11) { --h: 24px; --d: .06s; }
.landing-hook-wave i:nth-child(12) { --h: 11px; --d: .22s; }
.landing-hook-sub {
  margin: 0;
  max-width: 22ch;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.45;
}
@keyframes hookWave {
  0%, 100% { transform: scaleY(.55); opacity: .55; }
  50% { transform: scaleY(1); opacity: 1; }
}
.landing-steps {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 10px 22px 28px;
}
.landing-steps-head {
  max-width: 38rem;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.landing-steps-kicker {
  margin: 18px 0 8px;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ember);
}
.landing-steps-head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
}
.landing-steps-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
  text-wrap: pretty;
}
.landing-steps-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 28px;
  position: relative;
}
.landing-steps-list::before {
  content: "";
  position: absolute;
  top: 1.05rem;
  left: 4%;
  right: 4%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--ember) 45%, var(--line)) 20%,
    color-mix(in srgb, var(--ember) 45%, var(--line)) 80%,
    transparent
  );
  pointer-events: none;
  opacity: .55;
}
.landing-steps-list li {
  display: grid;
  gap: 10px;
  position: relative;
  animation: fadeUp .7s cubic-bezier(.22,1,.36,1) both;
}
.landing-steps-list li:nth-child(1) { animation-delay: .05s; }
.landing-steps-list li:nth-child(2) { animation-delay: .12s; }
.landing-steps-list li:nth-child(3) { animation-delay: .19s; }
.landing-step-num {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ember);
  letter-spacing: .06em;
  background: var(--bg);
  width: fit-content;
  padding-right: 10px;
  position: relative;
  z-index: 1;
}
.landing-step-body h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--ink);
}
.landing-step-body p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
  max-width: 32ch;
}
.landing-prices {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 28px 22px 10px;
}
.landing-prices-head {
  max-width: 36rem;
  margin-bottom: 18px;
}
.landing-prices-kicker {
  margin: 0 0 6px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 600;
}
.landing-prices-head h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3.5vw, 1.7rem);
  letter-spacing: -0.03em;
}
.landing-prices-lede {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
}
.landing-prices-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.landing-price-card {
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.landing-price-card h3 {
  margin: 0 0 6px;
  font-size: .95rem;
}
.landing-price-sum {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ember);
  letter-spacing: -0.02em;
}
.landing-price-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}
.landing-prices-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .78rem;
}
.landing-prices-note a { color: var(--ember); }
@media (max-width: 860px) {
  .landing-prices-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .landing-prices-grid { grid-template-columns: 1fr; }
}
.landing-legal {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 10px 22px calc(18px + var(--safe-b));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.landing-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  margin: 0;
  max-width: 42rem;
  font-size: .65rem;
  line-height: 1.4;
  opacity: .62;
  letter-spacing: .01em;
  color: var(--muted);
}
.landing-legal a {
  color: inherit;
  text-decoration: none;
  transition: opacity .18s ease, color .18s ease;
}
.landing-legal a:hover {
  color: var(--muted);
  opacity: .95;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.landing-contacts {
  display: inline;
  position: relative;
}
.landing-contacts > summary {
  list-style: none;
  cursor: pointer;
  display: inline;
  color: inherit;
  font: inherit;
}
.landing-contacts > summary::-webkit-details-marker { display: none; }
.landing-contacts > summary:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.landing-contacts-body {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  color: var(--ink);
  font-size: .78rem;
  line-height: 1.45;
  opacity: 1;
  z-index: 20;
}
.landing-contacts-body p { margin: 0 0 6px; }
.landing-contacts-body p:last-child { margin-bottom: 0; }
.landing-contacts-body a { color: var(--ember); opacity: 1; }
.account-contacts {
  display: inline;
  position: relative;
}
.account-contacts > summary {
  list-style: none;
  cursor: pointer;
  display: inline;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}
.account-contacts > summary::-webkit-details-marker { display: none; }
.account-contacts-body {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .82rem;
  color: var(--ink);
}
.account-contacts-body p { margin: 0 0 6px; }
.account-contacts-body p:last-child { margin-bottom: 0; }

.landing-stories {
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  padding: 6px 22px 28px;
}
.landing-stories-kicker {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.landing-stories-stage {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  min-height: clamp(320px, 58vw, 480px);
  isolation: isolate;
  background: color-mix(in srgb, var(--bg-elev) 88%, #000 12%);
  border: 1px solid var(--line);
  box-shadow: none;
}
.landing-story {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}
.landing-story.is-active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
  min-height: inherit;
}
.landing-story[hidden] {
  display: block !important;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}
.landing-story-photo {
  position: absolute;
  inset: -2%;
  background: center 28% / cover no-repeat;
  filter: saturate(0.88) brightness(1.02) contrast(1.02);
  opacity: 1;
  transform: none;
}
.landing-story-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 65% at 50% 32%, transparent 25%, color-mix(in srgb, var(--bg) 38%, transparent) 100%),
    linear-gradient(160deg, color-mix(in srgb, var(--bg) 12%, transparent), color-mix(in srgb, var(--bg) 22%, transparent));
  pointer-events: none;
}
.landing-story-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 16px 20px;
  background: linear-gradient(
    180deg,
    transparent 35%,
    color-mix(in srgb, var(--bg) 18%, transparent) 58%,
    color-mix(in srgb, var(--bg) 48%, transparent) 78%,
    color-mix(in srgb, var(--bg) 68%, transparent) 100%
  );
  z-index: 1;
}
.landing-story-label {
  margin: 0;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
}
.landing-story-chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, 92%);
}
.story-bubble {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .92rem;
  line-height: 1.35;
  color: var(--ink);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .45s ease, transform .45s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.landing-story.is-playing .story-bubble.is-in {
  opacity: 1;
  transform: none;
}
.story-bubble.bot {
  align-self: flex-start;
  background: var(--bubble-bot-bg);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.story-bubble.user {
  align-self: flex-end;
  background: var(--bubble-user-bg);
  border: 1px solid var(--bubble-user-border);
  border-bottom-right-radius: 5px;
}
.landing-stories-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.story-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.story-dot.is-on {
  background: var(--ember);
  transform: scale(1.2);
}
.story-dot:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .landing-stories { padding-top: 4px; }
  .landing-stories-stage { min-height: 360px; }
  .story-bubble { font-size: .86rem; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-story { transition: none; }
  .story-bubble {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

.eyebrow {
  letter-spacing: .14em; text-transform: uppercase; font-size: .7rem;
  color: var(--ember); margin: 0 0 10px;
}

@keyframes heroDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-1.5%, 1%, 0); }
}

@media (max-width: 860px) {
  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 8px;
    gap: 22px;
  }
  .landing-hook {
    min-height: 220px;
  }
  .landing-steps-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .landing-steps-list::before { display: none; }
  .landing-step-body p { max-width: none; }
  .brand-hero { font-size: clamp(2.6rem, 14vw, 3.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-hero, .landing-copy h1, .lede, .cta-row, .landing-hook,
  .landing-hook-glow, .landing-hook-wave i,
  .landing-steps-list li { animation: none !important; }
  .landing-hook-who { transition: none !important; }
  .landing-story { transition: none; }
  .story-bubble {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* App shell — Telegram-like */
.app-shell {
  height: 100dvh; height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-t);
  overflow: hidden;
}
.app-top {
  flex-shrink: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--pane-bar);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.app-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  position: relative;
}
.guest-gate {
  position: absolute;
  inset: 0;
  z-index: 40;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, transparent), var(--bg)),
    radial-gradient(500px 280px at 50% 35%, color-mix(in srgb, var(--ember) 10%, transparent), transparent 70%);
}
.guest-gate.hidden { display: none !important; }
.guest-gate-card {
  text-align: center;
  max-width: 32ch;
}
.guest-gate-card h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3.5vw, 1.7rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.guest-gate-card > p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
  text-wrap: pretty;
}
.guest-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}
.guest-gate-home {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px;
}
.guest-gate-home:hover { color: var(--ink); }
.app-shell.is-guest .sidebar,
.app-shell.is-guest .chat-pane {
  visibility: hidden;
  pointer-events: none;
}
.app-shell.is-guest .sidebar-head-actions .add-person,
.app-shell.is-guest .tour-help-btn {
  display: none !important;
}
.sidebar {
  display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  min-height: 0;
  overflow: hidden;
}
.sidebar-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px;
  border-bottom: 1px solid var(--line);
}
.sidebar-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.sidebar-search input[type="search"],
.sidebar-search input[type="date"],
.chat-search-bar input[type="search"],
.chat-search-bar input[type="date"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  font-size: .9rem;
}
.sidebar-search input::placeholder,
.chat-search-bar input::placeholder { color: var(--muted); opacity: .85; }
.sidebar-search input[type="date"],
.chat-search-bar input[type="date"] {
  width: auto;
  min-width: 7.5rem;
  padding: 8px 8px;
  color: var(--muted);
}
.sidebar-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--line);
  max-height: 45%;
}
.search-hit {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: start;
  width: 100%;
  text-align: left;
  border: 0;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.search-hit:hover { background: var(--surface); }
.search-hit .avatar { width: 40px; height: 40px; font-size: .9rem; }
.search-hit-body { min-width: 0; }
.search-hit-body strong {
  display: block;
  font-size: .9rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-hit-body p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-hit-body .when {
  margin-top: 3px;
  font-size: .72rem;
  color: var(--muted);
  opacity: .85;
}
.search-section-label {
  margin: 8px 6px 4px;
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.search-empty {
  padding: 16px 10px;
  color: var(--muted);
  font-size: .86rem;
  text-align: center;
}
.chat-search-bar {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto auto;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--pane-bar);
}
@media (max-width: 640px) {
  .chat-search-bar {
    grid-template-columns: 1fr auto auto;
  }
  .chat-search-bar input[type="date"] {
    grid-column: 1 / -1;
  }
  .sidebar-search {
    grid-template-columns: 1fr;
  }
  .sidebar-search input[type="date"] {
    width: 100%;
  }
}
.chat-search-count {
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
  min-width: 3.5rem;
  text-align: center;
}
.bubble.search-hit-flash {
  outline: 2px solid rgba(224,168,106,.75);
  box-shadow: 0 0 0 3px rgba(224,168,106,.2);
}
.sidebar-title {
  text-align: center;
  justify-self: center;
}
.icon-btn {
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink); cursor: pointer;
  display: grid; place-items: center;
  transition: background .18s ease, color .18s ease, transform .15s ease;
}
.icon-btn:hover { background: var(--hover-strong); }
.icon-btn:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}
.icon-btn:active { transform: scale(.96); }
.icon-btn.add-person { color: var(--ember); }
.burger {
  display: grid; gap: 4px; width: 18px;
}
.burger i {
  display: block; height: 1.7px; width: 100%; border-radius: 2px;
  background: currentColor;
}

.chat-list {
  flex: 1; overflow-y: auto; padding: 8px;
  -webkit-overflow-scrolling: touch;
}
.chat-item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center;
  width: 100%; text-align: left; border: 0; cursor: pointer;
  padding: 10px; border-radius: var(--radius);
  background: transparent; color: var(--ink); font: inherit;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  transition: background .18s ease, transform .15s ease;
}
.chat-item:hover { background: var(--surface); }
.chat-item.on {
  background: color-mix(in srgb, var(--ember) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ember) 22%, transparent);
}
.chat-item h3 {
  margin: 0; font-size: .98rem; font-family: var(--font); font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item .meta {
  margin: 3px 0 0; color: var(--muted); font-size: .78rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item .chat-time {
  align-self: start;
  margin-top: 2px;
  color: var(--muted);
  font-size: .7rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chat-item-body { min-width: 0; }
.chat-list-empty {
  padding: 28px 16px; text-align: center; color: var(--muted); font-size: .9rem; line-height: 1.45;
}

.chat-ctx {
  position: fixed; z-index: 70;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.chat-ctx button {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: .9rem;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.chat-ctx button:hover { background: var(--hover-strong); }
.chat-ctx button.danger { color: var(--danger); }

.chat-person {
  display: flex; gap: 10px; align-items: center; min-width: 0;
  cursor: pointer; border-radius: 12px; padding: 4px 6px; margin: -4px -6px;
}
.chat-person:hover { background: var(--surface); }

.mini-layer {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: max(12px, var(--safe-t)) 14px max(12px, var(--safe-b));
}
.mini-backdrop {
  position: absolute; inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.mini-sheet {
  position: relative;
  width: min(400px, 100%);
  max-height: min(90dvh, 860px);
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 18px 0 12px;
  text-align: center;
  animation: sheetPop .28s cubic-bezier(.22,1,.36,1) both;
}
.mini-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
}
.mini-hero { padding: 8px 20px 4px; }
.mini-avatar,
.avatar.xl.mini-avatar {
  margin: 8px auto 14px;
  width: 132px; height: 132px; font-size: 2.4rem;
  border-radius: 28px;
}
.mini-avatar.support-av,
.avatar.xl.mini-avatar.support-av {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: #0c0e12;
}
.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-sheet h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.mini-online {
  margin: 0;
  color: var(--online);
  font-size: .92rem;
  font-weight: 500;
}
.mini-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px 18px 8px;
}
.mini-qbtn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 12px 8px 10px;
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  transition: border-color .18s ease, background .18s ease, transform .15s ease;
}
.mini-qbtn:hover {
  border-color: color-mix(in srgb, var(--ember) 40%, var(--line));
  background: color-mix(in srgb, var(--ember) 10%, transparent);
}
.mini-qbtn:active { transform: scale(.98); }
.mini-qico { font-size: 1.15rem; line-height: 1; }
.mini-more-menu {
  margin: 0 18px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
}
.mini-more-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
}
.mini-more-item:hover { background: var(--surface); }
.mini-info {
  margin: 8px 0 0;
  padding: 4px 0;
  border-top: 1px solid var(--line);
  text-align: left;
}
.mini-info-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 20px;
  font: inherit;
  cursor: default;
}
button.mini-info-row { cursor: pointer; }
button.mini-info-row:hover { background: var(--surface); }
.mini-info-val {
  font-size: .98rem;
  color: var(--ink);
  word-break: break-all;
}
.mini-info-val.accent { color: var(--teal); }
.mini-info-lab {
  font-size: .78rem;
  color: var(--muted);
}
.mini-info-row.hidden { display: none; }
.mini-media {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.mini-media-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 12px 20px;
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
}
.mini-media-row:hover { background: var(--surface); }
.mini-media-row.on { background: rgba(110,176,168,.1); }
.mini-media-ico {
  width: 28px; text-align: center; opacity: .85;
}
.mini-gallery {
  border-top: 1px solid var(--line);
  padding: 12px 14px 16px;
  text-align: left;
  max-height: 240px;
  overflow-y: auto;
}
.mini-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.mini-gallery-grid a,
.mini-gallery-grid button {
  display: block;
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--hover-strong);
  cursor: pointer;
}
.mini-gallery-grid img,
.mini-gallery-grid video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.mini-gallery-list {
  display: flex; flex-direction: column; gap: 2px;
}
.mini-gallery-list a,
.mini-gallery-list .mini-g-item {
  display: block;
  padding: 10px 8px;
  border-radius: 8px;
  color: var(--teal);
  text-decoration: none;
  font-size: .88rem;
  word-break: break-all;
}
.mini-gallery-list a:hover,
.mini-gallery-list .mini-g-item:hover {
  background: var(--surface);
}
.mini-gallery-empty {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
  padding: 8px 4px;
}
.danger-btn { color: var(--danger) !important; border-color: rgba(212,122,122,.35) !important; }
.danger-btn:hover { background: rgba(212,122,122,.1) !important; }

.chat-pane {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--pane);
}
.chat-empty, .chat-active {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}
.chat-empty {
  align-items: center; justify-content: center; position: relative; padding: 24px;
  background:
    radial-gradient(500px 240px at 50% 40%, color-mix(in srgb, var(--ember) 8%, transparent), transparent 70%);
}
.empty-copy { text-align: center; max-width: 28ch; }
.empty-kicker {
  margin: 0 0 8px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 600;
}
.empty-copy h2 { margin: 0 0 8px; font-size: 1.45rem; letter-spacing: -0.02em; }
.empty-copy p { margin: 0; color: var(--muted); line-height: 1.45; text-wrap: pretty; }
.back-mobile { position: absolute; left: 12px; top: 12px; }

.avatar {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(145deg, color-mix(in srgb, var(--ember) 40%, transparent), color-mix(in srgb, var(--ember) 12%, transparent));
  color: var(--ink); font-weight: 700;
  font-family: var(--display);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Support mark: slightly smaller only in list/chat header, full size in profile */
.avatar.support-av {
  border-radius: 50%;
  background: #0c0e12;
}
.avatar.support-av img {
  object-fit: cover;
  object-position: center;
}
.chat-top .avatar.support-av,
.chat-item .avatar.support-av,
.search-hit .avatar.support-av {
  width: 40px;
  height: 40px;
}

.chat-top {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--pane-bar); backdrop-filter: blur(14px);
}
.chat-meta h1 {
  margin: 0; font-size: 1rem; font-family: var(--font); font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-line {
  margin: 2px 0 0; color: var(--muted); font-size: .75rem;
  display: flex; align-items: center; gap: 6px;
}
.chat-msg-quota {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .01em;
  opacity: .9;
}
.chat-msg-quota.low { color: var(--ember, #d4a574); }
.chat-msg-quota.hidden { display: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--online); display: inline-block; }
.dot.sleep, .dot.paused { background: var(--sleep); }

.messages {
  flex: 1; overflow-y: auto; padding: 14px 12px 10px;
  display: flex; flex-direction: column; gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.bubble {
  max-width: min(86%, 460px); padding: 10px 12px; border-radius: 16px;
  line-height: 1.4; font-size: .95rem; word-break: break-word;
  color: var(--ink);
  animation: pop .22s ease both;
}
.bubble.user {
  align-self: flex-end;
  background: var(--bubble-user-bg);
  border: 1px solid var(--bubble-user-border);
  border-bottom-right-radius: 6px;
  position: relative;
  padding: 8px 10px 6px 12px;
}
.bubble.bot {
  align-self: flex-start;
  background: var(--bubble-bot-bg);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  position: relative;
  padding: 8px 10px 6px 12px;
}
.bubble .bubble-text { display: block; white-space: pre-wrap; }
.bubble .bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 2px;
  min-height: 14px;
  float: right;
  margin-left: 10px;
  clear: both;
}
.bubble .msg-time {
  font-size: .68rem;
  line-height: 1;
  color: var(--msg-meta);
  white-space: nowrap;
  user-select: none;
}
.bubble.user .msg-time { color: var(--msg-meta); }
.bubble .ticks {
  position: static;
  font-size: .72rem;
  letter-spacing: -0.12em;
  line-height: 1;
  color: var(--msg-meta);
  font-weight: 600;
  pointer-events: none;
  user-select: none;
}
.bubble .ticks.read {
  color: #5dbe7a;
}
.bubble.system.day-sep {
  margin: 10px 0 4px;
  padding: 0;
  background: transparent;
  border: 0;
  max-width: 100%;
}
.bubble.system.day-sep span {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}
.bubble.system {
  align-self: center; max-width: 92%;
  background: transparent; color: var(--muted); font-size: .8rem;
  text-align: center; padding: 4px 8px;
}
.bubble.system.load-earlier {
  display: block;
  width: 100%;
  cursor: pointer;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-align: center;
  padding: 10px 12px;
}
.bubble.system.load-earlier:hover:not(:disabled) {
  color: var(--ember);
  border-color: rgba(224,168,106,.4);
}
.bubble.system.load-earlier:disabled {
  opacity: .7;
  cursor: default;
}
.bubble.media {
  padding: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.bubble.media.bot { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.media.user {
  align-self: flex-end;
  background: var(--bubble-user-bg);
  border: 1px solid var(--bubble-user-border);
  border-bottom-right-radius: 6px;
}
.bubble.media .bubble-meta { margin-top: 4px; }
.bubble.media img, .bubble.media video {
  display: block; width: 100%; max-width: 260px; border-radius: 12px;
}
.bubble.media .cap { margin-top: 6px; color: var(--muted); font-size: .8rem; }

.bubble.file {
  padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  max-width: min(280px, 88%);
}
.bubble.file.bot { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.file.user {
  align-self: flex-end;
  background: var(--bubble-user-bg);
  border: 1px solid var(--bubble-user-border);
  border-bottom-right-radius: 6px;
}
.bubble.file .file-chip {
  display: inline-block;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.bubble.voice {
  display: grid; grid-template-columns: 40px 1fr auto; column-gap: 10px; row-gap: 4px;
  align-items: center; min-width: 210px; max-width: min(280px, 88%);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 18px 18px 18px 6px; padding: 10px 12px;
}
.bubble.voice.bot { align-self: flex-start; }
.bubble.voice.user {
  align-self: flex-end;
  background: var(--bubble-user-bg);
  border: 1px solid var(--bubble-user-border);
  border-radius: 18px 18px 6px 18px;
}
.bubble.voice .bubble-meta {
  grid-column: 1 / -1;
  justify-self: end;
  float: none;
  margin-left: 0;
}
.bubble.voice audio { display: none; }
.bubble.voice .voice-play {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ember); color: var(--on-accent); font-size: .85rem;
  display: grid; place-items: center;
}
.bubble.voice.playing .voice-play { background: var(--teal); color: var(--on-accent); }
.bubble.voice .voice-wave {
  --p: 0; display: flex; align-items: flex-end; gap: 2px; height: 22px; position: relative;
}
.bubble.voice .voice-wave i {
  display: block; width: 3px; height: var(--h, 10px); border-radius: 2px;
  background: var(--wave);
}
.bubble.voice.playing .voice-wave i {
  background: rgba(224,168,106,.7);
  animation: voicePulse .9s ease-in-out infinite alternate;
  animation-delay: calc(var(--h) * 12ms);
}
.bubble.voice .voice-meta { margin-top: 3px; font-size: .7rem; color: var(--muted); }
.bubble.voice .voice-trans {
  border: 0; background: transparent; color: var(--muted);
  font-size: .7rem; cursor: pointer; text-decoration: underline;
}
.bubble.voice .cap { grid-column: 1 / -1; font-size: .84rem; color: var(--muted); }

.thinking {
  align-self: flex-start; color: var(--muted); font-size: .86rem;
  padding: 8px 12px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line);
}
.thinking .dots span {
  display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%;
  background: var(--ember); animation: blink 1.2s infinite ease-in-out;
}
.thinking .dots span:nth-child(2) { animation-delay: .15s; }
.thinking .dots span:nth-child(3) { animation-delay: .3s; }

.support-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 4px;
  border-top: 1px solid var(--line);
  background: var(--pane-bar);
  max-height: 132px;
  overflow-y: auto;
}
.support-quick.hidden { display: none; }
.support-quick-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel, rgba(255,255,255,.04));
  color: var(--ink, inherit);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: .82rem;
  line-height: 1.25;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.support-quick-chip:hover {
  border-color: var(--ember);
  color: var(--ember);
}
.support-quick-chip.human {
  border-color: color-mix(in srgb, var(--ember) 55%, var(--line));
  color: var(--ember);
}

.composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px 12px calc(10px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--pane-bar) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
}
.composer.sending {
  grid-template-columns: auto 1fr auto;
}
#btn-stop-gen {
  min-width: 44px;
  color: var(--danger, #c45c5c);
}
#btn-stop-gen.hidden,
#btn-send.hidden,
#btn-mic.hidden { display: none !important; }
.composer-send-slot {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  flex-shrink: 0;
}
.composer-send-slot > .send {
  grid-area: 1 / 1;
}
.composer-tools {
  display: flex; gap: 2px; align-items: center;
  padding-bottom: 4px;
}
.composer-btn {
  width: 36px; height: 36px; font-size: 1.05rem;
  border-radius: 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#btn-mic, #btn-cam {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#btn-mic.mode-video {
  background: color-mix(in srgb, var(--ember) 88%, #1a1a1a);
}
.chat-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-clone-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 7px 12px !important;
  position: relative;
}
.voice-clone-ico {
  font-size: .95rem;
  line-height: 1;
  opacity: .9;
}
.voice-clone-label {
  font-size: .82rem;
  font-weight: 650;
}
.voice-clone-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--pane-bar);
}
.voice-clone-btn.is-ready .voice-clone-badge {
  background: var(--online);
}
.voice-clone-btn.needs-voice {
  border-color: color-mix(in srgb, var(--ember) 45%, var(--line));
  color: var(--ember);
}
.voice-status-line {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.voice-status-line.ok { color: var(--online); }
.voice-status-line.warn { color: var(--ember); }
.voice-rec-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.voice-rec-timer {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
}
.voice-rec-preview {
  width: 100%;
  margin-top: 4px;
}

/* Hold-to-record overlay (Telegram-like) */
.rec-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 92%, transparent) 28%);
  pointer-events: none;
}
.rec-overlay:not(.hidden) { pointer-events: auto; }
.rec-overlay.locked .rec-lock-zone { opacity: 0; pointer-events: none; }
.rec-preview {
  align-self: center;
  width: min(220px, 55vw);
  max-height: 280px;
  border-radius: 18px;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: scaleX(-1);
}
.rec-lock-zone {
  align-self: center;
  display: grid;
  place-items: center;
  gap: 2px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--ember) 45%, var(--line));
  color: var(--ember);
  background: color-mix(in srgb, var(--ember) 8%, transparent);
  font-size: 1.1rem;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.rec-lock-zone small {
  font-size: .65rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-weight: 650;
}
.rec-lock-zone.hot {
  background: color-mix(in srgb, var(--ember) 22%, transparent);
  border-style: solid;
  transform: scale(1.06);
}
.rec-bar {
  display: grid;
  grid-template-columns: 44px 1fr 46px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--pane-bar);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.rec-cancel {
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
  font: inherit; font-size: 1.05rem;
  cursor: pointer;
}
.rec-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  animation: pulseRec 1s ease-in-out infinite;
}
.rec-info strong {
  font-variant-numeric: tabular-nums;
  font-size: .95rem;
}
.rec-info span {
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#btn-mic.recording,
.composer-btn.recording {
  background: color-mix(in srgb, var(--danger) 28%, var(--ember)) !important;
  color: #fff !important;
}
.chat-active { position: relative; }
@keyframes pulseRec {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.composer-main { position: relative; min-width: 0; }
.composer input#message {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); border-radius: 999px; padding: 13px 16px; font: inherit; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.composer input#message::placeholder { color: var(--muted); opacity: .85; }
.composer input#message:focus {
  border-color: color-mix(in srgb, var(--ember) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ember) 14%, transparent);
}
.emoji-panel {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  padding: 10px; border-radius: 14px;
  background: var(--sidebar); border: 1px solid var(--line);
  box-shadow: var(--shadow); max-height: 160px; overflow-y: auto;
  z-index: 5;
}
.emoji-panel button {
  border: 0; background: transparent; font-size: 1.25rem;
  cursor: pointer; border-radius: 8px; padding: 4px;
}
.emoji-panel button:hover { background: var(--hover-strong); }
.attach-preview {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; padding: 8px 10px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .82rem; color: var(--muted);
}
.attach-preview img, .attach-preview video {
  width: 48px; height: 48px; object-fit: cover; border-radius: 8px;
}
.attach-preview .attach-clear {
  margin-left: auto; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 1rem;
}

.banner {
  margin: 0 12px 8px; padding: 10px 12px; border-radius: 12px;
  background: rgba(212,122,122,.12); border: 1px solid rgba(212,122,122,.28);
  color: var(--danger); font-size: .84rem;
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
}
.banner button {
  border: 0; background: transparent; color: var(--ink); cursor: pointer; font: inherit;
  text-decoration: underline; white-space: nowrap;
}
.limit-gate {
  flex-shrink: 0;
  margin: 0 10px 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--ember) 35%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--ember) 14%, var(--pane-bar)), var(--pane-bar));
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -8px 24px color-mix(in srgb, var(--bg) 55%, transparent);
  z-index: 3;
}
.limit-gate.hidden { display: none !important; }
.limit-gate-copy {
  min-width: 0;
  flex: 1;
}
.limit-gate-copy strong {
  display: block;
  font-size: .92rem;
  font-weight: 650;
  margin: 0 0 4px;
}
.limit-gate-copy p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
}
.limit-gate #limit-gate-cta {
  flex-shrink: 0;
  white-space: nowrap;
}
.limit-gate.pulse {
  animation: limitGatePulse .55s ease;
}
@keyframes limitGatePulse {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-3px); }
  70% { transform: translateY(1px); }
}

/* Add person drawer */
.drawer {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: end center;
}
.drawer-backdrop {
  position: absolute; inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.drawer-sheet {
  position: relative; z-index: 1;
  width: min(640px, 100%);
  max-height: min(92dvh, 920px);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px) calc(var(--radius) + 8px) 0 0;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: sheetUp .3s cubic-bezier(.22,1,.36,1) both;
}
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(12px);
}
.drawer-kicker {
  margin: 0 0 4px;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 600;
}
.drawer-head h2 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}
.drawer-body {
  overflow-y: auto; padding: 16px 18px calc(22px + var(--safe-b));
  -webkit-overflow-scrolling: touch;
}
.block {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.block h3 {
  margin: 0 0 12px;
  font-size: .98rem;
  font-family: var(--font);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  flex-shrink: 0;
}
.hint { color: var(--muted); font-size: .88rem; margin: 0 0 10px; line-height: 1.45; text-wrap: pretty; }

.create-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.create-mode-tab {
  font: inherit;
  font-size: .82rem;
  font-weight: 650;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.create-mode-tab:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ember) 35%, var(--line));
}
.create-mode-tab.on {
  color: var(--on-accent);
  background: var(--ember);
  border-color: transparent;
}
#create-mode-hint { margin-top: 0; }

.guide-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.guide-tab {
  font: inherit; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 8px 12px; cursor: pointer;
  min-height: 40px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.guide-tab:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ember) 35%, var(--line)); }
.guide-tab.on {
  color: var(--on-accent); background: var(--ember); border-color: transparent;
}
.guide-intro { margin: 0 0 10px; }
.guide { display: none; }
.guide.on { display: block; }
.guide-lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}
.guide-lead strong { color: var(--ink); }
.guide-platform-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px;
}
.guide-platform-tab {
  font: inherit; font-size: .75rem; font-weight: 600;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--bg-elev) 80%, transparent);
  color: var(--muted); border-radius: 10px; padding: 8px 12px; cursor: pointer;
  min-height: 40px;
}
.guide-platform-tab.on {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ember) 45%, var(--line));
  background: color-mix(in srgb, var(--ember) 14%, transparent);
}
.guide-platform { display: none; }
.guide-platform.on { display: block; }
.guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  counter-reset: guide-step;
}
.guide-steps > li {
  counter-increment: guide-step;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
}
.guide-steps > li::before {
  content: counter(guide-step);
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  grid-column: 1;
  grid-row: 1 / span 2;
}
.guide-step-title {
  display: block;
  grid-column: 2;
  color: var(--ink);
  font-weight: 650;
  font-size: .9rem;
  line-height: 1.35;
}
.guide-step-body {
  display: block;
  grid-column: 2;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
}
.guide-tips {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--ember) 28%, var(--line));
  background: color-mix(in srgb, var(--ember) 8%, transparent);
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.45;
}
.guide-tips p { margin: 0 0 6px; }
.guide-tips p:last-child { margin-bottom: 0; }
.guide-tips strong { color: var(--ink); }
.guide ol {
  margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.5; font-size: .9rem;
}
.guide li { margin-bottom: 6px; }
.guide strong { color: var(--ink); font-weight: 650; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span { color: var(--muted); font-size: .78rem; font-weight: 500; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  color-scheme: inherit;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus {
  border-color: color-mix(in srgb, var(--ember) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ember) 14%, transparent);
  background: var(--bg-elev);
}
/* Native <select> popup: OS often paints a light panel; force readable option colors per theme */
select {
  background-color: var(--bg-soft);
  color: var(--ink);
}
select option,
select optgroup {
  /* Canvas/CanvasText follow html { color-scheme } — works on Win/Chrome/Edge */
  background-color: Canvas;
  color: CanvasText;
}
/* Fallback if browser ignores Canvas keywords */
@supports not (background-color: Canvas) {
  select option,
  select optgroup {
    background-color: var(--bg-elev);
    color: var(--ink);
  }
}
html[data-theme="light"] select,
html[data-theme="mist"] select {
  background-color: #fff;
}
html[data-theme="light"] select option,
html[data-theme="light"] select optgroup,
html[data-theme="mist"] select option,
html[data-theme="mist"] select optgroup {
  background-color: #fff;
  color: var(--ink);
}
.drop {
  display: grid; gap: 6px; place-items: center; text-align: center;
  border: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: var(--radius);
  padding: 22px 14px; margin-bottom: 12px; cursor: pointer;
  background: var(--surface);
  transition: border-color .18s ease, background .18s ease, transform .15s ease;
}
.drop:hover, .drop.drag {
  border-color: color-mix(in srgb, var(--ember) 55%, transparent);
  background: color-mix(in srgb, var(--ember) 8%, transparent);
}
.drop:active { transform: scale(.99); }
.drop strong { font-size: .95rem; }
.drop span { color: var(--muted); font-size: .82rem; }
.drop.soft { padding: 16px; }

.veil {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--backdrop);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px;
  animation: fadeVeil .2s ease both;
}
.veil-inner, .sheet {
  width: min(400px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeUp .35s cubic-bezier(.22,1,.36,1) both;
}
.veil-ring {
  width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--ember) 25%, transparent);
  border-top-color: var(--ember);
  animation: spin 1s linear infinite;
}
.progress {
  height: 4px; border-radius: 999px; background: var(--hover-strong);
  overflow: hidden; margin-top: 12px;
}
.progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--ember), var(--ember-deep));
  transition: width .25s ease;
}
.sheet-title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 5vw, 1.9rem);
  letter-spacing: -0.03em;
}
.auth-sheet { text-align: left; position: relative; }
.auth-sheet .sheet-title { text-align: center; }
.auth-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted, #6b6560);
}
.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 4px 22px 0;
  padding: 0;
  border-top: none;
}
.auth-oauth-shared {
  margin-top: 4px;
}
.auth-oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}
.auth-oauth-divider::before,
.auth-oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-oauth-divider span {
  flex: 0 0 auto;
  opacity: 0.9;
}
.auth-oauth-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.oauth-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.oauth-chip.oauth-icon-only {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 14px;
}
.oauth-chip.oauth-icon-only svg {
  display: block;
}
.oauth-chip:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--ember) 35%, var(--line));
}
.oauth-chip:active {
  transform: translateY(1px);
}
.oauth-chip-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.oauth-chip-mark-ya {
  background: color-mix(in srgb, #fc0 82%, #fff);
  color: #1a1a1a;
}
.oauth-chip-mark-vk {
  background: color-mix(in srgb, #4a76a8 70%, #1a1a1a);
  color: #fff;
  font-size: 0.58rem;
}
.auth-telegram-widget,
.oauth-chip-tg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-height: 48px;
  overflow: hidden;
  border-radius: 14px;
}
.auth-telegram-widget iframe {
  max-height: 48px !important;
}
.auth-foot-out {
  margin: 12px 22px 0;
  text-align: center;
}
.auth-sheet.is-verify {
  max-width: 420px;
}
#auth-gate-status,
.auth-inline-status {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger, #c45) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger, #c45) 28%, var(--line));
  font-size: 0.9rem;
  line-height: 1.4;
}
.auth-inline-status:not(.error) {
  background: color-mix(in srgb, var(--ember, #c9a27a) 10%, transparent);
  border-color: color-mix(in srgb, var(--ember, #c9a27a) 25%, var(--line));
}
.auth-inline-status[hidden] {
  display: none !important;
}
.auth-oauth-status {
  margin: 8px 22px 0;
}
#wallet-status,
#wallet-pack-status,
#wallet-plan-status {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.4;
}
#wallet-status.error,
#wallet-pack-status.error,
#wallet-plan-status.error {
  background: color-mix(in srgb, var(--danger, #c45) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger, #c45) 28%, var(--line));
}
#wallet-status[hidden] {
  display: none !important;
}
.drawer-cta {
  position: sticky;
  bottom: -4px;
  margin-top: 8px;
  padding-top: 12px;
  padding-bottom: 4px;
  background: linear-gradient(180deg, transparent, var(--bg-elev) 28%);
}
.status { color: var(--muted); font-size: .86rem; min-height: 1.2em; margin-top: 10px; }
.status.error { color: var(--danger); }

@keyframes fadeVeil {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes blink {
  0%, 80%, 100% { opacity: .25; }
  40% { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes voicePulse {
  from { transform: scaleY(.7); }
  to { transform: scaleY(1.2); }
}

.drawer-body textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  padding: 10px 12px;
  font: inherit;
}
.context-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0;
}
.context-questions .hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .75rem;
}

/* Mobile: list OR chat — top bar always stays */
@media (max-width: 839px) {
  .app-shell.show-chat .sidebar { display: none; }
  .app-shell:not(.show-chat) .chat-pane { display: none; }
  .app-shell:not(.show-chat) .sidebar { display: flex; width: 100%; }
  .app-top { position: sticky; top: 0; }
  .chat-top {
    padding: 8px 10px;
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .chat-top .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: .9rem; }
}

/* Desktop: side-by-side */
@media (min-width: 840px) {
  .app-main {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
  .back-mobile { display: none !important; }
  .chat-top { grid-template-columns: 1fr auto; }
  .drawer { place-items: center; }
  .drawer-sheet {
    border-radius: 22px;
    max-height: min(88vh, 860px);
  }
}

/* —— Onboarding tour —— */
.tour-help-btn {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ember);
  border: 1px solid color-mix(in srgb, var(--ember) 35%, transparent);
  border-radius: 999px;
}
.tour-help-btn:hover {
  background: color-mix(in srgb, var(--ember) 14%, transparent);
}
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: auto;
}
.tour-overlay.hidden { display: none; }
.tour-spotlight {
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(5, 6, 8, 0.72);
  outline: 2px solid color-mix(in srgb, var(--ember) 80%, white);
  outline-offset: 2px;
  transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease, border-radius .28s ease;
  pointer-events: none;
  animation: tour-pulse 1.8s ease-in-out infinite;
}
.tour-spotlight.is-center {
  border-radius: 20px;
  outline: none;
  box-shadow: 0 0 0 9999px rgba(5, 6, 8, 0.78);
  animation: none;
}
.tour-spotlight.is-hidden {
  outline: none;
  border-radius: 0;
  animation: none;
  box-shadow: 0 0 0 9999px rgba(5, 6, 8, 0.78);
  opacity: 1;
}
@keyframes tour-pulse {
  0%, 100% { outline-color: color-mix(in srgb, var(--ember) 70%, white); }
  50% { outline-color: color-mix(in srgb, var(--ember) 100%, white); }
}
.tour-card {
  position: absolute;
  z-index: 1;
  width: min(340px, calc(100vw - 28px));
  padding: 18px 18px 14px;
  border-radius: calc(var(--radius) + 2px);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: inherit;
  transition: top .28s ease, left .28s ease;
}
.tour-step {
  margin: 0 0 6px;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ember);
  font-weight: 600;
}
.tour-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 700;
  font-family: var(--display);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.tour-text {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  text-wrap: pretty;
}
.tour-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.tour-target-live {
  position: relative !important;
  z-index: 12001 !important;
  pointer-events: none !important;
}

/* Site ad — stretched across chats sidebar (not the dialogue pane) */
.site-ad {
  position: fixed;
  left: max(10px, env(safe-area-inset-left, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  bottom: max(10px, var(--safe-b));
  z-index: 25;
  width: auto;
  max-width: none;
  padding: 8px 36px 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  animation: site-ad-in .35s ease both;
}
.site-ad:has(.site-ad-img.hidden) {
  grid-template-columns: minmax(0, 1fr) auto;
}
.site-ad.hidden,
.site-ad[hidden] {
  display: none !important;
}
@keyframes site-ad-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.site-ad-close {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.site-ad-close:hover { color: var(--ink); background: rgba(127,127,127,.12); }
.site-ad-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.site-ad-img.hidden { display: none; }
.site-ad-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.site-ad-sponsor {
  margin: 0;
  font-size: .62rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.site-ad-title {
  font-family: var(--display);
  font-size: .86rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-ad-title.hidden { display: none; }
.site-ad-body {
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-ad-body.hidden { display: none; }
.site-ad-cta {
  justify-self: end;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 12px;
  font-size: .78rem;
}
.site-ad-cta.hidden { display: none; }

/* Leave room in chat list so the last items aren’t covered by the ad */
body:has(#view-app:not(.hidden)):has(#site-ad:not(.hidden):not([hidden])) .chat-list {
  padding-bottom: 92px;
}

/* App desktop: stretch over the left chats sidebar only */
@media (min-width: 840px) {
  body:has(#view-app:not(.hidden)) #site-ad {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: auto;
    width: calc(var(--sidebar-w) - 20px);
    max-width: calc(var(--sidebar-w) - 20px);
    bottom: max(12px, var(--safe-b));
  }
}

/* App mobile: show on chat list; hide inside an open dialogue */
@media (max-width: 839px) {
  body:has(#view-app:not(.hidden)) #site-ad {
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    width: auto;
    bottom: max(10px, var(--safe-b));
    padding: 7px 32px 7px 8px;
    gap: 8px 10px;
    border-radius: 12px;
  }
  body:has(#view-app.show-chat:not(.hidden)) #site-ad {
    display: none !important;
  }
  .site-ad-img {
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }
  .site-ad-title { font-size: .82rem; }
  .site-ad-body { font-size: .7rem; }
}


/* ============================================================
   Responsive system — monitors, tablets, phones (portrait/landscape)
   ============================================================ */

/* Large monitors */
@media (min-width: 1280px) {
  :root { --page-max: 1280px; --sidebar-w: min(380px, 32vw); }
  .landing-hero { min-height: min(70dvh, 680px); gap: clamp(28px, 4vw, 64px); }
  .landing-bar { padding-left: 28px; padding-right: 28px; }
  .messages { padding-left: clamp(16px, 4vw, 48px); padding-right: clamp(16px, 4vw, 48px); }
  .composer { padding-left: clamp(16px, 4vw, 48px); padding-right: clamp(16px, 4vw, 48px); }
  .bubble { max-width: min(72%, 520px); }
}

@media (min-width: 1440px) {
  :root { --page-max: 1360px; --sidebar-w: min(400px, 28vw); }
  .landing-copy h1 { font-size: clamp(2rem, 2.6vw, 2.75rem); }
  .brand-hero { font-size: clamp(3.6rem, 5vw, 5.4rem); }
}

@media (min-width: 1800px) {
  :root { --page-max: 1480px; }
}

/* Tablet landscape / small laptop — keep side-by-side but denser */
@media (min-width: 840px) and (max-width: 1100px) {
  :root { --sidebar-w: min(300px, 34vw); }
  .app-top { padding: 8px; }
  .chat-top { padding: 8px 10px; }
  .composer { padding: 8px 10px calc(8px + var(--safe-b)); gap: 6px; }
  .composer-send-slot { width: 42px; height: 42px; }
  .landing-hero { gap: 28px; padding: 10px 18px 24px; }
  .landing-steps-list { gap: 18px; }
}

/* Tablet portrait band (stacked landing already; app is list/chat) */
@media (min-width: 600px) and (max-width: 839px) {
  .landing-bar { padding: 12px 18px; }
  .landing-hero { padding: 8px 18px 24px; }
  .landing-hook { min-height: 240px; padding: clamp(22px, 4vw, 36px); }
  .landing-stories-stage { min-height: clamp(300px, 48vw, 420px); }
  .app-top { padding: 8px 12px; }
  .chat-top { padding: 8px 12px; }
  .composer { padding: 10px 14px calc(10px + var(--safe-b)); }
  .messages { padding: 14px 16px 10px; }
  .bubble { max-width: min(78%, 480px); }
  .drawer-sheet { width: min(520px, 94vw); }
}

/* Phones + narrow tablets */
@media (max-width: 639px) {
  .landing-bar {
    padding: 10px 14px;
    min-height: 52px;
    gap: 8px;
  }
  .landing-nav .btn.sm { padding: 7px 10px; font-size: .8rem; }
  .brand.sm .brand-logo { width: 34px; height: 34px; border-radius: 9px; }
  .landing-hero { padding: 6px 14px 20px; gap: 16px; }
  .landing-copy h1 { font-size: clamp(1.45rem, 6.5vw, 1.85rem); margin-bottom: 10px; }
  .lede { font-size: .95rem; margin-bottom: 16px; max-width: none; }
  .brand-hero { font-size: clamp(2.35rem, 12vw, 3.1rem); margin-bottom: 10px; }
  .landing-hook {
    min-height: 0;
    padding: 20px 16px;
    border-radius: var(--radius);
  }
  .cta-row { gap: 8px; }
  .cta-row .btn.xl { padding: 12px 18px; font-size: .95rem; }
  .landing-stories-stage { min-height: clamp(260px, 72vw, 360px); border-radius: var(--radius); }
  .landing-step-body h3 { font-size: 1.05rem; }

  .app-top {
    padding: 8px;
    gap: 6px;
    grid-template-columns: 36px 1fr auto;
  }
  .app-top .btn.icon { width: 36px; height: 36px; }
  .chat-top {
    gap: 6px;
    padding: 7px 8px;
  }
  .chat-meta h1 { font-size: .92rem; }
  .chat-top-actions { gap: 4px; }
  .voice-clone-label { display: none; }
  .voice-clone-btn {
    padding: 7px 9px !important;
    min-width: 40px;
    justify-content: center;
  }
  .composer {
    gap: 4px;
    padding: 8px 8px calc(8px + var(--safe-b));
  }
  .composer-btn { width: 34px; height: 34px; font-size: 1rem; }
  .composer-send-slot { width: 40px; height: 40px; }
  .composer input#message { font-size: 16px; /* iOS zoom guard */ }
  .messages { padding: 10px 8px 8px; gap: 6px; }
  .bubble { max-width: min(92%, 100%); font-size: .9rem; padding: 8px 10px; border-radius: 14px; }

  .auth-sheet {
    width: min(100%, 100%);
    max-height: min(94dvh, 100%);
    border-radius: 18px;
  }
  .auth-hero-band { min-height: 64px; padding: 18px 16px 14px; margin-bottom: 12px; }
  .auth-mark { font-size: 1.65rem; }
  .auth-sheet .sheet-title { font-size: 1.25rem; margin-left: 16px; margin-right: 16px; }

  .site-ad-title,
  .site-ad-body {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .site-ad-cta { padding: 5px 10px; font-size: .72rem; }
  body:has(#view-app:not(.hidden)):has(#site-ad:not(.hidden):not([hidden])) .chat-list {
    padding-bottom: 84px;
  }

  .account-sidebar { width: min(100vw, 100%); max-width: 100%; }
  .tour-card { width: min(100vw - 20px, 340px); padding: 14px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .landing-nav { gap: 4px; }
  .landing-nav .btn.ghost.sm { padding: 6px 8px; font-size: .74rem; }
  .brand-hero { font-size: clamp(2.1rem, 11vw, 2.6rem); }
  .composer-tools #btn-emoji { display: none; }
  .chat-msg-quota { display: none; }
}

/* Phone landscape — reclaim vertical space */
@media (max-height: 500px) and (orientation: landscape) {
  .landing {
    min-height: auto;
  }
  .landing-bar {
    min-height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .landing-hero {
    min-height: auto;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 8px 16px 14px;
    align-items: center;
  }
  .brand-hero { font-size: clamp(1.8rem, 8vw, 2.4rem); margin-bottom: 6px; }
  .landing-copy h1 { font-size: clamp(1.15rem, 3.5vw, 1.45rem); margin-bottom: 6px; }
  .lede { font-size: .85rem; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .landing-hook { min-height: 140px; padding: 14px 16px; }
  .landing-stories-stage { min-height: 220px; }
  .cta-row .btn.xl { padding: 8px 14px; font-size: .86rem; }

  .app-top { padding: 4px 8px; min-height: 0; }
  .app-top .brand-logo { width: 30px; height: 30px; }
  .chat-top { padding: 4px 8px; }
  .chat-top .avatar { width: 32px; height: 32px; border-radius: 10px; }
  .status-line { display: none; }
  .composer { padding: 4px 8px calc(4px + var(--safe-b)); }
  .composer-send-slot { width: 36px; height: 36px; }
  .composer-btn { width: 30px; height: 30px; }
  .messages { padding: 6px 8px; gap: 4px; }
  .bubble { padding: 6px 9px; font-size: .85rem; }

  .auth-hero-band { min-height: 48px; padding: 10px 14px; margin-bottom: 8px; }
  .auth-sheet { max-height: min(96dvh, 100%); }
  .auth-mark { font-size: 1.35rem; }

  .drawer-sheet { max-height: min(94dvh, 100%); }
  .echo-sheet { max-height: min(94dvh, 100%); }
  .site-ad { display: none !important; }
}

/* Tablet landscape short height */
@media (min-width: 840px) and (max-height: 700px) and (orientation: landscape) {
  .landing-hero { min-height: min(62dvh, 480px); padding-top: 8px; padding-bottom: 16px; }
  .landing-hook { min-height: 200px; }
  .app-top { padding: 6px 10px; }
  .chat-top { padding: 6px 10px; }
  .composer { padding: 6px 10px calc(6px + var(--safe-b)); }
}

/* Prefer no hover sticky states on touch — reduce accidental lift */
@media (hover: none) and (pointer: coarse) {
  .btn.primary:hover:not(:disabled) { transform: none; }
  .chat-item:hover { background: transparent; }
  .ticket-card:active, .chat-item:active { background: var(--hover); }
}

/* Keyboard open (set by app.js visualViewport) */
html.kb-open .app-shell {
  height: calc(100dvh - var(--vv-bottom, 0px));
  height: calc(100vh - var(--vv-bottom, 0px));
}
html.kb-open .site-ad { display: none !important; }

/* Safe areas for notched devices in landscape */
@supports (padding: max(0px)) {
  @media (orientation: landscape) {
    .app-shell {
      padding-left: env(safe-area-inset-left, 0px);
      padding-right: env(safe-area-inset-right, 0px);
    }
    .landing-bar,
    .landing-hero {
      padding-left: max(14px, env(safe-area-inset-left, 0px));
      padding-right: max(14px, env(safe-area-inset-right, 0px));
    }
  }
}

