/* ============================================================
   NeuroArt Studio — design system
   "Aurum Studio" → cold deep-navy + sky-cyan refresh.
   Display: Unbounded · Body: Manrope · Numerals: JetBrains Mono
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #0B1220;
  --bg-soft: #0F1A30;
  --surface: rgba(206, 226, 255, 0.045);
  --surface-2: rgba(206, 226, 255, 0.075);
  --surface-3: rgba(206, 226, 255, 0.11);
  --surface-solid: #13203A;
  --surface-solid-2: #1A2A48;

  --ink: #EDF3FC;
  --ink-dim: #A8BAD6;
  --ink-faint: #6B7F9E;
  --ink-ghost: rgba(237, 243, 252, 0.5);

  --line: rgba(206, 226, 255, 0.10);
  --line-strong: rgba(206, 226, 255, 0.18);

  --accent: #3FB8FF;
  --accent-2: #74CDFF;
  --accent-soft: #AEE5FF;
  --accent-glow: rgba(63, 184, 255, 0.50);
  --gold: #8FD0FF;          /* was warm gold → ice / electric blue (premium highlight) */
  --violet: #8E7BFF;        /* electric indigo-violet */
  --magenta: #B07BFF;       /* was warm magenta → cool electric violet */
  --teal: #3FE0DA;

  --good: #5EE08A;
  --bad: #FF6259;

  /* dark navy text/icon drawn ON the bright cyan accent (buttons, thumb, mark) */
  --on-accent: #071325;

  --tint-image: var(--accent);
  --tint-video: var(--violet);
  --tint-music: var(--magenta);

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 11px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --shadow-1: 0 1px 0 rgba(206, 226, 255, 0.05) inset, 0 10px 30px -16px rgba(0, 0, 0, 0.7);
  --shadow-2: 0 20px 60px -20px rgba(0, 0, 0, 0.8);

  --ff-display: "Unbounded", system-ui, sans-serif;
  --ff-body: "Manrope", system-ui, sans-serif;
  --ff-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 80% at 50% -10%, #13243F 0%, var(--bg) 55%),
    var(--bg);
}
button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; -webkit-tap-highlight-color: transparent; }
input, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--accent-glow); color: #fff; }
svg { display: block; }

/* ── Atmosphere ─────────────────────────────────────────── */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 0.9  0 0 0 0 0.7  0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; }
.glow--a { width: 60vw; height: 60vw; left: -22vw; top: -24vw; background: radial-gradient(circle, var(--accent) 0%, transparent 65%); opacity: 0.34; animation: drift1 18s ease-in-out infinite; }
.glow--b { width: 55vw; height: 55vw; right: -24vw; top: 8vw; background: radial-gradient(circle, #2B4FD0 0%, transparent 65%); opacity: 0.5; animation: drift2 22s ease-in-out infinite; }
.glow--c { width: 50vw; height: 50vw; left: 18vw; bottom: -30vw; background: radial-gradient(circle, var(--gold) 0%, transparent 60%); opacity: 0.16; animation: drift3 26s ease-in-out infinite; }
@keyframes drift1 { 50% { transform: translate(8vw, 6vw) scale(1.1); } }
@keyframes drift2 { 50% { transform: translate(-7vw, 10vw) scale(0.9); } }
@keyframes drift3 { 50% { transform: translate(10vw, -8vw) scale(1.15); } }

/* ── Device frame ───────────────────────────────────────── */
.device {
  position: relative;
  z-index: 1;
  width: min(100vw, 420px);
  height: min(100dvh, 900px);
  background: linear-gradient(180deg, #0E1A30 0%, #08101E 100%);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
}
@media (min-width: 480px) {
  body { padding: 24px; }
  .device {
    border-radius: 46px;
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-2), 0 0 0 10px #070D18, 0 0 0 11px #1B2A40;
    height: min(100dvh - 48px, 880px);
  }
  .device__notch {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
    width: 116px; height: 30px; background: #03060D; border-radius: 20px; z-index: 40;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.04) inset;
  }
}
@media (max-width: 479px) { .device__notch { display: none; } }

/* ── Status bar ─────────────────────────────────────────── */
.statusbar {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--ink);
  padding-top: env(safe-area-inset-top, 0);
  position: relative; z-index: 20;
}
@media (min-width: 480px) { .statusbar { padding-top: 18px; } }
.statusbar__brand { font-family: var(--ff-display); font-size: 11px; letter-spacing: 0.32em; color: var(--ink-faint); }

/* ── App shell ──────────────────────────────────────────── */
.app {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* ── Top bar ────────────────────────────────────────────── */
.topbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 12px;
  position: relative; z-index: 15;
}
.topbar__back { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.topbar__back svg { width: 22px; height: 22px; transition: transform .25s var(--ease); }
.topbar__back:active svg { transform: translateX(-3px); }
.topbar__back[hidden] { visibility: hidden; }
.topbar__center { text-align: center; min-width: 0; }
.topbar__title { font-family: var(--ff-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__sub { font-size: 11px; color: var(--ink-faint); margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; min-height: 13px; }
.topbar__trail { display: flex; align-items: center; gap: 8px; min-width: 44px; justify-content: flex-end; }

.iconbtn { display: grid; place-items: center; border-radius: 50%; color: var(--ink); transition: background .2s, transform .15s; }
.iconbtn:active { transform: scale(0.92); }

/* balance pill in topbar */
.balpill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px 7px 10px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(143,208,255,0.16), rgba(63,184,255,0.10));
  border: 1px solid rgba(143,208,255,0.30);
  font-family: var(--ff-mono); font-weight: 600; font-size: 13px; color: var(--gold);
  line-height: 1; white-space: nowrap;
}
.balpill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.balpill.balpill--buy { color: var(--accent-2); border-color: rgba(116,205,255,0.4); background: linear-gradient(135deg, rgba(63,184,255,0.2), rgba(63,184,255,0.06)); }

/* ── Screen base ────────────────────────────────────────── */
.screen {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px 18px 28px;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen > * {
  opacity: 0;
  transform: translateY(11px);
  animation: rise .5s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 48ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ── Type ───────────────────────────────────────────────── */
.display { font-family: var(--ff-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.02; }
.eyebrow { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-2); }
.h1 { font-family: var(--ff-display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; line-height: 1.06; }
.h2 { font-family: var(--ff-display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; line-height: 1.15; }
.lede { font-size: 14.5px; line-height: 1.55; color: var(--ink-dim); }
.cap { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.02em; }
.mono { font-family: var(--ff-mono); font-variant-numeric: tabular-nums; }
.grad-text {
  background: linear-gradient(105deg, var(--gold) 0%, var(--accent-2) 45%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 20px; border-radius: var(--r-md);
  font-weight: 700; font-size: 15.5px; line-height: 1;
  width: 100%; transition: transform .14s var(--ease), box-shadow .2s, background .2s, opacity .2s;
  user-select: none;
}
.btn svg { width: 19px; height: 19px; }
.btn:active { transform: translateY(1px) scale(0.992); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: var(--on-accent);
  box-shadow: 0 10px 26px -10px var(--accent-glow), 0 1px 0 rgba(255,255,255,0.35) inset;
}
.btn--primary:hover { box-shadow: 0 14px 34px -10px var(--accent-glow), 0 1px 0 rgba(255,255,255,0.4) inset; }
.btn--ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--link { background: transparent; color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(116,205,255,0.35); }
.btn--link:hover { background: rgba(116,205,255,0.08); }
.btn--soft { background: linear-gradient(135deg, rgba(116,205,255,0.18), rgba(63,184,255,0.10)); color: var(--accent-2); border: 1px solid rgba(116,205,255,0.28); }
.btn--danger { background: rgba(255,98,89,0.12); color: var(--bad); border: 1px solid rgba(255,98,89,0.28); }
.btn--block + .btn--block { margin-top: 9px; }
.btn[disabled], .btn.is-disabled { opacity: 0.4; filter: grayscale(0.3); pointer-events: none; }
.btn__sub { font-size: 12px; font-weight: 600; opacity: 0.72; font-family: var(--ff-mono); }
.btn--lg { padding: 17px 20px; font-size: 16px; border-radius: var(--r-lg); }
.btn--sm { padding: 10px 14px; font-size: 13px; width: auto; border-radius: var(--r-sm); }

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.card--solid { background: var(--surface-solid); }

/* ── Chips / segment ────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink-dim);
}
.chip--accent { color: var(--accent-2); border-color: rgba(116,205,255,0.32); background: rgba(116,205,255,0.10); }
.chip--violet { color: var(--violet); border-color: rgba(142,123,255,0.32); background: rgba(142,123,255,0.10); }
.chip--magenta { color: var(--magenta); border-color: rgba(176,123,255,0.32); background: rgba(176,123,255,0.10); }
.chip--muted { color: var(--ink-faint); }

/* ── Toggle switch ──────────────────────────────────────── */
.switch { position: relative; width: 46px; height: 28px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch__track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); transition: background .25s var(--ease); }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-dim); transition: transform .28s var(--ease-out), background .25s; }
.switch input:checked ~ .switch__track { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: transparent; }
.switch input:checked ~ .switch__thumb { transform: translateX(18px); background: var(--on-accent); }

/* ── Setting row (constructor + options) ────────────────── */
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 15px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  transition: background .2s, transform .12s, border-color .2s;
}
.row:active { transform: scale(0.99); }
.row--btn { cursor: pointer; width: 100%; text-align: left; }
.row--btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.row__ico { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: var(--surface-3); }
.row__main { flex: 1 1 auto; min-width: 0; }
.row__label { font-size: 14px; font-weight: 600; color: var(--ink); }
.row__hint { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.row__val { font-family: var(--ff-mono); font-size: 13px; font-weight: 600; color: var(--ink-dim); white-space: nowrap; }
.row__chev { color: var(--ink-faint); flex: 0 0 auto; }
.row__chev svg { width: 18px; height: 18px; }
.row__val.is-accent { color: var(--accent-2); }
/* small sub-hint rendered as a sibling of a setting row (e.g. vocal toggle) */
.row-note { font-size: 11.5px; color: var(--ink-faint); line-height: 1.4; padding: 0 4px; }

/* ── Textarea / field ───────────────────────────────────── */
.field { position: relative; }
.field__ta {
  width: 100%; resize: none; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  padding: 16px; font-size: 15px; line-height: 1.45; color: var(--ink);
  transition: border-color .2s, background .2s; min-height: 96px;
}
.field__ta::placeholder { color: var(--ink-faint); }
.field__ta:focus { outline: none; border-color: rgba(116,205,255,0.5); background: var(--surface-2); box-shadow: 0 0 0 4px rgba(63,184,255,0.10); }
.field__ta--lg { min-height: 140px; font-size: 16px; }
.field__bar { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding: 0 4px; }
.field__count { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-faint); }
.field__tools { display: flex; gap: 6px; }
.toolbtn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink-dim);
  background: var(--surface-2); border: 1px solid var(--line); transition: all .18s;
}
.toolbtn svg { width: 14px; height: 14px; }
.toolbtn:active { transform: scale(0.95); }
.toolbtn:disabled { opacity: 0.4; pointer-events: none; }
.toolbtn--accent { color: var(--accent-2); border-color: rgba(116,205,255,0.3); }

/* ── Lyrics: structural-tag chips ───────────────────────── */
.lyr-tags {
  display: flex; gap: 6px; margin-bottom: 10px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.lyr-tags::-webkit-scrollbar { display: none; }
.lyr-tag {
  flex: 0 0 auto; min-height: 36px; padding: 8px 12px; border-radius: 999px;
  white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--accent-2);
  background: rgba(116,205,255,0.10); border: 1px solid rgba(116,205,255,0.32);
  transition: background .18s, transform .12s, border-color .18s;
}
.lyr-tag:active { transform: scale(0.94); }
.lyr-tag:hover { background: rgba(116,205,255,0.18); border-color: rgba(116,205,255,0.5); }

/* ── Segmented control (formats / presets) ──────────────── */
.segmented { display: flex; gap: 6px; flex-wrap: wrap; }
.seg {
  flex: 1 1 0; min-width: 0; padding: 11px 6px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 600; font-size: 13px; color: var(--ink-dim);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  transition: all .2s var(--ease); text-align: center;
}
.seg:active { transform: scale(0.96); }
.seg.is-active {
  background: linear-gradient(135deg, rgba(116,205,255,0.22), rgba(63,184,255,0.12));
  border-color: rgba(116,205,255,0.55); color: var(--ink);
  box-shadow: 0 6px 18px -10px var(--accent-glow);
}
.seg__px { font-family: var(--ff-mono); font-size: 10px; color: var(--ink-faint); }
.seg.is-active .seg__px { color: var(--accent-soft); }

/* ratio visual box */
.ratio-box {
  width: 26px; height: 26px; position: relative; border-radius: 3px;
  border: 1.5px solid currentColor; opacity: 0.8;
}
.ratio-box::after { content: ""; position: absolute; inset: 0; border-radius: 2px; background: currentColor; opacity: 0.18; }

/* ── Section spacing ────────────────────────────────────── */
.section { margin-top: 22px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; padding: 0 2px; }
.section__label { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }

/* ════════════════════ MENU ════════════════════ */
.menu-hero { padding: 6px 4px 4px; }
.menu-hero__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.mark {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  display: grid; place-items: center; color: var(--on-accent);
  box-shadow: 0 8px 22px -8px var(--accent-glow);
  font-family: var(--ff-display); font-weight: 800; font-size: 20px;
}
.menu-hero__title { font-family: var(--ff-display); font-weight: 800; font-size: 24px; letter-spacing: -0.025em; line-height: 1; }
.menu-hero__sub { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }

.catgrid { display: grid; gap: 12px; }
.cat {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: var(--r-xl); cursor: pointer;
  border: 1px solid var(--line); text-align: left; width: 100%;
  transition: transform .18s var(--ease), box-shadow .25s;
}
.cat:active { transform: scale(0.985); }
.cat__art { position: absolute; inset: 0; z-index: 0; opacity: 0.9; }
.cat__art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(8,14,28,0.45) 0%, rgba(8,14,28,0.15) 55%, transparent 100%); }
.cat__body { position: relative; z-index: 1; }
.cat__emoji { font-size: 30px; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }
.cat__title { font-family: var(--ff-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.cat__desc { font-size: 12.5px; color: var(--ink-ghost); margin-top: 3px; }
.cat__arrow { position: relative; z-index: 1; margin-left: auto; color: var(--ink); opacity: 0.7; }
.cat__arrow svg { width: 22px; height: 22px; }
.cat--image { background: linear-gradient(120deg, #10243F, #0B1426); }
.cat--image .cat__art { background: radial-gradient(120% 140% at 85% 20%, rgba(116,205,255,0.55), transparent 60%); }
.cat--video { background: linear-gradient(120deg, #1A1C3E, #12142E); }
.cat--video .cat__art { background: radial-gradient(120% 140% at 85% 20%, rgba(142,123,255,0.5), transparent 60%); }
.cat--music { background: linear-gradient(120deg, #231337, #140D22); }
.cat--music .cat__art { background: radial-gradient(120% 140% at 85% 20%, rgba(176,123,255,0.5), transparent 60%); }

.tilegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 9px;
  padding: 16px; border-radius: var(--r-lg); cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .16s var(--ease), background .2s;
}
.tile:active { transform: scale(0.97); }
.tile:hover { background: var(--surface-2); }
.tile__ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--surface-3); }
.tile__title { font-weight: 700; font-size: 14px; }
.tile__sub { font-size: 11.5px; color: var(--ink-faint); }

/* ════════════════════ CONSTRUCTOR ════════════════════ */
.ctor-promptwrap { position: relative; }
.ctor-costbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(143,208,255,0.10), rgba(63,184,255,0.05));
  border: 1px solid rgba(143,208,255,0.22);
}
.ctor-costbar__l { display: flex; flex-direction: column; gap: 2px; }
.ctor-costbar__cap { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.02em; }
.ctor-costbar__big { font-family: var(--ff-display); font-weight: 700; font-size: 19px; color: var(--ink); }
.ctor-costbar__big .mono { color: var(--gold); }
.ctor-costbar__r { text-align: right; }
.ctor-costbar__bal { font-family: var(--ff-mono); font-size: 12px; color: var(--ink-dim); }
.ctor-costbar__bal b { color: var(--ink); }
.ctor-costbar.is-low { border-color: rgba(255,98,89,0.4); background: linear-gradient(135deg, rgba(255,98,89,0.12), rgba(255,98,89,0.04)); }

.refsmini { display: flex; flex-wrap: wrap; gap: 7px; }
.refsmini__pill { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim); }

/* ════════════════════ MODEL PICK / CARDS ════════════════════ */
.modelcard {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 15px; border-radius: var(--r-lg); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .16s var(--ease), border-color .2s, background .2s; position: relative;
}
.modelcard:active { transform: scale(0.985); }
.modelcard:hover { border-color: var(--line-strong); background: var(--surface-2); }
.modelcard.is-active { border-color: rgba(116,205,255,0.5); background: linear-gradient(135deg, rgba(116,205,255,0.10), rgba(63,184,255,0.03)); box-shadow: 0 8px 24px -14px var(--accent-glow); }
.modelcard__ico { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; font-size: 21px; background: var(--surface-3); }
.modelcard__main { flex: 1 1 auto; min-width: 0; }
.modelcard__name { display: flex; align-items: center; gap: 7px; font-family: var(--ff-display); font-weight: 600; font-size: 15.5px; }
.modelcard__desc { font-size: 12px; color: var(--ink-faint); margin-top: 3px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.modelcard__price { font-family: var(--ff-mono); font-weight: 600; font-size: 13px; color: var(--accent-2); white-space: nowrap; }
.modelcard__price small { color: var(--ink-faint); font-weight: 500; }
.star { color: var(--gold); font-size: 13px; }

/* ════════════════════ CABINET ════════════════════ */
.balhero {
  position: relative; overflow: hidden;
  padding: 24px 20px; border-radius: var(--r-xl);
  background: linear-gradient(135deg, #11243F 0%, #0A1626 100%);
  border: 1px solid rgba(143,208,255,0.22);
}
.balhero__glow { position: absolute; width: 220px; height: 220px; right: -70px; top: -90px; background: radial-gradient(circle, var(--accent) 0%, transparent 65%); opacity: 0.4; filter: blur(20px); }
.balhero__cap { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); position: relative; }
.balhero__num { font-family: var(--ff-display); font-weight: 800; font-size: 48px; line-height: 1; margin-top: 8px; position: relative; letter-spacing: -0.02em; }
.balhero__num .unit { font-size: 16px; color: var(--ink-dim); font-weight: 600; margin-left: 6px; }
.balhero__rub { font-family: var(--ff-mono); font-size: 13px; color: var(--ink-faint); margin-top: 10px; position: relative; }
.statrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { padding: 15px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.stat__cap { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.02em; }
.stat__val { font-family: var(--ff-display); font-weight: 700; font-size: 22px; margin-top: 4px; }
.stat__sub { font-size: 11px; color: var(--ink-faint); margin-top: 3px; }

/* ── PWA install CTA (cabinet) ── */
.pwa-card { padding: 0; }
.pwa-cta { position: relative; display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 16px 18px; border-radius: var(--r-lg); font-family: var(--ff-display); font-weight: 700; font-size: 15.5px; color: #071325; background: linear-gradient(135deg, #8FD0FF 0%, #3FB8FF 100%); border: 1px solid rgba(143,208,255,0.6); box-shadow: 0 10px 26px -14px var(--accent-glow); cursor: pointer; transition: transform .12s; animation: pwaPulse 2.1s ease-in-out infinite; }
.pwa-cta:active { transform: scale(0.985); }
.pwa-cta__ico { font-size: 18px; }
.pwa-card__hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; text-align: center; }
@keyframes pwaPulse { 0%, 100% { box-shadow: 0 10px 26px -14px var(--accent-glow), 0 0 0 0 rgba(143,208,255,0); } 50% { box-shadow: 0 10px 26px -10px var(--accent-glow), 0 0 0 6px rgba(143,208,255,0.16); } }
@media (prefers-reduced-motion: reduce) { .pwa-cta { animation: none; } }

/* ════════════════════ HISTORY ════════════════════ */
.gencard { display: flex; gap: 13px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.gencard__thumb { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: var(--surface-3); position: relative; }
.gencard__thumb::after { content: ""; position: absolute; inset: 0; border-radius: 11px; box-shadow: 0 0 0 1px var(--line) inset; }
.gencard__main { flex: 1 1 auto; min-width: 0; }
.gencard__prompt { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gencard__meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.gencard__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-faint); }
.gencard__price { font-family: var(--ff-mono); font-size: 12px; font-weight: 600; color: var(--ink-dim); white-space: nowrap; }
.gencard.is-clickable { cursor: pointer; transition: transform .12s, border-color .2s, background .2s; }
.gencard.is-clickable:active { transform: scale(0.99); }
.gencard.is-clickable:hover { border-color: var(--line-strong); background: var(--surface-2); }
.gencard__side { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 7px; flex: 0 0 auto; }
.gencard__dl { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; background: var(--surface-3); color: var(--accent-2); border: 1px solid var(--line); transition: background .18s, transform .12s; }
.gencard__dl:hover { background: rgba(116,205,255,0.12); }
.gencard__dl:active { transform: scale(0.92); }
.status-pill { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.status--done { color: var(--good); background: rgba(94,224,138,0.12); }
.status--failed { color: var(--bad); background: rgba(255,98,89,0.12); }
.status--processing, .status--pending { color: var(--gold); background: rgba(143,208,255,0.12); }
.empty { text-align: center; padding: 48px 24px; color: var(--ink-faint); }
.empty__ico { font-size: 40px; opacity: 0.5; margin-bottom: 12px; }

/* infinite-scroll sentinel + spinner at the bottom of the history list */
.history-sentinel { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 16px 8px; color: var(--ink-faint); font-size: 12px; }
.history-sentinel[hidden] { display: none; }
.history-loader { border-color: rgba(206, 226, 255, 0.22); border-top-color: var(--accent-2); }

/* ════════════════════ TOPUP / TARIFFS ════════════════════ */
.tariff { position: relative; padding: 18px; border-radius: var(--r-lg); cursor: pointer; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); transition: transform .16s var(--ease), border-color .2s, background .2s; }
.tariff:active { transform: scale(0.985); }
.tariff:hover { border-color: var(--line-strong); }
.tariff--feat { border-color: rgba(116,205,255,0.45); background: linear-gradient(135deg, rgba(116,205,255,0.10), rgba(63,184,255,0.02)); box-shadow: 0 10px 30px -16px var(--accent-glow); }
.tariff__ribbon { position: absolute; top: 14px; right: 14px; font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); }
.tariff__name { font-family: var(--ff-display); font-weight: 700; font-size: 19px; }
.tariff__tokens { font-family: var(--ff-display); font-weight: 800; font-size: 30px; margin-top: 6px; letter-spacing: -0.01em; }
.tariff__tokens .unit { font-size: 13px; color: var(--ink-dim); font-weight: 600; }
.tariff__desc { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; line-height: 1.4; }
.tariff__price { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line); }
.tariff__rub { font-family: var(--ff-mono); font-weight: 700; font-size: 20px; }
.tariff__per { font-size: 11.5px; color: var(--ink-faint); }

/* pricing table */
.pricegroup { margin-bottom: 6px; }
.pricegroup__head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.pricegroup__title { font-family: var(--ff-display); font-weight: 600; font-size: 14px; }
.pricegroup__hint { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-faint); }
.priceline { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.priceline + .priceline { margin-top: 6px; }
.priceline__name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.priceline__tok { font-family: var(--ff-mono); font-weight: 600; font-size: 12.5px; color: var(--accent-2); }

/* ════════════════════ GENERATING ════════════════════ */
.genstage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; padding: 20px 0; }
.genframe { position: relative; width: 78%; max-width: 230px; aspect-ratio: var(--ar, 1/1); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-solid); }
.genframe__shimmer { position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent 0deg, var(--accent-glow) 60deg, transparent 120deg, var(--gold) 200deg, transparent 280deg); animation: spin 2.4s linear infinite; opacity: 0.6; filter: blur(8px); }
.genframe__core { position: absolute; inset: 3px; border-radius: calc(var(--r-lg) - 3px); background: linear-gradient(160deg, #0F1B30, #0A1322); display: grid; place-items: center; font-size: 38px; }
.genframe__core span { animation: pulse 1.8s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.12); opacity: 0.7; } }
.genbar { width: 78%; max-width: 230px; height: 5px; border-radius: 999px; background: var(--surface-3); margin-top: 26px; overflow: hidden; }
.genbar__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; transition: width .4s var(--ease); }
.genbar__fill.is-indet { width: 38%; transition: none; animation: indet 1.2s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-130%); } to { transform: translateX(330%); } }
.genstage__title { font-family: var(--ff-display); font-weight: 700; font-size: 19px; margin-top: 22px; }
.genstage__sub { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }

/* ════════════════════ RESULT ════════════════════ */
.result { }
.result__art { position: relative; height: 160px; max-width: 100%; aspect-ratio: var(--ar, 1/1); margin-inline: auto; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-strong); display: grid; place-items: center; cursor: pointer; }
.result__art .rs-bg { position: absolute; inset: 0; }
.result__art .rs-emoji { position: relative; font-size: 58px; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5)); }
.result__art .rs-type { position: absolute; top: 12px; left: 12px; }
.result__art .rs-prompt { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 13px; font-size: 12px; color: var(--ink); background: linear-gradient(0deg, rgba(6,10,22,0.85), transparent); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.result__done { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding: 13px 15px; border-radius: var(--r-md); background: rgba(94,224,138,0.10); border: 1px solid rgba(94,224,138,0.25); }
.result__done__ico { color: var(--good); font-size: 18px; }
.result__done__t { font-size: 13.5px; }
.result__done__t b { color: var(--good); }

/* real media from producer_st */
.rs-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #070D18; }
.rs-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(7,19,37,0.55); color: #fff; font-size: 17px; padding-left: 3px; pointer-events: none; border: 1px solid rgba(255,255,255,0.25); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.rs-audio { width: 100%; margin-top: 14px; }
.rs-dl { display: inline-block; margin-top: 14px; color: var(--accent-2); font-weight: 700; font-size: 13px; text-decoration: none; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(116,205,255,0.32); background: rgba(116,205,255,0.08); }
.rs-dl:hover { background: rgba(116,205,255,0.14); }
.rs-dl[hidden] { display: none; }
/* download / share action row on the result screen */
.rs-actions { display: flex; gap: 9px; margin-top: 16px; }
.rs-actions .btn { flex: 1; }

/* ════════════════════ INFO / LEGAL ════════════════════ */
.infostub { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.infostub__ico { font-size: 30px; margin-bottom: 12px; }
.linkcard { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 15px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); transition: background .2s, transform .14s; }
.linkcard:hover { background: var(--surface-2); }
.linkcard:active { transform: scale(0.99); }
.linkcard__ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; background: var(--surface-3); }
.linkcard__main { flex: 1; min-width: 0; }
.linkcard__t { font-weight: 700; font-size: 14px; }
.linkcard__s { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkcard__ext { color: var(--ink-faint); }
.linkcard__ext svg { width: 16px; height: 16px; }

/* ════════════════════ REF UPLOAD ════════════════════ */
.refdrop {
  display: block;
  border: 1.5px dashed rgba(116,205,255,0.5); border-radius: var(--r-lg);
  padding: 32px 16px; text-align: center; cursor: pointer;
  background: linear-gradient(135deg, rgba(116,205,255,0.12), rgba(63,184,255,0.04));
  box-shadow: 0 8px 24px -16px var(--accent-glow);
  transition: border-color .2s, background .2s, transform .12s;
}
.refdrop:hover { border-color: rgba(116,205,255,0.8); background: linear-gradient(135deg, rgba(116,205,255,0.18), rgba(63,184,255,0.06)); }
.refdrop:active { transform: scale(0.99); }
/* The native file input must never render (a stray dark block was covering
   the dropzone). Force-hide it regardless of the `hidden` attribute. */
#refInput { display: none !important; }
.refdrop__ico { font-size: 36px; margin-bottom: 10px; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); }
.refdrop__t { font-weight: 700; font-size: 15px; color: var(--ink); }
.refdrop__s { font-size: 12px; color: var(--ink-dim); margin-top: 5px; }
.refthm { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.refthm__t { aspect-ratio: 1; border-radius: 10px; overflow: hidden; position: relative; background: var(--surface-3); }
.refthm__t img { width: 100%; height: 100%; object-fit: cover; }
.refthm__del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; display: grid; place-items: center; font-size: 13px; line-height: 1; }
.reftab { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px 2px; }
.reftab::-webkit-scrollbar { display: none; }
.reftab__t { flex: 0 0 auto; padding: 9px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-dim); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.reftab__t.is-active { color: var(--accent-2); border-color: rgba(116,205,255,0.5); background: rgba(116,205,255,0.10); }
.reftab__count { font-family: var(--ff-mono); font-size: 11px; opacity: 0.7; margin-left: 4px; }

/* ════════════════════ AUTH / LOGIN ════════════════════ */
.mark--xl { width: 64px; height: 64px; border-radius: 20px; font-size: 32px; margin: 0 auto; box-shadow: 0 14px 36px -12px var(--accent-glow); }
.login-code {
  display: inline-block; margin-top: 18px; padding: 14px 24px 14px 30px; border-radius: var(--r-md);
  font-family: var(--ff-mono); font-weight: 700; font-size: 32px; letter-spacing: 0.34em;
  color: var(--gold); background: linear-gradient(135deg, rgba(143,208,255,0.12), rgba(63,184,255,0.06));
  border: 1px solid rgba(143,208,255,0.3);
}
.cmdline { display: flex; align-items: center; gap: 10px; }
.cmdline__code { flex: 1 1 auto; min-width: 0; font-family: var(--ff-mono); font-size: 13.5px; font-weight: 600; color: var(--ink); background: var(--surface-3); padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.cmdline__code::-webkit-scrollbar { display: none; }

/* ════════════════════ DURATION SLIDER ════════════════════ */
.row--slider { margin-bottom: 2px; }
.slider-wrap { padding: 4px 4px 2px; }
.slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) var(--p, 50%), var(--surface-3) var(--p, 50%), var(--surface-3) 100%);
  outline: none; cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); border: 2px solid var(--on-accent);
  box-shadow: 0 4px 12px -4px var(--accent-glow); cursor: pointer;
}
.slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--on-accent);
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); cursor: pointer;
}
.slider-edges { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--ff-mono); font-size: 10.5px; color: var(--ink-faint); }

/* ════════════════════ DOCK ════════════════════ */
.dock {
  flex: 0 0 auto; padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(7,12,22,0.85) 30%);
  position: relative; z-index: 12;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.dock[hidden] { display: none; }
.dock__row { display: flex; gap: 9px; }
.dock__row .btn { flex: 1; }
.dock__hint { text-align: center; font-size: 11px; color: var(--ink-faint); margin-top: 8px; }

/* home indicator */
.home-indicator { flex: 0 0 auto; height: 22px; display: grid; place-items: center; }
.home-indicator::after { content: ""; width: 130px; height: 5px; border-radius: 999px; background: var(--ink); opacity: 0.5; }

/* ════════════════════ SHEET ════════════════════ */
.sheet-veil { position: fixed; inset: 0; z-index: 80; background: rgba(5,8,16,0.6); backdrop-filter: blur(3px); opacity: 0; transition: opacity .28s; }
.sheet-veil[hidden] { display: none; }
.sheet-veil.is-shown { opacity: 1; }
.sheet {
  position: fixed; z-index: 81; left: 50%; bottom: 0; transform: translate(-50%, 100%);
  width: min(100vw, 420px);
  max-height: 82dvh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #16243E, #0E1A2E);
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--line-strong); border-bottom: none;
  box-shadow: 0 -20px 60px -10px rgba(0,0,0,0.7);
  transition: transform .36s var(--ease-out); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet[hidden] { display: flex; }
.sheet.is-shown { transform: translate(-50%, 0); }
.sheet__grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 10px auto 4px; flex: 0 0 auto; }
.sheet__head { padding: 8px 20px 12px; flex: 0 0 auto; border-bottom: 1px solid var(--line); }
.sheet__head .h2 { font-size: 17px; }
.sheet__head .cap { margin-top: 3px; }
.sheet__body { padding: 16px 20px 24px; overflow-y: auto; scrollbar-width: none; }
.sheet__body::-webkit-scrollbar { display: none; }
.sheet__close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-dim); }
.sheet__close svg { width: 16px; height: 16px; }

.sheet__list { display: flex; flex-direction: column; gap: 8px; }
.sheetopt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 15px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  transition: background .18s, transform .14s, border-color .18s;
}
.sheetopt:hover { background: var(--surface-2); }
.sheetopt:active { transform: scale(0.98); }
.sheetopt.is-active { border-color: rgba(116,205,255,0.5); background: linear-gradient(135deg, rgba(116,205,255,0.12), rgba(63,184,255,0.03)); }
.sheetopt__main { flex: 1; min-width: 0; }
.sheetopt__t { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.sheetopt__s { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.sheetopt__check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: 0 0 auto; display: grid; place-items: center; }
.sheetopt.is-active .sheetopt__check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sheetopt__check svg { width: 13px; height: 13px; opacity: 0; transition: opacity .15s; }
.sheetopt.is-active .sheetopt__check svg { opacity: 1; }

/* ════════════════════ TOAST ════════════════════ */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 24px);
  z-index: 90; max-width: 360px; width: max-content;
  padding: 13px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: rgba(16,26,44,0.96); border: 1px solid var(--line-strong); color: var(--ink);
  box-shadow: var(--shadow-2); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .3s var(--ease-out);
  display: flex; align-items: center; gap: 9px;
}
.toast[hidden] { display: none; }
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.toast--bad { border-color: rgba(255,98,89,0.4); }
.toast--bad .toast__ico { color: var(--bad); }
.toast--good { border-color: rgba(94,224,138,0.4); }
.toast--good .toast__ico { color: var(--good); }
.toast__ico { font-size: 16px; }

/* ════════════════════ LIGHTBOX (full-size result preview) ════════════════════ */
.lightbox {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(5, 8, 16, 0.94); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 18px 24px;
  opacity: 0; transition: opacity .22s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-shown { opacity: 1; }
.lightbox__close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); z-index: 2; }
.lightbox__close:active { transform: scale(0.92); }
.lightbox__close svg { width: 18px; height: 18px; }
.lightbox__body { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 540px; display: flex; align-items: center; justify-content: center; }
.lb-media { max-width: 100%; max-height: 100%; border-radius: var(--r-md); object-fit: contain; box-shadow: var(--shadow-2); }
.lb-audiowrap { text-align: center; }
.lb-audiowrap .lb-emoji { font-size: 72px; margin-bottom: 18px; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5)); }
.lb-audio { width: min(420px, 100%); }
.lb-empty { text-align: center; color: var(--ink-faint); }
.lb-empty .lb-emoji { font-size: 64px; margin-bottom: 12px; opacity: 0.6; }
.lightbox__bar { flex: 0 0 auto; width: 100%; max-width: 540px; margin-top: 18px; text-align: center; }
.lb-prompt { font-size: 13.5px; color: var(--ink-dim); line-height: 1.45; margin-bottom: 6px; }
.lb-meta { font-size: 11.5px; color: var(--ink-faint); margin-bottom: 14px; }

/* spinner (used inside buttons during async ops) */
.loader {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(7, 19, 37, 0.3); border-top-color: var(--on-accent);
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* ════════════════════ UTIL ════════════════════ */
.spacer { flex: 1; }
.muted { color: var(--ink-faint); }
.tcenter { text-align: center; }
.row-gap-sm > * + * { margin-top: 8px; }
.row-gap > * + * { margin-top: 11px; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.kbd { font-family: var(--ff-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim); }

/* hide caret flicker on long press */
* { -webkit-tap-highlight-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .screen > * { animation: none; opacity: 1; transform: none; }
  .glow { animation: none; }
}

/* ── Subscriptions (#11) ─────────────────────────────────────── */
.tariff--sub { border-color: rgba(143,208,255,0.40); background: linear-gradient(135deg, rgba(143,208,255,0.12), rgba(63,184,255,0.03)); box-shadow: 0 12px 34px -18px rgba(143,208,255,0.55); }
.tariff--sub .tariff__ribbon { color: var(--gold); }
.subbadge { padding: 16px; }
.subbadge__head { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--good); display: flex; align-items: center; gap: 8px; }
.subbadge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(94,224,138,0.18); }

/* ── Share banner (#12) ──────────────────────────────────────── */
.share-banner { padding: 14px; }
.share-banner__head { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 10px; }
.share-banner__media { width: 100%; max-height: 56vh; object-fit: contain; border-radius: var(--r-md); display: block; background: #000; }
.share-banner__media:not([controls]) { max-height: 40vh; }

/* ── TOPUP: term picker + disabled packs ─────────────────────── */
.termrow { display: flex; gap: 8px; margin-top: 12px; }
.termbtn { flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding: 10px 11px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-soft); cursor: pointer; transition: transform .14s var(--ease), border-color .2s, background .2s; }
.termbtn:active { transform: scale(0.97); }
.termbtn:hover { border-color: var(--line-strong); background: rgba(63,184,255,0.06); }
.termbtn__label { font-size: 11px; color: var(--ink-dim); letter-spacing: 0.02em; }
.termbtn__price { font-family: var(--ff-display); font-weight: 700; font-size: 15px; color: var(--ink); }
.tariff:disabled, .tariff[disabled] { opacity: 0.45; cursor: not-allowed; }
.tariff:disabled:active { transform: none; }

/* ── Inspiration cards (home screen) ─────────────────────────── */
.insprow { display: flex; flex-direction: column; gap: 10px; }
.insp { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .14s var(--ease), border-color .2s, background .2s; text-align: left; }
.insp:active { transform: scale(0.985); }
.insp:hover { border-color: var(--line-strong); background: rgba(63,184,255,0.05); }
.insp__emoji { font-size: 24px; line-height: 1; }
.insp__body { flex: 1; min-width: 0; }
.insp__title { font-family: var(--ff-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.insp__type { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.insp__arrow { color: var(--ink-faint); display: grid; place-items: center; }
.insp__arrow svg { width: 18px; height: 18px; }
