/* ==========================================================================
   TalexLead AI Studio 5.0 — "Crystal Studio" design system
   Palette: Crystal Porcelain · Sapphire Blue · Violet & Rose Aurora
   ========================================================================== */

:root {
  --sky-700: #1D4ED8;
  --sky-600: #2563EB;
  --sky-500: #3E9BFF;
  --sky-400: #60A5FA;
  --sky-200: #BFDBFE;
  --sky-100: #EFF6FF;
  --pink-600: #E11D48;
  --pink-500: #FF5C9A;
  --pink-400: #FB7185;
  --pink-200: #FECDD3;
  --pink-100: #FFF1F2;
  --sand-50: #FCF8F2;
  --sand-100: #EEF2F8;
  --sand-200: #E2E8F0;
  --sand-300: #CBD5E1;
  --sand-400: #94A3B8;
  --sand-500: #64748B;
  --sand-700: #334155;
  --sand-900: #0F172A;

  --grad-brand: linear-gradient(120deg, #2563EB 0%, #7C3AED 52%, #F43F5E 100%);
  --grad-brand-soft: linear-gradient(120deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.08) 52%, rgba(244, 63, 94, 0.08) 100%);
  --grad-sand: linear-gradient(160deg, #FFFFFF 0%, #F4F7FC 58%, #EAF0FA 100%);

  --bg: #F6F9FC;
  --bg-2: #E6EDF7;
  --surface: #FFFFFF;
  --surface-2: #EDF2FA;
  --surface-glass: rgba(255, 255, 255, 0.92);
  --line: rgba(15, 23, 42, 0.16);
  --line-strong: rgba(37, 99, 235, 0.36);
  --ink: #0B1120;
  --ink-2: #1E293B;
  --muted: #475569;
  --on-brand: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.14), 0 6px 20px rgba(15, 23, 42, 0.07);
  --shadow-glow: 0 10px 32px rgba(37, 99, 235, 0.30), 0 6px 20px rgba(124, 58, 237, 0.24);

  --radius-xs: 8px;
  --radius-sm: 14px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --nav-h: 64px;
  --composer-h: 0px;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}

[data-theme="night"] {
  --bg: #080C16;
  --bg-2: #10182B;
  --surface: #152038;
  --surface-2: #1C2B4B;
  --surface-glass: rgba(11, 17, 32, 0.92);
  --line: rgba(148, 163, 184, 0.24);
  --line-strong: rgba(96, 165, 250, 0.46);
  --ink: #F8FAFC;
  --ink-2: #E2E8F0;
  --muted: #94A3B8;
  --grad-brand-soft: linear-gradient(120deg, rgba(37, 99, 235, .22) 0%, rgba(124, 58, 237, .20) 52%, rgba(244, 63, 94, .18) 100%);
  --grad-sand: linear-gradient(160deg, #152038 0%, #0F172A 100%);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.45);
  --shadow-md: 0 14px 36px rgba(0,0,0,.52);
  --shadow-lg: 0 30px 80px rgba(0,0,0,.68);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
button svg, a svg, .icon-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.mini-btn svg { width: 15px; height: 15px; }
.btn-lg svg { width: 20px; height: 20px; }
:focus-visible { outline: 2.5px solid var(--sky-500); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--pink-200); color: var(--ink); }

/* Ambient background: luminous sapphire, violet & rose crystal aurora */
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(58vw 46vh at 10% -6%, rgba(37, 99, 235, 0.13), transparent 62%),
    radial-gradient(52vw 42vh at 96% -2%, rgba(124, 58, 237, 0.11), transparent 60%),
    radial-gradient(64vw 52vh at 50% 108%, rgba(244, 63, 94, 0.07), transparent 65%),
    var(--bg);
}
[data-theme="night"] .ambient {
  background:
    radial-gradient(58vw 46vh at 10% -6%, rgba(37, 99, 235, 0.22), transparent 62%),
    radial-gradient(52vw 42vh at 96% -2%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(64vw 52vh at 50% 108%, rgba(244, 63, 94, 0.11), transparent 65%),
    var(--bg);
}
.ambient::after { display: none; }

/* ── Top navigation ─────────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 50;
  min-height: var(--nav-h);
  height: auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px clamp(12px, 2vw, 26px);
  padding-top: calc(8px + env(safe-area-inset-top));
  background: var(--surface-glass);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { order: 1; display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; position: relative;
  background: var(--grad-brand); box-shadow: var(--shadow-glow);
  display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.brand-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 8px; border: 1px solid rgba(255,255,255,.45); }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; white-space: nowrap; }
.brand-name em { font-style: normal; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-tabs {
  order: 2;
  display: flex; align-items: center; justify-content: center;
  gap: 3px; flex: 1 1 auto; min-width: 0; max-width: 100%;
  padding: 0 6px; scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  position: relative; border: 0; background: none; text-decoration: none;
  padding: 7px 10px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; flex-shrink: 0;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-tab:hover { background: var(--bg-2); color: var(--ink); }
.nav-tab.is-active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.nav-tab .tab-new { font-size: 9px; font-weight: 800; letter-spacing: .06em; margin-left: 5px; padding: 2px 5px; border-radius: 6px; background: var(--pink-500); color: #fff; vertical-align: 2px; }

.nav-actions { order: 3; display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-inline-start: auto; }
.credits-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 5px 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow-sm); white-space: nowrap; flex-shrink: 0;
}
.credits-pill .coin { width: 17px; height: 17px; border-radius: 50%; background: var(--grad-brand); box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); flex-shrink: 0; }
.credits-pill .plus { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--grad-brand); color: #fff; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); font-size: 12.5px; font-weight: 800; color: var(--ink-2); flex-shrink: 0;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; background: var(--grad-brand) border-box; padding: 0; overflow: hidden; color: #fff; font-weight: 800; flex-shrink: 0; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.topnav .btn-sm { min-height: 36px; height: 36px; padding: 0 13px; font-size: 13.5px; flex-shrink: 0; }

.mode-banner {
  display: block;
  padding: 7px 16px; font-size: 13px; font-weight: 600; text-align: center;
  background: var(--grad-brand-soft); border-bottom: 1px solid var(--line); color: var(--ink-2);
}
.mode-banner b { color: var(--ink); }

/* ── Buttons & inputs ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  background-origin: border-box; background-clip: border-box;
  font-weight: 700; font-size: 15px; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap;
  max-width: 100%; box-sizing: border-box;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  border: 0;
  background: var(--grad-brand);
  background-origin: border-box;
  background-clip: border-box;
  color: var(--on-brand);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 14px 40px rgba(62,155,255,.36), 0 8px 26px rgba(255,92,154,.3); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-sand { background: var(--sand-200); color: var(--sand-900); }
[data-theme="night"] .btn-sand { background: rgba(224,203,169,.16); color: var(--sand-100); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn .cost { padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.22); font-size: 12px; }

.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); font-size: 16px; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--sky-400); box-shadow: 0 0 0 4px rgba(62,155,255,.14); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'><path d='M1 1.5l5 5 5-5' stroke='%2385798A' stroke-width='1.6' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.is-active { border-color: transparent; background: var(--ink); color: var(--bg); }
[data-theme="night"] .chip.is-active { background: var(--sand-100); color: #1A1420; }
.chip .ratio-ico { display: inline-block; border: 1.6px solid currentColor; border-radius: 3px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.badge-sky { background: var(--sky-100); color: var(--sky-700); }
.badge-pink { background: var(--pink-100); color: var(--pink-600); }
.badge-sand { background: var(--sand-200); color: var(--sand-700); }
[data-theme="night"] .badge-sky { background: rgba(62,155,255,.18); color: var(--sky-400); }
[data-theme="night"] .badge-pink { background: rgba(255,92,154,.18); color: var(--pink-400); }
[data-theme="night"] .badge-sand { background: rgba(224,203,169,.16); color: var(--sand-300); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app-main { min-height: calc(100vh - var(--nav-h)); }
.view { animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.container { width: min(1360px, 100%); margin: 0 auto; padding: 0 clamp(14px, 3vw, 32px); }
.section { padding: clamp(36px, 6vw, 72px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 3vw, 34px); letter-spacing: -.02em; line-height: 1.12; margin: 0; }
.section-title .serif { font-family: var(--font-serif); font-style: italic; font-weight: 600; font-size: 1.15em; }
.section-sub { color: var(--muted); margin: 6px 0 0; max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--sand-700); }
[data-theme="night"] .eyebrow { color: var(--sand-300); }
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--grad-brand); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(28px, 5vw, 56px) 0 clamp(24px, 4vw, 40px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(22px, 4vw, 56px); align-items: center; }
.hero h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.035em; line-height: 1.02;
  font-size: clamp(36px, 6.2vw, 78px); margin: 14px 0 18px;
}
.hero h1 .grad { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .serif { font-family: var(--font-serif); font-style: italic; font-weight: 600; letter-spacing: -.01em; font-size: 1.12em; color: var(--sand-700); }
[data-theme="night"] .hero h1 .serif { color: var(--sand-300); }
.hero-lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 560px; margin: 0 0 26px; }
.hero-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 28px; }
.hero-stat b { display: block; font-family: var(--font-display); font-size: 24px; letter-spacing: -.02em; }
.hero-stat span { font-size: 13px; color: var(--muted); }

.hero-collage { position: relative; aspect-ratio: 1 / 1.02; }
.hero-card {
  position: absolute; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: var(--sand-200);
  border: 4px solid var(--surface);
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card.c1 { inset: 0 22% 26% 0; }
.hero-card.c2 { width: 46%; height: 52%; right: 0; top: 8%; transform: rotate(3deg); }
.hero-card.c3 { width: 50%; height: 40%; left: 12%; bottom: 0; transform: rotate(-2.5deg); }
.hero-card .tag { position: absolute; left: 12px; bottom: 12px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.88); color: #221B26; font-size: 12px; font-weight: 800; backdrop-filter: blur(8px); display: inline-flex; align-items: center; gap: 6px; }
.hero-card .tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--pink-500); box-shadow: 0 0 0 3px rgba(255,92,154,.25); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255,92,154,0); } }

/* Big prompt bar on the home hero */
.prompt-hero {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 8px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md);
  max-width: 640px;
}
.prompt-hero .seg { display: flex; gap: 4px; padding: 3px; border-radius: 14px; background: var(--bg-2); }
.prompt-hero .seg button { border: 0; background: none; padding: 8px 12px; border-radius: 11px; font-weight: 700; font-size: 13px; color: var(--muted); }
.prompt-hero .seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.prompt-hero input { border: 0; background: transparent; min-height: 44px; font-size: 16px; padding: 0 6px; min-width: 0; }
.prompt-hero input:focus { outline: none; }

/* ── Feature tiles ──────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.tile {
  position: relative; overflow: hidden; border-radius: var(--radius); min-height: 220px; border: 0; padding: 0; text-align: left;
  background: var(--sand-200); box-shadow: var(--shadow-sm); color: #fff; isolation: isolate;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s var(--ease); }
.tile:hover img { transform: scale(1.08); }
.tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(20, 14, 24, .78)); }
.tile .tile-body { position: absolute; left: 14px; right: 14px; bottom: 14px; }
.tile h3 { margin: 6px 0 2px; font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.tile p { margin: 0; font-size: 12.5px; opacity: .86; line-height: 1.35; }
.tile .badge { background: rgba(255,255,255,.9); color: #221B26; }
.tile.wide { grid-column: span 2; }

/* ── Preset (camera motion) cards ───────────────────────────────────────── */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 210px); gap: 12px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.preset-card {
  position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 3 / 4; border: 0; padding: 0; text-align: left;
  background: var(--sand-200); color: #fff; box-shadow: var(--shadow-sm); isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.preset-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.preset-card .media { position: absolute; inset: 0; overflow: hidden; z-index: -2; }
.preset-card img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 45%; }
.preset-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.12) 0%, transparent 30%, transparent 50%, rgba(18, 12, 22, .82)); }
.preset-card .pc-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 6px; }
.preset-card .pc-cost { padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.9); color: #221B26; font-size: 11px; font-weight: 800; }
.preset-card .pc-play { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.88); display: grid; place-items: center; color: #221B26; font-size: 10px; }
.preset-card .pc-body { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.preset-card .pc-title { display: block; font-weight: 800; font-size: 14px; line-height: 1.2; }
.preset-card .pc-motion { display: block; font-size: 11.5px; opacity: .82; margin-top: 3px; }
.preset-card.is-selected { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--sky-500), var(--shadow-md); }
.preset-card.is-selected .pc-play { background: var(--grad-brand); color: #fff; }
.preset-card.compact { aspect-ratio: 4 / 5; }
.preset-card.compact .pc-title { font-size: 12.5px; }

/* Camera motion simulation (CSS) — previews & demo renders */
.motion-run img, .motion-run .motion-target { animation-duration: 5.5s; animation-iteration-count: infinite; animation-timing-function: cubic-bezier(.45,.05,.35,1); animation-direction: alternate; }
.preset-card:not(.motion-run):hover img { animation-duration: 3.6s; animation-iteration-count: infinite; animation-timing-function: cubic-bezier(.45,.05,.35,1); animation-direction: alternate; }
.m-crash.motion-run img, .preset-card.m-crash:hover img { animation-name: mCrash; animation-duration: 2.4s; }
.m-orbit.motion-run img, .preset-card.m-orbit:hover img { animation-name: mOrbit; }
.m-fpv.motion-run img, .preset-card.m-fpv:hover img { animation-name: mFpv; }
.m-dollyout.motion-run img, .preset-card.m-dollyout:hover img { animation-name: mDollyOut; }
.m-crane.motion-run img, .preset-card.m-crane:hover img { animation-name: mCrane; }
.m-handheld.motion-run img, .preset-card.m-handheld:hover img { animation-name: mHandheld; animation-duration: 1.6s; }
.m-vertigo.motion-run img, .preset-card.m-vertigo:hover img { animation-name: mVertigo; }
.m-dollyback.motion-run img, .preset-card.m-dollyback:hover img { animation-name: mDollyBack; }
.m-push.motion-run img, .preset-card.m-push:hover img { animation-name: mPush; }
.m-pan.motion-run img, .preset-card.m-pan:hover img { animation-name: mPan; }
.m-static.motion-run img { animation-name: mBreathe; }
@keyframes mCrash { 0%, 20% { transform: scale(1); } 70%, 100% { transform: scale(1.55); } }
@keyframes mOrbit { 0% { transform: perspective(700px) scale(1.25) rotateY(-9deg) translateX(-4%); } 100% { transform: perspective(700px) scale(1.25) rotateY(9deg) translateX(4%); } }
@keyframes mFpv { 0% { transform: scale(1.4) translate(-5%, -6%) rotate(-4deg); } 100% { transform: scale(1.18) translate(4%, 3%) rotate(3deg); } }
@keyframes mDollyOut { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes mCrane { 0% { transform: scale(1.22) translateY(7%); } 100% { transform: scale(1.22) translateY(-7%); } }
@keyframes mHandheld { 0% { transform: scale(1.12) translate(0, 0) rotate(0); } 25% { transform: scale(1.12) translate(-.8%, .6%) rotate(-.4deg); } 50% { transform: scale(1.13) translate(.6%, -.5%) rotate(.3deg); } 75% { transform: scale(1.12) translate(-.4%, -.7%) rotate(-.2deg); } 100% { transform: scale(1.12) translate(.7%, .4%) rotate(.4deg); } }
@keyframes mVertigo { 0% { transform: scale(1); filter: none; } 100% { transform: scale(1.38); filter: blur(.4px) saturate(1.15); } }
@keyframes mDollyBack { 0% { transform: scale(1.32) translateY(-2%); } 100% { transform: scale(1.02); } }
@keyframes mPush { 0% { transform: scale(1); } 100% { transform: scale(1.18) translateY(-1.5%); } }
@keyframes mPan { 0% { transform: scale(1.25) translateX(-8%); } 100% { transform: scale(1.25) translateX(8%); } }
@keyframes mBreathe { 0% { transform: scale(1.02); } 100% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── Apps (A → B) ───────────────────────────────────────────────────────── */
.apps-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.app-card {
  display: grid; grid-template-rows: 170px auto; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm); text-align: left; padding: 0; transition: transform .3s var(--ease), box-shadow .3s;
}
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.app-card .app-media { position: relative; overflow: hidden; }
.app-card .app-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.app-card:hover .app-media img { transform: scale(1.06); }
.app-card .app-body { padding: 14px 16px 16px; }
.app-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.ab-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.ab-row .ab { padding: 8px 10px; border-radius: 12px; background: var(--bg-2); line-height: 1.3; }
.ab-row .ab b { display: block; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.ab-row .arrow { width: 26px; height: 26px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }

/* ── Masonry feed / gallery ─────────────────────────────────────────────── */
.masonry { columns: 4 240px; column-gap: 14px; }
.masonry > * { break-inside: avoid; margin-bottom: 14px; }
.feed-card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--sand-200); box-shadow: var(--shadow-sm); cursor: pointer; border: 0; padding: 0; width: 100%; display: block; text-align: left; color: #fff; }
.feed-card img { width: 100%; height: auto; transition: transform .8s var(--ease); }
.feed-card:hover img { transform: scale(1.04); }
.feed-card .fc-meta { position: absolute; inset: auto 0 0 0; padding: 30px 12px 12px; background: linear-gradient(180deg, transparent, rgba(18,12,22,.78)); font-size: 12.5px; font-weight: 600; opacity: 0; transform: translateY(6px); transition: all .3s var(--ease); }
.feed-card:hover .fc-meta, .feed-card:focus-visible .fc-meta { opacity: 1; transform: none; }

/* ── Studio workspace (create views) ────────────────────────────────────── */
.studio {
  display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 0;
  min-height: calc(100vh - var(--nav-h));
}
.studio-panel {
  position: sticky; top: var(--nav-h); align-self: start; height: calc(100vh - var(--nav-h));
  overflow-y: auto; padding: 18px 18px 120px; border-right: 1px solid var(--line); background: var(--surface-glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  scrollbar-width: thin;
}
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.panel-title h2 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.panel-block { padding: 14px 0; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.panel-block:first-of-type { border-top: 0; padding-top: 4px; }
.panel-block .label { display: flex; justify-content: space-between; align-items: center; }
.panel-block .label a, .panel-block .label button { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--sky-600); background: none; border: 0; font-weight: 700; padding: 0; }

.model-list { display: grid; gap: 6px; }
.model-opt {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left;
  padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: all .18s var(--ease);
}
.model-opt:hover { border-color: var(--line-strong); }
.model-opt.is-active { border-color: transparent; box-shadow: 0 0 0 2px var(--sky-500), var(--shadow-sm); background: linear-gradient(var(--surface), var(--surface)) padding-box; }
.model-opt .mo-name { font-weight: 800; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.model-opt .mo-cost { font-weight: 800; font-size: 13px; color: var(--sand-700); white-space: nowrap; }
[data-theme="night"] .model-opt .mo-cost { color: var(--sand-300); }
.model-opt .mo-desc { grid-column: 1 / -1; font-size: 12px; color: var(--muted); line-height: 1.35; }
.model-opt .mo-off { font-size: 10px; font-weight: 800; color: var(--muted); border: 1px dashed var(--line-strong); padding: 1px 6px; border-radius: 6px; }
.model-opt:disabled { opacity: .5; cursor: not-allowed; }
.model-opt .mo-caret { display: inline-block; margin-left: 4px; color: var(--muted); }
.model-opt[aria-expanded="true"] .mo-caret { transform: rotate(180deg); }
.model-opt + .model-list { margin-top: 6px; padding: 6px; border-radius: 16px; background: var(--bg-2); }

.dropzone {
  position: relative; display: grid; place-items: center; gap: 6px; text-align: center; min-height: 116px; padding: 14px;
  border-radius: var(--radius); border: 1.5px dashed var(--sand-400); background: var(--grad-brand-soft); color: var(--ink-2);
  cursor: pointer; transition: border-color .2s, transform .2s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--sky-500); transform: translateY(-1px); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow-sm); font-size: 18px; }
.dropzone small { color: var(--muted); font-size: 12px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--sand-200); box-shadow: var(--shadow-sm); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .thumb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(20,14,24,.72); color: #fff; font-size: 12px; display: grid; place-items: center; }
.thumb .thumb-tag { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; font-size: 9.5px; font-weight: 800; background: rgba(255,255,255,.9); color: #221B26; }
.thumb.is-uploading::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.55) linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent) -100% 0 / 60% 100% no-repeat; animation: shimmer 1.2s infinite; }
.thumb.audio { display: grid; place-items: center; font-size: 22px; background: var(--grad-brand-soft); }
@keyframes shimmer { to { background-position: 200% 0; } }

.soul-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.soul-chip { position: relative; display: grid; gap: 4px; justify-items: center; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 11px; font-weight: 800; text-align: center; }
.soul-chip img, .soul-chip .soul-ph { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--grad-brand); }
.soul-chip.is-active { box-shadow: 0 0 0 2px var(--pink-500); border-color: transparent; }
.soul-chip .soul-state { font-size: 9.5px; color: var(--muted); font-weight: 700; }

.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; accent-color: var(--sky-500); }

/* Feed of results */
.studio-feed { padding: 18px clamp(12px, 2.4vw, 28px) calc(var(--composer-h) + 40px); min-width: 0; }
.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.feed-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.result-card {
  position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; animation: viewIn .4s var(--ease);
}
.result-media { position: relative; overflow: hidden; background: var(--sand-200); cursor: zoom-in; aspect-ratio: var(--ar, 3/4); }
.result-media img, .result-media video { width: 100%; height: 100%; object-fit: cover; }
.result-media .demo-flag { position: absolute; top: 10px; left: 10px; }
.result-media .multi { position: absolute; top: 10px; right: 10px; padding: 3px 8px; border-radius: 999px; background: rgba(20,14,24,.66); color: #fff; font-size: 11px; font-weight: 800; }
.result-media audio { position: absolute; left: 10px; right: 10px; bottom: 10px; width: calc(100% - 20px); }
.result-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.result-prompt { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.result-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-btn { min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.mini-btn:hover { color: var(--ink); border-color: var(--line-strong); }

.progress-card .result-media { cursor: default; display: grid; place-items: center; background: var(--grad-brand-soft); }
.progress-orb { width: 74px; height: 74px; border-radius: 50%; background: conic-gradient(from 0deg, var(--sky-500), var(--pink-500), var(--sand-400), var(--sky-500)); animation: spin 2.2s linear infinite; position: relative; }
.progress-orb::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-text { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.progress-steps { display: flex; gap: 4px; justify-content: center; position: absolute; left: 0; right: 0; bottom: 44px; }
.progress-steps i { width: 22px; height: 4px; border-radius: 4px; background: var(--line-strong); }
.progress-steps i.on { background: var(--grad-brand); }
.failed-card .result-media { display: grid; place-items: center; background: var(--pink-100); color: var(--pink-600); font-weight: 800; padding: 16px; text-align: center; cursor: default; font-size: 13px; }
[data-theme="night"] .failed-card .result-media { background: rgba(255,92,154,.12); }

.empty-state { display: grid; place-items: center; text-align: center; gap: 10px; padding: clamp(30px, 6vw, 70px) 16px; border-radius: var(--radius-lg); border: 1.5px dashed var(--line-strong); background: var(--grad-sand); color: var(--ink-2); }
.empty-state h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.empty-state p { margin: 0; max-width: 420px; color: var(--muted); }
.empty-collage { display: flex; margin-bottom: 6px; }
.empty-collage img { width: 64px; height: 84px; object-fit: cover; border-radius: 12px; border: 3px solid var(--surface); box-shadow: var(--shadow-md); }
.empty-collage img:nth-child(1) { transform: rotate(-8deg) translateX(10px); }
.empty-collage img:nth-child(2) { transform: translateY(-6px); z-index: 1; }
.empty-collage img:nth-child(3) { transform: rotate(8deg) translateX(-10px); }

/* Composer (sticky bottom prompt bar) */
.composer {
  position: fixed; left: 360px; right: 0; bottom: 0; z-index: 40;
  padding: 12px clamp(12px, 2.4vw, 28px) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 38%);
  pointer-events: none;
}
.composer-box {
  pointer-events: auto; max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end;
  padding: 10px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.composer-box textarea { border: 0; background: transparent; resize: none; min-height: 52px; max-height: 180px; padding: 8px 10px; font-size: 16px; line-height: 1.45; width: 100%; }
.composer-box textarea:focus { outline: none; }
.composer-tools { display: flex; gap: 6px; align-items: center; padding: 0 6px 4px; flex-wrap: wrap; grid-column: 1 / -1; }
.composer-tools .chip { min-height: 30px; font-size: 12px; }
.composer-go { display: grid; gap: 6px; justify-items: end; }
.enhance-btn { border: 0; background: var(--grad-brand-soft); color: var(--ink); min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.enhance-btn .spark { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 14px; }

/* ── Story board ─────────────────────────────────────────────────────────── */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.scene-card { border-radius: 14px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; display: grid; }
.scene-card .scene-img { aspect-ratio: 9/16; background: var(--grad-brand-soft); position: relative; }
.scene-card .scene-img img { width: 100%; height: 100%; object-fit: cover; }
.scene-card .scene-n { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.9); color: #221B26; font-size: 11px; font-weight: 800; }
.scene-card .scene-body { padding: 8px 10px 10px; font-size: 12px; display: grid; gap: 4px; }
.scene-card .scene-body b { font-size: 12px; }
.scene-card textarea { min-height: 64px; font-size: 13px; padding: 8px; border-radius: 10px; }

/* ── Pricing ─────────────────────────────────────────────────────────────── */
.pricing { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.plan.featured { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad-brand) border-box; border: 2px solid transparent; box-shadow: var(--shadow-glow); }
.plan .plan-badge { position: absolute; top: -11px; left: 22px; }
.plan h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.plan .price { font-family: var(--font-display); font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.plan .price small { font-family: var(--font-ui); font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.plan .credits { font-weight: 800; color: var(--sand-700); }
[data-theme="night"] .plan .credits { color: var(--sand-300); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); flex: 1; }
.plan li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.plan li::before { content: "✦"; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 13px; }

/* ── Library ─────────────────────────────────────────────────────────────── */
.lib-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.data th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
.amount-pos { color: #1E9E6A; font-weight: 800; }
.amount-neg { color: var(--pink-600); font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.kpi b { display: block; font-family: var(--font-display); font-size: 28px; letter-spacing: -.02em; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 700; }
.kpi.live b::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 8px; border-radius: 50%; background: #2BC38A; box-shadow: 0 0 0 4px rgba(43,195,138,.2); vertical-align: 6px; animation: pulse 1.6s infinite; }

/* ── Modals ─────────────────────────────────────────────────────────────── */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: min(92vw, 520px); width: 100%; color: var(--ink); }
dialog.modal:focus, dialog.modal:focus-visible { outline: none; }
dialog.modal::backdrop { background: rgba(28, 20, 30, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.modal[open] { animation: modalIn .35s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-card { position: relative; padding: 26px; border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 16px; display: grid; place-items: center; z-index: 2; }
.modal-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; margin: 0 0 6px; letter-spacing: -.02em; }
.modal-card .sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.auth-providers { display: grid; gap: 8px; }
.auth-btn { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; text-align: left; transition: all .18s; }
.auth-btn:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.auth-btn svg { width: 22px; height: 22px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-bonus { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--grad-brand-soft); font-weight: 800; font-size: 13px; margin-bottom: 16px; }
.seg-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-2); margin-bottom: 12px; }
.seg-tabs button { flex: 1; border: 0; background: none; min-height: 36px; border-radius: 11px; font-weight: 800; font-size: 13px; color: var(--muted); }
.seg-tabs button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; gap: 10px; }
.form-error { color: var(--pink-600); font-size: 13px; font-weight: 700; min-height: 1em; }
.fine { font-size: 12px; color: var(--muted); }

dialog.viewer { max-width: min(96vw, 1180px); }
.viewer-card { display: grid; grid-template-columns: minmax(0, 1fr) 340px; padding: 0; overflow: hidden; }
.viewer-media { background: #120E16; display: grid; place-items: center; min-height: 320px; max-height: 86vh; position: relative; overflow: hidden; }
.viewer-media img, .viewer-media video { max-width: 100%; max-height: 86vh; object-fit: contain; }
.viewer-media .demo-video { width: 100%; height: 100%; min-height: 60vh; position: relative; overflow: hidden; }
.viewer-media .demo-video img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; max-height: none; }
.viewer-strip { position: absolute; bottom: 10px; left: 10px; right: 10px; display: flex; gap: 6px; justify-content: center; }
.viewer-strip button { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #000; }
.viewer-strip button.is-active { border-color: #fff; }
.viewer-strip img { width: 100%; height: 100%; object-fit: cover; }
.viewer-side { padding: 22px; display: grid; gap: 14px; align-content: start; overflow-y: auto; max-height: 86vh; }
.viewer-side .prompt-box { padding: 12px; border-radius: 14px; background: var(--bg-2); font-size: 13.5px; color: var(--ink-2); max-height: 220px; overflow-y: auto; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; font-weight: 700; }
.viewer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.demo-video-badge { position: absolute; top: 12px; left: 12px; z-index: 2; }
.demo-video-note { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.88); color: #221B26; font-size: 12px; font-weight: 700; text-align: center; }

/* Toasts */
.toasts { position: fixed; top: calc(var(--nav-h) + 12px); right: 14px; z-index: 100; display: grid; gap: 8px; width: min(380px, calc(100vw - 28px)); }
.toast { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; animation: toastIn .35s var(--ease); }
.toast .t-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 13px; background: var(--grad-brand); }
.toast.error .t-ico { background: var(--pink-600); }
.toast.success .t-ico { background: #2BC38A; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 30px 0 calc(30px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; }
.footer-grid { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--ink-2); text-decoration: none; font-weight: 700; }

/* Mobile tab bar */
.mobile-bar { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
/* Studio 4.0 switchable palettes (Sky & Blush is the house palette) */
[data-palette="obsidian_lime"] { --sky-700: #047857; --sky-600: #059669; --sky-500: #0D9488; --sky-400: #10B981; --sky-200: #A7F3D0; --sky-100: #ECFDF5; --pink-600: #0369A1; --pink-500: #0284C7; --pink-400: #38BDF8; --pink-200: #BAE6FD; --pink-100: #E0F2FE; --grad-brand: linear-gradient(125deg, #059669 0%, #0D9488 52%, #0284C7 100%); }
[data-palette="tungsten_gold"] { --sky-700: #B45309; --sky-600: #D97706; --sky-500: #EA580C; --sky-400: #F59E0B; --sky-200: #FDE68A; --sky-100: #FEF3C7; --pink-600: #BE123C; --pink-500: #E11D48; --pink-400: #FB7185; --pink-200: #FECDD3; --pink-100: #FFE4E6; --grad-brand: linear-gradient(125deg, #D97706 0%, #EA580C 52%, #E11D48 100%); }
[data-palette="vogue_neutral"] { --sky-700: #1E293B; --sky-600: #334155; --sky-500: #475569; --sky-400: #64748B; --sky-200: #CBD5E1; --sky-100: #F1F5F9; --pink-600: #4338CA; --pink-500: #4F46E5; --pink-400: #818CF8; --pink-200: #C7D2FE; --pink-100: #E0E7FF; --grad-brand: linear-gradient(125deg, #334155 0%, #475569 52%, #4F46E5 100%); }
.palette-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--grad-brand); box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }

/* Module 1 — A → B conveyor with live canvas monitor (ЗАКОН №18 ШЕФА — 100% Capsule Symmetry) */
.conveyor {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px;
  padding: 18px; border-radius: var(--radius-xl); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-md);
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; overflow: hidden;
}
.conveyor-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.conveyor-engines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.engine-btn {
  text-align: left; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface-2); display: grid; gap: 3px;
  min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; overflow: hidden;
}
.engine-btn b { font-size: 13.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.engine-btn span { font-size: 11.5px; line-height: 1.25; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.engine-btn.is-active { border-color: transparent; box-shadow: inset 0 0 0 2px var(--sky-500); background: var(--surface); }
.conveyor-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.conveyor-row .select { min-height: 40px; font-size: 13.5px; padding: 6px 28px 6px 10px; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.conveyor-form .textarea { min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
.conveyor-form .btn-block { min-width: 0; max-width: 100%; width: 100%; white-space: normal; height: auto; padding: 12px 16px; line-height: 1.25; flex-wrap: wrap; }
.monitor { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #120E16; min-height: 340px; }
.monitor canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.monitor-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; z-index: 1; }
.monitor-badges span { padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.88); color: #221B26; font-size: 11px; font-weight: 800; }
.monitor-ab { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-size: 12px; color: #221B26; }
.monitor-ab > span:not(.arrow) { padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.9); font-weight: 700; line-height: 1.3; }
.monitor-ab b { display: block; font-size: 10px; letter-spacing: .1em; color: #85798A; }
.monitor-ab .arrow { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* Module 3 — MCSLA console */
.mcsla-slots { display: grid; gap: 6px; }
.mcsla-slot { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 12px; padding: 7px 9px; border-radius: 12px; background: var(--bg-2); min-width: 0; }
.mcsla-slot b { display: grid; place-items: center; height: 22px; border-radius: 8px; background: var(--grad-brand); color: #fff; font-size: 11px; }
.mcsla-slot span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ink-2); }
.console-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.console-grid .select { min-height: 40px; font-size: 14px; padding: 6px 30px 6px 10px; }

/* Render pipeline modal */
.pipe-steps { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 8px; }
.pipe-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--bg-2); font-weight: 700; font-size: 14px; color: var(--muted); }
.pipe-steps li i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: var(--surface); border: 1px solid var(--line); font-size: 12px; }
.pipe-steps li.done { color: var(--ink); }
.pipe-steps li.done i { background: #2BC38A; color: #fff; border-color: transparent; }
.pipe-steps li.active { color: var(--ink); box-shadow: 0 0 0 2px var(--sky-500); }
.pipe-steps li.active i { background: var(--grad-brand); color: #fff; border-color: transparent; animation: pulse 1.6s infinite; }
.badge-refund { background: #DDF7EA; color: #1E9E6A; }
.soul-chip .soul-hex { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; }
@media (max-width: 920px) { .conveyor { grid-template-columns: minmax(0, 1fr); } .monitor { min-height: 300px; } }
@media (max-width: 480px) { .conveyor-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .conveyor-engines { grid-template-columns: minmax(0, 1fr); } }

.hero-card.c1 .tag { top: 14px; bottom: auto; }
@media (max-width: 1560px) {
  .nav-tab { padding: 8px 9px; font-size: 13.5px; }
}
@media (max-width: 1280px) {
  .nav-tab { padding: 7px 7px; font-size: 13px; }
  .nav-tab .tab-new { display: none; }
}
@media (max-width: 1180px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile.wide { grid-column: span 1; }
  .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio { grid-template-columns: 320px minmax(0, 1fr); }
  .composer { left: 320px; }
}
@media (max-width: 920px) {
  :root { --nav-h: 56px; }
  .mode-banner { display: none !important; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-collage { max-width: 520px; width: 100%; margin: 0 auto; }
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio-panel { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 12px 16px; overflow: visible; min-width: 0; max-width: 100%; }
  .composer { left: 0; }
  .studio-feed { padding-bottom: 170px; min-width: 0; max-width: 100%; }
  .viewer-card { grid-template-columns: minmax(0, 1fr); }
  .viewer-side { max-height: none; }
  .mobile-bar {
    display: none; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--line);
  }
  .mobile-bar button { display: grid; justify-items: center; gap: 2px; border: 0; background: none; min-height: 48px; font-size: 10.5px; font-weight: 800; color: var(--muted); border-radius: 12px; }
  .mobile-bar button svg { width: 22px; height: 22px; }
  .mobile-bar button.is-active { color: var(--ink); background: var(--bg-2); }
  .toasts { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 180px; }
  .apps-grid, .pricing { grid-template-columns: 1fr; }
  .brand-name { display: none; }
  .credits-pill { padding-left: 10px; }
  .prompt-hero { grid-template-columns: 1fr; }
  .prompt-hero .seg { justify-content: stretch; }
  .prompt-hero .seg button { flex: 1; }
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .result-actions .mini-btn span { display: none; }
  .masonry { columns: 2 140px; column-gap: 10px; }
  .masonry > * { margin-bottom: 10px; }
  .modal-card { padding: 22px 18px; border-radius: 26px; }
  .composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .composer-box { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 8px; border-radius: 20px; }
  .composer-box textarea { min-height: 44px; padding: 6px 8px; }
  .composer-go .btn { min-height: 46px; padding: 0 14px; font-size: 14px; }
  .composer-go .btn .cost { padding: 1px 6px; font-size: 11px; }
  .composer-tools { padding: 0 2px 2px; }
  .composer-tools .chip { display: none; }
  .composer-tools .enhance-btn { min-height: 28px; }
  .hero-stats { gap: 18px; }
  .viewer-actions { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .results { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .nav-actions { gap: 5px; }
  .icon-btn { width: 34px; height: 34px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .composer { position: static; }
  .studio-feed { padding-bottom: 30px; }
}

/* ── About, AI Matrix, FAQ & Legal Compliance Suite ────────────────────── */
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.info-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.info-card { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.info-card h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.info-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.info-card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.faq-list { display: grid; gap: 10px; }
.faq-item { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; padding: 16px 20px; font-weight: 800; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; width: 26px; height: 26px; border-radius: 50%; background: var(--grad-brand-soft); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; background: var(--grad-brand); color: #fff; }
.faq-item .faq-body { padding: 0 20px 18px; font-size: 14px; line-height: 1.6; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 14px; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.footer-lang-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── 5-Language Switcher (AZ · RU · EN · TR · AR) ──────────────────────── */
.lang-wrap { position: relative; }
.lang-btn { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.lang-popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 80;
  min-width: 170px; padding: 6px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); display: grid; gap: 3px;
}
[dir="rtl"] .lang-popover { right: auto; left: 0; }
.lang-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 12px; border: 0; background: transparent;
  font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: left;
}
.lang-opt b { font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--bg-2); color: var(--ink); }
.lang-opt:hover { background: var(--bg-2); color: var(--ink); }
.lang-opt.is-active { background: var(--grad-brand-soft); color: var(--ink); }
.lang-opt.is-active b { background: var(--grad-brand); color: #fff; }

/* ── Omnilingual AI Director & MCP/MDS Agent ───────────────────────────── */
.agent-nav-btn { gap: 6px; font-weight: 800; }
.agent-nav-btn .spark { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 14px; }
dialog.agent-modal { max-width: min(94vw, 680px); }
.agent-card { display: flex; flex-direction: column; gap: 10px; max-height: 88vh; }
.agent-status-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.agent-chips { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.agent-chips::-webkit-scrollbar { display: none; }
.agent-chips .chip { flex-shrink: 0; font-size: 12px; min-height: 30px; }
.agent-messages {
  flex: 1; min-height: 240px; max-height: 44vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line);
}
.agent-msg {
  padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); display: grid; gap: 6px; font-size: 13.5px; line-height: 1.5;
}
.agent-msg.is-user { background: var(--grad-brand-soft); align-self: flex-end; max-width: 90%; }
.agent-msg.is-assistant { align-self: flex-start; max-width: 96%; }
.agent-msg-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.agent-msg-body { white-space: pre-wrap; color: var(--ink); }
.agent-mcsla {
  margin-top: 4px; padding: 10px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-strong);
  display: grid; gap: 6px; font-size: 12px;
}
.agent-mcsla-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; color: var(--sand-700); }
[data-theme="night"] .agent-mcsla-head { color: var(--sand-300); }
.agent-mcsla code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); }
.agent-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.agent-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 4px; }

.agent-fab {
  position: fixed; right: 20px; bottom: 22px; z-index: 44;
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 16px 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35);
  background: var(--grad-brand); color: #fff; font-weight: 800; font-size: 13.5px;
  box-shadow: var(--shadow-glow), var(--shadow-md);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
[dir="rtl"] .agent-fab { right: auto; left: 20px; }
.agent-fab:hover { transform: translateY(-2px) scale(1.02); }
.agent-fab-orb {
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: grid; place-items: center; font-size: 14px;
}

/* ── RTL Support for Arabic (ar) ───────────────────────────────────────── */
[dir="rtl"] .eyebrow::before { order: 2; }
[dir="rtl"] .info-card ul { padding-left: 0; padding-right: 18px; }
[dir="rtl"] .modal-close { right: auto; left: 14px; }
[dir="rtl"] .select { background-position: left 14px center; padding-right: 14px; padding-left: 36px; }
[dir="rtl"] table.data th { text-align: right; }

/* ── Mobile Collapsible Panel Toggle (hidden on desktop) ───────────────── */
.mobile-panel-toggle { display: none; }
.studio-panel-body { display: contents; }

/* ── Full Mobile & Touch Optimization (<= 920px, <= 768px, <= 640px) ───── */
@media (max-width: 920px) {
  .info-grid, .info-grid-2 { grid-template-columns: 1fr; }
  .mobile-panel-toggle { display: inline-flex; min-height: 32px; padding: 0 12px; font-size: 12px; }
  .studio-panel-body { display: block; }
  .studio.is-panel-collapsed .studio-panel-body { display: none; }
  .studio.is-panel-collapsed .panel-title { margin-bottom: 0; }
  .nav-tabs, .rail, .table-wrap, .lib-tabs { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 768px) {
  .mobile-bar {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(58px + env(safe-area-inset-bottom));
  }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .composer {
    bottom: calc(58px + env(safe-area-inset-bottom));
    padding: 8px 10px 10px;
  }
  .studio-feed {
    padding-bottom: calc(var(--composer-h, 110px) + 84px + env(safe-area-inset-bottom));
  }
  .agent-fab {
    bottom: calc(var(--composer-h, 0px) + 70px + env(safe-area-inset-bottom));
    right: 12px;
    height: 42px;
    padding: 0 13px 0 10px;
    font-size: 12.5px;
  }
  [dir="rtl"] .agent-fab { right: auto; left: 12px; }
  .toasts {
    bottom: calc(var(--composer-h, 0px) + 122px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  .brand-mark { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
  .nav-actions { gap: 4px; }
  .agent-nav-btn span:not(.spark) { display: none; }
  .agent-nav-btn { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%; }
  .icon-btn, .avatar-btn { width: 32px; height: 32px; font-size: 11.5px; }
  .credits-pill { height: 32px; font-size: 12px; padding: 0 4px 0 8px; gap: 5px; }
  .credits-pill .coin { width: 14px; height: 14px; }
  .credits-pill .plus { width: 23px; height: 23px; font-size: 13px; }
  #auth-btn, #signin-btn { min-height: 32px; height: 32px; padding: 0 12px; font-size: 12.5px; }
  .hero { padding: 14px 0 14px; }
  .hero h1 { font-size: clamp(26px, 7.8vw, 38px); margin: 8px 0 10px; }
  .hero-lead { font-size: 14.5px; margin-bottom: 16px; }
  .hero-collage { aspect-ratio: 16 / 11; max-height: 240px; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rail { grid-auto-columns: minmax(150px, 172px); gap: 10px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 22px; }
  .monitor { min-height: 250px; }
  .monitor-ab { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .monitor-ab .arrow { display: none; }
  .conveyor { padding: 12px; border-radius: 20px; gap: 12px; }
  .conveyor-row { grid-template-columns: minmax(0, 1fr); }
  .info-card { padding: 16px; border-radius: 20px; }
  .faq-item summary { padding: 14px 16px; font-size: 14px; }
  .faq-item .faq-body { padding: 12px 16px 14px; font-size: 13.5px; }
  dialog.modal {
    max-width: 100vw; width: 100vw; margin: auto 0 0 0;
  }
  .modal-card {
    border-radius: 26px 26px 0 0;
    max-height: 90vh;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .agent-messages { max-height: 40vh; min-height: 190px; }
  .agent-fab-text { display: none; }
  .agent-fab { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
}

@media (max-width: 420px) {
  .console-grid { grid-template-columns: minmax(0, 1fr); }
  .ab-row { grid-template-columns: minmax(0, 1fr); }
  .ab-row .arrow { display: none; }
}

/* ── ЗАКОН №18 ШЕФА: Global Capsule Symmetry, Exact Cost Receipt & Syntx-Killer Pricing ── */
html, body { max-width: 100vw; overflow-x: clip; }
.chip, .badge, .mini-btn, .credits-pill, .nav-tab {
  background-origin: border-box;
  background-clip: border-box;
  box-sizing: border-box;
  max-width: 100%;
}
.cost-receipt-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--grad-brand-soft); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 700; color: var(--ink-2);
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.cost-receipt-pill b { color: var(--ink); font-weight: 800; }

/* Syntx-Killer Market Plans Grid */
.pricing-market {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.pricing-packs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.market-plan {
  padding: 22px 20px;
  gap: 12px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.market-plan:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.market-plan .plan-head h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.crown-plan {
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(125deg, #FF5C9A 0%, #E0A100 50%, #3E9BFF 100%) border-box;
  border: 2px solid transparent;
  box-shadow: var(--shadow-glow);
}
.badge-crown {
  background: linear-gradient(115deg, #221B26 0%, #E0A100 100%);
  color: #fff;
  padding: 4px 10px;
  font-size: 11px;
}
.token-toggle-bar {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
}
.token-toggle-bar span {
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.token-toggle-bar .tok-zero {
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.token-toggle-bar .tok-active {
  background: var(--grad-brand);
  color: #fff;
}
.plan-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  font-weight: 600;
}
.plan-price-box {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 2px;
}
.plan-price-box .old-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
}
.plan-price-box .vs-syntx {
  font-size: 11.5px;
  font-weight: 700;
  color: #1E9E6A;
}
.enterprise-plan {
  background: linear-gradient(145deg, var(--surface) 0%, var(--grad-brand-soft) 100%);
}
.enterprise-actions {
  margin-top: auto;
  display: grid;
  gap: 8px;
}
@media (max-width: 1180px) {
  .pricing-market { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pricing-market, .pricing-packs { grid-template-columns: minmax(0, 1fr); }
  .cost-receipt-pill { display: none; }
}

/* 48-Model AI Hub Showcase Grid */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.hub-card {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.hub-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.hub-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
}
.hub-price-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.hub-desc {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  flex: 1;
}
.hub-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
@media (max-width: 1180px) {
  .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hub-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Compact Top Navigation & "More" Dropdown (Clean Zero-Collision Header Architecture) */
.nav-tabs { overflow: visible; flex-wrap: wrap; gap: 3px; min-width: 0; max-width: 100%; justify-content: center; }
.nav-more { position: relative; display: inline-flex; flex-shrink: 0; }
.nav-more > summary { list-style: none; cursor: pointer; user-select: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more-menu {
  position: absolute; top: calc(100% + 8px); right: 0; left: auto; z-index: 95;
  min-width: 340px; max-width: min(420px, calc(100vw - 24px)); padding: 8px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
}
[dir="rtl"] .nav-more-menu { left: 0; right: auto; }
.nav-more-menu .nav-tab {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 9px 12px; border-radius: 12px; text-align: start;
}
@media (max-width: 1620px) {
  .topnav {
    flex-wrap: wrap;
    min-height: 0;
    height: auto;
    gap: 6px 12px;
    padding: calc(8px + env(safe-area-inset-top)) clamp(14px, 2vw, 24px) 8px;
  }
  .brand { order: 1; height: 36px; }
  .nav-actions { order: 2; margin-inline-start: auto; gap: 6px; }
  .nav-tabs {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
    margin: 2px 0 0;
    padding: 6px 2px 0;
    gap: 4px 6px;
    border-top: 1px solid var(--line);
  }
  .nav-tab { padding: 6px 11px; font-size: 13px; flex-shrink: 0; }
}
@media (max-width: 900px) {
  .nav-more { position: static; }
  .nav-more-menu {
    position: fixed; top: calc(96px + env(safe-area-inset-top)); left: 16px; right: 16px;
    min-width: 0; max-width: calc(100vw - 32px); grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact Hero Deck: System <-> AI Live Formula Console (v5.1.0) */
.hero { padding: clamp(18px, 3vw, 32px) 0 clamp(14px, 2vw, 24px); }
.hero h1 { font-size: clamp(30px, 4.4vw, 54px); margin: 10px 0 12px; }
.hero-lead { font-size: 15px; margin-bottom: 18px; }
.tile { min-height: 138px; }
.sys-ai-deck {
  padding: 20px; border-radius: var(--radius-xl);
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg); display: grid; gap: 14px;
  min-width: 0; max-width: 100%; box-sizing: border-box;
}
.sys-deck-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sys-deck-head h3 { margin: 4px 0 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.sys-deck-block { display: grid; gap: 6px; }
.sys-deck-block .chips { gap: 5px; }
.sys-deck-block .chip { min-height: 30px; padding: 0 10px; font-size: 12px; }
.sys-formula-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  padding: 12px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line);
}
.sys-stat { display: grid; gap: 2px; min-width: 0; }
.sys-stat span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sys-stat b { font-size: 14px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sys-stat small { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grad-txt { font-style: normal; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sys-deck-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sys-deck-actions .btn { flex: 1; min-width: 160px; }
.nav-more-menu { min-width: 340px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .sys-formula-grid { grid-template-columns: minmax(0, 1fr); }
  .nav-more-menu { min-width: 0; }
}

/* ==========================================================================
   Compact Smart Studio Dock & Visual Quick-Start Deck (v5.2 Home Redesign)
   ========================================================================== */
.hero.hero-compact {
  padding: clamp(14px, 2.2vw, 24px) 0 clamp(10px, 1.8vw, 18px);
}
.hero-compact .hero-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(16px, 2.4vw, 28px);
  align-items: stretch;
}
.smart-dock {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.smart-dock-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-compact h1 {
  font-size: clamp(24px, 3.2vw, 40px);
  line-height: 1.08;
  margin: 0;
}
.hero-compact .hero-lead {
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  max-width: 640px;
}

/* Unified 6-Mode Smart Prompt Dock */
.prompt-hero.smart-prompt-dock {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  max-width: 100%;
  box-sizing: border-box;
}
.smart-mode-tabs {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border-radius: 16px;
  background: var(--bg-2);
}
.smart-mode-tabs button {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.smart-mode-tabs .mode-lbl {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.smart-mode-tabs .mode-cost {
  font-size: 10px;
  opacity: 0.72;
  font-weight: 800;
  flex-shrink: 0;
}
.smart-prompt-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-width: 0;
}
.hero-photo-btn {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  gap: 6px;
}
.hero-attached-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-attached-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--grad-brand-soft);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.hero-attached-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.hero-attached-pill button {
  border: 0;
  background: var(--surface);
  color: var(--ink-2);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.smart-prompt-row input,
.smart-prompt-row textarea.hero-prompt-ta {
  width: 100%;
  min-height: 44px;
  max-height: 92px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.35;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 6px 6px;
  min-width: 0;
  resize: none;
  outline: none;
  scrollbar-width: none;
}
.smart-prompt-row textarea.hero-prompt-ta::-webkit-scrollbar {
  display: none;
}
.smart-ideas-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip.chip-xs {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11.5px;
}

/* Compact 9-Tool Bento Grid */
.quick-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 921px) and (max-width: 1280px) {
  .quick-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-tools-grid .quick-tool-pill:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
.quick-tool-pill {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.quick-tool-pill:hover {
  transform: translateY(-2px);
  border-color: var(--sky-400);
  box-shadow: var(--shadow-md);
}
.quick-tool-pill .qt-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--grad-brand-soft);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.quick-tool-pill .qt-text {
  display: grid;
  min-width: 0;
}
.quick-tool-pill .qt-text b {
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-tool-pill .qt-text small {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Visual Interactive Side-by-Side Stage inside Hero (#system-ai-deck) */
.sys-preview-card {
  position: relative;
  height: auto;
  border-radius: 20px;
  padding: 10px;
  background: var(--bg-2);
  border: 1.5px solid var(--line-strong);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.sys-stage-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.sys-stage-slot {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 268px;
  width: 100%;
  border-radius: 15px;
  overflow: hidden;
  background: #0B101D;
  border: 1px solid var(--line);
  cursor: pointer;
  min-width: 0;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.sys-stage-slot.is-after {
  border: 1.5px solid var(--sky-400);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
}
.sys-stage-slot:hover {
  transform: translateY(-2px);
  border-color: var(--sky-500);
  box-shadow: var(--shadow-md);
}
.sys-stage-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform .45s var(--ease);
}
.sys-stage-slot:hover .sys-stage-media {
  transform: scale(1.03);
}
.sys-stage-bar {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.sys-stage-slot.is-before .sys-stage-hint {
  position: absolute;
  left: 7px;
  bottom: 7px;
  z-index: 2;
}
.sys-stage-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.82);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 100%;
  white-space: nowrap;
}
.sys-stage-arrow {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
.sys-cost-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--grad-brand);
  background-origin: border-box;
  background-clip: border-box;
  border: 0;
  color: #fff;
  text-shadow: 0 1px 2px rgba(8, 12, 24, 0.25);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.btn-primary {
  text-shadow: 0 1px 2px rgba(8, 12, 24, 0.24);
}
.sys-task-chips {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px !important;
}
.sys-task-chips .chip {
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 6px;
}
.sys-chip-lbl {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sys-chip-cr {
  flex-shrink: 0;
  opacity: 0.82;
  font-weight: 800;
}
.sys-passport-box {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-width: 0;
  box-sizing: border-box;
}
.sys-passport-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  font-size: 12px;
  line-height: 1.38;
  color: var(--ink-2);
  min-width: 0;
}
.sys-passport-row b {
  color: var(--ink);
  font-weight: 800;
  flex-shrink: 0;
}
.sys-passport-row span {
  min-width: 0;
  word-break: break-word;
}
.sys-formula-compact {
  padding: 10px 12px;
}
.sys-plan-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.section-tight {
  padding: clamp(20px, 3.2vw, 36px) 0;
}
.home-bottom-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 1080px) {
  .hero-compact .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .quick-tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .smart-mode-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .quick-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-tools-grid .quick-tool-pill:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .smart-prompt-row {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 8px;
  }
  .smart-prompt-row .btn-primary {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 46px;
  }
  .sys-task-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 370px) {
  .smart-mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sys-task-chips {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── 60-30-10 Design Tokens, 72h PRO Guarantee & Double-Entry Wallet (v5.3) ── */
:root {
  --bg-surface-primary: var(--bg);
  --bg-surface-elevated: var(--surface);
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --border-subtle: var(--line);
  --brand-primary: var(--sky-500);
  --brand-secondary: var(--pink-500);
}

#credits-count {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.escrow-mini-pill,
.hold-mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  background-origin: border-box;
  background-clip: border-box;
  border: 0;
}
.escrow-mini-pill {
  background: rgba(62, 155, 255, .15);
  color: var(--sky-600);
}
.hold-mini-pill {
  background: rgba(20, 184, 132, .16);
  color: #149A6E;
}

.pro-trust-timeline {
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.pro-trust-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pro-trust-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.pro-trust-step {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  display: grid;
  gap: 4px;
  min-width: 0;
  box-sizing: border-box;
}
.pro-trust-step b {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}
.pro-trust-step span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.pro-guarantee-card {
  padding: 18px 20px;
  border-radius: var(--radius-xl);
  background: var(--grad-brand-soft);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}
.pro-guarantee-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.pro-guarantee-top h3 {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 800;
}
.pro-guarantee-balances {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wallet-pill {
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: grid;
  gap: 2px;
  min-width: 110px;
  box-sizing: border-box;
}
.wallet-pill.is-escrow {
  border-color: var(--sky-400);
}
.wallet-pill span {
  font-size: 10.5px;
  color: var(--text-secondary);
}
.wallet-pill b {
  font-size: 14px;
  font-weight: 800;
}
.pro-guarantee-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .pro-trust-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Crystal Studio v5.3.6 — Child-Level Clarity (① → ② → ③), Symmetrical Grids,
   Collapsible Pro MCSLA Drawer, Payment Trust Strip & All-Mobile Perfection
   ========================================================================== */

/* 1. Child-Friendly 3-Step Visual Guide Bar */
.kids-steps-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.kids-steps-bar.is-compact {
  margin-bottom: 14px;
}
.kids-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.kids-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grad-brand);
  background-origin: border-box;
  background-clip: border-box;
  border: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kids-step-text {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--ink);
}
.kids-step-text i {
  font-style: normal;
  flex-shrink: 0;
}
.kids-step-text b {
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2. Symmetrical 6-Card Market Pricing Grid (3x2 desktop -> 2x3 tablet -> 1x6 mobile) */
.pricing.market-pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1120px) {
  .pricing.market-pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .pricing.market-pricing-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 3. Payment Trust Strip (Epoint 3-D Secure · Visa · Mastercard · Apple Pay · Google Pay) */
.payment-methods-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.pms-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.pms-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pms-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-2);
  white-space: nowrap;
}

/* 4. Collapsible Pro MCSLA Optical Console Drawer */
.pro-console-drawer > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  user-select: none;
}
.pro-console-drawer > summary::-webkit-details-marker { display: none; }
.pro-console-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

/* 5. Direct Photo Upload & Quick Options inside Bottom Studio Composer */
.composer-photo-btn,
.composer-opts-btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.composer-photo-btn:hover,
.composer-opts-btn:hover {
  border-color: var(--sky-500);
}
.composer-photo-btn svg {
  width: 15px;
  height: 15px;
}

/* 6. Mobile Smart Sheet (#mobile-menu-modal) — Symmetrical 2-Column Cockpit */
.mobile-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 14px;
  padding-right: 38px;
}
[dir="rtl"] .mobile-sheet-head {
  padding-right: 0;
  padding-left: 38px;
}
.mobile-sheet-head h2 {
  margin: 0;
  font-size: 19px;
}
.mobile-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.mobile-sheet-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  min-width: 0;
  box-sizing: border-box;
}
.mobile-sheet-tile.is-active {
  background: var(--grad-brand-soft);
  border-color: var(--sky-500);
}
.mobile-sheet-tile .mst-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.mobile-sheet-tile .mst-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-sheet-controls {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mobile-sheet-langs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.mobile-sheet-langs .chip {
  justify-content: center;
  width: 100%;
}
.mobile-sheet-langs .chip:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.mobile-sheet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* 7. Clean Single-Row Mobile Header & Symmetrical Mobile Breakpoints */
@media (max-width: 768px) {
  .topnav {
    flex-wrap: nowrap;
    min-height: 0;
    height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0;
    gap: 6px;
  }
  .topnav .nav-tabs {
    display: none !important;
  }
  #palette-cycle-btn {
    display: none;
  }
  .agent-nav-btn span:not(.spark) {
    display: none;
  }
  .agent-nav-btn {
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 50%;
  }
  .icon-btn,
  .avatar-btn {
    width: 34px;
    height: 34px;
  }
  .credits-pill {
    height: 34px;
    font-size: 12.5px;
    padding: 0 4px 0 9px;
    gap: 5px;
  }
  #auth-btn,
  #signin-btn {
    min-height: 34px;
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
  }
  .kids-steps-bar {
    gap: 6px;
  }
  .kids-step {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 6px;
    gap: 4px;
  }
  .kids-step-text {
    font-size: 11px;
    line-height: 1.2;
    justify-content: center;
    text-align: center;
  }
  .kids-step-text i {
    display: none;
  }
  .kids-step-text b {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* 8. Law №18 Zero-Truncation & Zero-Overlap Perfection */
.smart-mode-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px;
}
.smart-mode-tabs button {
  padding: 9px 10px;
  gap: 6px;
  overflow: visible;
  text-overflow: clip;
}
.smart-mode-tabs .mode-lbl {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .smart-mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.quick-tool-pill .qt-text b,
.quick-tool-pill .qt-text small {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.22;
}
.quick-tool-pill .qt-text b {
  font-size: 12px;
}
.quick-tool-pill .qt-text small {
  font-size: 10.5px;
}
@media (max-width: 640px) {
  .quick-tools-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .quick-tools-grid .quick-tool-pill:last-child:nth-child(odd) {
    grid-column: auto;
  }
}

.token-toggle-bar {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  font-size: 10.5px;
  letter-spacing: .01em;
}
.token-toggle-bar span {
  padding: 8px 6px;
  overflow: visible;
  text-overflow: clip;
}

.mobile-sheet-eyebrow {
  padding-right: 46px;
}
[dir="rtl"] .mobile-sheet-eyebrow {
  padding-right: 0;
  padding-left: 46px;
}
.mobile-sheet-tile .mst-label {
  white-space: normal;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
}

.agent-fab {
  border: 0;
  background-origin: border-box;
  background-clip: border-box;
  bottom: calc(22px + var(--composer-h, 0px));
}
@media (max-width: 820px) {
  .agent-fab {
    bottom: calc(74px + var(--composer-h, 0px) + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 640px) {
  #palette-cycle-btn {
    display: none;
  }
  .sys-deck-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .sys-deck-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

/* ==========================================================================
   9. Obsidian Pro Studio & Center-Stage Creation Cockpit (v5.3.10)
   100% High-Contrast Visibility · Zero Clipping · Child-Simple Symmetry
   ========================================================================== */
html, body, .app-main {
  max-width: 100%;
  overflow-x: clip;
}

.sys-preview-top .badge {
  background: rgba(8, 12, 22, 0.86) !important;
  color: #F8FAFC !important;
  border: 1px solid rgba(96, 165, 250, 0.55) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 921px) {
  .agent-fab,
  .mobile-panel-toggle,
  .composer-opts-btn.mobile-panel-toggle {
    display: none !important;
  }
  .studio {
    grid-template-columns: 376px minmax(0, 1fr);
  }
  .studio-panel {
    padding: 18px 18px 44px;
    background: var(--surface);
    border-right: 1px solid var(--line);
  }
}

.studio-feed {
  padding: 18px clamp(12px, 2.4vw, 28px) 48px !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 920px) {
  .studio {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .studio-feed {
    order: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 12px 12px 24px !important;
    box-sizing: border-box;
  }
  .studio-panel {
    order: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: var(--surface);
    padding: 14px 12px 84px;
    box-sizing: border-box;
  }
  .studio-mode-bar,
  .composer.studio-cockpit,
  .composer.studio-cockpit .composer-box,
  .cockpit-controls-bar,
  .cockpit-launch-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .cockpit-upload-group,
  .cockpit-inline-group,
  .cockpit-active-pills {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* Studio Mode Switcher Strip */
.studio-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.studio-mode-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.studio-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.studio-mode-pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.studio-mode-pill.is-active {
  background: var(--grad-brand);
  border: 0;
  background-origin: border-box;
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.studio-live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}
.studio-live-status b {
  color: var(--ink);
  font-weight: 800;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
}

/* Center-Stage Creation Cockpit (replaces clipped bottom-fixed composer) */
.composer.studio-cockpit {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1;
  padding: 0 !important;
  background: none !important;
  pointer-events: auto !important;
  width: 100%;
  min-width: 0;
}
.composer.studio-cockpit .composer-box {
  max-width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 18px;
  border-radius: 24px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  box-shadow: var(--shadow-md);
}

.cockpit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.cockpit-step-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}
.cockpit-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cockpit-clear-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
}
.cockpit-clear-btn:hover {
  border-color: var(--pink-500);
  color: var(--ink);
}
.enhance-btn {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
}

.cockpit-special-box {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.cockpit-field-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.studio-speech-textarea {
  min-height: 82px !important;
  background: var(--bg) !important;
  border: 1.5px solid var(--line-strong) !important;
  color: var(--ink) !important;
}

.cockpit-prompt-well {
  border-radius: 16px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  padding: 2px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.cockpit-prompt-well:focus-within {
  border-color: var(--sky-500);
  box-shadow: 0 0 0 3px rgba(62, 155, 255, 0.20);
}
.composer.studio-cockpit textarea.studio-prompt-textarea {
  display: block;
  width: 100%;
  min-height: 112px;
  max-height: 340px;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  border: 0;
  resize: vertical;
  overflow-y: auto;
}
.composer.studio-cockpit textarea.studio-prompt-textarea::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

.cockpit-ideas {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cockpit-ideas .ideas-lbl {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-right: 2px;
}
.cockpit-idea-chip {
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  transition: all .16s var(--ease);
}
.cockpit-idea-chip:hover {
  border-color: var(--sky-500);
  color: var(--ink);
  background: var(--surface-2);
}

.cockpit-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.cockpit-upload-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.composer-photo-btn {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.composer-photo-btn.is-attached {
  background: var(--grad-brand-soft);
  border-color: var(--sky-500);
}
.cpb-thumb {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.cockpit-clear-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.cockpit-inline-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cockpit-inline-group .cig-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.cockpit-inline-group .chip {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
}

.composer.studio-cockpit .cockpit-launch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}
.cockpit-active-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.composer.studio-cockpit .cockpit-launch-bar .chip {
  display: inline-flex !important;
}
.chip-strong {
  background: var(--bg-2);
  border-color: var(--line-strong);
  color: var(--ink);
}
.chip-preset-on {
  background: var(--grad-brand-soft);
  border-color: var(--pink-500);
  color: var(--ink);
  font-weight: 800;
}
.cockpit-guarantee {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.studio-create-btn {
  min-height: 50px;
  padding: 0 24px;
  font-size: 15.5px;
  font-weight: 800;
  border-radius: 16px;
  box-shadow: var(--shadow-glow);
  white-space: nowrap;
}

.studio-feed .empty-state {
  padding: 26px 18px;
  border: 1.5px dashed var(--line-strong);
}
.studio-feed .empty-collage img {
  width: 54px;
  height: 70px;
}

.mini-btn-dl {
  background: var(--grad-brand-soft);
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 800;
}

/* Crisp Inputs, Selects & Chips across both themes */
.input, .select, .textarea {
  background: var(--bg);
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--sky-500);
}
.chip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.chip.is-active {
  background: var(--grad-brand);
  border: 0;
  background-origin: border-box;
  color: #fff;
}

@media (max-width: 640px) {
  .studio-mode-bar {
    padding: 8px;
    gap: 8px;
  }
  .studio-mode-pills {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }
  .studio-mode-pill {
    justify-content: center;
    padding: 4px 8px;
    font-size: 12px;
    min-height: 34px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
  .studio-mode-pill:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .studio-live-status {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    padding: 6px 10px;
  }
  .composer.studio-cockpit .composer-box {
    padding: 14px 12px;
    border-radius: 20px;
  }
  .cockpit-top {
    align-items: flex-start;
  }
  .cockpit-top-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .enhance-btn,
  .cockpit-clear-btn {
    max-width: 100%;
    white-space: normal;
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
    line-height: 1.25;
    text-align: center;
  }
  .cockpit-idea-chip {
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    min-height: 30px;
    padding: 6px 11px;
    line-height: 1.3;
  }
  .composer-photo-btn,
  .composer-opts-btn {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    height: auto;
    padding-top: 7px;
    padding-bottom: 7px;
    line-height: 1.25;
  }
  .cockpit-active-pills .chip {
    max-width: 100%;
    white-space: normal;
    height: auto;
    padding-top: 5px;
    padding-bottom: 5px;
    line-height: 1.25;
  }
  .composer.studio-cockpit .composer-go {
    width: 100%;
  }
  .studio-create-btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: 1.25;
  }
  .result-actions .mini-btn.mini-btn-dl span {
    display: inline;
  }
  .kids-step-text b {
    display: block;
    overflow: visible;
    text-overflow: clip;
    -webkit-line-clamp: unset;
  }
}

@media (max-width: 370px) {
  .kids-steps-bar {
    grid-template-columns: minmax(0, 1fr);
  }
  .kids-step {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    padding: 7px 10px;
    gap: 8px;
  }
  .kids-step-text {
    justify-content: flex-start;
    text-align: left;
  }
}

/* ==========================================================================
   10. Real Verified Showcase ("От этого → Появилось вот это") & Facts (v5.3.11)
   Law №18 Symmetrical Capsules · Zero Clipping · Live Audio Toggle
   ========================================================================== */

.sys-before-inset {
  flex-shrink: 0;
  width: 58px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  background: rgba(8, 12, 22, 0.92);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}
.sys-before-inset img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  display: block;
}
.sys-before-inset span {
  display: block;
  font-size: 8.5px;
  font-weight: 800;
  text-align: center;
  padding: 2.5px 4px;
  color: #F8FAFC;
  letter-spacing: 0.01em;
  line-height: 1.15;
  white-space: nowrap;
  background: rgba(8, 12, 22, 0.94);
}

.real-showcase-sec {
  position: relative;
}

.real-facts-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.real-fact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.rf-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rf-ico {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.rf-top b {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  min-width: 0;
}
.real-fact-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
}

.showcase-ba-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.showcase-ba-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.showcase-ba-card.is-compact {
  padding: 14px;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.showcase-ba-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.showcase-case-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  max-width: 100%;
  box-sizing: border-box;
}

.showcase-ba-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.showcase-ba-slot {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-width: 0;
  width: 100%;
}
.showcase-ba-card.is-compact .showcase-ba-slot {
  max-height: 310px;
}
.showcase-ba-slot.is-after {
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}
.ba-media-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.ba-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  max-width: calc(100% - 16px);
  padding: 4px 8px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-sizing: border-box;
  word-break: break-word;
}
.ba-tag-before {
  background: rgba(8, 12, 22, 0.84);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.ba-tag-after {
  background: var(--grad-brand);
  background-origin: border-box;
  background-clip: border-box;
  border: 0;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.ba-arrow-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-brand);
  background-origin: border-box;
  background-clip: border-box;
  border: 0;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.showcase-audio-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.86);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .15s var(--ease), background .15s var(--ease);
}
.showcase-audio-btn.is-deck {
  position: relative;
  right: auto;
  bottom: auto;
}
.showcase-audio-btn:hover {
  transform: translateY(-1px);
  border-color: #60A5FA;
}
.showcase-audio-btn.is-unmuted {
  background: var(--grad-brand);
  background-origin: border-box;
  background-clip: border-box;
  border: 0;
  color: #FFFFFF;
  box-shadow: var(--shadow-glow);
}

.showcase-ba-story {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.ba-headline {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.42;
  color: var(--ink);
}
.ba-prompt-quote {
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2);
  min-width: 0;
  word-break: break-word;
}
.ba-prompt-quote span {
  font-weight: 800;
  color: var(--ink);
}

.showcase-ba-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.ba-fact-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.ba-fact-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  box-sizing: border-box;
}
.ba-try-btn {
  border: 0;
  background-origin: border-box;
  background-clip: border-box;
  white-space: nowrap;
}

.studio-empty-showcase {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 820px;
  box-sizing: border-box;
}
.ses-head h4 {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}

@media (max-width: 1040px) {
  .real-facts-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .showcase-ba-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 580px) {
  .real-facts-strip {
    grid-template-columns: minmax(0, 1fr);
  }
  .showcase-ba-card {
    padding: 12px;
  }
  .showcase-ba-pair {
    gap: 6px;
  }
  .ba-arrow-pill {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .ba-tag {
    top: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    padding: 3px 6px;
    font-size: 9px;
  }
  .showcase-audio-btn {
    right: 6px;
    bottom: 6px;
    padding: 4px 8px;
    font-size: 10.5px;
  }
  .showcase-ba-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .ba-try-btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
    height: auto;
    padding-top: 9px;
    padding-bottom: 9px;
    text-align: center;
  }
  .conveyor-form .btn-lg {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    height: auto;
    padding: 12px 14px;
    line-height: 1.25;
    text-align: center;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ==========================================================================
   11. World-Class Interactive Cinema Showcase, Site Guide & 4-Provider Auth (v5.3.14)
   Law №18 100% Capsule Symmetry · 320px–1440px Mobile Perfection · Live Auth
   ========================================================================== */

.grad-txt {
  font-style: normal;
  font-weight: 800;
  color: var(--sky-600);
}
[data-theme="night"] .grad-txt {
  color: var(--sky-400);
}

/* Clickable Before/After Slots & Expand Chips */
.showcase-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ba-expand-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.15;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.ba-expand-chip:hover {
  background: var(--grad-brand);
  background-origin: border-box;
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: var(--shadow-glow);
}
.showcase-ba-slot.is-clickable {
  cursor: pointer;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.showcase-ba-slot.is-clickable:hover {
  transform: translateY(-2px);
  border-color: var(--sky-500);
  box-shadow: var(--shadow-md);
}
.showcase-ba-slot.is-clickable:hover .ba-media-el {
  transform: scale(1.025);
}
.ba-media-el {
  transition: transform .4s var(--ease);
}
.ba-zoom-pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.80);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.showcase-audio-btn.is-stage {
  position: static;
  right: auto;
  bottom: auto;
  padding: 4px 9px;
  font-size: 11px;
}

/* Mini Technical Passport inside Showcase Cards ("Что дали" / "Где и чем") */
.ba-mini-passport {
  display: grid;
  gap: 5px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-width: 0;
}
.ba-mp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 6px;
  font-size: 12px;
  line-height: 1.38;
  color: var(--ink-2);
  min-width: 0;
}
.ba-mp-row b {
  color: var(--ink);
  font-weight: 800;
}

/* 4-Step Visual Site Guide ("Что к чему на сайте · Понятно за 15 секунд") */
.how-site-works-box {
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 16px;
  min-width: 0;
  box-sizing: border-box;
}
.hsw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hsw-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}
.how-site-works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.hsw-step-card {
  padding: 14px 15px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
}
.hsw-step-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.hsw-num {
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--grad-brand);
  background-origin: border-box;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.hsw-ico {
  font-size: 16px;
  flex-shrink: 0;
}
.hsw-step-top b {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
  min-width: 0;
}
.hsw-step-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--ink-2);
}

/* Full-Screen Cinema Comparison Modal (#viewer-modal .viewer-card.is-showcase) */
dialog.viewer {
  max-width: min(96vw, 1220px);
}
.viewer-card.is-showcase {
  grid-template-columns: minmax(0, 1.35fr) 390px;
  max-height: 90vh;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
}
.showcase-modal-media {
  padding: 18px 20px;
  background: #080C16;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-width: 0;
  overflow-y: auto;
}
.showcase-modal-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-right: 36px;
}
.showcase-modal-tabs .chip {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #E2E8F0;
  font-size: 12px;
  min-height: 32px;
  padding: 4px 11px;
}
.showcase-modal-tabs .chip.is-active {
  background: var(--grad-brand);
  background-origin: border-box;
  border: 0;
  color: #FFFFFF;
}
.showcase-modal-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.sm-slot {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 68vh;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #050811;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  min-width: 0;
}
.sm-slot.is-after {
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.50);
}
.sm-media-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
.showcase-modal-side {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 90vh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
}
.sm-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-right: 36px;
}
.sm-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.28;
  color: var(--ink);
}
.sm-lead {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.48;
  color: var(--ink-2);
}
.sys-passport-box.is-modal {
  gap: 8px;
  padding: 12px 14px;
}
.showcase-modal-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

/* 4-Provider Symmetrical Auth Modal (#auth-modal: Google, Apple ID, Facebook, SMS)
   Non-top-layer fixed overlay (z-index: 400) keeps Google reCAPTCHA SMS popup clickable on top! */
dialog#auth-modal[open] {
  position: fixed;
  inset: 0;
  z-index: 400;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 22, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-sizing: border-box;
}
dialog#auth-modal .modal-card {
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
}
#auth-modal .auth-providers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#auth-modal .auth-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 50px;
  padding: 8px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
  min-width: 0;
  box-sizing: border-box;
  cursor: pointer;
}
#auth-modal .auth-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
#auth-modal .auth-btn span {
  min-width: 0;
  word-break: break-word;
}
#auth-modal .auth-btn:hover {
  border-color: var(--sky-500);
  background: var(--surface);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
#auth-modal .auth-btn[data-provider="facebook"]:hover {
  border-color: #1877F2;
}
#auth-modal .auth-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.phone-flow-box {
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1.5px solid var(--line-strong);
}
.phone-prefix-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.phone-prefix-bar .chip {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}
.phone-otp-input {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.28em;
}

/* Responsive perfection across Tablet & All Mobile Screens (1040px → 920px → 640px → 390px → 320px) */
@media (max-width: 1040px) {
  .how-site-works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .viewer-card.is-showcase {
    grid-template-columns: minmax(0, 1fr);
    max-height: 92dvh;
    overflow-y: auto;
  }
  .showcase-modal-side {
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .sm-slot {
    max-height: 46vh;
  }
}

@media (max-width: 640px) {
  .how-site-works-box {
    padding: 14px;
    border-radius: 20px;
  }
  .how-site-works-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ba-zoom-pill {
    display: none;
  }
  .sys-stage-slot {
    max-height: 240px;
  }
  .sys-stage-hint {
    padding: 3px 7px;
    font-size: 9.5px;
  }
  dialog#auth-modal[open] {
    padding: 0;
    align-items: flex-end;
  }
  dialog#auth-modal .modal-card {
    max-width: 100vw;
    max-height: 92dvh;
    border-radius: 26px 26px 0 0;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .showcase-modal-media {
    padding: 14px 12px;
  }
  .showcase-modal-pair {
    gap: 6px;
  }
  .showcase-modal-side {
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 400px) {
  #auth-modal .auth-providers {
    grid-template-columns: minmax(0, 1fr);
  }
  .sys-task-chips {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .sys-stage-pair {
    gap: 4px;
  }
  .sys-stage-arrow {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  .smart-mode-tabs button {
    padding: 8px 6px;
    gap: 5px;
    font-size: 11.5px;
  }
  .smart-mode-tabs .mode-cost {
    font-size: 9.5px;
    margin-left: 2px;
  }
}
@media (max-width: 365px) {
  .smart-mode-tabs {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .smart-mode-tabs button {
    justify-content: flex-start;
    padding: 9px 12px;
    gap: 8px;
    font-size: 12.5px;
  }
  .smart-mode-tabs .mode-cost {
    margin-left: auto;
    font-size: 10.5px;
  }
}

/* ==========================================================================
   14. v5.4.0 FASHN AI Fashion Studio, Dual Upload Cockpit & Gateway Vault
   100% Symmetrical Capsules · Law №18 Zero-Overflow · 320px–1440px
   ========================================================================== */

/* Home Fashion Studio Spotlight */
.fashion-spotlight-sec {
  padding-top: 10px;
}
.fashion-spotlight-box {
  padding: clamp(20px, 3vw, 32px);
  border-radius: 30px;
  background:
    radial-gradient(640px 280px at 0% 0%, rgba(232, 190, 82, 0.14), transparent 70%),
    radial-gradient(560px 280px at 100% 0%, rgba(56, 189, 248, 0.14), transparent 70%),
    var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
[data-theme="night"] .fashion-spotlight-box {
  background:
    radial-gradient(640px 280px at 0% 0%, rgba(232, 190, 82, 0.11), transparent 72%),
    radial-gradient(560px 280px at 100% 0%, rgba(56, 189, 248, 0.12), transparent 72%),
    rgba(17, 24, 39, 0.92);
}

.fashion-modes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.fash-mode-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
[data-theme="night"] .fash-mode-card {
  background: rgba(15, 23, 42, 0.78);
}
.fash-mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--sky-500);
  box-shadow: var(--shadow-sm);
}
.fash-mode-card .fmc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.fash-mode-card .fmc-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}
.fash-mode-card b {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.fash-mode-card small {
  font-size: 12.5px;
  line-height: 1.42;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.fash-mode-card .fmc-cta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--sky-600);
}
[data-theme="night"] .fash-mode-card .fmc-cta {
  color: #38BDF8;
}

/* Lookbook Center-Stage Cockpit */
.lookbook-cockpit-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
[data-theme="night"] .lookbook-cockpit-box {
  background: rgba(15, 23, 42, 0.72);
}
.lookbook-mode-pills {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}
.lookbook-mode-pills .chip {
  width: 100%;
  min-width: 0;
  justify-content: center;
  text-align: center;
  padding: 8px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
  height: auto;
  min-height: 36px;
}
.lookbook-mode-pills .chip.is-active {
  border: 0;
  background-origin: border-box;
}
.lookbook-dual-uploads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.lookbook-dual-uploads > .look-slot-card:only-child {
  grid-column: 1 / -1;
}
.look-slot-card {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1.5px dashed var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.look-slot-card:hover {
  border-color: var(--sky-500);
  transform: translateY(-1px);
}
.look-slot-card.is-filled {
  border-style: solid;
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.06);
}
.look-slot-card img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}
.look-slot-card .lsc-ico {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--grad-brand-soft);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.look-slot-card .lsc-txt {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.look-slot-card .lsc-txt b {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.look-slot-card .lsc-txt small {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Live vs Gateway-Key Indicators */
.model-opt .mo-live {
  font-size: 10px;
  font-weight: 800;
  color: #059669;
  background: rgba(16, 185, 129, 0.14);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: .02em;
}
[data-theme="night"] .model-opt .mo-live {
  color: #34D399;
  background: rgba(16, 185, 129, 0.2);
}
.hub-card.is-locked {
  opacity: 0.84;
  border-style: dashed;
}

/* Admin Encrypted Gateway Vault */
.gateway-vault-box {
  margin-bottom: 24px;
  padding: clamp(18px, 2.5vw, 26px);
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.gvb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.gvb-counter {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--grad-brand-soft);
  border: 1px solid var(--line);
  text-align: right;
  flex-shrink: 0;
}
.gvb-counter b {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}
.gvb-counter span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.gateway-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.gateway-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grad-brand);
  transition: width .35s var(--ease);
}
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.gateway-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.gateway-card.is-live {
  border-color: rgba(16, 185, 129, 0.45);
}
.gateway-card .gc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.gateway-card .gc-top b {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}
.gateway-card .gc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.gateway-card .gc-meta code {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink);
}
.gateway-card .gc-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--sky-600);
  text-decoration: none;
  overflow-wrap: anywhere;
}
[data-theme="night"] .gateway-card .gc-link {
  color: #38BDF8;
}
.gateway-card .gc-adc-ok {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 12.5px;
  font-weight: 700;
}
[data-theme="night"] .gateway-card .gc-adc-ok {
  color: #34D399;
}
.gateway-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.gateway-form-row .input {
  min-width: 0;
  width: 100%;
}
.zero-shield-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--bg-2);
  border: 1.5px solid var(--line-strong);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.zero-shield-banner.is-active {
  border-color: rgba(16, 185, 129, 0.52);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.10), rgba(56, 189, 248, 0.08));
}
.zsb-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.zsb-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.zsb-copy h4 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}
.zsb-action {
  flex-shrink: 0;
}
.free-gateways-sec {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.fgs-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.fgs-head b {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}
@media (max-width: 760px) {
  .zero-shield-banner {
    flex-direction: column;
    align-items: stretch;
  }
  .zsb-action .btn {
    width: 100%;
  }
}

/* Mobile Responsive Symmetry (920px -> 640px -> 400px -> 320px) */
@media (max-width: 920px) {
  .fashion-modes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
  .mobile-bar button {
    min-width: 0;
    padding: 4px 2px;
  }
  .mobile-bar button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .gateway-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .gvb-counter {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .fashion-spotlight-box {
    padding: 16px 14px;
    border-radius: 22px;
  }
  .lookbook-mode-pills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lookbook-dual-uploads {
    grid-template-columns: minmax(0, 1fr);
  }
  .gateway-form-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .gateway-form-row .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .fashion-modes-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .topnav .escrow-mini-pill,
  .topnav .hold-mini-pill {
    display: none;
  }
}

@media (max-width: 380px) {
  .topnav {
    padding-inline: 8px;
    gap: 4px;
  }
  .topnav .nav-actions {
    gap: 3px;
  }
  .topnav .brand-name {
    font-size: 13.5px;
  }
  .topnav .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  .topnav .icon-btn,
  .topnav .agent-nav-btn,
  .topnav .avatar-btn {
    width: 30px;
    height: 30px;
    min-height: 30px;
  }
  .topnav .credits-pill {
    height: 30px;
    font-size: 11.5px;
    padding: 0 3px 0 7px;
    gap: 4px;
  }
  .topnav .credits-pill .plus {
    width: 22px;
    height: 22px;
  }
  #auth-btn,
  #signin-btn {
    min-height: 30px;
    height: 30px;
    padding: 0 9px;
    font-size: 11.5px;
  }
}

/* Complete RTL Symmetry & Mirroring (AR · العربية) */
[dir="rtl"] .ba-arrow-pill,
[dir="rtl"] .ab-row .arrow,
[dir="rtl"] .monitor-ab .arrow {
  transform: scaleX(-1);
}
@media (min-width: 921px) {
  [dir="rtl"] .studio-panel {
    border-right: 0;
    border-left: 1px solid var(--line);
  }
}
[dir="rtl"] .showcase-modal-side {
  border-left: 0;
  border-right: 1px solid var(--line);
}
[dir="rtl"] .showcase-modal-tabs,
[dir="rtl"] .sm-badges-row {
  padding-right: 0;
  padding-left: 36px;
}
[dir="rtl"] .toasts {
  right: auto;
  left: 14px;
}
[dir="rtl"] .ba-tag {
  left: auto;
  right: 8px;
}

/* ==========================================================================
   12. v5.6.0 · Crystal Cinema Studio Ultra (Interactive Curtain Slider,
       6-Axis Director Rigs, Dual-Keyframe A→B, Live Motion & Superiority Matrix)
   ========================================================================== */

/* Header actions & Compare mode pill switch (#system-ai-deck + Showcase Modal) */
.sys-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}
.sys-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  max-width: 100%;
}
.sys-mode-btn {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s var(--ease), color .18s var(--ease);
}
.sys-mode-btn.is-active {
  background: var(--grad-brand);
  background-origin: border-box;
  border: 0;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Interactive 60 FPS Before ↔ After Curtain Stage */
.ba-curtain-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 250px;
  max-height: 360px;
  border-radius: 16px;
  overflow: hidden;
  background: #090D16;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: ew-resize;
  isolation: isolate;
}
.ba-curtain-stage.is-modal {
  aspect-ratio: 16 / 10;
  min-height: 340px;
  max-height: 68vh;
  border-radius: 18px;
}
.ba-curtain-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba-curtain-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--curtain, 52%));
  will-change: clip-path;
  z-index: 2;
}
[dir="rtl"] .ba-curtain-after {
  clip-path: inset(0 var(--curtain, 52%) 0 0);
}
.ba-curtain-stage .ba-tag {
  z-index: 4;
  pointer-events: none;
}
.ba-curtain-stage .ba-tag.is-curtain-end {
  left: auto;
  right: 10px;
}
[dir="rtl"] .ba-curtain-stage .ba-tag.is-curtain-end {
  right: auto;
  left: 10px;
}
.ba-curtain-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--curtain, 52%);
  width: 2px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}
[dir="rtl"] .ba-curtain-divider {
  left: auto;
  right: var(--curtain, 52%);
  transform: translateX(50%);
}
.ba-curtain-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-brand);
  background-origin: border-box;
  border: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 8px 22px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  display: grid;
  place-items: center;
  transition: transform .18s var(--ease);
}
.ba-curtain-stage.is-dragging .ba-curtain-knob,
.ba-curtain-stage:hover .ba-curtain-knob {
  transform: translate(-50%, -50%) scale(1.08);
}
.ba-curtain-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.ba-curtain-bar-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.showcase-zoom-chip {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 14, 24, 0.76);
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Preset Viewfinder Optical Lens Badge & Viewport Live Motion */
.preset-card .pc-lens {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(10, 15, 28, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 700;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.preset-card.compact .pc-lens {
  font-size: 9.5px;
  padding: 1px 6px;
}
.preset-card.is-live-motion img {
  animation-duration: 6.4s;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(.45, .05, .35, 1);
  animation-direction: alternate;
  will-change: transform;
}
.preset-card.m-crash.is-live-motion img { animation-name: mCrash; animation-duration: 4.2s; }
.preset-card.m-orbit.is-live-motion img { animation-name: mOrbit; }
.preset-card.m-fpv.is-live-motion img { animation-name: mFpv; }
.preset-card.m-dollyout.is-live-motion img { animation-name: mDollyOut; }
.preset-card.m-crane.is-live-motion img { animation-name: mCrane; }
.preset-card.m-handheld.is-live-motion img { animation-name: mHandheld; animation-duration: 2.8s; }
.preset-card.m-vertigo.is-live-motion img { animation-name: mVertigo; }
.preset-card.m-dollyback.is-live-motion img { animation-name: mDollyBack; }
.preset-card.m-push.is-live-motion img { animation-name: mPush; }
.preset-card.m-pan.is-live-motion img { animation-name: mPan; }
.preset-card.m-static.is-live-motion img { animation-name: mBreathe; }

/* Direct Image → Cinema Animate button on Result Cards */
.mini-btn.mini-btn-cine {
  background: var(--grad-brand);
  background-origin: border-box;
  border: 0;
  color: #fff;
  font-weight: 800;
}
.mini-btn.mini-btn-cine:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* 1-Click Director Optical Rig Strip in Studio Cockpit */
.director-rig-strip {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
}
.rig-strip-lbl {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.rig-chips-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}
.rig-chip {
  min-height: 28px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  gap: 5px;
  max-width: 100%;
}
.rig-chip.is-active {
  background: var(--grad-brand) !important;
  background-origin: border-box !important;
  border: 0 !important;
  color: #fff !important;
}
.chip-more-moves {
  border-style: dashed !important;
  font-weight: 800 !important;
  color: var(--sky-500) !important;
}

/* Dual-Keyframe Start A → End B Cockpit Pills */
.composer-photo-btn .cpb-thumb.is-second {
  margin-inline-start: -8px;
  box-shadow: 0 0 0 2px var(--surface);
}
.composer-photo-btn.is-endframe {
  border-style: dashed;
  border-color: var(--sky-500);
  color: var(--sky-500);
  background: var(--grad-brand-soft);
}

/* Cinema Studio Superiority Matrix (TalexLead 5.6 vs Higgsfield vs Bots) */
.sup-cta-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sup-matrix {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: grid;
  min-width: 0;
  max-width: 100%;
}
.sup-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.05fr) minmax(200px, 1.45fr) minmax(140px, 1fr) minmax(140px, 1fr);
  border-top: 1px solid var(--line);
  min-width: 0;
}
.sup-row.is-head {
  border-top: 0;
  background: var(--bg-2);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.sup-col {
  padding: 13px 16px;
  font-size: 13px;
  line-height: 1.42;
  min-width: 0;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sup-col.is-metric {
  font-weight: 800;
  color: var(--ink);
}
.sup-col.is-us {
  background: var(--grad-brand-soft);
  font-weight: 700;
  color: var(--ink);
  border-inline: 1px solid var(--line-strong);
}
.sup-col.is-peer {
  color: var(--muted);
}
.sup-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10B981;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .sup-row.is-head {
    display: none;
  }
  .sup-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    gap: 8px;
  }
  .sup-col {
    padding: 8px 10px;
    border-radius: 12px;
  }
  .sup-col.is-metric {
    grid-column: 1 / -1;
    padding: 2px 4px;
    font-size: 14px;
  }
  .sup-col.is-us {
    grid-column: 1 / -1;
    border: 1px solid var(--line-strong);
  }
  .sup-col.is-peer {
    background: var(--bg-2);
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .sys-deck-head {
    flex-direction: column;
    align-items: stretch;
  }
  .sys-head-actions {
    justify-content: space-between;
  }
  .ba-curtain-stage {
    min-height: 215px;
  }
  .sup-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── v5.7.0 · Zero-Cost Viral Referral, Free/PRO Result Pill & B2B Turnkey (Law 18 Symmetry) ── */
.mini-btn.mini-btn-pro {
  border: 0;
  background: linear-gradient(135deg, #F59E0B, #EC4899);
  background-origin: border-box;
  background-clip: border-box;
  color: #fff;
  font-weight: 800;
}
.mini-btn.mini-btn-pro:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.result-free-badge {
  font-size: 10px;
  padding: 2px 7px;
  vertical-align: middle;
}
@media (max-width: 640px) {
  .result-actions .mini-btn.mini-btn-pro span {
    display: inline;
  }
}

.b2b-turnkey-banner,
.referral-share-card {
  margin-top: 20px;
  padding: clamp(16px, 2.4vw, 24px);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px 22px;
  max-width: 100%;
  box-sizing: border-box;
}
.referral-share-card {
  margin-bottom: 20px;
  background: var(--grad-brand-soft);
}
.b2b-tb-copy,
.rsc-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.b2b-tb-copy h3,
.rsc-copy h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(16px, 1.9vw, 20px);
  line-height: 1.25;
  color: var(--ink);
}
.b2b-tb-copy p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.rsc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.b2b-tb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}
.rsc-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.rsc-controls .input {
  flex: 1 1 200px;
  min-width: 0;
  height: 38px;
  font-size: 12.5px;
  font-weight: 700;
}
.b2b-tb-actions .btn,
.rsc-controls .btn {
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.referral-mini-box {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--grad-brand-soft);
  border: 1px solid var(--line-strong);
  display: grid;
  gap: 8px;
  min-width: 0;
}
.rmb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}
.rmb-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.rmb-row .input {
  min-width: 0;
  height: 36px;
  font-size: 12px;
  font-weight: 700;
}

.gw-priority-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 4px;
}

@media (max-width: 860px) {
  .b2b-turnkey-banner,
  .referral-share-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .b2b-tb-actions,
  .rsc-controls {
    justify-content: stretch;
  }
  .b2b-tb-actions .btn,
  .rsc-controls .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .rmb-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .b2b-tb-actions .btn {
    white-space: normal;
    height: auto;
    min-height: 38px;
    padding: 8px 12px;
  }
}

/* ── Monetization: Express Checkout, Instant Top-Up Grid, Paywall & B2B ── */
.plan-express-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
  min-width: 0;
}
.plan-express-row .btn {
  min-width: 0;
  max-width: 100%;
  padding: 0 10px;
  min-height: 38px;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pricing.topup-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
dialog.paywall-modal {
  max-width: min(94vw, 600px);
}
.paywall-options {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}
.paywall-option {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid;
  gap: 8px;
  min-width: 0;
}
.paywall-option.is-featured {
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, var(--grad-brand) border-box;
  border: 2px solid transparent;
}
.po-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.po-head h3 {
  margin: 6px 0 0;
  font-size: 17px;
  font-family: var(--font-display);
}
.po-head b {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}
.paywall-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.b2b-direct-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.b2b-direct-links .btn {
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 860px) {
  .pricing.topup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .pricing.topup-grid,
  .b2b-direct-links {
    grid-template-columns: minmax(0, 1fr);
  }
  .plan-express-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .billing-controls-bar {
    grid-template-columns: minmax(0, 1fr);
  }
}

.billing-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 0 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  box-sizing: border-box;
}
.billing-cycle-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.billing-cycle-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.billing-cycle-switch button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.promo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 280px;
  justify-content: flex-end;
}
.promo-bar .input {
  max-width: 240px;
  min-width: 140px;
  flex: 1 1 140px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .04em;
}
.receipt-card {
  display: grid;
  gap: 8px;
}
.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
@media print {
  .ambient, header.topnav, .mobile-bar, .agent-fab, .toasts, .modal-close, .receipt-actions {
    display: none !important;
  }
}






