/* Nét Vẽ Studio — tím cam rực rỡ. Mobile first, behaves like an app on phones (bottom tab bar,
   safe areas, no zoom), roomy two-column layouts on desktop. */
:root {
  --violet: #7c3aed; --violet-2: #6d28d9; --orange: #f97316; --orange-2: #ea580c; --pink: #ec4899;
  --grad: linear-gradient(120deg, #7c3aed 0%, #c026d3 45%, #f97316 100%);
  --grad-soft: linear-gradient(135deg, #f5f3ff 0%, #fff7ed 100%);
  --paper: #fcfbff; --card: #ffffff; --ink: #17122b; --muted: #5f587a; --line: #e9e4f5;
  --accent: #7c3aed; --accent-ink: #ffffff; --marker: #fdba74; --bad: #dc2626; --good: #059669;
  --shadow: 0 10px 30px -12px rgba(76, 29, 149, .25); --shadow-lg: 0 30px 60px -20px rgba(76, 29, 149, .35);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Pangolin", "Comic Sans MS", cursive;
  --radius: 16px; --tabbar: 64px;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #0f0b1d; --card: #19132e; --ink: #f3efff; --muted: #a79fc4; --line: #2b2348; --accent: #a78bfa; --accent-ink: #12091f;
    --grad-soft: linear-gradient(135deg, #1b1236 0%, #2a160d 100%); --shadow: 0 10px 30px -12px rgba(0,0,0,.6); color-scheme: dark; }
}
@font-face { font-family: "Pangolin"; src: url("/assets/fonts/Pangolin-Regular.ttf") format("truetype"); font-display: swap; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* app-like: no double-tap zoom, no pull-to-refresh bounce on the shell */
html, body { touch-action: manipulation; overscroll-behavior-y: none; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font); min-height: 100dvh; overflow-x: clip; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem); font-weight: 800; letter-spacing: -0.02em; }
.card h2, .sheet h2, dialog h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 32px) 72px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; color: #fff; font-size: 16px; box-shadow: var(--shadow); }
.brand span.accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: .9375rem; }
.nav a:hover, .nav a.on { background: var(--grad-soft); color: var(--accent); }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who #whoEmail { color: var(--muted); font-size: 0.85rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adminLink { font-weight: 700; text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; text-decoration: none; }

/* ---------- controls */
button, select, input, textarea { font: inherit; color: var(--ink); }
/* 16px stops iOS from zooming into fields */
input, select, textarea { font-size: 16px; }
button, .btn { background: var(--grad); color: #fff; border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  box-shadow: 0 8px 20px -10px rgba(124, 58, 237, .7); transition: transform .12s ease, box-shadow .12s ease, opacity .12s; }
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(124, 58, 237, .8); }
button:active, .btn:active { transform: translateY(0) scale(.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
button.ghost, .btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
button.small, .btn.small { padding: 6px 14px; min-height: 36px; font-size: .875rem; border-radius: 10px; }
button.big, .btn.big { padding: 14px 28px; min-height: 52px; font-size: 1.0625rem; border-radius: 14px; }
button.danger { color: var(--bad); border-color: currentColor; background: transparent; box-shadow: none; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 2px; }
select, input, textarea { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; transition: border-color .12s; }
select:focus, input:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; min-height: 48px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .875rem; color: var(--muted); font-weight: 600; min-width: 0; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--ink); font-weight: 500; }
label.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); margin-top: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > select, .row > input { width: auto; }
.card > button.small, .card > button.ghost.small, .scene > button.small { align-self: flex-start; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; padding: 3px 10px; border-radius: 99px; border: 1px solid currentColor; width: fit-content; font-weight: 600; text-decoration: none; }
.pill.done { color: var(--good); } .pill.failed { color: var(--bad); } .pill.running, .pill.queued { color: var(--accent); }
.badge { align-self: flex-start; width: fit-content; display: inline-block; font-size: 0.7rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--grad); color: #fff; letter-spacing: .02em; }
.error { color: var(--bad); }
.ok { color: var(--good); } .bad { color: var(--bad); }
code { font-size: .8125rem; color: var(--muted); }

/* ---------- landing
   Type scale (1.25 ratio, fluid): 14 · 16 · 18/20 · 25 · 31-40 · 40-60px. Line length ≤ 65ch. Touch targets ≥ 44px. */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding: clamp(24px, 5vw, 64px) 0 clamp(16px, 3vw, 32px); }
.hero h1 { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem); line-height: 1.08; letter-spacing: -0.03em; margin-top: 16px; max-width: 16ch; }
.hero .lead { font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.6; color: var(--muted); margin-top: 20px; max-width: 54ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); padding: 6px 14px; border-radius: 99px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 25%, transparent); }
.facts { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.facts li { padding: 16px 16px 0 0; display: flex; flex-direction: column; gap: 2px; }
.facts li + li { padding-left: 16px; border-left: 1px solid var(--line); }
.facts b { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.facts span { font-size: .875rem; color: var(--muted); }
.hero-media { position: relative; display: grid; place-items: center; }
.hero-media::before { content: ""; position: absolute; inset: 12% 4% 4% 12%; background: var(--grad); filter: blur(64px); opacity: .28; border-radius: 48px; z-index: 0; }
.media-frame { position: relative; z-index: 1; width: 100%; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--card); border: 1px solid var(--line); }
.media-frame img, .media-frame video { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: cover; }
.glow { position: relative; }
/* iPhone: titanium frame, Dynamic Island, side buttons */
.iphone { position: relative; z-index: 1; width: min(300px, 74vw); margin: 0 auto; padding: 11px; border-radius: 52px;
  background: linear-gradient(145deg, #4b4459 0%, #1d1828 35%, #0d0a14 60%, #3a3347 100%); box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(255,255,255,.18), inset 0 0 0 4px #0b0811; }
.iphone .screen { position: relative; border-radius: 42px; overflow: hidden; background: #000; aspect-ratio: 9 / 16; }
.iphone .screen > canvas, .iphone .screen > video { width: 100%; height: 100%; display: block; object-fit: cover; background: #fff; }
.iphone .island { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 31%; height: 26px; border-radius: 20px; background: #000; z-index: 3; box-shadow: inset 0 0 0 1px #1a1a1a; }
.iphone .island::after { content: ""; position: absolute; right: 12px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #3b4a7a, #0b0f1d 60%); }
.iphone .btn-side { position: absolute; width: 4px; border-radius: 3px; background: linear-gradient(90deg, #2b2536, #5b5368); }
.iphone .btn-side.l1 { left: -3px; top: 21%; height: 9%; } .iphone .btn-side.l2 { left: -3px; top: 32%; height: 9%; } .iphone .btn-side.r1 { right: -3px; top: 26%; height: 14%; }
.screen.flat { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #000; }
.screen.flat > canvas, .screen.flat > video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: 99px; padding: 8px 16px; min-height: 40px; font-weight: 600; font-size: .875rem; box-shadow: none; }
.chip.on { background: var(--grad); color: #fff; border-color: transparent; }
.section { display: flex; flex-direction: column; gap: 32px; margin-top: clamp(48px, 7vw, 96px); scroll-margin-top: 80px; }
.section > .head { display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.section > .head p { color: var(--muted); max-width: 60ch; font-size: 1.0625rem; }
.kicker { font-size: .875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 24px; }
.sample { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.sample canvas, .sample img, .sample .vbox { width: 100%; aspect-ratio: 9 / 16; border-radius: 20px; box-shadow: var(--shadow); background: #fff; display: block; object-fit: cover; overflow: hidden; }
.sample figcaption { display: flex; flex-direction: column; gap: 4px; }
.sample figcaption b { font-size: 1.0625rem; }
.sample figcaption span { font-size: .9375rem; color: var(--muted); }
.vbox { position: relative; background: #000; }
.vbox video { width: 100%; height: 100%; object-fit: cover; display: block; }

.vbox .sound { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; box-shadow: none; font-size: 1.125rem; }
.demos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.demo { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); background: transparent; box-shadow: none; padding: 0; border-radius: 22px; }
.demo canvas { width: 100%; aspect-ratio: 9 / 16; border-radius: 20px; box-shadow: var(--shadow); background: #fff; display: block; }
.demo b { font-size: 1rem; } .demo small { color: var(--muted); font-weight: 500; font-size: .875rem; }
.steps3 { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.steps3 .card { gap: 12px; padding: 28px; box-shadow: none; }
.steps3 .card p { color: var(--muted); font-size: 1rem; }
.steps3 .num { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 1.125rem; }
.try { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 32px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 4vw, 48px); }
.try h2 { margin: 8px 0 12px; }
.try-box { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.formats .card { padding: 16px; gap: 6px; box-shadow: none; }
.formats .icon { font-size: 1.5rem; }
.faq { max-width: 760px; width: 100%; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.0625rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; min-height: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--muted); margin-top: 12px; max-width: 65ch; }
.cta-band { background: var(--grad); color: #fff; border-radius: 28px; padding: clamp(32px, 5vw, 64px); display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; box-shadow: var(--shadow-lg); margin-top: clamp(48px, 7vw, 96px); }
.cta-band p { opacity: .92; max-width: 56ch; font-size: 1.0625rem; }
.cta-band button, .cta-band .btn { background: #fff; color: var(--violet-2); }
footer.site { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 8px; display: flex; flex-wrap: wrap; gap: 12px 24px; color: var(--muted); font-size: .875rem; }
footer.site a { color: var(--muted); text-decoration: none; min-height: 24px; }
footer.site a:hover { color: var(--accent); }
.brand .beta { font-size: .6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--orange-2); border: 1.5px solid currentColor; border-radius: 6px; padding: 1px 6px; margin-left: 2px; }

/* ---------- login sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(18, 9, 36, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .18s ease; }
.sheet { width: min(860px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); border-radius: 26px; display: grid; grid-template-columns: 1fr 1fr; box-shadow: var(--shadow-lg); animation: rise .22s ease; }
.sheet .side { background: var(--grad); color: #fff; padding: 30px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.sheet .side ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sheet .side li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.22); margin-right: 8px; font-weight: 800; }
.sheet .side .mini { margin-top: auto; font-size: .82rem; opacity: .9; }
.sheet .main { padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.sheet .close { position: absolute; right: 12px; top: 12px; }
.gslot { min-height: 46px; display: flex; justify-content: center; }
.gslot.off { position: relative; opacity: .45; pointer-events: none; }
.secure { display: flex; gap: 8px; align-items: flex-start; font-size: .82rem; color: var(--muted); background: var(--grad-soft); border-radius: 12px; padding: 10px 12px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } }

/* ---------- studio */
.hello { background: var(--grad); color: #fff; border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-lg); }
.hello .planbar { color: #fff; }
.hello .planbar .pill { color: #fff; border-color: rgba(255,255,255,.6); }
.notice { background: linear-gradient(90deg, #fff7ed, #f5f3ff); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-weight: 600; }
.planbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.9rem; }
.detect { font-size: 0.85rem; min-height: 1.2em; color: var(--muted); }
.detect b { color: var(--accent); }
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl { background: var(--grad-soft); color: var(--ink); border: 1px solid var(--line); text-align: left; font-weight: 600; box-shadow: none; justify-content: flex-start; min-height: 56px; }
.tpl:hover { border-color: var(--accent); color: var(--accent); }
.tips ol { margin: 0; padding-left: 20px; }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.proj { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; color: var(--ink); display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; position: relative; overflow: hidden; }
.proj:hover { transform: translateY(-3px); border-color: var(--accent); }
.proj small { color: var(--muted); }
.proj .thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 12px; background: var(--grad); text-decoration: none; color: #fff; overflow: hidden; }
.proj .thumb .mi { font-size: 2.4rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
.proj .thumb small { position: absolute; left: 10px; bottom: 8px; color: rgba(255,255,255,.9); font-weight: 700; font-size: .72rem; }
.proj .thumb .play, .vthumb .play { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--violet); display: grid; place-items: center; font-size: .8rem; box-shadow: var(--shadow); }
.proj .pinfo { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.proj > .row { padding: 0 4px 4px; }
.stylepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.stylepick button { flex-direction: column; padding: 6px; background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: none; font-size: .78rem; font-weight: 600; gap: 4px; border-radius: 14px; }
.stylepick button.on { border-color: var(--accent); color: var(--accent); }
.stylepick canvas { width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; display: block; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.preview { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 10px; }
.preview .iphone { width: min(300px, 74vw, calc(56vh * 9 / 16 + 22px)); }
.scenes { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.scene { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.scene h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.line { font-family: var(--hand); font-size: 1.1rem; }
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.panel { border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.panel img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border-radius: 8px; }
.panel .tag, .tag { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.sketch { display: flex; flex-direction: column; gap: 8px; }
.skrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; border-top: 1px dashed var(--line); padding-top: 8px; }
.skrow > label { flex: 1 1 160px; }
.skrow > .tag { flex: 0 0 64px; align-self: center; }
.jobs { display: flex; flex-direction: column; gap: 8px; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); width: 0; transition: width 0.4s; }

/* plans */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); position: relative; }
.plan.hot { border: 2px solid transparent; background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box; }
.plan.hot::before { content: "Phổ biến"; position: absolute; top: -12px; right: 18px; background: var(--grad); color: #fff; font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.plan.current { outline: 3px solid var(--marker); }
.plan ul { margin: 0; padding-left: 18px; font-size: 0.92rem; }
.plan button { margin-top: auto; }
.price { font-size: 1.8rem; font-weight: 800; }
.price small { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.pay { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.pay img { max-width: 100%; height: auto; background: #fff; border-radius: 12px; }
.memo { font-family: ui-monospace, monospace; font-size: 1.05rem; background: var(--grad-soft); padding: 2px 8px; border-radius: 6px; }
.wait { color: var(--accent); font-weight: 700; }

/* legal / account */
.doc { max-width: 820px; margin: 0 auto; }
.doc .card { gap: 10px; }
.doc h2 { margin-top: 8px; font-size: 1.1rem; }
.doc p, .doc li { color: var(--ink); }
.doc ul { margin: 0; padding-left: 20px; }
.cookie button { flex: none; white-space: nowrap; }
.cookie { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); z-index: 40; max-width: 560px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-size: .86rem; }

/* admin */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.tabs a { text-decoration: none; padding: 7px 13px; border-radius: 10px; color: var(--ink); white-space: nowrap; font-weight: 600; }
.tabs a.on { background: var(--grad); color: #fff; }
.keyrow { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.keyrow > label { flex: 1 1 320px; }
.keyrow small { color: var(--muted); font-weight: 500; }
details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; font-weight: 700; margin-bottom: 10px; }
.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; }
td.data { min-width: 260px; max-width: 460px; white-space: normal; font-family: ui-monospace, monospace; font-size: 0.75rem; color: var(--muted); word-break: break-all; }
.savebar { position: sticky; bottom: calc(var(--tabbar) + 12px); display: flex; justify-content: flex-end; z-index: 5; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.4rem; }
.stat small { color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.spark i { flex: 1; background: var(--grad); border-radius: 3px 3px 0 0; min-height: 1px; }
.funnel div { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.funnel i { display: block; height: 14px; background: var(--grad); border-radius: 4px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.vis { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 6px 12px; align-items: center; }
.drawer { border-left: 4px solid var(--accent); }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #1c1433; color: #fff; padding: 12px 18px; border-radius: 14px; max-width: calc(100% - 32px); z-index: 60; box-shadow: var(--shadow-lg); font-weight: 600; }
.toast a { color: var(--marker); }

/* ---------- bottom tab bar (phones) */
.tabbar { display: none; }
@media (max-width: 820px) {
  .editor { grid-template-columns: 1fr; }
  .preview { position: static; max-width: 360px; margin: 0 auto; width: 100%; }
  .hero { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero h1, .hero .lead { margin-inline: auto; }
  .hero .cta, .hero .trust { justify-content: center; }
  .facts { text-align: left; }
  .try { grid-template-columns: 1fr; }
  .samples { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .stripe { grid-template-columns: repeat(2, 1fr); }
  .steps3 { grid-template-columns: 1fr; }
  .sheet { grid-template-columns: 1fr; border-radius: 26px 26px 0 0; align-self: end; max-height: 92dvh; }
  .sheet-bg { padding: 0; place-items: end center; }
  .sheet .side { padding: 22px; }
  .sheet .side ul, .sheet .side .mini { display: none; }
  .nav, .who #whoEmail { display: none; }
  .wrap { padding-bottom: calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 700; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a { position: relative; overflow: hidden; transition: color .15s; }
  .tabbar a.on::before { content: ""; position: absolute; top: 6px; width: 46px; height: 30px; border-radius: 99px; background: var(--grad-soft); z-index: -1; animation: pop .25s ease; }
  .tabbar a.on svg { stroke-width: 2.4; }
  .card { padding: 16px; }
}
@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr; }
  .facts li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .facts li { padding: 12px 0 0; }
  .hero .cta .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- motion & feedback */
.wrap.enter > * { animation: rise .28s ease both; }
.wrap.enter > *:nth-child(2) { animation-delay: .03s; } .wrap.enter > *:nth-child(3) { animation-delay: .06s; } .wrap.enter > *:nth-child(4) { animation-delay: .09s; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
button, .btn, .chip, .proj, .vcard, .mode, .tabbar a { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); animation: ripple .55s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; flex: none; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
button.busy, .btn.busy { opacity: .85; cursor: progress; }
a.chip, .chip { cursor: pointer; transition: transform .12s, background .15s; }
.chip:active, .mode:active, .quick:active, .tpl:active { transform: scale(.96); }
.chip.small { padding: 5px 11px; font-size: .78rem; }
/* loading */
.loader { display: grid; place-items: center; gap: 10px; padding: 18vh 0; color: var(--muted); font-weight: 600; }
.loader svg { width: 120px; height: 60px; }
.loader .ink { fill: none; stroke: var(--violet); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw 1.4s ease-in-out infinite; }
@keyframes draw { 50% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -160; } }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sk { border-radius: 16px; background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 40%, var(--card)) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk-card { height: 190px; } .sk-tall { aspect-ratio: 9 / 14; } .sk-player { height: 60vh; grid-column: 1 / -1; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { align-items: center; text-align: center; }
.big-emoji { font-size: 2.6rem; }

/* ---------- login */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 18px; border-radius: 99px; background: #fff; color: #1f1f1f; border: 1.5px solid #dadce0; font-weight: 700; text-decoration: none; font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.08); transition: box-shadow .15s, transform .12s; }
.gbtn:hover { box-shadow: 0 6px 16px rgba(0,0,0,.14); transform: translateY(-1px); }
.gbtn:active { transform: scale(.98); }
.agree { font-size: .82rem; color: var(--muted); text-align: center; }

/* ---------- create */
.plabel { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.mode { flex-direction: column; align-items: flex-start; text-align: left; gap: 3px; padding: 14px; background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: none; border-radius: 16px; font-weight: 600; transition: border-color .15s, transform .12s, box-shadow .15s; }
.mode:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }
.mode.on { border-color: var(--accent); background: var(--grad-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.mode.on::after { content: "✓"; position: absolute; right: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: .75rem; animation: pop .2s; }
.mode .mi { font-size: 1.5rem; } .mode small { color: var(--muted); font-weight: 500; font-size: .78rem; line-height: 1.4; }
.toggles { display: flex; flex-direction: column; gap: 10px; }
.card.inner, details.inner { box-shadow: none; background: var(--grad-soft); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.photo { display: flex; flex-direction: column; gap: 6px; }
.photo img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; border: 2px solid var(--card); box-shadow: var(--shadow); }
.tplpick .tpls { margin-top: 8px; }
.tpl.on { border-color: var(--accent); color: var(--accent); background: var(--card); }
.quicks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.quick { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.quick:hover { transform: translateY(-2px); border-color: var(--accent); }
.quick .qi { font-size: 1.5rem; } .quick small { color: var(--muted); }
.genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.genre { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); transition: transform .15s; }
.genre:hover { transform: translateY(-4px); }
.genre canvas { width: 100%; aspect-ratio: 9 / 16; border-radius: 22px; box-shadow: var(--shadow-lg); background: #111; }
.genre small { color: var(--muted); }

/* ---------- platform overlays (TikTok, Reels, Shorts, YouTube) */
.pfwrap { display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; }
.pfwrap > .screen.flat { width: 100%; }
.pf { position: absolute; inset: 0; z-index: 2; pointer-events: none; color: #fff; font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,.6); animation: fade .2s; }
.pf::before { content: ""; position: absolute; inset: auto 0 0 0; height: 38%; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.pf-top { position: absolute; top: 44px; left: 0; right: 0; display: flex; justify-content: center; gap: 14px; font-size: 12px; }
.pf-top span { opacity: .75; }
.pf-side { position: absolute; right: 8px; bottom: 16%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pf-side span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pf-side b { font-size: 20px; line-height: 1; }
.pf-side small { font-size: 9px; font-weight: 700; }
.pf-bottom { position: absolute; left: 10px; right: 54px; bottom: 12px; display: flex; flex-direction: column; gap: 3px; }
.pf-bottom p { margin: 0; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-bottom .row { gap: 6px; flex-wrap: nowrap; }
.pf .tags { font-weight: 700; }
.pf-av { width: 22px; height: 22px; border-radius: 50%; background: var(--grad); border: 1.5px solid #fff; display: inline-block; }
.pf-follow { border: 1px solid #fff; border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.pf-sub { background: #fff; color: #0f0f0f; border-radius: 99px; padding: 2px 9px; font-weight: 800; text-shadow: none; }
.pf.tiktok .pf-side span:first-child b { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); border: 2px solid #fff; display: grid; place-items: center; font-size: 16px; }
.pf.youtube::before { height: 30%; }
.pf.youtube .pf-top { top: 10px; justify-content: flex-start; padding: 0 12px; font-size: 13px; }
.pf.youtube .pf-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 54px; height: 38px; border-radius: 12px; background: rgba(255,0,0,.9); display: grid; place-items: center; font-size: 18px; }
.pf.youtube .pf-bottom { right: 12px; }
.pf.youtube .pf-bottom .row { justify-content: space-between; }
.pf-progress { height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; }
.pf-progress i { display: block; height: 100%; width: 22%; background: #f00; }
.pfchips { justify-content: center; }

/* ---------- watch & community */
.watch { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 24px; align-items: start; }
.watch.wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.watch .stage { position: sticky; top: 76px; }
.player { display: block; width: 100%; background: #000; }
.caption { white-space: pre-wrap; }
.community { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.vcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s; }
.vcard:hover { transform: translateY(-4px); }
.vcard.wide { grid-column: span 2; }
.vthumb { position: relative; aspect-ratio: 9 / 14; background: var(--grad); overflow: hidden; }
.vcard.wide .vthumb { aspect-ratio: 16 / 9; }
.vthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vthumb .mi { position: absolute; left: 10px; bottom: 8px; font-size: 1.3rem; }
.vmeta { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.vmeta b { font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.like { background: none; color: var(--muted); box-shadow: none; padding: 4px 8px; font-size: .85rem; border-radius: 99px; }
.like:hover { transform: none; box-shadow: none; color: var(--pink); }
.like.on { color: var(--pink); }
.like.on::first-letter { animation: pop .25s; }
.playerbox { position: relative; width: min(420px, 100%); background: var(--card); border-radius: 22px; padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-lg); animation: rise .22s ease; }
.playerbox.wide { width: min(900px, 100%); }
.playerbox .player { border-radius: 14px; max-height: 72dvh; }
.playerbox .close, .modal .close { position: absolute; right: 10px; top: 10px; z-index: 2; }

/* ---------- payment window */
.modal { position: relative; width: min(680px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--card); border-radius: 26px; padding: 24px; box-shadow: var(--shadow-lg); animation: rise .22s ease; }
.paybox { display: flex; flex-direction: column; gap: 16px; }
.payhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-right: 36px; }
.timer { display: flex; align-items: center; gap: 8px; }
.ring { position: relative; width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--violet), var(--orange), var(--violet)); }
.ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.ringfill { position: absolute; left: 50%; top: 2px; width: 2px; height: 11px; background: var(--ink); transform-origin: 50% 11px; z-index: 1; border-radius: 1px; }
.clock { font-size: 1.5rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock.low { color: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .5; } }
.qrwrap { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.qrwrap img { display: block; }
.payinfo { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.bankrow { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--grad-soft); }
.bankrow > div { display: flex; flex-direction: column; }
.banklogo { border-radius: 10px; background: #fff; object-fit: contain; border: 1px solid var(--line); display: inline-grid; place-items: center; font-size: .7rem; font-weight: 800; color: var(--violet); flex: none; }
.kv { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: center; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.kv span { color: var(--muted); font-size: .85rem; }
.kv .amount { color: var(--orange-2); font-size: 1.15rem; }
.small { font-size: .82rem; }
.success { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 24px 0; }
.success .tick { width: 76px; height: 76px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 2.4rem; display: grid; place-items: center; animation: pop .4s cubic-bezier(.2, 1.6, .4, 1); box-shadow: var(--shadow-lg); }
/* bank picker (admin) */
.banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; padding: 2px; }
.bankopt { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: none; border-radius: 12px; font-size: .82rem; font-weight: 600; justify-content: flex-start; text-align: left; }
.bankopt.on { border-color: var(--accent); background: var(--grad-soft); }
@media (max-width: 820px) {
  .watch, .watch.wide { grid-template-columns: 1fr; }
  .watch .stage { position: static; }
  .vcard.wide { grid-column: span 1; }
  .community { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .modal { border-radius: 26px 26px 0 0; align-self: end; max-height: 94dvh; padding: 18px; }
  .playerbox { align-self: center; }
  .kv { grid-template-columns: 84px 1fr auto; }
}
@media (max-width: 820px) { .who #logout, .who #adminLink { display: none !important; } }
/* Server render desk: real phases, reference-style storyboard and result actions. */
.render-desk{width:min(1080px,94vw);max-height:92dvh;padding:24px;border:1px solid var(--line);border-radius:24px;background:var(--card);color:var(--ink);box-shadow:var(--shadow-lg);overflow:auto}
.render-desk::backdrop{background:rgb(10 15 30 / .72);backdrop-filter:blur(5px)}
.render-desk-head{display:flex;align-items:center;gap:18px;justify-content:space-between;margin-bottom:24px}.render-desk-head h2{margin:4px 0;font-size:1.5rem}.render-clock{font-variant-numeric:tabular-nums;color:var(--muted)}
.render-steps{list-style:none;display:grid;grid-template-columns:repeat(5,1fr);gap:12px;padding:0;margin:0 0 24px}.render-steps li{border-bottom:3px solid var(--line);padding:10px 0;font-size:.85rem;color:var(--muted)}.render-steps .active{border-color:var(--accent);color:var(--accent);font-weight:700}.render-steps .complete{border-color:var(--good);color:var(--good)}.step-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:currentColor;margin-right:8px}
.render-desk-body{display:grid;grid-template-columns:minmax(220px,.7fr) minmax(280px,1fr);gap:28px}.render-still{margin:0;background:var(--grad-soft);border:1px solid var(--line);border-radius:18px;padding:14px;text-align:center}.render-still canvas{max-width:100%;max-height:56dvh;height:auto;object-fit:contain;border-radius:10px}.render-still figcaption{font-size:.8rem;color:var(--muted);padding-top:8px}.render-meter{display:flex;align-items:center;gap:12px}.render-meter progress{width:100%;height:12px;accent-color:var(--accent)}.render-storyboard{display:grid;gap:10px;margin-top:12px;max-height:260px;overflow:auto}.render-storyboard article{background:var(--grad-soft);border:1px solid var(--line);padding:12px;border-radius:12px}.render-storyboard p{font-size:.85rem;margin:6px 0}.zalo-message{max-width:340px;white-space:pre-wrap;overflow-wrap:anywhere}.render-state{font-size:.85rem}
@media(max-width:650px){.render-desk{padding:16px}.render-desk-body{grid-template-columns:1fr}.render-still canvas{max-height:30dvh}.render-steps{gap:6px}.render-steps li{font-size:.7rem}.render-desk-head{gap:8px}}
.render-storyboard{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.render-storyboard canvas{display:block;width:100%;height:150px;object-fit:contain;margin:8px 0}.render-storyboard p{overflow-wrap:anywhere}
/* admin: home page media and budget */
.mediafield { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.media-preview { border: 1.5px dashed var(--line); border-radius: 12px; min-height: 72px; display: grid; place-items: center; overflow: hidden; background: var(--paper); }
.media-preview img, .media-preview video { display: block; max-width: 100%; max-height: 220px; }
.budget-status { display: flex; flex-direction: column; gap: 12px; }
.budget-status .row { justify-content: space-between; }
.warn { color: #b45309; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
/* hero video keeps its 9:16 frame before (or without) metadata */
.media-frame:has(.vbox) { max-width: 360px; }
.media-frame .vbox { aspect-ratio: 9 / 16; max-height: 72vh; }
.media-frame .vbox video { height: 100%; object-fit: cover; }
/* video formats: picker cards with a live preview */
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.look { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 8px 12px; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 16px; box-shadow: none; text-align: left; font-weight: 600; min-height: 0; }
.look:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: none; box-shadow: none; }
.look.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.look canvas, .look .look-thumb { width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; display: block; background: #111; }
.look .look-thumb.classic { display: grid; place-items: center; font-size: 2.5rem; background: #fff8ee; }
.look b { font-size: .9375rem; line-height: 1.3; padding: 0 2px; }
.look small { color: var(--muted); font-weight: 500; font-size: .8125rem; line-height: 1.45; padding: 0 2px; }
.credit-tag { position: absolute; top: 14px; right: 14px; font-size: .6875rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #facc15; color: #2e1065; padding: 3px 8px; border-radius: 99px; }
.swatch { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 1.5px solid rgba(0,0,0,.15); flex: none; }
.grid.wide-2 { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; align-items: end; }
a.sample { text-decoration: none; color: var(--ink); }
.sample .cap { display: flex; flex-direction: column; gap: 4px; }
.sample .cap b { font-size: 1.0625rem; }
.sample .cap span { font-size: .9375rem; color: var(--muted); }
.grid.wide-2 .chips, .card .chips { justify-content: flex-start; }
/* account menu behind the avatar */
.usermenu { position: relative; }
.avatar { border: 0; cursor: pointer; padding: 0; min-height: 0; font-size: 1rem; box-shadow: none; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); width: min(320px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; display: flex; flex-direction: column; gap: 4px; }
.menu-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.menu-head b { font-size: 1rem; }
.menu-head span { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-stats { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; padding: 12px; border-bottom: 1px solid var(--line); font-size: .875rem; }
.menu-stats dt { color: var(--muted); }
.menu-stats dd { margin: 0; font-weight: 600; text-align: right; }
.menu-links { display: flex; flex-direction: column; padding: 4px 0 0; }
.menu-links a, .menu-links button { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9375rem; background: none; border: 0; box-shadow: none; justify-content: flex-start; }
.menu-links a:hover, .menu-links button:hover { background: var(--grad-soft); color: var(--accent); transform: none; box-shadow: none; }
.menu-links .menu-out { color: var(--bad); margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
#logout, #adminLink { display: none !important; }
@media (max-width: 820px) { #createBtn { display: none; } }

/* ===== v3: thin-bezel phone, one home page, video grid, consistent type ===== */
/* Type scale used everywhere: 14 (meta) · 16 (body) · 18 (lead/card title) · 24 (section h2 in cards) · 28-36 (page h1) · 36-56 (home h1).
   Text is left-aligned except centred section headers; headings balance their lines, paragraphs avoid orphans. */
h1, h2, h3, .lead { text-wrap: balance; }
p, li, dd, small { text-wrap: pretty; }
.wrap h1 { font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.25rem); line-height: 1.15; }
.wrap .hero h1 { font-size: clamp(2.25rem, 1.45rem + 3vw, 3.5rem); line-height: 1.1; max-width: 18ch; }
.card h2 { font-size: 1.25rem; line-height: 1.3; }
.card h3, .scene h3 { font-size: 1.0625rem; }
.muted, small { font-size: .875rem; }
label { font-size: .875rem; }
.pill { font-size: .8125rem; }

/* phone: thin bezel, no fake buttons */
.iphone { width: min(300px, 74vw); padding: 6px; border-radius: 40px; background: #0d0c12; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 24px 50px -24px rgba(20, 10, 40, .55); }
.iphone .screen { border-radius: 34px; }
.iphone .btn-side { display: none; }
.iphone .island { top: 9px; width: 26%; height: 22px; border-radius: 14px; box-shadow: none; }
.iphone .island::after { right: 9px; top: 6px; width: 9px; height: 9px; }
.preview .iphone { width: min(320px, 78vw, calc(62vh * 9 / 16 + 12px)); }
.phone-wrap { position: relative; z-index: 1; }
.demo-toggle { position: absolute; left: 50%; bottom: -60px; transform: translateX(-50%); width: 44px; height: 44px; padding: 0; border-radius: 50%; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .875rem; }
.demo-toggle:hover { transform: translateX(-50%); }

/* home */
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.hero-copy h1, .hero .lead { margin: 0; }
.benefits { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 1.0625rem; font-weight: 600; }
.benefits li { display: flex; align-items: center; gap: 10px; }
.benefits .tick { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); font-size: .8125rem; font-weight: 800; flex: none; }
.limit { font-size: .9375rem; color: var(--ink); background: var(--grad-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.hero .cta { margin-top: 4px; }
.hero-media { padding-bottom: 64px; }
.guide { display: grid; gap: 24px; }
.guide.has-video { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }
.guide-video .vbox { aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 4vw, 48px); }
.offer h2 { margin: 8px 0 12px; }
.offer-list { display: grid; grid-template-columns: auto 1fr; gap: 12px 24px; margin: 0; font-size: 1rem; }
.offer-list dt { color: var(--muted); }
.offer-list dd { margin: 0; font-weight: 600; }
.offer > .btn { grid-column: 1 / -1; justify-self: start; }
footer.site { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px 32px; align-items: start; }
footer.site .operator { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; }
footer.site .operator b { color: var(--ink); font-size: 1rem; }
footer.site .policies { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: flex-end; font-size: .875rem; }
footer.site > small { grid-column: 1 / -1; }

/* my videos */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pagehead p { margin-top: 6px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 24px 16px; }
.vcard2 { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.vtile { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #111; box-shadow: var(--shadow); }
.vtile video, .vtile canvas { width: 100%; height: 100%; object-fit: cover; display: block; background: #111; }
.vtile.wide video, .vtile.wide canvas { object-fit: contain; }
.vtile .vplay { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; font-size: .8125rem; transition: opacity .15s; }
.vtile:hover .vplay { opacity: 0; }
.vtile .vdraft { position: absolute; left: 10px; top: 10px; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.9); color: #17122b; }
.vmeta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vtitle { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vactions { display: flex; gap: 8px; }
.card.empty { align-items: flex-start; }
@media (max-width: 820px) {
  .offer, .guide.has-video, footer.site { grid-template-columns: 1fr; }
  footer.site .policies { justify-content: flex-start; }
  .hero-copy { align-items: center; text-align: center; }
  .benefits { align-items: flex-start; text-align: left; }
  .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
}
.wrap > .chips { justify-content: flex-start; }
.vtile .vposter { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; } .vtile.wide .vposter { object-fit: contain; background: #111; } .vtile .vposter.gone { opacity: 0; }
/* create: three steps */
.create { display: flex; flex-direction: column; gap: 20px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 28px); display: flex; flex-direction: column; gap: 16px; }
.step > header { display: flex; gap: 14px; align-items: flex-start; }
.step > header h2 { font-size: 1.25rem; line-height: 1.3; }
.step > header p { margin-top: 2px; }
.stepno { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; padding: 16px; border-radius: 14px; background: var(--grad-soft); border: 1px solid var(--line); font-size: .9375rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.advanced { border-top: 1px solid var(--line); padding-top: 12px; }
.advanced > summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.advanced[open] { display: flex; flex-direction: column; gap: 16px; }
/* pricing as a checkout */
.checkout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 24px; align-items: start; }
.choose { display: flex; flex-direction: column; gap: 12px; }
.choose h2 { font-size: 1.25rem; margin-top: 8px; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; text-align: left; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: none; font-weight: 500; }
.opt:hover { transform: none; box-shadow: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.opt.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.opt-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.0625rem; }
.opt-price { font-weight: 800; font-size: 1.0625rem; text-align: right; }
.opt > small { grid-column: 1 / -1; }
.order { position: sticky; top: 84px; }
.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; }
.total b { font-size: 1.75rem; color: var(--accent); font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .checkout { grid-template-columns: 1fr; } .order { position: static; } }
/* account settings */
.setgroup { gap: 16px; }
.setgroup > .btn { align-self: flex-start; }
.profile { display: flex; align-items: center; gap: 14px; min-width: 0; }
.profile p { margin-top: 2px; overflow-wrap: anywhere; }
.avatar.big { width: 52px; height: 52px; font-size: 1.25rem; flex: none; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.setrow:first-of-type { border-top: 0; padding-top: 0; }
.setrow p { margin-top: 2px; }
.danger-zone input { max-width: 220px; }
/* phones: the hero reads left-aligned like the rest of the page */
@media (max-width: 820px) {
  .hero, .hero-copy { text-align: left; align-items: flex-start; }
  .hero h1, .hero .lead { margin-inline: 0; }
  .hero .cta { justify-content: flex-start; width: 100%; }
  .setrow { flex-direction: column; align-items: flex-start; }
}

/* =====================================================================================
   v4 design system: one type scale and spacing scale for the whole site (desktop, tablet,
   mobile). Body text 16px everywhere, secondary 14px, headings scale with the screen but
   never shrink body text; contrast per WCAG 2.2 AA; works at 200% text zoom (rem units,
   no fixed heights on text).
   ===================================================================================== */
:root {
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.8125rem;   /* 13px: badges, counters only */
  --fs-sm: 0.875rem;    /* 14px: secondary text, labels, captions */
  --fs-base: 1rem;      /* 16px: body text, inputs, buttons */
  --fs-lg: 1.125rem;    /* 18px: lead paragraphs */
  --fs-h4: 1.0625rem;   /* 17px */
  --fs-h3: 1.1875rem;   /* 19px */
  --fs-h2: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem);   /* 22 → 28px */
  --fs-h1: clamp(1.625rem, 1.25rem + 1.6vw, 2.375rem);  /* 26 → 38px */
  --fs-hero: clamp(1.875rem, 1.35rem + 2.2vw, 2.75rem); /* 30 → 44px, home page only */
  --lh-tight: 1.2; --lh-head: 1.25; --lh-body: 1.6;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-heavy: 800;
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem; --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem;
  --section-gap: clamp(2.5rem, 1.8rem + 3vw, 4rem);
  --measure: 68ch;
}
body { font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh-body); font-weight: var(--fw-regular); }
h1, h2, h3, h4 { line-height: var(--lh-head); text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: var(--fs-h1); font-weight: var(--fw-heavy); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-heavy); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-bold); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-bold); margin: 0; }
.card h2, .sheet h2, dialog h2 { font-size: var(--fs-h3); }
p, li, dd, summary, small { text-wrap: pretty; }
p { max-width: var(--measure); }
small, .muted.small, figcaption { font-size: var(--fs-sm); }
label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
/* 16px fields: phones do not zoom in while typing */
input, select, textarea, .nv-select > button { font-size: max(16px, var(--fs-base)); }
button, .btn { font-size: var(--fs-base); font-weight: var(--fw-bold); }
button.small, .btn.small { font-size: var(--fs-sm); }
.pill, .badge, .credit-tag { font-size: var(--fs-xs); }
.kicker { font-size: var(--fs-sm); letter-spacing: .06em; }
.wrap { gap: var(--sp-5); padding-top: var(--sp-5); }

/* home page: tighter rhythm, one alignment (left), no oversized titles */
.hero { padding: clamp(1rem, 3vw, 2.5rem) 0 0; gap: clamp(1.5rem, 4vw, 3.5rem); }
.hero h1 { font-size: var(--fs-hero); line-height: 1.12; max-width: 20ch; margin: 0; }
.hero .lead { font-size: var(--fs-lg); margin: 0; }
.hero-copy { gap: var(--sp-4); }
.hero .benefits { gap: var(--sp-2); }
.hero-media { padding-bottom: var(--sp-6); }
.section { margin-top: var(--section-gap); gap: var(--sp-5); }
.section > .head { text-align: left; align-items: flex-start; gap: var(--sp-2); }
.section > .head p { font-size: var(--fs-base); }
.steps3 { gap: var(--sp-4); }
.steps3 .card { padding: var(--sp-5); gap: var(--sp-2); }
.steps3 .card p { font-size: var(--fs-base); }
.steps3 .num { width: 2.25rem; height: 2.25rem; font-size: var(--fs-base); }
.samples { gap: var(--sp-5); }
.offer, .try { gap: var(--sp-5); padding: clamp(1.25rem, 3vw, 2.5rem); }
.offer h2, .try h2 { margin: var(--sp-2) 0; }
.faq details { padding: var(--sp-4) 0; }
.faq summary { font-size: var(--fs-base); }
.limit { font-size: var(--fs-sm); }
.pagehead h1 { font-size: var(--fs-h1); }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-media { order: 2; }
  .section { gap: var(--sp-4); }
}

/* format picker: grouped (hand-drawn first) */
.lookgroups { display: flex; flex-direction: column; gap: var(--sp-5); }
.lookgroup { display: flex; flex-direction: column; gap: var(--sp-3); }
.lookgroup > h3 { font-size: var(--fs-h4); color: var(--muted); font-weight: var(--fw-semibold); }

/* modern dropdown (enhanced <select>): button + listbox, keyboard and screen-reader friendly */
.nv-select { position: relative; width: 100%; min-width: 0; }
.nv-select > select { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 100%; }
.nv-select > button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); text-align: left;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; box-shadow: none; font-weight: var(--fw-medium); }
.nv-select > button:hover { transform: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: none; }
.nv-select > button[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.nv-select > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nv-select > button::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.nv-select > button[aria-expanded="true"]::after { transform: rotate(225deg) translate(-2px, -2px); }
.nv-select > button:disabled { opacity: .55; }
.nv-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: min(320px, 50dvh); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.nv-list.up { top: auto; bottom: calc(100% + 6px); }
.nv-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); font-size: var(--fs-base); line-height: 1.35; }
.nv-list li[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: var(--fw-semibold); }
.nv-list li.active { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.nv-list li[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.nv-list li.group { cursor: default; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px 4px; background: none; }
.nv-list .play { flex: none; width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); box-shadow: none; font-size: .8rem; }
.nv-list .play:hover { transform: none; background: var(--accent); color: var(--accent-ink); }
.voice-field { display: flex; gap: var(--sp-2); align-items: stretch; }
.voice-field .nv-select { flex: 1; }
.voice-field .listen { flex: none; min-height: 46px; padding: 0 14px; }

/* segmented choice (voice source, ratio) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: color-mix(in srgb, var(--accent) 6%, var(--card)); border: 1px solid var(--line); border-radius: 12px; }
.seg button { background: transparent; color: var(--ink); box-shadow: none; min-height: 38px; padding: 6px 14px; font-weight: var(--fw-semibold); font-size: var(--fs-sm); border-radius: 9px; }
.seg button:hover { transform: none; box-shadow: none; color: var(--accent); }
.seg button.on { background: var(--card); color: var(--accent); box-shadow: 0 1px 6px -2px rgba(0,0,0,.18); }
.slider { display: flex; flex-direction: column; gap: 4px; }
.slider input[type=range] { padding: 0; border: 0; accent-color: var(--accent); background: transparent; }

.audio .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.audio .seg button { padding: 6px 8px; }
.card.flat { box-shadow: none; padding: var(--sp-4); gap: var(--sp-3); }

/* ---------- admin: sidebar by task, compact density */
.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.admin-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: var(--sp-4); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: var(--sp-3); }
.admin-group { display: flex; flex-direction: column; gap: 2px; }
.admin-group > span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: var(--fw-semibold); padding: 4px 10px; }
.admin-group a { text-decoration: none; color: var(--ink); padding: 8px 10px; border-radius: 9px; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.admin-group a:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.admin-group a.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: var(--fw-bold); }
.admin-main { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.admin-head { display: flex; flex-direction: column; gap: 4px; }
.admin-head h1 { font-size: var(--fs-h2); }
.admin-head p { font-size: var(--fs-sm); }
.admin-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.admin .card { padding: var(--sp-4); gap: var(--sp-3); box-shadow: none; border-radius: 12px; }
.admin .card h2 { font-size: var(--fs-h4); }
.admin .card > p.muted { font-size: var(--fs-sm); margin-top: -6px; }
.admin .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-2); }
.admin .stat { padding: 10px 12px; border-radius: 10px; }
.admin .stat b { font-size: 1.25rem; }
.admin .table table { font-size: var(--fs-sm); }
.admin .table th, .admin .table td { padding: 8px 10px; }
.admin .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.admin .savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: flex-end; }
.admin .savebar button { box-shadow: var(--shadow-lg); }
.kv { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 8px 16px; margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv ol { margin: 0; padding-left: 18px; }
.frames { display: flex; gap: 8px; flex-wrap: wrap; }
.frames img { height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.proposal:not(:empty) { border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.formats { display: flex; flex-direction: column; gap: var(--sp-3); }
.fmt { border: 1px solid var(--line); border-radius: 12px; padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); }
.fmt-head { display: flex; align-items: center; gap: var(--sp-2); }
.fmt-head .danger { margin-left: auto; }
details.brief { border-top: 1px solid var(--line); padding: 10px 0; }
details.brief summary { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: var(--fs-sm); }
details.brief textarea { margin: 8px 0; font-size: var(--fs-sm); }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; gap: var(--sp-3); scrollbar-width: none; }
  .admin-group { flex-direction: row; align-items: center; flex: none; }
  .admin-group > span { display: none; }
  .admin-group a { white-space: nowrap; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}

/* readability floor: labels ≥ 13px, badges legible; header never overflows (200% text zoom) */
.tabbar a, .tabbar a span { font-size: var(--fs-xs); }
.vdraft, .vtile .vdraft, .vthumb .vdraft { font-size: var(--fs-xs); }
.brand .beta { font-size: var(--fs-xs); }
.top { flex-wrap: nowrap; min-width: 0; }
.brand { min-width: 0; flex: 1 1 auto; overflow: hidden; }
.brand > span:not(.logo) { overflow: hidden; text-overflow: ellipsis; }
.who { flex: none; }
@media (max-width: 420px) { .brand #brandAccent { display: none; } }

/* format picker: a dropdown and the chosen way playing beside it */
.lookpick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); gap: var(--sp-5); align-items: start; }
.lookpick-side { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.lookpick-side label { font-weight: 600; }
.look-note { margin: 0; color: var(--muted); line-height: 1.6; }
.look-demo { margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.look-demo canvas { width: 100%; max-width: 100%; aspect-ratio: 9 / 16; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: block; }
.look-demo figcaption { font-size: .8125rem; color: var(--muted); text-align: center; }
@media (max-width: 640px) { .lookpick { grid-template-columns: 1fr; } .look-demo { max-width: 240px; margin-inline: auto; width: 100%; } }

.section .more { display: flex; justify-content: center; margin: var(--sp-4) 0 0; }

/* ======================================================================
   Giao diện 2026-10 (theo ảnh tham chiếu): xanh dương sạch, thanh bên trái
   kiểu ứng dụng trên máy tính, thẻ trắng viền mảnh, nút đặc màu.
   Lớp này đè lên phần trên; phần trên vẫn lo bố cục điện thoại và các màn cũ.
   ====================================================================== */
:root {
  --blue: #1f5eff; --blue-2: #1748d6; --blue-soft: #eaf1ff; --navy: #0f1b3d; --sun: #ffb020;
  --violet: var(--blue); --violet-2: var(--blue-2); --orange: var(--sun); --orange-2: #f59e0b; --pink: var(--blue);
  --grad: linear-gradient(135deg, #2f6bff 0%, #1f5eff 55%, #1748d6 100%);
  --grad-soft: linear-gradient(135deg, #eef4ff 0%, #f6f9ff 100%);
  --paper: #f5f7fb; --card: #ffffff; --ink: #0f1b3d; --muted: #5b6785; --line: #e6eaf2;
  --accent: var(--blue); --accent-ink: #ffffff; --marker: #ffd27a;
  --shadow: 0 1px 2px rgba(15, 27, 61, .04), 0 6px 18px -10px rgba(15, 27, 61, .18);
  --shadow-lg: 0 24px 48px -24px rgba(15, 27, 61, .28);
  --radius: 14px; --side: 236px;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #0b1020; --card: #121a30; --ink: #eef2ff; --muted: #9aa6c7; --line: #22304f; --accent: #6b95ff; --blue-soft: #16244a;
    --grad-soft: linear-gradient(135deg, #131d3a 0%, #0f1730 100%); }
}
body { background: var(--paper); }
.grad-text { background: none; color: var(--accent); -webkit-text-fill-color: currentColor; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons: solid blue, quiet ghost */
button, .btn { background: var(--blue); box-shadow: 0 6px 14px -8px rgba(31, 94, 255, .7); border-radius: 10px; }
button:hover, .btn:hover { background: var(--blue-2); box-shadow: 0 8px 18px -8px rgba(31, 94, 255, .75); }
button.ghost, .btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); color: var(--accent); }
.btn .ic, button .ic { width: 18px; height: 18px; flex: none; }
.card { box-shadow: var(--shadow); border-radius: var(--radius); }
.badge { background: var(--blue); }
.pill { border: 0; background: color-mix(in srgb, currentColor 12%, transparent); }
.pill.queued { color: #b26b00; } .pill.running { color: var(--blue); }

/* header */
.top { background: color-mix(in srgb, var(--card) 92%, transparent); }
.brand .logo { background: var(--blue); box-shadow: none; border-radius: 10px; }
.brand span.accent { background: none; color: var(--accent); -webkit-text-fill-color: currentColor; }
.nav a { font-weight: 600; color: var(--muted); border-radius: 0; padding: 10px 12px; border-bottom: 2px solid transparent; }
.nav a:hover { background: none; color: var(--ink); }
.nav a.on { background: none; color: var(--accent); border-bottom-color: var(--accent); }
.topsearch { flex: 1; max-width: 340px; margin-left: auto; position: relative; display: flex; align-items: center; }
.topsearch svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.topsearch input { padding: 8px 12px 8px 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-size: .9375rem; min-height: 40px; }
.iconbtn { position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.iconbtn:hover { background: var(--blue-soft); color: var(--accent); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--card); }
.avatar { background: var(--blue); }

/* side bar (desktop app pages) */
.appside { display: none; }
@media (min-width: 1024px) {
  body:not([data-page="home"]) .appside { display: flex; flex-direction: column; gap: 6px; position: fixed; inset: 0 auto 0 0; width: var(--side); padding: 18px 14px; background: var(--card); border-right: 1px solid var(--line); z-index: 40; overflow-y: auto; }
  body:not([data-page="home"]) .top { margin-left: var(--side); }
  body:not([data-page="home"]) .top > .brand, body:not([data-page="home"]) .top > .nav { display: none; }
  body:not([data-page="home"]) .top .topsearch { margin-left: 0; }
  body:not([data-page="home"]) main.wrap { margin-left: calc(var(--side) + max(0px, (100vw - var(--side) - 1240px) / 2)); max-width: 1240px; }
  body:not([data-page="home"]) .cookie { left: calc(var(--side) + 16px); }
}
.appside > * { flex: none; }
.appside .brand { padding: 4px 8px 14px; height: auto; min-height: 0; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav.bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sidenav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9375rem; }
.sidenav a svg { width: 20px; height: 20px; flex: none; }
.sidenav a:hover { background: var(--paper); color: var(--ink); }
.sidenav a.on { background: var(--blue-soft); color: var(--accent); }
@media (max-width: 1023px) { .topsearch { max-width: 260px; } }
@media (max-width: 640px) { .topsearch { display: none; } }

/* page heads, tabs, toolbars */
.pagehead { align-items: center; }
.pagehead h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.02em; }
.pagehead.center { justify-content: center; text-align: center; }
.pagehead.center p { max-width: 62ch; margin-inline: auto; }
p.center { text-align: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { background: var(--card); color: var(--muted); border: 1px solid var(--line); box-shadow: none; border-radius: 999px; padding: 6px 16px; min-height: 36px; font-weight: 600; font-size: .875rem; }
.tab:hover { background: var(--blue-soft); color: var(--accent); box-shadow: none; transform: none; }
.tab.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar select { width: auto; min-height: 40px; padding: 8px 12px; border-radius: 10px; border-width: 1px; }
.searchbox { position: relative; flex: 1 1 260px; flex-direction: row; align-items: center; }
.searchbox svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); }
.searchbox input { padding-left: 38px; min-height: 40px; border-radius: 10px; border-width: 1px; }

/* ---------- home (reference 1) */
.hero2 { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); padding-top: clamp(16px, 4vw, 48px); }
.hero2 h1 { font-size: clamp(2.25rem, 1.3rem + 3.2vw, 3.5rem); line-height: 1.12; max-width: 15ch; margin: 0; color: var(--ink); }
.hero2 h1 em { font-style: normal; color: var(--blue); }
.hero2 .lead { margin-top: 18px; }
.hero2 .cta { margin-top: 26px; }
.hero2 .cta .btn, .hero2 .cta button { min-height: 50px; padding: 12px 22px; }
.hstats { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 14px 32px; }
.hstats li { display: flex; align-items: center; gap: 10px; }
.hstats .stat-ic { width: 26px; height: 26px; color: var(--sun); }
.hstats b { display: block; font-size: 1.125rem; line-height: 1.2; }
.hstats span { font-size: .8125rem; color: var(--muted); }
.hero2 .limit { margin-top: 16px; font-size: .875rem; color: var(--muted); background: none; border: 0; padding: 0; }
.hstats { flex-wrap: nowrap; gap: 24px; } @media (max-width: 1180px) { .hstats { flex-wrap: wrap; } }
.hero2 .hero-copy { max-width: 600px; }
.hero-art { position: relative; display: grid; place-items: center; width: 100%; }
.hero-art .art-frame { position: relative; width: min(330px, 78vw); border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.hero-art .art-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; }
.hero-art .bubble { position: absolute; top: 4%; right: max(0px, calc(50% - 300px)); z-index: 2; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 18px; padding: 10px 14px;
  font: 700 1rem/1.25 var(--hand); transform: rotate(4deg); box-shadow: 4px 4px 0 var(--ink); }
.hero-art .bubble::after { content: ""; position: absolute; left: 18px; bottom: -10px; width: 16px; height: 16px; background: #fff; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); }
.hero-media::before { background: radial-gradient(closest-side, #cfe0ff, transparent); opacity: .7; }
.hero-art .demo-toggle { position: absolute; right: 10px; bottom: 10px; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: var(--shadow); }
.feature .fic { width: 52px; height: 52px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; margin-bottom: 4px; }
.feature .fic svg { width: 28px; height: 28px; }
.feature h3 { font-size: 1rem; }
.feature p { font-size: .875rem; color: var(--muted); }
.flow { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.flow h2 { font-size: 1.25rem; }
.flow ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.flow li { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); position: relative; }
.flow li + li::before { content: ""; position: absolute; left: -12px; top: 50%; width: 10px; border-top: 2px dashed color-mix(in srgb, var(--blue) 40%, transparent); }
.flow .num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; }
.flow p { font-size: .875rem; font-weight: 600; line-height: 1.35; }
@media (max-width: 1023px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } .flow ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } .flow li::before { display: none; } }
@media (max-width: 820px) { .hero2 { grid-template-columns: 1fr; } .hero2 h1 { margin-inline: auto; } .hstats { justify-content: center; } .hero-art .bubble { right: 4%; } }
@media (max-width: 520px) { .features, .flow ol { grid-template-columns: 1fr; } }

/* ---------- formats (reference 3) */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 18px; }
.fcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.fcard:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); transform: translateY(-2px); }
.fthumb { position: relative; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.fthumb canvas { height: 100%; width: auto; max-width: 100%; display: block; }
.fthumb.wide canvas { width: 100%; height: auto; }
.fthumb .credit-tag { position: absolute; left: 8px; top: 8px; }
.fcard h3 { font-size: 1rem; margin-top: 4px; }
.fcard p { font-size: .8125rem; line-height: 1.5; flex: 1; }
.fcard button { width: 100%; }
.fcard > button { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.fcard > button:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- community (reference 4) */
.community { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 18px; }
.vcard { border-radius: var(--radius); box-shadow: var(--shadow); }
.vcard:hover { transform: translateY(-3px); }
.vthumb { aspect-ratio: 16 / 10; background: #eef2fa; }
.vthumb .play { color: var(--blue); right: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; opacity: 0; transition: opacity .15s; }
.vcard:hover .vthumb .play { opacity: 1; }
.vthumb .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(15, 27, 61, .82); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.vcard .vmeta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.vcard .vtitle { font-size: .9375rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vauthor { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); }
.vauthor .av { width: 24px; height: 24px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: .75rem; }
.vstats { display: flex; align-items: center; gap: 14px; font-size: .8125rem; color: var(--muted); }
.vstats > span { display: inline-flex; align-items: center; gap: 4px; }
.vstats svg { width: 16px; height: 16px; }
.vstats .like { background: none; border: 0; box-shadow: none; color: var(--muted); padding: 0; min-height: 0; gap: 4px; font-weight: 600; font-size: .8125rem; }
.vstats .like.on { color: #ef4444; }
.vstats .like.on svg { fill: currentColor; }

/* ---------- pricing (reference 5) */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; align-items: stretch; max-width: 1040px; margin-inline: auto; width: 100%; }
.plan { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); text-align: center; }
.plan.hot { border: 2px solid var(--blue); box-shadow: 0 24px 40px -24px rgba(31, 94, 255, .45); }
.plan .ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--sun); color: #3b2500; font-weight: 800; font-size: .75rem; padding: 4px 14px; border-radius: 999px; white-space: nowrap; }
.plan-ic { width: 46px; height: 46px; margin: 0 auto; color: var(--blue); display: grid; place-items: center; }
.plan.hot .plan-ic { color: var(--sun); }
.plan-ic svg { width: 40px; height: 40px; }
.plan h2 { font-size: 1.25rem; }
.plan .price { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.plan .price b { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.plan .price span { color: var(--muted); }
.plan .ticks { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-direction: column; gap: 8px; text-align: left; flex: 1; }
.plan .ticks li { display: flex; gap: 8px; align-items: flex-start; font-size: .9375rem; }
.plan .ticks svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--blue); }
.plan.hot .ticks svg { color: var(--sun); }
.plan > .btn, .plan > button { width: 100%; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pack { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }

/* ---------- my videos (reference 6) */
.vrows { display: flex; flex-direction: column; gap: 10px; }
.vrow { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 10px 10px; box-shadow: var(--shadow); }
.vrow-thumb { display: grid; place-items: center; width: 112px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #eef2fa; color: var(--muted); }
.vrow-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vrow-thumb .noimg svg { width: 28px; height: 28px; }
.vrow-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.vrow-main .vtitle { font-weight: 700; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.vrow-main .vtitle:hover { color: var(--accent); }
.vrow-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .vrow { grid-template-columns: 88px minmax(0, 1fr); } .vrow-thumb { width: 88px; } .vrow-act { grid-column: 1 / -1; justify-content: flex-start; } }

/* ---------- admin (reference 7): tiles look like KPI cards */
.stat { border-radius: var(--radius); }
.stat b { color: var(--ink); }
.plan.hot { background: var(--card); }
.plan.hot::before { content: none; }
.plans + p.center, p.center { align-self: center; max-width: 70ch; }
.toolbar > .nv-select, .toolbar > select { width: auto; flex: 0 0 auto; min-width: 190px; }
.toolbar > .searchbox { flex: 1 1 280px; }
@media (max-width: 640px) { .toolbar > .nv-select, .toolbar > select { flex: 1 1 140px; min-width: 0; } }
/* month / year switch on the pricing page */
.billing { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; font-weight: 600; color: var(--muted); }
.billing .bl.on { color: var(--ink); }
.switch { width: 52px; height: 30px; min-height: 30px; padding: 0; border-radius: 99px; background: #cfd6e4; box-shadow: none; position: relative; }
.switch:hover { background: #bcc5d8; box-shadow: none; transform: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--blue); } .switch.on i { transform: translateX(22px); }
.billing .save { background: #fff4dc; color: #8a5300; font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.plan .struck { color: var(--muted); font-size: .875rem; margin-top: -6px; }
.plan .struck s { margin-right: 4px; }
.plan .small { font-size: .8125rem; }

/* ---------- video editor (reference 2): scenes | stage | panel, timeline below */
body[data-page="editor"] main.wrap { max-width: none; padding: 16px 20px 40px; }
@media (min-width: 1024px) { body[data-page="editor"] main.wrap { margin-left: var(--side); } }
.studio { display: grid; gap: 14px; grid-template-columns: 250px minmax(0, 1fr) 380px; grid-template-areas: "bar bar bar" "list stage panel" "tl tl tl"; align-items: start; }
.sbar { grid-area: bar; display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; box-shadow: var(--shadow); flex-wrap: wrap; }
.sbar .grow { flex: 1; }
.sbar .ptitle { width: auto; flex: 0 1 380px; min-width: 160px; border: 1px solid transparent; font-weight: 700; padding: 6px 10px; min-height: 38px; }
.sbar .ptitle:hover, .sbar .ptitle:focus { border-color: var(--line); }
.sbar > .nv-select, .sbar > select { width: auto; flex: 0 0 auto; min-width: 120px; }
.sbar .export-btn { min-height: 40px; }
.scol { grid-area: list; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); position: sticky; top: 76px; max-height: calc(100dvh - 300px); min-height: 280px; }
.scol h2 { font-size: .9375rem; }
.slist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 0; }
.sitem { width: 100%; display: grid; grid-template-columns: 22px 64px minmax(0, 1fr); gap: 8px; align-items: center; text-align: left; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: none; min-height: 0; font-weight: 500; }
.sitem:hover { background: var(--paper); box-shadow: none; transform: none; }
.slist li.on .sitem { border-color: var(--blue); background: var(--blue-soft); }
.slist li.now .snum { background: var(--blue); color: #fff; }
.snum { width: 22px; height: 22px; border-radius: 50%; background: var(--paper); color: var(--muted); display: grid; place-items: center; font-size: .75rem; font-weight: 800; }
.sthumb { width: 64px; height: auto; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: block; }
.stext { display: flex; flex-direction: column; min-width: 0; }
.stext b { font-size: .8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stext small { font-size: .6875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage { grid-area: stage; display: flex; flex-direction: column; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.stage .pfwrap { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stage-screen { width: auto; max-width: 100%; border-radius: 14px; box-shadow: none; }
.stage-screen canvas { aspect-ratio: 9 / 16 !important; height: min(56dvh, 560px); width: auto !important; max-width: 100%; }
.stage-screen.wide canvas { aspect-ratio: 16 / 9 !important; height: auto; width: 100% !important; max-height: 52dvh; }
.transport { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; border-radius: 12px; padding: 6px 8px 6px 6px; }
.transport button { min-height: 34px; }
.transport button.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.transport .clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .875rem; padding: 0 6px; }
.pcol { grid-area: panel; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; position: sticky; top: 76px; max-height: calc(100dvh - 300px); min-height: 280px; }
.ptabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 8px; }
.ptabs button { background: none; color: var(--muted); box-shadow: none; border-radius: 0; border-bottom: 2px solid transparent; min-height: 44px; padding: 8px 12px; font-size: .875rem; }
.ptabs button:hover { background: none; color: var(--ink); box-shadow: none; transform: none; }
.ptabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.pbody { overflow-y: auto; padding: 12px; min-height: 0; }
.pbody > .card, .pbody .scenes > .card, .sdetail .scene { box-shadow: none; border: 0; padding: 4px 2px; }
.sdetail { display: flex; flex-direction: column; gap: 12px; }
.sdetail .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tl { grid-area: tl; display: grid; grid-template-columns: 110px minmax(0, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 12px 10px; font-size: .75rem; }
.tl-names { display: grid; grid-template-rows: 22px repeat(5, 30px); gap: 4px; color: var(--muted); font-weight: 600; }
.tl-names span { display: flex; align-items: center; gap: 6px; }
.tl-names svg { width: 16px; height: 16px; }
.tl-body { position: relative; display: grid; grid-template-rows: 22px repeat(5, 30px); gap: 4px; cursor: pointer; min-width: 0; }
.tl-ruler { position: relative; border-bottom: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-ruler span { position: absolute; top: 2px; transform: translateX(-50%); font-size: .6875rem; }
.tl-ruler span:first-child { transform: none; }
.tl-lane { position: relative; background: var(--paper); border-radius: 6px; overflow: hidden; }
.tl-box { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; padding: 0 6px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; font-size: .6875rem; }
.tl-box.sc { background: #dfe8ff; color: #1a3d99; } .tl-box.sc.on { background: var(--blue); color: #fff; }
.tl-box.tx { background: #e3f0ff; color: #0f4c8a; border: 1px solid #c3dcff; }
.tl-box.im { background: #fff1d6; color: #7a4a00; } .tl-box.im.on { outline: 2px solid var(--sun); }
.tl-box.mu { background: #e3f7ef; color: #0c6b48; }
.tl-empty { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.tl-wave { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, #22b07d 0 2px, transparent 2px 4px); opacity: .85;
  -webkit-mask: linear-gradient(0deg, transparent 0 20%, #000 20% 80%, transparent 80%), radial-gradient(#000, #000); mask-image: repeating-linear-gradient(90deg, #000 0 6px, rgba(0,0,0,.45) 6px 10px); }
.tl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--blue); pointer-events: none; }
.tl-head::before { content: ""; position: absolute; top: 0; left: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--blue); }
@media (max-width: 1279px) {
  .studio { grid-template-columns: 220px minmax(0, 1fr) 340px; }
}
@media (max-width: 1099px) {
  .studio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "bar bar" "stage panel" "list list" "tl tl"; }
  .scol { position: static; max-height: none; min-height: 0; }
  .slist { flex-direction: row; overflow-x: auto; }
  .slist li { flex: 0 0 210px; }
}
@media (max-width: 760px) {
  body[data-page="editor"] main.wrap { padding: 10px 10px calc(var(--tabbar) + 40px); }
  .studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "stage" "list" "panel" "tl"; }
  .pcol { position: static; max-height: none; }
  .stage-screen canvas { height: min(60dvh, 520px); }
  .tl { grid-template-columns: 76px minmax(0, 1fr); }
  .tl-names span { font-size: .625rem; } .tl-names svg { display: none; }
  .sbar .ptitle { flex: 1 1 100%; order: 3; }
}
.stage-screen { width: fit-content !important; max-width: 100%; align-self: center; background: #fff; }
.stage-screen canvas { height: min(44dvh, 440px); }
.stage-screen.wide canvas { max-height: 40dvh; }
.stage .pfwrap > small { display: none; }
.stage .pfchips .chip { min-height: 30px; padding: 4px 10px; font-size: .75rem; }
@media (min-width: 1100px) { .scol, .pcol { max-height: calc(100dvh - 330px); } }
.studio .screen.flat.stage-screen > canvas { height: min(44dvh, 440px) !important; width: auto !important; aspect-ratio: auto !important; }
.studio .screen.flat.stage-screen.wide > canvas { height: auto !important; width: 100% !important; max-height: 40dvh; }
