/* Ralso Studio — "Kaveri night" theme */
@font-face { font-family: "Noto Sans Tamil"; src: url(/fonts/NotoSansTamil.ttf); font-weight: 700; font-display: swap; unicode-range: U+0B80-0BFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Devanagari"; src: url(/fonts/NotoSansDevanagari.ttf); font-weight: 700; font-display: swap; unicode-range: U+0900-097F, U+A8E0-A8FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Telugu"; src: url(/fonts/NotoSansTelugu.ttf); font-weight: 700; font-display: swap; unicode-range: U+0C00-0C7F, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Kannada"; src: url(/fonts/NotoSansKannada.ttf); font-weight: 700; font-display: swap; unicode-range: U+0C80-0CFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Malayalam"; src: url(/fonts/NotoSansMalayalam.ttf); font-weight: 700; font-display: swap; unicode-range: U+0D00-0D7F, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Bengali"; src: url(/fonts/NotoSansBengali.ttf); font-weight: 700; font-display: swap; unicode-range: U+0980-09FF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Gujarati"; src: url(/fonts/NotoSansGujarati.ttf); font-weight: 700; font-display: swap; unicode-range: U+0A80-0AFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Oriya"; src: url(/fonts/NotoSansOriya.ttf); font-weight: 700; font-display: swap; unicode-range: U+0B00-0B7F, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans"; src: url(/fonts/NotoSans.ttf); font-weight: 700; font-display: swap; }

:root {
  --night: #15132B;
  --night-2: #1B1937;
  --panel: #1F1C3D;
  --panel-2: #272449;
  --line: #36325F;
  --line-soft: #2B2850;
  --jasmine: #F6F1E7;
  --muted: #B4AFCB;
  --faint: #8984A8;
  --turmeric: #F2B705;
  --turmeric-ink: #2A2000;
  --peacock: #2BB3A3;
  --kumkum: #E5484D;
  --leaf: #4CC38A;
  --display: "Baloo Thambi 2", "Noto Sans Tamil", system-ui, sans-serif;
  --body: "Hind Madurai", "Noto Sans Tamil", "Noto Sans Devanagari", "Noto Sans Telugu", "Noto Sans Kannada",
          "Noto Sans Malayalam", "Noto Sans Bengali", "Noto Sans Gujarati", "Noto Sans Oriya", system-ui, sans-serif;
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-pill: 999px;
  --rail: 232px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night); color: var(--jasmine); font-family: var(--body);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img, video, canvas { max-width: 100%; display: block; }
a { color: var(--turmeric); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--turmeric); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--turmeric); color: var(--turmeric-ink); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: .9rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px; border-right: 1px solid var(--line-soft); background: var(--night-2);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-family: var(--display);
  font-weight: 800; font-size: 1.25rem; color: var(--jasmine); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--night);
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md);
  color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--jasmine); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--panel-2); color: var(--jasmine); }
.nav a[aria-current="page"] svg { color: var(--turmeric); }
.nav .sep { height: 1px; background: var(--line-soft); margin: 10px 8px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.credit-pill { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px;
  border-radius: var(--r-md); background: var(--panel); color: var(--jasmine); }
.credit-pill:hover { text-decoration: none; background: var(--panel-2); }
.credit-pill b { font-family: var(--display); font-size: 1.15rem; color: var(--turmeric); }
.who { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .9rem; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.linkbtn:hover { color: var(--jasmine); }

main { min-width: 0; padding: 28px clamp(16px, 3vw, 44px) 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; color: var(--muted); max-width: 62ch; }

.tabbar { display: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--jasmine); padding: 10px 16px; border-radius: var(--r-pill);
  cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--turmeric); border-color: var(--turmeric); color: var(--turmeric-ink); }
.btn.primary:hover { background: #FFC61F; }
.btn.ghost { background: transparent; }
.btn.danger { color: #FFB3B5; border-color: #5a2b3a; }
.btn.danger:hover { background: #3a1b26; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.big { padding: 15px 26px; font-size: 1.08rem; font-family: var(--display); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: .95rem; }
.field small { color: var(--faint); }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; background: var(--night); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 14px; color: var(--jasmine); }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--turmeric); box-shadow: 0 0 0 3px #f2b70522; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input[type=range] { width: 100%; accent-color: var(--turmeric); }
input[type=color] { width: 42px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 7px 13px;
  border-radius: var(--r-pill); cursor: pointer; font-weight: 500; transition: all .15s; }
.chip:hover { color: var(--jasmine); border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--jasmine); color: var(--night); border-color: var(--jasmine); }
.chip .native { font-family: var(--body); }

.group { display: flex; flex-direction: column; gap: 10px; }
.group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.group-title h3 { font-size: 1rem; }
.group-title .faint { font-size: .85rem; }

/* ---------- create video ---------- */
.create { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .9fr); gap: 26px; align-items: start; }
.composer { position: relative; border-radius: var(--r-lg); padding: clamp(20px, 3vw, 34px); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line-soft); }
.composer::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle, #ffffff14 1.2px, transparent 1.6px); background-size: 22px 22px;
  mask-image: linear-gradient(160deg, #000 0%, transparent 65%); }
.composer > * { position: relative; }
.composer h1 { max-width: 16ch; }
.composer .lede { color: var(--muted); margin: 10px 0 22px; max-width: 52ch; }
.mic-row { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.mic { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: radial-gradient(circle at 35% 30%, #ffd451, var(--turmeric) 60%, #c99300);
  color: var(--turmeric-ink); display: grid; place-items: center; box-shadow: 0 10px 30px #f2b70533; }
.mic svg { width: 34px; height: 34px; }
.mic[disabled] { filter: grayscale(.8); opacity: .5; cursor: not-allowed; }
.mic.listening { background: radial-gradient(circle at 35% 30%, #ff8a8d, var(--kumkum) 60%, #b4262b); color: #fff; }
.mic.listening::before, .mic.listening::after { content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid #e5484d88; animation: ring 1.6s var(--ease) infinite; }
.mic.listening::after { animation-delay: .8s; }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
.mic-label b { display: block; font-family: var(--display); font-size: 1.1rem; }
.mic-label span { color: var(--muted); font-size: .92rem; }
.story-box { position: relative; }
.story-box textarea { min-height: 220px; font-size: 1.08rem; background: #15132Bcc; padding: 16px 18px; }
.interim { min-height: 1.4em; color: var(--peacock); font-style: italic; margin-top: 6px; }
.story-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--faint); font-size: .88rem; flex-wrap: wrap; }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.idea { border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: var(--r-md);
  padding: 8px 12px; cursor: pointer; text-align: left; font-size: .92rem; }
.idea:hover { border-color: var(--peacock); color: var(--jasmine); }

.settings { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 20px; }
.voices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.voice { text-align: left; border: 1px solid var(--line); background: transparent; border-radius: var(--r-md);
  padding: 10px 12px; cursor: pointer; color: var(--jasmine); }
.voice b { font-family: var(--display); font-weight: 600; display: block; }
.voice span { color: var(--faint); font-size: .84rem; }
.voice[aria-pressed="true"] { border-color: var(--turmeric); background: #f2b70512; }
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.format { border: 1px solid var(--line); background: transparent; border-radius: var(--r-md); padding: 12px 8px 10px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.format i { display: block; border: 2px solid currentColor; border-radius: 4px; }
.format[aria-pressed="true"] { border-color: var(--turmeric); color: var(--jasmine); background: #f2b70512; }
.length-out { font-family: var(--display); font-size: 1.3rem; }
.tiers { display: grid; gap: 8px; }
.tier { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; text-align: left;
  border: 1px solid var(--line); background: transparent; border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; color: var(--jasmine); }
.tier b { font-family: var(--display); font-size: 1.05rem; }
.tier .price { font-family: var(--display); font-size: 1.2rem; grid-row: span 2; }
.tier .speed { color: var(--muted); font-size: .88rem; }
.tier .why { grid-column: 1 / -1; color: var(--faint); font-size: .82rem; }
.tier[aria-pressed="true"] { border-color: var(--turmeric); background: #f2b70512; }
.tier[aria-pressed="true"] .price { color: var(--turmeric); }
.tier[disabled] { opacity: .45; cursor: not-allowed; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--leaf); box-shadow: 0 0 0 3px #4cc38a33; }
.go { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-lg); background: var(--panel);
  border: 1px solid var(--line-soft); }
.go .btn { width: 100%; }
.go .total { display: flex; justify-content: space-between; color: var(--muted); }
.go .total b { color: var(--jasmine); font-family: var(--display); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: var(--jasmine); transition: .2s; }
.switch input:checked + span { background: var(--peacock); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--turmeric); outline-offset: 2px; }
details.more { border-top: 1px solid var(--line-soft); padding-top: 14px; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.more[open] summary { margin-bottom: 14px; }
.char-pick { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- job ---------- */
.job-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; margin-bottom: 20px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: .85rem; font-weight: 600;
  background: var(--panel-2); color: var(--muted); }
.status.running { color: var(--turmeric); }
.status.done { color: var(--leaf); }
.status.failed, .status.cancelled { color: #ff9a9d; }
.progress { height: 10px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--peacock), var(--turmeric)); border-radius: 99px;
  transition: width .6s var(--ease); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.step { font-size: .85rem; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--faint); }
.step.now { border-color: var(--turmeric); color: var(--turmeric); }
.step.done { border-color: transparent; background: #4cc38a1f; color: var(--leaf); }
.job-msg { color: var(--muted); margin-top: 6px; }
.player { background: #000; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-soft); }
.player video { width: 100%; max-height: 72vh; margin: 0 auto; background: #000; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
.side-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.side-card h3 { font-size: 1.05rem; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; }
.copy-row p { flex: 1; background: var(--night); border-radius: var(--r-sm); padding: 9px 11px; font-size: .93rem; white-space: pre-wrap; word-break: break-word; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px; }
.storyboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 26px; }
.scene { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column; }
.scene .frame { aspect-ratio: 16 / 9; background: var(--night-2); position: relative; overflow: hidden; }
.scene.portrait .frame { aspect-ratio: 9 / 16; max-height: 300px; }
.scene.square .frame { aspect-ratio: 1; }
.scene .frame img { width: 100%; height: 100%; object-fit: cover; }
.scene .frame .num { position: absolute; left: 8px; top: 8px; background: #15132Bcc; padding: 1px 8px; border-radius: 99px; font-size: .8rem; }
.scene .frame.wait::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, #ffffff12 50%, transparent 80%); background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.scene .txt { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.scene .nar { font-size: .98rem; }
.scene .shot { color: var(--faint); font-size: .8rem; line-height: 1.4; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.img-grid figure { margin: 0; background: var(--panel); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line-soft); }
.img-grid figcaption { display: flex; gap: 6px; padding: 8px; justify-content: flex-end; }
.queue-note { display: flex; gap: 14px; align-items: center; background: var(--panel); border-radius: var(--r-lg); padding: 18px; border: 1px solid var(--line-soft); margin-top: 16px; }
.queue-note .big { font-family: var(--display); font-size: 2.2rem; color: var(--turmeric); line-height: 1; }

/* ---------- library ---------- */
.lib-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column;
  cursor: pointer; text-align: left; padding: 0; color: var(--jasmine); }
.card:hover { border-color: var(--line); }
.card .thumb { aspect-ratio: 16 / 10; background: var(--night-2); display: grid; place-items: center; overflow: hidden; position: relative; }
.card .thumb img, .card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .kind { position: absolute; left: 8px; bottom: 8px; background: #15132Bdd; border-radius: 99px; padding: 1px 9px; font-size: .78rem; }
.card .thumb svg { width: 40px; height: 40px; color: var(--faint); }
.card .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.card .meta b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty h3 { color: var(--jasmine); }
.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.recent a { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 10px; color: var(--jasmine); }
.recent a:hover { text-decoration: none; border-color: var(--line); }
.recent .rt { width: 76px; aspect-ratio: 16/10; border-radius: 8px; background: var(--night-2); overflow: hidden; flex: none; display: grid; place-items: center; }
.recent .rt img { width: 100%; height: 100%; object-fit: cover; }
.recent .ri { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.recent .ri b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-progress { height: 4px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: var(--turmeric); }

/* ---------- banner studio ---------- */
.banner-studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.canvas-wrap { background: repeating-conic-gradient(#1f1c3d 0% 25%, #24214a 0% 50%) 50% / 24px 24px; border-radius: var(--r-lg);
  padding: clamp(10px, 2vw, 24px); display: grid; place-items: center; border: 1px solid var(--line-soft); }
.canvas-wrap canvas { max-height: 70vh; width: auto; box-shadow: 0 20px 50px #0008; border-radius: 4px; touch-action: none; cursor: grab; }
.templates { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: var(--jasmine); }

/* ---------- plans / credits / admin ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.plan .price { font-family: var(--display); font-size: 2rem; color: var(--turmeric); }
.plan .price small { font-size: .95rem; color: var(--muted); font-family: var(--body); }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); }
.plan.featured { border-color: var(--turmeric); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.amt-pos { color: var(--leaf); }
.amt-neg { color: #ffb3b5; }
.table-wrap { overflow-x: auto; background: var(--panel); border-radius: var(--r-lg); border: 1px solid var(--line-soft); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 18px; }
.stat b { font-family: var(--display); font-size: 1.8rem; display: block; }
.section { margin-top: 32px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- auth / welcome ---------- */
.welcome { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); }
.welcome-art { position: relative; padding: clamp(28px, 5vw, 70px); display: flex; flex-direction: column; justify-content: space-between; gap: 30px; overflow: hidden;
  background: radial-gradient(1200px 600px at -10% 110%, #2bb3a322, transparent 60%), var(--night-2); }
.welcome-art::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, #ffffff18 1.3px, transparent 1.7px); background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 70%); }
.welcome-art > * { position: relative; }
.welcome-art h1 { font-size: clamp(2.3rem, 1.6rem + 3vw, 4.2rem); max-width: 12ch; }
.welcome-art .tamil { font-family: var(--display); font-size: clamp(1.3rem, 1rem + 1.2vw, 2rem); color: var(--turmeric); }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 760px; }
.how div { border-top: 2px solid var(--line); padding-top: 12px; color: var(--muted); font-size: .95rem; }
.how b { color: var(--jasmine); display: block; font-family: var(--display); font-size: 1.05rem; }
.auth { display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.auth form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.auth .switch-line { color: var(--muted); text-align: center; }
.err { color: #ffb3b5; font-size: .92rem; min-height: 1.2em; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: #0a0918cc; display: grid; place-items: center; z-index: 50; padding: 16px;
  animation: fade .15s ease; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); width: min(920px, 100%); max-height: 92vh;
  overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal.small { width: min(440px, 100%); }
.modal-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.modal video, .modal img.view { max-height: 66vh; margin: 0 auto; border-radius: var(--r-md); background: #000; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--jasmine); color: var(--night); padding: 11px 16px; border-radius: var(--r-md); font-weight: 600;
  box-shadow: 0 10px 30px #0006; max-width: 360px; animation: fade .2s ease; }
.toast.bad { background: var(--kumkum); color: #fff; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pick-grid button { padding: 0; border: 2px solid transparent; border-radius: var(--r-sm); overflow: hidden; cursor: pointer; background: var(--night); aspect-ratio: 16/10; }
.pick-grid button:hover { border-color: var(--turmeric); }
.pick-grid img { width: 100%; height: 100%; object-fit: cover; }

.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }

/* ---------- responsive ---------- */
/* admin: no fast GPU */
.gpu-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 12px 16px; border-radius: var(--r-md); background: #f2b70514; border: 1px solid #f2b70566; }
.gpu-banner[hidden] { display: none; }
.gpu-banner b { color: var(--turmeric); }
.gpu-banner span { color: var(--muted); }

/* mode switch: story / photos / ad */
.modes { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 20px; border-radius: var(--r-pill);
  background: var(--night); border: 1px solid var(--line-soft); }
.modes a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--r-pill); color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: .92rem; }
.modes a:hover { color: var(--jasmine); }
.modes a[aria-current="page"] { background: var(--turmeric); color: var(--turmeric-ink); }
.modes .short { display: none; }

/* photo board */
.drop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 34px 18px;
  border: 1.5px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); }
.drop b { color: var(--jasmine); font-family: var(--display); font-size: 1.2rem; }
.drop p { margin: 0 0 8px; max-width: 46ch; }
.ptiles { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
.ptile { display: flex; flex-direction: column; gap: 6px; }
.ptile input { padding: 7px 9px; font-size: .85rem; }
.pimg { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; background: var(--night-2);
  border: 1px solid var(--line-soft); display: grid; place-items: center; }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pimg .num { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: #15132Bcc; font-size: .78rem; font-weight: 700; display: grid; place-items: center; }
.ptools { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 3px; }
.ptools button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: #15132Bd9; color: var(--jasmine);
  display: grid; place-items: center; cursor: pointer; }
.ptools button:hover:not([disabled]) { background: var(--turmeric); color: var(--turmeric-ink); }
.ptools button[disabled] { opacity: .35; cursor: default; }
.ptools button:focus-visible { outline: 2px solid var(--turmeric); outline-offset: 1px; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 56vh; overflow: auto; }
.pick { padding: 0; border: 2px solid transparent; border-radius: var(--r-md); overflow: hidden; background: var(--night-2);
  aspect-ratio: 1; cursor: pointer; }
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick[aria-pressed="true"] { border-color: var(--turmeric); }

/* footer links to the policy pages */
.legal-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 18px; font-size: .88rem; }
.legal-links a { color: var(--faint); }

/* credit packs */
.packs { margin-bottom: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pack { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--r-lg); background: var(--panel);
  border: 1px solid var(--line-soft); }
.pack.featured { border-color: var(--turmeric); }
.pack b { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.pack b small { font-size: .9rem; color: var(--muted); font-family: var(--body); }
.pack .bonus { color: var(--leaf); font-weight: 600; font-size: .9rem; }

/* video model picker */
.engines .voices { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.engine { text-align: left; border: 1px solid var(--line); background: transparent; border-radius: var(--r-md);
  padding: 10px 12px; color: var(--jasmine); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.engine:hover { border-color: var(--faint); }
.engine[aria-pressed="true"] { border-color: var(--turmeric); background: #f2b70512; }
.engine[disabled] { opacity: .45; cursor: not-allowed; }
.eng-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.eng-top b { font-family: var(--display); font-weight: 600; }
.eng-label { font-size: .72rem; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.eng-label.l-cheapest, .eng-label.l-budget { color: var(--leaf); border-color: #4cc38a55; }
.eng-label.l-good { color: var(--peacock); border-color: #2bb3a355; }
.eng-label.l-premium, .eng-label.l-top { color: var(--turmeric); border-color: #f2b70566; }
.eng-hint { color: var(--faint); font-size: .82rem; line-height: 1.35; }
.eng-price { font-size: .85rem; font-weight: 600; color: var(--muted); }
.eng-sep { margin: 12px 0 6px; font-size: .85rem; }

/* talking photo */
.face-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.face { width: 132px; aspect-ratio: 3 / 4; border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center;
  background: var(--night-2); border: 1px solid var(--line-soft); color: var(--faint); flex: none; }
.face img { width: 100%; height: 100%; object-fit: cover; }
.face.empty { border-style: dashed; }
.voice.quality b { display: inline-flex; align-items: center; gap: 4px; }

/* ad form */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.logo-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-prev { width: 112px; height: 72px; border-radius: var(--r-md); display: grid; place-items: center; overflow: hidden;
  background: repeating-conic-gradient(#2B2850 0 25%, #221F44 0 50%) 0 0 / 14px 14px; border: 1px solid var(--line-soft); }
.logo-prev img { max-width: 92%; max-height: 88%; object-fit: contain; }
.logo-prev.empty { color: var(--faint); background: var(--night-2); }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .modes { display: flex; } .modes a { flex: 1; justify-content: center; padding: 8px 6px; white-space: nowrap; }
  .modes .long { display: none; } .modes .short { display: inline; } }

@media (max-width: 1100px) {
  .create, .result-grid, .banner-studio { grid-template-columns: 1fr; }
  .settings { position: static; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  main { padding: 18px 16px 96px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--night-2);
    border-top: 1px solid var(--line-soft); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--faint); font-size: .72rem; padding: 4px 6px; min-width: 56px; }
  .tabbar a[aria-current="page"] { color: var(--turmeric); }
  .tabbar a:hover { text-decoration: none; }
  .mobile-top { display: flex !important; }
  .welcome { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .voices { grid-template-columns: 1fr 1fr; }
  .mic { width: 70px; height: 70px; }
}
.mobile-top { display: none; justify-content: space-between; align-items: center; margin-bottom: 14px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
