:root {
  --bg: #0b0b12;
  --panel: #14141f;
  --panel-2: #1c1c2a;
  --border: #2a2a3d;
  --text: #ececf3;
  --muted: #8d8da6;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --danger: #ff5c7a;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #2a1f5c55, transparent), var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, .logo { font-family: "Space Grotesk", sans-serif; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem 5vw;
  background: #0b0b12cc; backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.25rem; }
.logo-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.nav nav { display: flex; gap: 1.5rem; margin-left: auto; color: var(--muted); }
.nav nav a:hover { color: var(--text); }
.badge {
  font-size: .75rem; padding: .25rem .6rem; border-radius: 99px;
  background: #f5b94222; color: #f5b942; border: 1px solid #f5b94255;
}

/* Hero */
.hero { text-align: center; padding: 5rem 5vw 3rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.1; margin-bottom: 1rem; }
.hero p { color: var(--muted); font-size: 1.15rem; margin-bottom: 2rem; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.4rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #5b3df5); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--panel-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-block { width: 100%; padding: 1rem; font-size: 1rem; }
.small { padding: .4rem .8rem; font-size: .85rem; }

/* Studio */
.studio {
  display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 1.5rem;
  padding: 0 5vw 4rem; max-width: 1400px; margin: 0 auto;
}
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.controls { display: flex; flex-direction: column; gap: 1.2rem; }
.field { display: flex; flex-direction: column; gap: .5rem; position: relative; }
.field > span, summary { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field em { font-weight: 400; font-style: normal; }
summary { cursor: pointer; }
details[open] summary { margin-bottom: .8rem; }
textarea, input[type="text"] {
  width: 100%; padding: .8rem; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); font: inherit; resize: vertical;
}
textarea:focus, input:focus { outline: none; border-color: var(--accent); }
.counter { position: absolute; right: .6rem; bottom: .4rem; color: var(--muted); font-size: .75rem; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: inherit; font-size: .78rem; padding: .35rem .7rem; border-radius: 99px;
  background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--accent); }

.segmented { display: flex; flex-wrap: wrap; gap: .35rem; }
.segmented button {
  font: inherit; font-size: .85rem; padding: .45rem .8rem; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); cursor: pointer;
}
.segmented button.active { background: #7c5cff22; border-color: var(--accent); color: var(--text); }

.dropzone {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 90px; padding: 1rem; border: 1.5px dashed var(--border); border-radius: 10px;
  color: var(--muted); font-size: .85rem; text-align: center; cursor: pointer; overflow: hidden;
}
.dropzone.drag { border-color: var(--accent); background: #7c5cff11; }
.dropzone img { max-height: 140px; border-radius: 8px; }
.remove {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: #000a; color: #fff; border: none; cursor: pointer; font-size: 1rem;
}

/* Preview */
.preview { display: flex; flex-direction: column; gap: 1rem; }
.stage {
  position: relative; width: 100%; max-height: 72vh; margin: 0 auto;
  background: #07070c; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-9-16 { aspect-ratio: 9 / 16; width: auto; height: 72vh; }
.ratio-1-1 { aspect-ratio: 1 / 1; width: auto; height: 72vh; max-width: 100%; }
.stage video { width: 100%; height: 100%; object-fit: contain; }
.placeholder, .loading { text-align: center; color: var(--muted); padding: 1rem; }
.pulse {
  width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); opacity: .5;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(.9); opacity: .25; } }
.loading { display: flex; flex-direction: column; align-items: center; gap: 1rem; width: min(80%, 360px); }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress { width: 100%; height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.progress div {
  height: 100%; width: 0%; transition: width .4s;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.error {
  color: var(--danger); background: #ff5c7a14; border: 1px solid #ff5c7a44;
  padding: .7rem 1rem; border-radius: 10px; font-size: .9rem;
}
[hidden] { display: none !important; }

/* Gallery */
.gallery-section, .pricing { padding: 3rem 5vw; max-width: 1400px; margin: 0 auto; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.card video { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; }
.card .meta { padding: .7rem .8rem; font-size: .82rem; }
.card .meta p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta small { color: var(--muted); }
.muted { color: var(--muted); }

/* Pricing */
.pricing h2 { text-align: center; margin-bottom: 2rem; font-size: 2rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.plan { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.8rem; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 40px #7c5cff33; }
.price { font-size: 2.2rem; font-weight: 700; margin: .5rem 0 1rem; font-family: "Space Grotesk"; }
.price span { font-size: 1rem; color: var(--muted); }
.plan ul { list-style: none; color: var(--muted); display: grid; gap: .4rem; }
.plan li::before { content: "✓ "; color: var(--accent-2); }

.footer { text-align: center; color: var(--muted); padding: 2rem; border-top: 1px solid var(--border); font-size: .85rem; }

@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
  .nav nav { display: none; }
  .ratio-9-16, .ratio-1-1 { height: 60vh; }
}

/* Website sections */
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.stats { display: flex; gap: 3rem; justify-content: center; margin-top: 3rem; flex-wrap: wrap; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-family: "Space Grotesk"; font-size: 2rem; }
.stats span { color: var(--muted); font-size: .85rem; }

.features, .how, .faq { padding: 3rem 5vw; max-width: 1200px; margin: 0 auto; }
.features h2, .how h2, .faq h2 { text-align: center; font-size: 2rem; margin-bottom: 2rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.feature .icon {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 1rem;
  background: linear-gradient(135deg, #7c5cff33, #22d3ee33); color: var(--accent-2); font-size: 1.2rem;
}
.feature h3 { margin-bottom: .4rem; }
.feature p, .steps p { color: var(--muted); font-size: .92rem; }

.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.steps li { padding: 1.5rem; border-left: 2px solid var(--accent); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; }
.steps span {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; margin-bottom: .7rem;
}

.faq { max-width: 800px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item button {
  width: 100%; text-align: left; padding: 1.1rem 0; background: none; border: none;
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between;
}
.faq-item button::after { content: "+"; color: var(--accent-2); font-size: 1.2rem; }
.faq-item.open button::after { content: "–"; }
.faq-item p { display: none; color: var(--muted); padding-bottom: 1.1rem; }
.faq-item.open p { display: block; }

/* Modes, audio, consent */
.mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .3rem;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
}
.mode-tabs button {
  font: inherit; font-weight: 600; padding: .65rem; border-radius: 9px; border: none;
  background: transparent; color: var(--muted); cursor: pointer;
}
.mode-tabs button.active { background: linear-gradient(135deg, #7c5cff, #5b3df5); color: #fff; }
.mode-help { color: var(--muted); font-size: .88rem; margin-top: -.4rem; }

#genForm[data-mode="sing"] .only-video { display: none !important; }
#genForm[data-mode="video"] .only-sing { display: none !important; }

.audio-info { display: flex; flex-direction: column; gap: .4rem; width: 100%; align-items: center; }
.audio-info audio { width: 100%; max-width: 320px; }
.audio-info small { color: var(--muted); word-break: break-all; }
.hint { color: var(--muted); font-size: .78rem; }

.consent {
  display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: .75rem;
  cursor: pointer;
}
.consent input { margin-top: .2rem; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.small-note { font-size: .8rem; text-align: center; margin-top: -.4rem; }
input[type="password"] {
  width: 100%; padding: .8rem; border-radius: 10px; background: var(--panel-2);
  border: 1px solid var(--border); color: var(--text); font: inherit;
}
#audioZone .audio-info { margin-top: 1.4rem; }

/* ---- v4: voiceover, song, audio results ---- */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
select, input[type="number"] {
  width: 100%; padding: .7rem .8rem; border-radius: 10px; background: var(--panel-2);
  border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .9rem;
}
select:focus, input[type="number"]:focus { outline: none; border-color: var(--accent); }
input[type="range"] { width: 100%; accent-color: var(--accent); margin-top: .5rem; }
.field em#speedVal { color: var(--accent-2); font-style: normal; margin-left: .3rem; }

.song-tools { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-top: -.4rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .86rem; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.trim-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted);
  background: #22d3ee10; border: 1px solid #22d3ee40; border-radius: 10px; padding: .6rem .75rem;
}
.trim-row input { width: 80px; padding: .4rem .5rem; }

.audio-result {
  width: min(90%, 560px); display: flex; flex-direction: column; align-items: center; gap: 1.2rem; text-align: center;
}
.audio-result p { color: var(--text); font-weight: 600; font-family: "Space Grotesk", sans-serif; font-size: 1.05rem; }
.audio-result audio { width: 100%; }
.eq { display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.eq span {
  width: 10px; height: 20%; border-radius: 6px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  transition: height .3s;
}
.audio-result.playing .eq span { animation: eq 1s ease-in-out infinite; }
.eq span:nth-child(2n) { animation-delay: -.3s !important; }
.eq span:nth-child(3n) { animation-delay: -.55s !important; }
.eq span:nth-child(5n) { animation-delay: -.8s !important; }
@keyframes eq { 0%, 100% { height: 18%; } 50% { height: 100%; } }

.card-audio {
  aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem;
  background: radial-gradient(circle at 30% 20%, #7c5cff33, transparent 60%), #07070c; padding: 1rem;
}
.card-audio audio { width: 100%; }
.card-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.card .meta { cursor: pointer; }
.mode-tabs button { font-size: .92rem; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

/* ---- v5: Create prompts assistant ---- */
.assist {
  border: 1px solid #7c5cff55; border-radius: 12px; background: linear-gradient(135deg, #7c5cff14, #22d3ee0d);
}
.assist summary {
  list-style: none; cursor: pointer; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .1rem;
}
.assist summary::-webkit-details-marker { display: none; }
.assist-title { color: var(--text); font-weight: 700; font-size: .95rem; }
.assist-sub { color: var(--muted); font-weight: 400; font-size: .8rem; }
.assist[open] summary { border-bottom: 1px solid #7c5cff33; margin-bottom: 0 !important; }
.assist-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .7rem; }
.assist-opts { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.mini { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.mini select { width: auto; padding: .4rem .5rem; font-size: .82rem; }
.btn-assist { border-color: #7c5cff88; }
.btn-assist:hover { background: #7c5cff22; }
.idea-result { display: flex; flex-direction: column; gap: .6rem; max-height: 520px; overflow: auto; padding-right: .2rem; }
.idea-result.loading-dim { opacity: .45; }
.idea-title { font-family: "Space Grotesk", sans-serif; font-size: 1rem; }
.idea-block, .scene { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: .65rem .75rem; }
.idea-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.idea-label { font-size: .75rem; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: .04em; }
.idea-acts { display: flex; gap: .3rem; flex-shrink: 0; }
.idea-text { font-size: .86rem; color: var(--text); white-space: pre-wrap; word-break: break-word; font-family: inherit; margin: 0; }
.scene-narr { font-size: .8rem; color: var(--muted); margin-top: .35rem; font-style: italic; }
.idea-note { font-size: .78rem; color: var(--muted); }
.idea-bar { display: flex; flex-wrap: wrap; gap: .4rem; }
.mini-btn {
  font: inherit; font-size: .76rem; font-weight: 600; padding: .3rem .6rem; border-radius: 7px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
}
.mini-btn:hover { border-color: var(--accent); }
.mini-btn.use { background: #7c5cff; border-color: #7c5cff; color: #fff; }
.flash { animation: flash 1s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px #22d3eeaa; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---- v6: Long video studio ---- */
.mode-tabs .tab-wide { grid-column: 1 / -1; }
.tab-new {
  font-size: .62rem; font-weight: 700; padding: .1rem .4rem; border-radius: 99px; margin-left: .3rem;
  background: #22d3ee; color: #062a33; vertical-align: middle;
}
.long { display: flex; flex-direction: column; gap: 1rem; }
.long-sec { display: flex; flex-direction: column; gap: .7rem; padding-bottom: 1rem; border-bottom: 1px dashed var(--border); }
.long-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.long-head span { font-weight: 700; font-size: .92rem; }
.long-head small { color: var(--muted); font-size: .8rem; }
.scene-list { display: flex; flex-direction: column; gap: .6rem; }
.scene-edit { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: .6rem; display: flex; flex-direction: column; gap: .45rem; }
.scene-edit-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.scene-no { font-weight: 700; font-size: .82rem; }
.scene-tools { display: flex; gap: .25rem; margin-left: auto; align-items: center; }
.mini-select { width: auto; padding: .25rem .4rem; font-size: .76rem; border-radius: 7px; }
.scene-prompt { font-size: .84rem; padding: .55rem; }
.scene-narr-input {
  width: 100%; padding: .45rem .55rem; border-radius: 8px; background: var(--panel); border: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: .8rem; font-style: italic;
}
.scene-err { color: var(--danger); font-size: .76rem; }
.badge { font-size: .68rem; font-weight: 700; padding: .15rem .5rem; border-radius: 99px; background: #ffffff12; color: var(--muted); }
.badge.st-queued, .badge.st-starting, .badge.st-running { background: #f5b94222; color: #f5b942; }
.badge.st-done { background: #22c55e22; color: #4ade80; }
.badge.st-failed { background: #ff5c7a22; color: var(--danger); }
.sub-box { display: flex; flex-direction: column; gap: .55rem; padding-left: 1.6rem; }
.sub-box input[type="text"] {
  width: 100%; padding: .7rem .8rem; border-radius: 10px; background: var(--panel-2);
  border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .88rem;
}
.narr-row { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.music-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.long-cost { font-size: .82rem; color: var(--muted); text-align: center; }
.btn-join { background: linear-gradient(135deg, #22d3ee, #0ea5e9); color: #04202a; }
.btn-join:disabled { background: var(--panel-2); color: var(--muted); border-color: var(--border); }
#longReset { align-self: center; }
.small-zone { min-height: 70px; }
.small-zone img { max-height: 110px; }

.long-board { display: flex; flex-direction: column; gap: .8rem; }
.long-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.lg-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lg-card.st-failed { border-color: #ff5c7a88; }
.lg-card.st-done { border-color: #22c55e55; }
.lg-media { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; cursor: pointer; }
.lg-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: var(--muted); font-size: .75rem; cursor: default; }
.lg-foot { display: flex; justify-content: space-between; align-items: center; padding: .4rem .5rem; font-size: .75rem; color: var(--muted); }
.spinner.small { width: 22px; height: 22px; border-width: 2px; }
.long-audio { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.la-chip { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.la-top { display: flex; align-items: center; gap: .5rem; }
.la-label { font-weight: 700; font-size: .82rem; }
.la-status { font-size: .74rem; color: var(--muted); margin-right: auto; }
.la-chip.st-done .la-status { color: #4ade80; }
.la-chip.st-failed .la-status { color: var(--danger); }
.la-chip audio { width: 100%; height: 34px; }
.error.notice { color: #86efac; background: #22c55e14; border-color: #22c55e55; }
@media (max-width: 860px) { .long-audio { grid-template-columns: 1fr; } }

/* ---- v7: Render studio ---- */
.mode-tabs { grid-template-columns: repeat(3, 1fr); }
.mode-tabs button { font-size: .84rem; padding: .6rem .3rem; }
.render { display: flex; flex-direction: column; gap: 1rem; }
.seg-wide { display: grid; grid-template-columns: 1fr 1fr; }
.seg-wide button { padding: .6rem; font-weight: 600; }
#rvZone video { max-height: 160px; border-radius: 8px; }
.compare { position: absolute; inset: 0; user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.compare #cmpAfter { clip-path: inset(0 0 0 50%); }
.cmp-line {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; transform: translateX(-1px);
  box-shadow: 0 0 8px #0008; pointer-events: none;
}
.cmp-line span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: #111; display: grid; place-items: center; font-weight: 700; box-shadow: 0 2px 10px #0006;
}
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
}
.cmp-tag {
  position: absolute; top: 10px; font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px;
  background: #000a; color: #fff; pointer-events: none;
}
.cmp-left { left: 10px; }
.cmp-right { right: 10px; }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; cursor: pointer; }
@media (max-width: 480px) { .mode-tabs { grid-template-columns: repeat(2, 1fr); } }

/* ---- v8: show / hide password ---- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 2.9rem; }
.pw-toggle {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px;
  background: transparent; border: none; color: var(--muted); cursor: pointer;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--text); background: #ffffff10; outline: none; }
.pw-toggle .i-hide { display: none; }
.pw-toggle.showing .i-show { display: none; }
.pw-toggle.showing .i-hide { display: block; }
.pw-toggle.showing { color: var(--accent-2); }

/* ---- v9: Voice Lab ---- */
.mode-tabs { grid-template-columns: repeat(4, 1fr); }
.mode-tabs button { font-size: .78rem; padding: .55rem .2rem; }
@media (max-width: 1100px) { .mode-tabs { grid-template-columns: repeat(3, 1fr); } }
.lab { display: flex; flex-direction: column; gap: 1rem; }
.lab-tools { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.lab-tools button {
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left; cursor: pointer;
  padding: .6rem .7rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit;
}
.lab-tools button b { font-size: .84rem; }
.lab-tools button small { font-size: .72rem; color: var(--muted); }
.lab-tools button.active { border-color: var(--accent); background: #7c5cff1f; }
.rec-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: .45rem; margin-top: .3rem; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; display: inline-block; }
.rec-btn.recording { border-color: #ef4444; color: #fca5a5; }
.rec-btn.recording .rec-dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rec-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.rec-timer { color: #fca5a5; font-size: .82rem; font-weight: 600; }
.stt-tr { align-self: end; padding-bottom: .7rem; }
.clone-box, .dub-box, .sfx-box { display: flex; flex-direction: column; gap: .8rem; }
.clone-box input[type="text"] {
  width: 100%; padding: .7rem .8rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit;
}
.clone-script {
  white-space: pre-wrap; font-size: .88rem; line-height: 1.6; color: var(--text);
  background: #22d3ee0f; border: 1px solid #22d3ee40; border-radius: 10px; padding: .8rem .9rem;
}
.cloned-list { display: flex; flex-direction: column; gap: .5rem; }
.cloned-row { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.cloned-row audio { width: 100%; height: 34px; }
.cloned-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cloned-top small { color: var(--muted); font-size: .72rem; margin-right: auto; }
.cloned-top small.warn { color: #f5b942; }
.stage.stage-text { aspect-ratio: auto; height: auto; min-height: 320px; max-height: none; align-items: stretch; }
.text-result { display: flex; flex-direction: column; gap: .7rem; width: 100%; padding: 1rem; }
.tr-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.tr-head span { font-weight: 700; font-family: "Space Grotesk", sans-serif; }
.tr-head small { color: var(--muted); }
.text-result textarea { min-height: 260px; font-size: .92rem; line-height: 1.6; background: var(--panel); }
.tr-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.tr-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.extra-audio { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .4rem; padding-top: .6rem; border-top: 1px dashed var(--border); }
.extra-audio small { color: var(--muted); }
.extra-audio audio { width: 100%; }

/* ---- v10: 3D Model studio ---- */
.m3d { display: flex; flex-direction: column; gap: 1rem; }
.m3d-tools { grid-template-columns: 1fr 1fr; }
.m3d-tools .m3d-wide { grid-column: 1 / -1; }
.frame-form { display: flex; flex-direction: column; gap: .8rem; }
.frame-form input[type="text"], .frame-form input[type="number"] {
  width: 100%; padding: .6rem .7rem; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .88rem;
}
.frame-form .field > span { font-size: .76rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.pair { display: flex; align-items: center; gap: .3rem; }
.pair b { color: var(--muted); font-weight: 400; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.m3d-view { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.m3d-view model-viewer { width: 100%; height: 100%; background: radial-gradient(circle at 50% 40%, #1c1c2a, #07070c); --poster-color: transparent; }
.m3d-tip { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: .72rem; color: #fffa; background: #0008; padding: .2rem .6rem; border-radius: 99px; pointer-events: none; }
.m3d-loading { display: flex; align-items: center; gap: .6rem; color: var(--muted); }
.m3d-fallback { color: var(--muted); padding: 1rem; text-align: center; }
.m3d-panel { display: flex; flex-direction: column; gap: .9rem; }
.m3d-downloads { display: flex; flex-wrap: wrap; gap: .4rem; }
.m3d-downloads a { text-decoration: none; padding: .45rem .75rem; font-size: .82rem; }
.qty-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin: .4rem 0; }
.qty-table th, .qty-table td { padding: .4rem .6rem; border-bottom: 1px solid var(--border); text-align: left; }
.qty-table th { color: var(--muted); font-weight: 600; font-size: .76rem; }
.qty-table td:nth-child(2), .qty-table td:nth-child(3), .qty-table th:nth-child(2), .qty-table th:nth-child(3) { text-align: right; }
.qty-total td { font-weight: 700; }
.m3d-help summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
.m3d-help p { font-size: .84rem; color: var(--muted); margin-top: .5rem; }
.m3d-help b { color: var(--text); }
@media (max-width: 1100px) { .row3 { grid-template-columns: 1fr 1fr; } }
.pair input[type="number"] { min-width: 0; padding: .6rem .35rem; text-align: center; -moz-appearance: textfield; }
.pair input[type="number"]::-webkit-outer-spin-button, .pair input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.frame-form .row3 { align-items: end; }

/* ---- v11: Avatar studio + Tamil typing ---- */
.avatar { display: flex; flex-direction: column; gap: 1rem; }
.av-tools { grid-template-columns: 1fr 1fr; }
.dropzone.small { min-height: 0; padding: .9rem; }
.dropzone.small img { max-height: 120px; }
.av-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.av-thumb { position: relative; padding: 0; border: 2px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--panel-2); cursor: pointer; aspect-ratio: 3 / 4; }
.av-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-thumb.active { border-color: var(--accent, #7c5cff); box-shadow: 0 0 0 3px #7c5cff55; }
.av-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #000a; color: #fff; font-size: 14px; line-height: 20px; text-align: center; opacity: 0; transition: opacity .15s; }
.av-thumb:hover .av-del, .av-thumb:focus .av-del { opacity: 1; }
.av-empty { font-size: .84rem; grid-column: 1 / -1; margin: 0; }
.avatar .check, .field > .check { display: flex; align-items: center; gap: .45rem; font-size: .84rem; color: var(--muted); margin-top: .5rem; }
.avatar input[type="text"] { width: 100%; padding: .6rem .7rem; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .88rem; }
.counter .over, .counter.over { color: #ff8a8a; }
.av-panel { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.av-panel > span { font-size: .84rem; color: var(--muted); margin-right: .2rem; }
.av-panel .mini-btn { padding: .45rem .75rem; font-size: .82rem; }
.tamil-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .35rem; }
.tamil-switch, .tamil-convert { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); border-radius: 99px; padding: .22rem .65rem; font: inherit; font-size: .76rem; cursor: pointer; }
.tamil-switch .ta-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.tamil-switch.on { color: var(--text); border-color: #7c5cff; background: #7c5cff22; }
.tamil-switch.on .ta-dot { background: #4ade80; }
.tamil-convert { display: none; }
.tamil-switch.on + .tamil-convert { display: inline-flex; }
.tamil-help { flex-basis: 100%; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.tamil-help b { color: var(--text); font-weight: 600; }
textarea[lang="ta"] { font-family: "Noto Sans Tamil", "Latha", "Nirmala UI", inherit; line-height: 1.7; }
#avShapeRow { grid-template-columns: 1fr; }

/* ---- v12: phonetic typing in many languages ---- */
.type-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .35rem; }
.type-bar .type-lang { width: auto; max-width: 100%; padding: .25rem 1.6rem .25rem .6rem; font-size: .78rem; border-radius: 99px; background-color: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.type-bar.on .type-lang { color: var(--text); border-color: #7c5cff; background-color: #7c5cff22; }
.type-convert { border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); border-radius: 99px; padding: .22rem .65rem; font: inherit; font-size: .76rem; cursor: pointer; }
.type-help { flex-basis: 100%; color: var(--muted); font-size: .74rem; line-height: 1.55; }
.type-help b { color: var(--text); font-weight: 600; }
.type-bar.on + textarea { font-family: "Noto Sans Sinhala", "Iskoola Pota", "Noto Sans Tamil", "Latha", "Nirmala UI", "Mangal", inherit; line-height: 1.7; }
#songLangSel { max-width: 320px; }

/* ---- v13: accounts, credits, payments ---- */
header.nav { position: sticky; }
.acct-bar { display: flex; align-items: center; gap: .5rem; margin-left: .8rem; position: relative; }
.acct-credits { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 99px; padding: .35rem .8rem; font: inherit; font-weight: 700; cursor: pointer; }
.acct-credits small { font-weight: 400; color: var(--muted); }
.acct-credits .bolt { color: #fbbf24; }
.acct-who { width: 34px; height: 34px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #7c5cff, #22d3ee); color: #fff; font-weight: 700; cursor: pointer; }
.acct-signin { white-space: nowrap; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: .5rem; box-shadow: 0 18px 50px #0009; z-index: 60; display: flex; flex-direction: column; }
.acct-menu button { text-align: left; border: 0; background: none; color: var(--text); font: inherit; padding: .55rem .7rem; border-radius: 9px; cursor: pointer; }
.acct-menu button:hover { background: var(--panel-2); }
.acct-menu-head { padding: .4rem .7rem .6rem; display: flex; flex-direction: column; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.acct-menu-head small { color: var(--muted); }
.acct-menu-credits { display: grid; grid-template-columns: 1fr auto; gap: .15rem .6rem; padding: .3rem .7rem .6rem; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.acct-menu-credits b { color: var(--text); text-align: right; }
.acct-modal-back { position: fixed; inset: 0; background: #000b; backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; overflow: auto; }
.acct-modal { position: relative; width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 1.6rem 1.5rem 1.4rem; box-shadow: 0 30px 80px #000c; }
.acct-modal.wide { max-width: 620px; }
.acct-modal h3 { margin: 0 0 1rem; font-size: 1.2rem; }
.acct-x { position: absolute; top: .7rem; right: .8rem; border: 0; background: none; color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.acct-form { display: flex; flex-direction: column; gap: .8rem; }
.acct-form form { display: flex; flex-direction: column; gap: .8rem; }
.acct-form input[type="text"], .acct-form input[type="email"], .acct-form input[type="password"], .acct-form input[type="tel"], .acct-copy input {
  width: 100%; padding: .65rem .75rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit; }
.acct-tabs { margin-bottom: .2rem; }
.acct-why { background: #7c5cff1f; border: 1px solid #7c5cff55; border-radius: 10px; padding: .6rem .8rem; margin: 0; font-size: .9rem; }
.acct-perk { margin: 0; font-size: .9rem; color: var(--muted); }
.acct-perk b { color: var(--text); }
.acct-err { color: #ff8a8a; margin: 0; font-size: .88rem; }
.acct-link { align-self: flex-start; border: 0; background: none; color: #a99bff; font: inherit; font-size: .85rem; cursor: pointer; padding: 0; }
.acct-or { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .8rem; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.acct-google { display: flex; justify-content: center; min-height: 44px; }
.acct-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.acct-packs.big { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 1rem 0; }
.acct-pack { position: relative; display: flex; flex-direction: column; gap: .15rem; border: 1px solid var(--border); background: var(--panel-2); border-radius: 14px; padding: .9rem; cursor: pointer; }
.acct-pack input { position: absolute; opacity: 0; }
.acct-pack:has(input:checked) { border-color: #7c5cff; box-shadow: 0 0 0 3px #7c5cff44; }
.acct-pack.best { border-color: #7c5cff88; }
.acct-pack.free { cursor: default; }
.acct-pack-name { font-weight: 700; }
.acct-pack-name em { font-style: normal; font-size: .7rem; background: #7c5cff; color: #fff; padding: .05rem .4rem; border-radius: 99px; margin-left: .2rem; vertical-align: middle; }
.acct-pack-credits { font-size: 1.15rem; font-weight: 700; }
.acct-pack-price { color: #a7f3d0; font-weight: 600; }
.acct-pack small { color: var(--muted); font-size: .75rem; }
.acct-bank { background: var(--panel-2); border: 1px dashed var(--border); border-radius: 10px; padding: .6rem .8rem; font-size: .88rem; margin: 0; }
.acct-details summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.acct-costs { width: 100%; border-collapse: collapse; font-size: .86rem; margin-top: .5rem; }
.acct-costs td, .acct-costs th { padding: .35rem .5rem; border-bottom: 1px solid var(--border); text-align: left; }
.acct-costs td:last-child, .acct-costs th:last-child { text-align: right; white-space: nowrap; }
.acct-costs .neg { color: #fca5a5; } .acct-costs .pos { color: #86efac; }
.acct-copy { display: flex; gap: .4rem; }
.acct-costnote { font-size: .82rem; color: var(--muted); margin: .3rem 0 0; text-align: center; }
.acct-costnote a { color: #a99bff; }
.acct-pricing .center { text-align: center; }
.acct-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--panel); border: 1px solid var(--border); color: var(--text); padding: .75rem 1.1rem; border-radius: 12px; z-index: 120; transition: all .3s; box-shadow: 0 12px 40px #0009; max-width: 90vw; }
.acct-toast.show { opacity: 1; transform: translate(-50%, 0); }
.acct-toast.good { border-color: #22c55e88; }
@media (max-width: 760px) { header.nav nav { display: none; } .acct-credits small { display: none; } }

/* ---- v14: templates, Image studio, Makers, share ---- */
.templates { max-width: 1180px; margin: 0 auto 1.5rem; padding: 0 1.2rem; }
.templates .section-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.tpl-cats { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 .9rem; }
.tpl-cats button { border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); border-radius: 99px; padding: .35rem .9rem; font: inherit; font-size: .85rem; cursor: pointer; }
.tpl-cats button.active { color: #fff; background: #7c5cff; border-color: #7c5cff; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.tpl-card { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; text-align: left; border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 14px; padding: .8rem .9rem; cursor: pointer; font: inherit; transition: transform .15s, border-color .15s; }
.tpl-card:hover { transform: translateY(-2px); border-color: #7c5cff; }
.tpl-card .tpl-icon { font-size: 1.5rem; }
.tpl-card b { font-size: .92rem; }
.tpl-card small { color: var(--muted); font-size: .78rem; }
.imgstudio, .makers { display: flex; flex-direction: column; gap: 1rem; }
.img-tools, .mk-tools { grid-template-columns: repeat(2, 1fr); }
.imgstudio input[type="text"], .makers input[type="text"], .makers select, .imgstudio select { width: 100%; padding: .6rem .7rem; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .88rem; }
.imgstudio .check, .makers .check { display: flex; gap: .45rem; align-items: center; font-size: .84rem; color: var(--muted); }
.imgstudio textarea#imgHeadline { min-height: 2.6rem; }
.mk-photos { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.mk-photo { display: grid; grid-template-columns: 64px 1fr auto auto; gap: .4rem; align-items: center; }
.mk-photo img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; }
.mk-photo button { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; }
.mk-photo button:disabled { opacity: .35; }
.share-row { display: flex; flex-wrap: wrap; gap: .4rem; }
#mkSongPick { margin-bottom: .5rem; }
@media (min-width: 1200px) { .img-tools, .mk-tools { grid-template-columns: repeat(2, 1fr); } }

/* =========================================================
   v15: multi-page site (home, templates, pricing, help) + Falvia AI brand
   ========================================================= */
.nav { gap: 1.2rem; }
.nav .nav-links { display: flex; gap: 1.4rem; margin-left: auto; color: var(--muted); align-items: center; }
.nav .nav-links a { padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav .nav-links a:hover { color: var(--text); }
.nav .nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }
.nav-cta { white-space: nowrap; }
.nav-cta.has-credits { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 9px; width: 40px; height: 38px; font-size: 1.2rem; cursor: pointer; }
.btn.small { padding: .5rem .95rem; font-size: .88rem; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); margin-bottom: .8rem; }
.center { text-align: center; }

/* Home hero */
.home-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; max-width: 1200px; margin: 0 auto; padding: 4.5rem 5vw 3rem; }
.home-hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.08; margin-bottom: 1.1rem; }
.home-hero p { color: var(--muted); font-size: 1.12rem; margin-bottom: 1.8rem; max-width: 36rem; }
.home-hero .hero-cta { justify-content: flex-start; }
.lang-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.6rem; }
.lang-chips span { font-size: .85rem; padding: .3rem .75rem; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.hh-visual { position: relative; height: 380px; }
.hv-card { position: absolute; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: .9rem; box-shadow: 0 24px 60px #0008; }
.hv-tag { display: inline-block; font-size: .75rem; color: var(--muted); margin-bottom: .6rem; }
.hv-1 { left: 0; top: 10px; width: 62%; }
.hv-1 .hv-screen { aspect-ratio: 9 / 12; border-radius: 12px; background: linear-gradient(160deg, #f59e0b55, #7c5cff66), radial-gradient(circle at 30% 30%, #fde68a, transparent 50%), #1e1b4b; display: flex; flex-direction: column; justify-content: flex-end; padding: 1rem; gap: .2rem; }
.hv-1 b { font-size: 1.3rem; } .hv-1 small { color: #e0e7ff; }
.hv-2 { right: 0; top: 0; width: 50%; }
.hv-wave { display: flex; align-items: center; gap: 4px; height: 60px; }
.hv-wave i { flex: 1; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); animation: wave 1.4s ease-in-out infinite; }
.hv-wave i:nth-child(odd) { animation-delay: -.5s; } .hv-wave i:nth-child(3n) { animation-delay: -.9s; }
@keyframes wave { 0%, 100% { height: 20%; } 50% { height: 100%; } }
.hv-2 small, .hv-3 small { color: var(--muted); font-size: .8rem; }
.hv-3 { right: 4%; bottom: 0; width: 56%; }
.hv-poster { border-radius: 12px; padding: 1.2rem 1rem; background: linear-gradient(135deg, #b91c1c, #f59e0b); display: flex; flex-direction: column; gap: .25rem; }
.hv-poster b { font-size: 1.05rem; } .hv-poster small { color: #fff8; }

.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1100px; margin: 0 auto 1rem; padding: 1.2rem 5vw; gap: 1rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trust-strip div { text-align: center; } .trust-strip b { display: block; font-family: "Space Grotesk", sans-serif; font-size: 1.6rem; }
.trust-strip span { color: var(--muted); font-size: .85rem; }

.home-section { max-width: 1200px; margin: 0 auto; padding: 4rem 5vw 1rem; }
.home-section.narrow { max-width: 860px; }
.hs-head { text-align: center; max-width: 720px; margin: 0 auto 2rem; }
.hs-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: .6rem; }
.hs-head p { color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.tool-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.2rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); transition: transform .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.tool-icon { font-size: 1.6rem; } .tool-card h3 { font-size: 1.1rem; } .tool-card p { color: var(--muted); font-size: .9rem; flex: 1; }
.tool-go { color: var(--accent-2); font-size: .85rem; font-weight: 600; }
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; align-items: center; }
.split h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: .8rem; }
.split p { color: var(--muted); margin-bottom: 1.4rem; }
.mk-list { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.mk-card { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.mk-card:hover { border-color: var(--accent); }
.mk-card > span { font-size: 1.5rem; } .mk-card b { display: block; } .mk-card small { color: var(--muted); font-size: .84rem; }
.type-demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .7rem; max-width: 980px; margin: 0 auto; }
.type-demo div { display: flex; align-items: center; gap: .7rem; justify-content: center; padding: 1rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.type-demo code { color: var(--muted); font-size: .95rem; } .type-demo span { color: var(--accent-2); } .type-demo b { font-size: 1.3rem; }
.aud-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem; }
.aud { padding: 1.3rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); display: flex; flex-direction: column; gap: .6rem; }
.aud ul { list-style: none; color: var(--muted); font-size: .92rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.aud li::before { content: "✓ "; color: var(--accent-2); }
.aud a { color: var(--accent-2); font-weight: 600; font-size: .88rem; }
.home-section .steps { margin-top: 0; }
.price-teaser .pt-box { display: flex; gap: 2rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 2rem; border-radius: 20px; background: linear-gradient(135deg, #7c5cff22, #22d3ee18); border: 1px solid var(--border); }
.pt-box h2 { font-size: 1.7rem; margin-bottom: .5rem; } .pt-box p { color: var(--muted); max-width: 40rem; }
.pt-cta { display: flex; gap: .6rem; flex-wrap: wrap; }
.final-cta { text-align: center; padding: 4.5rem 5vw; }
.final-cta h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin-bottom: 1.4rem; }
.page-hero { text-align: center; padding: 4rem 5vw 1rem; max-width: 820px; margin: 0 auto; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: .6rem; } .page-hero p { color: var(--muted); font-size: 1.08rem; }
.studio-top { max-width: 1400px; margin: 0 auto; padding: 1.6rem 5vw .2rem; display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.studio-top h1 { font-size: 1.6rem; } .studio-top p { color: var(--muted); } .studio-top a { color: var(--accent-2); font-weight: 600; }
.price-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.price-table th, .price-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
.price-table th { color: var(--muted); font-size: .8rem; font-weight: 600; } .price-table td:last-child, .price-table th:last-child { text-align: right; font-weight: 600; }
.faq-group { font-size: 1.15rem; margin: 2rem 0 .4rem; color: var(--accent-2); }
.home-section.faq { max-width: 860px; }
.contact-box { text-align: center; padding: 2rem; border-radius: 20px; background: var(--panel); border: 1px solid var(--border); }
.contact-box h2 { margin-bottom: .5rem; } .contact-box p { color: var(--muted); } .contact-lines { margin-top: 1rem; font-size: 1.05rem; color: var(--text) !important; }
.contact-lines a { color: var(--accent-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 3rem 5vw 1.5rem; }
.foot-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.foot-grid h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .7rem; }
.foot-grid a:not(.logo) { display: block; color: var(--text); opacity: .85; font-size: .92rem; padding: .2rem 0; }
.foot-grid a:not(.logo):hover { opacity: 1; color: var(--accent-2); }
.foot-brand p { color: var(--muted); font-size: .9rem; margin-top: .7rem; max-width: 20rem; }
.foot-note { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 2.5rem; }

@media (max-width: 900px) {
  .home-hero, .split { grid-template-columns: 1fr; }
  .hh-visual { height: 330px; }
  .trust-strip { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav .nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: var(--panel); border-bottom: 1px solid var(--border); padding: .5rem 5vw 1rem; }
  body.nav-open .nav .nav-links { display: flex; }
  .nav .nav-links a { padding: .8rem 0; border-bottom: 1px solid var(--border); }
  .nav-cta { display: none; }
  .mk-list { grid-template-columns: 1fr; }
  .home-hero { padding-top: 2.5rem; }
}
#homeTemplates { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { #homeTemplates { grid-template-columns: 1fr 1fr; } }

/* ---- v16: account, password eye, currencies ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 2.6rem !important; width: 100%; }
.pw-eye { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: .3rem; display: flex; border-radius: 6px; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--text); background: var(--panel); }
.acct-who.has-pic { padding: 0; overflow: hidden; }
.acct-who img, .nav-pic { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.nav-pic { width: 22px; height: 22px; }
.nav-cta.has-credits { gap: .45rem; }
.acct-account { gap: 1.1rem; }
.acct-pic { display: flex; gap: 1rem; align-items: center; }
.acct-face { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #7c5cff, #22d3ee); }
.acct-face img { width: 100%; height: 100%; object-fit: cover; }
.acct-pic-side { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.acct-pic-side small { color: var(--muted); overflow-wrap: anywhere; }
.acct-pic-btns { display: flex; gap: .7rem; align-items: center; margin-top: .3rem; }
.acct-section { display: flex; flex-direction: column; gap: .7rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.acct-section h4 { font-size: .95rem; }
.acct-section input[readonly] { opacity: .65; }
.acct-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.pw-meter { height: 5px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.acct-danger summary { cursor: pointer; color: #fca5a5; font-weight: 600; font-size: .9rem; }
.acct-danger form { display: flex; flex-direction: column; gap: .7rem; margin-top: .6rem; }
.btn-danger { background: #b91c1c; color: #fff; border: 1px solid #ef4444; }
.btn-danger:hover { background: #dc2626; }
.cur-row { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .9rem; }
.cur-row.center { justify-content: center; margin-bottom: 1rem; }
.cur-select { padding: .4rem .6rem; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .88rem; max-width: 100%; }
.acct-form .cur-select { width: auto; }
.pay-note b { color: var(--text); }

/* ======================= v17 ======================= */
.acct-toast.ok { border-color: #22c55e88; }
.install-app { margin-left: .3rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: end; margin-top: .6rem; }
.row3 input, .ac-form input, .ac-form textarea, .ac-form select, .row3 select { width: 100%; padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; }
@media (max-width: 640px) { .row3 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.small-hero { padding-bottom: 1rem; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.buy-sub { margin: 1rem 0 .5rem; font-size: .95rem; } .buy-sub small { color: var(--muted); font-weight: 400; }
.acct-pack.plan { border-color: #22d3ee55; } .acct-pack-price small { font-size: .7em; color: var(--muted); margin-left: .15rem; }
.acct-menu-team { display: flex; flex-direction: column; gap: .3rem; padding: .5rem .8rem; border-bottom: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.explore-opt { font-size: .88rem; }

/* Makers v17 */
.mk2-extra { flex-wrap: wrap; }
.mk2-thumbs { display: flex; gap: .4rem; width: 100%; }
.mk2-thumbs button { width: 72px; height: 72px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); background: #fff; cursor: pointer; }
.mk2-thumbs button.active { border-color: var(--accent); }
.mk2-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.mk2-colors { display: flex; gap: .5rem; } .mk2-colors input { width: 52px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: none; padding: 2px; }
#mk2EvList { flex-direction: row; flex-wrap: wrap; }
#mk2EvList .mk-photo { display: block; position: relative; }
#mk2EvList .mk-photo img { width: 64px; height: 64px; }
#mk2EvList .mk-photo .remove { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; font-size: .8rem; padding: 0; }

/* Home: festivals, business, WhatsApp, explore strip */
.season-grid .tpl-card.season em { font-style: normal; font-size: .78rem; color: #fbbf24; margin-top: .3rem; }
.wa-box { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; background: linear-gradient(135deg, #0f2f25, #14141f); border: 1px solid #25d36644; border-radius: 22px; padding: 2rem; }
.wa-text h2 { margin: .3rem 0 .6rem; } .wa-text p { color: #cbd5e1; margin-bottom: 1rem; }
.wa-chat { display: flex; flex-direction: column; gap: .5rem; background: #0b141a; border-radius: 16px; padding: 1rem; font-size: .9rem; }
.wa-chat p { max-width: 85%; padding: .5rem .75rem; border-radius: 10px; }
.wa-chat .me { align-self: flex-end; background: #005c4b; } .wa-chat .bot { align-self: flex-start; background: #202c33; }
@media (max-width: 760px) { .wa-box { grid-template-columns: 1fr; } }
.ex-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 180px; gap: .8rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
.ex-mini { scroll-snap-align: start; display: flex; flex-direction: column; gap: .35rem; color: var(--text); text-decoration: none; }
.ex-mini video, .ex-mini img, .ex-mini > span { width: 180px; height: 220px; object-fit: cover; border-radius: 14px; background: var(--panel-2); display: grid; place-items: center; font-size: 2.5rem; }
.ex-mini b { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Explore page */
.ex-bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.ex-tools { display: flex; gap: .5rem; } .ex-tools input { padding: .45rem .7rem; border-radius: 9px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.ex-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.ex-card.featured { border-color: #fbbf2466; }
.ex-media { position: relative; display: block; aspect-ratio: 4 / 5; background: #000; }
.ex-media video, .ex-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-audio { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; background: linear-gradient(135deg, #312e81, #0e7490); font-size: 3rem; padding: 1rem; }
.ex-audio audio { width: 100%; }
.ex-badge { position: absolute; top: .5rem; left: .5rem; background: #000a; color: #fbbf24; font-size: .75rem; padding: .15rem .5rem; border-radius: 99px; }
.ex-body { padding: .7rem .8rem .8rem; display: flex; flex-direction: column; gap: .45rem; }
.ex-body > b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-meta { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); }
.ex-meta img, .ex-meta i { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-style: normal; background: linear-gradient(135deg, #7c5cff, #22d3ee); color: #fff; font-size: .7rem; }
.ex-meta em { margin-left: auto; font-style: normal; background: var(--panel-2); padding: .05rem .45rem; border-radius: 99px; }
.ex-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.ex-like { border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); border-radius: 99px; padding: .3rem .7rem; cursor: pointer; font: inherit; font-size: .85rem; }
.ex-like.on { color: #fb7185; border-color: #fb718566; }

/* Account centre + planner */
.ac-wrap { max-width: 900px; }
.ac-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: .4rem 0; }
.ac-nav a { font-size: .85rem; padding: .35rem .8rem; border-radius: 99px; border: 1px solid var(--border); color: var(--text); text-decoration: none; background: var(--panel); }
.ac-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 1.4rem; margin-bottom: 1.2rem; scroll-margin-top: 120px; display: flex; flex-direction: column; gap: .8rem; }
.ac-card h2 { font-size: 1.15rem; } .ac-card h3 { font-size: .98rem; margin-top: .4rem; } .ac-card h3 small { color: var(--muted); font-weight: 400; }
.ac-stats { display: flex; gap: .7rem; flex-wrap: wrap; }
.ac-stats > div { background: var(--panel-2); border-radius: 12px; padding: .65rem .9rem; display: flex; flex-direction: column; min-width: 120px; gap: .2rem; }
.ac-stats b { font-size: 1.15rem; } .ac-stats span, .ac-stats small { color: var(--muted); font-size: .78rem; }
.ac-plan { background: #22d3ee14; border: 1px solid #22d3ee44; border-radius: 12px; padding: .8rem 1rem; }
.ac-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ac-table th, .ac-table td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ac-table th { color: var(--muted); font-weight: 500; font-size: .78rem; }
.ac-table input { width: 110px; padding: .3rem .5rem; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.ac-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: .4rem; }
.ac-form { display: flex; flex-direction: column; gap: .7rem; }
.ac-more summary { cursor: pointer; color: var(--muted); font-size: .9rem; } .ac-more[open] summary { margin-bottom: .7rem; }
.ac-brand { display: flex; gap: 1rem; align-items: center; }
.ac-logo { width: 120px; height: 90px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; color: #888; font-size: .8rem; flex: none; }
.ac-logo img { max-width: 92%; max-height: 92%; object-fit: contain; }
.ac-colors { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; font-size: .88rem; color: var(--muted); }
.ac-colors label { display: flex; align-items: center; gap: .4rem; }
.ac-colors input[type="color"] { width: 44px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: none; padding: 2px; }
.ac-code { font-size: 1.4rem; letter-spacing: .12em; display: inline-block; margin-top: .3rem; color: #4ade80; }
.ac-wa-examples { display: flex; flex-wrap: wrap; gap: .4rem; } .ac-wa-examples code { background: var(--panel-2); padding: .3rem .6rem; border-radius: 8px; font-size: .8rem; }
.ac-newkey { border-color: #fbbf2466; }
.tag { font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; background: var(--panel-2); } .tag.paid { background: #1f4d2c; } .tag.pending { background: #3b3417; }
.pl-accounts { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.pl-acc { display: inline-flex; align-items: center; gap: .35rem; background: var(--panel-2); border-radius: 99px; padding: .3rem .4rem .3rem .7rem; font-size: .85rem; }
.pl-acc button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.pl-acc i, .pl-target i, .pl-ic { font-style: normal; font-weight: 700; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; background: #1877f2; color: #fff; }
.pl-acc.instagram i, .pl-target.instagram i { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.pl-target.remind i { background: #4b5563; }
.pl-targets { display: flex; flex-direction: column; gap: .4rem; }
.pl-target { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.pl-ideas-bar { display: flex; gap: .5rem; justify-content: flex-end; }
.pl-ideas { display: flex; flex-direction: column; gap: .8rem; }
.pl-idea { display: grid; grid-template-columns: 140px 1fr; gap: .8rem; background: var(--panel-2); border-radius: 14px; padding: .7rem; }
.pl-idea-pic { width: 140px; aspect-ratio: 4 / 5; border-radius: 10px; background: #0003; display: grid; place-items: center; overflow: hidden; }
.pl-idea-pic img { width: 100%; height: 100%; object-fit: cover; }
.pl-idea-body { display: flex; flex-direction: column; gap: .4rem; }
.pl-idea-body textarea, .pl-idea-row input { width: 100%; padding: .5rem .6rem; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-size: .88rem; }
.pl-idea-row { display: flex; gap: .5rem; } .pl-idea-row input { width: auto; flex: 1; }
@media (max-width: 560px) { .pl-idea { grid-template-columns: 1fr; } .pl-idea-pic { width: 100%; } }
.pl-preview img, .pl-preview video { max-width: 220px; max-height: 260px; border-radius: 10px; }
.pl-post { display: grid; grid-template-columns: 64px 1fr auto; gap: .7rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.pl-thumb { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.pl-thumb img, .pl-thumb video { width: 100%; height: 100%; object-fit: cover; }
.pl-body p { font-size: .88rem; margin-bottom: .3rem; white-space: pre-line; }
.pl-ic { margin-left: .2rem; width: 18px; height: 18px; font-size: .65rem; }
.pl-act { display: flex; flex-direction: column; gap: .3rem; }

/* Developers */
.dev-docs h2 { margin: 1.6rem 0 .5rem; font-size: 1.15rem; }
.dev-docs p, .dev-docs li { color: #cfcfe0; } .dev-docs ul { padding-left: 1.2rem; }
.dev-docs pre { background: #0d0d16; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; overflow-x: auto; margin: .6rem 0; font-size: .84rem; line-height: 1.55; }
.dev-docs code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dev-docs p code, .dev-docs td code, .dev-docs li code { background: var(--panel-2); padding: .05rem .35rem; border-radius: 5px; font-size: .85em; }
.ac-form input[type="checkbox"], .ac-form input[type="radio"], .row3 input[type="checkbox"] { width: auto; padding: 0; }
.ac-form .check { display: flex; gap: .5rem; align-items: center; }

/* ---- Studio tool picker (matches the home page cards) ---- */
.studio-tools { max-width: 1400px; margin: .6rem auto 1.2rem; padding: 0 5vw; display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: .6rem; }
.st-card { display: flex; align-items: center; gap: .7rem; text-align: left; padding: .75rem .85rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; transition: transform .15s, border-color .15s, background .15s; min-width: 0; }
.st-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.st-card.active { border-color: var(--accent); background: linear-gradient(135deg, #7c5cff2e, #22d3ee14); box-shadow: 0 0 0 1px var(--accent) inset; }
.st-icon { font-size: 1.45rem; flex: none; width: 2.2rem; text-align: center; }
.st-text { display: flex; flex-direction: column; min-width: 0; }
.st-text b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-text small { color: var(--muted); font-size: .76rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-chat { border-style: dashed; }
@media (max-width: 760px) {
  .studio-tools { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; }
  .st-card { scroll-snap-align: start; }
}

/* ======================= Falvia Chat ======================= */
body.page-chat { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.page-chat .nav { position: relative; flex: none; padding: .7rem 1.2rem; gap: 1.4rem; }
.cm-side-btn { display: none; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 9px; width: 38px; height: 36px; cursor: pointer; font-size: 1.05rem; }
.cm-app { flex: 1; min-height: 0; display: grid; grid-template-columns: 270px 1fr; }
.cm-side { display: flex; flex-direction: column; gap: .6rem; padding: .9rem .8rem; border-right: 1px solid var(--border); background: #0e0e17; min-height: 0; }
.cm-new { width: 100%; justify-content: center; }
.cm-search { width: 100%; padding: .5rem .7rem; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-size: .88rem; }
.cm-list { flex: 1; overflow-y: auto; margin: 0 -.3rem; padding: 0 .3rem; }
.cm-group { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: .9rem .5rem .3rem; }
.cm-item { display: flex; align-items: center; border-radius: 9px; }
.cm-item a { flex: 1; min-width: 0; padding: .48rem .6rem; color: var(--text); text-decoration: none; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-item:hover, .cm-item.active { background: var(--panel-2); }
.cm-item-tools { display: none; padding-right: .3rem; }
.cm-item:hover .cm-item-tools, .cm-item.active .cm-item-tools { display: flex; }
.cm-item-tools button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: .2rem .3rem; font-size: .8rem; }
.cm-item-tools button:hover { color: var(--text); }
.cm-none { color: var(--muted); font-size: .85rem; padding: .6rem; }
.cm-side-foot { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; padding: .6rem .4rem 0; border-top: 1px solid var(--border); }
.cm-side-foot a { color: var(--accent-2); }
.cm-shade { display: none; }
.cm-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cm-scroll { flex: 1; overflow-y: auto; scroll-behavior: auto; }
.cm-msgs { max-width: 780px; margin: 0 auto; padding: 1.6rem 1.2rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; }
.cm-empty { max-width: 780px; margin: 0 auto; padding: 9vh 1.2rem 1rem; text-align: center; }
.cm-empty h1 { font-family: "Space Grotesk", sans-serif; font-size: 2rem; margin: .8rem 0 .3rem; }
.cm-empty p { color: var(--muted); margin-bottom: 1.6rem; }
.cm-suggest { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; text-align: left; }
.cm-suggest button { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 12px; padding: .75rem .9rem; font: inherit; font-size: .88rem; cursor: pointer; text-align: left; line-height: 1.35; }
.cm-suggest button:hover { border-color: var(--accent); }
.cm-avatar { width: 30px; height: 30px; border-radius: 9px; flex: none; background: linear-gradient(135deg, #7c5cff, #22d3ee); position: relative; }
.cm-avatar::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; transform: translateX(1px); }
.cm-avatar.big { width: 56px; height: 56px; border-radius: 16px; display: inline-block; }
.cm-avatar.big::after { border-left-width: 16px; border-top-width: 11px; border-bottom-width: 11px; }
.cm-msg.user { display: flex; justify-content: flex-end; }
.cm-bubble { max-width: 82%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 18px 18px 4px 18px; padding: .7rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.cm-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-upimg { max-width: 260px; max-height: 260px; border-radius: 10px; object-fit: cover; }
.cm-msg.bot { display: flex; gap: .9rem; align-items: flex-start; }
.cm-body { flex: 1; min-width: 0; }
.cm-md { line-height: 1.65; overflow-wrap: anywhere; }
.cm-md > * + * { margin-top: .75rem; }
.cm-md h2, .cm-md h3, .cm-md h4 { font-family: "Space Grotesk", sans-serif; line-height: 1.3; }
.cm-md h2 { font-size: 1.3rem; } .cm-md h3 { font-size: 1.12rem; } .cm-md h4 { font-size: 1rem; }
.cm-md ul, .cm-md ol { padding-left: 1.4rem; } .cm-md li + li { margin-top: .3rem; }
.cm-md a { color: var(--accent-2); }
.cm-md code { background: var(--panel-2); border: 1px solid var(--border); padding: .05rem .35rem; border-radius: 5px; font-size: .88em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cm-md blockquote { border-left: 3px solid var(--accent); padding-left: .9rem; color: #cfcfe0; }
.cm-md hr { border: 0; border-top: 1px solid var(--border); }
.cm-table { overflow-x: auto; } .cm-table table { border-collapse: collapse; font-size: .9rem; min-width: 60%; }
.cm-table th, .cm-table td { border: 1px solid var(--border); padding: .45rem .65rem; text-align: left; } .cm-table th { background: var(--panel-2); }
.cm-code { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #0a0a12; }
.cm-code-bar { display: flex; justify-content: space-between; align-items: center; padding: .35rem .8rem; background: var(--panel-2); font-size: .78rem; color: var(--muted); }
.cm-code-bar button { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; }
.cm-code-bar button:hover { color: var(--text); }
.cm-code pre { margin: 0; padding: .9rem 1rem; overflow-x: auto; font-size: .85rem; line-height: 1.55; }
.cm-code pre code { background: none; border: 0; padding: 0; }
.cm-tools { display: flex; gap: .3rem; margin-top: .5rem; opacity: 0; transition: opacity .15s; }
.cm-msg.bot:hover .cm-tools, .cm-msg.bot:last-child .cm-tools { opacity: 1; }
.cm-tool { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: .8rem; padding: .25rem .5rem; border-radius: 7px; }
.cm-tool:hover { background: var(--panel-2); color: var(--text); }
.cm-msg.typing .cm-tools { display: none; }
.cm-caret { display: inline-block; width: .55rem; height: 1.05rem; background: var(--accent-2); vertical-align: text-bottom; margin-left: 2px; animation: cmblink 1s steps(2) infinite; border-radius: 2px; }
@keyframes cmblink { 50% { opacity: 0; } }
.cm-dots { display: inline-flex; gap: .3rem; padding: .4rem 0; } .cm-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: cmdot 1.2s infinite ease-in-out; }
.cm-dots i:nth-child(2) { animation-delay: .15s; } .cm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cmdot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.cm-action { border: 1px solid #7c5cff55; background: linear-gradient(135deg, #7c5cff14, #22d3ee0d); border-radius: 14px; padding: .85rem; display: flex; flex-direction: column; gap: .65rem; margin-top: .8rem; }
.cm-action.pending, .cm-action.bad { color: var(--muted); font-size: .9rem; }
.cm-action.done { background: none; border-color: var(--border); }
.cm-action-head { display: flex; gap: .7rem; align-items: flex-start; } .cm-action-icon { font-size: 1.5rem; }
.cm-action-head small { display: block; color: var(--muted); font-size: .84rem; margin-top: .15rem; }
.cm-action-row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; } .cm-action-status { font-size: .84rem; color: var(--muted); }
.cm-action-status a { color: var(--accent-2); }
.cm-action-out:empty { display: none; }
.cm-action-out img, .cm-action-out video { max-width: 100%; max-height: 460px; border-radius: 10px; display: block; }
.cm-action-out audio { width: 100%; }
.cm-media-row { display: flex; gap: .5rem; margin-top: .5rem; }
.cm-composer-wrap { flex: none; padding: .4rem 1.2rem .7rem; max-width: 820px; width: 100%; margin: 0 auto; }
.cm-composer { border: 1px solid var(--border); background: var(--panel); border-radius: 20px; padding: .55rem .7rem .5rem; box-shadow: 0 10px 40px #0006; display: flex; flex-direction: column; gap: .3rem; }
.cm-composer:focus-within { border-color: #7c5cff88; }
.cm-composer textarea { width: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: 1rem; resize: none; outline: none; padding: .35rem .3rem; max-height: 220px; line-height: 1.5; }
.cm-composer .type-bar { margin: 0; font-size: .78rem; }
.cm-bar { display: flex; align-items: center; gap: .5rem; }
.cm-icon-btn { border: 0; background: none; color: var(--muted); font-size: 1.15rem; cursor: pointer; border-radius: 9px; width: 34px; height: 34px; }
.cm-icon-btn:hover { background: var(--panel-2); color: var(--text); }
.cm-model { margin-left: auto; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 9px; padding: .35rem .5rem; font: inherit; font-size: .8rem; }
.cm-send { width: 36px; height: 36px; border-radius: 11px; border: 0; background: linear-gradient(135deg, #7c5cff, #5b3df5); color: #fff; cursor: pointer; display: grid; place-items: center; }
.cm-send:disabled { opacity: .35; cursor: default; }
.cm-send .i-stop { display: none; } .cm-send.stop .i-stop { display: block; } .cm-send.stop .i-send { display: none; }
.cm-send.stop { background: var(--text); color: var(--bg); }
.cm-preview { display: flex; gap: .4rem; }
.cm-chip { position: relative; } .cm-chip img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.cm-chip button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #000c; color: #fff; cursor: pointer; font-size: .8rem; line-height: 1; }
.cm-note { text-align: center; font-size: .74rem; color: var(--muted); margin-top: .45rem; }
.cm-err { background: #3b1219; border: 1px solid #7f1d1d; color: #fecaca; border-radius: 10px; padding: .5rem .8rem; font-size: .88rem; margin-bottom: .5rem; }
.cm-err a { color: #fff; font-weight: 600; }
.cm-signin { flex: 1; display: grid; place-items: center; text-align: center; padding: 2rem; }
.cm-signin > div { max-width: 520px; } .cm-signin h1 { margin: .8rem 0 .5rem; } .cm-signin p { color: var(--muted); margin-bottom: 1.3rem; }
@media (max-width: 860px) {
  .cm-app { grid-template-columns: 1fr; }
  .cm-side-btn { display: block; }
  .cm-side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 82vw; max-width: 300px; transform: translateX(-100%); transition: transform .2s; }
  body.cm-side-open .cm-side { transform: none; }
  body.cm-side-open .cm-shade { display: block; position: fixed; inset: 0; background: #0009; z-index: 39; }
  .page-chat .nav-cta { display: none; }
  .cm-bubble { max-width: 90%; }
  .cm-empty { padding-top: 4vh; } .cm-empty h1 { font-size: 1.6rem; }
  .cm-msg.bot .cm-avatar { display: none; }
}
.studio-tools { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.st-text b { white-space: normal; line-height: 1.25; }
@media (max-width: 1180px) { .studio-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) and (min-width: 761px) { .studio-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .studio-tools { grid-template-columns: none; } }
.cm-model { width: auto; max-width: 60%; }

/* Account menu on every page */
.acct-menu[hidden] { display: none; }
.acct-menu a { color: var(--text); text-decoration: none; padding: .55rem .7rem; border-radius: 9px; }
.acct-menu a:hover { background: var(--panel-2); }
.site-acct { margin-left: 0; }
.site-acct .acct-credits { text-decoration: none; }
.acct-who.has-pic { padding: 0; overflow: hidden; }
@media (max-width: 760px) { .site-acct .acct-credits small { display: none; } }

/* Falvia AI logo */
.logo-img { height: 28px; width: auto; display: block; }
.site-footer .logo-img { height: 30px; }
@media (max-width: 760px) { .logo-img { height: 22px; } }
.page-chat .logo-img { height: 24px; }

/* ===== v21: Movie maker & Writing tools ===== */
.mv-wrap, .wt-wrap { max-width: 1100px; padding-top: 1.5rem; }
.mv-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1rem; }
.mv-card h2 { font-size: 1.15rem; margin: 0 0 .7rem; }
.mv-card textarea, .mv-card input:not([type=checkbox]):not([type=file]), .mv-card select { width: 100%; box-sizing: border-box; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; font: inherit; }
.mv-card textarea:focus, .mv-card input:focus, .mv-card select:focus { outline: none; border-color: var(--accent); }
.mv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin: .8rem 0; }
.mv-grid label, .wt-opts label:not(.btn):not(.mv-check) { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.mv-check { display: flex; align-items: flex-start; gap: .5rem; margin: .4rem 0; font-size: .92rem; cursor: pointer; }
.mv-check input { width: auto !important; margin-top: .2rem; accent-color: var(--accent); }
.mv-hint { color: var(--muted); font-size: .85rem; margin: .6rem 0 0; }
.mv-examples { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .5rem 0 0; }
.mv-example, .mv-addline { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: .25rem .7rem; font: inherit; font-size: .8rem; cursor: pointer; }
.mv-example:hover, .mv-addline:hover { border-color: var(--accent); }
.mv-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }
.mv-row > select, .mv-row > input { width: auto !important; }
.mv-title { font-size: 1.3rem !important; font-weight: 700; flex: 1; min-width: 200px; }
.mv-summary { margin: .4rem 0 0; font-size: .92rem; }
.mv-errbox { background: #ff5c7a1c; border: 1px solid var(--danger); color: #ffd1da; border-radius: 10px; padding: .7rem .9rem; }
.mv-err { color: var(--danger); }
.mv-signin { background: #7c5cff1f; border: 1px solid var(--accent); border-radius: 10px; padding: .7rem .9rem; }
.mv-mine { margin-top: .8rem; font-size: .9rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.mv-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .8rem; }
.mv-char { display: flex; gap: .8rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: .7rem; }
.mv-pic { width: 90px; height: 120px; flex: none; border-radius: 10px; overflow: hidden; background: #0003; display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: var(--muted); }
.mv-pic img { width: 100%; height: 100%; object-fit: cover; }
.mv-cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.mv-cbody .mv-cname { font-weight: 600; }
.mv-cbody .mv-row select { flex: 1; min-width: 0; }
.mv-shots { display: flex; flex-direction: column; gap: .7rem; }
.mv-shot { display: flex; gap: .8rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: .7rem; }
.mv-thumb { width: 200px; aspect-ratio: 16/9; flex: none; border-radius: 8px; overflow: hidden; background: #0004; display: grid; place-items: center; color: var(--muted); font-size: 1.4rem; font-weight: 700; }
.page-movie .mv-thumb img, .page-movie .mv-thumb video { width: 100%; height: 100%; object-fit: cover; }
.mv-sbody { flex: 1; min-width: 0; }
.mv-sbody .mv-row:first-child { margin-top: 0; margin-bottom: .4rem; }
.mv-lines { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; align-items: flex-start; }
.mv-line { display: flex; gap: .4rem; align-items: center; width: 100%; flex-wrap: wrap; }
.mv-line select, .mv-line .mv-mfrom { width: auto !important; flex: none; }
.mv-line .mv-mfrom { width: 70px !important; }
.mv-line .mv-text, .mv-line .mv-mstyle { flex: 1; min-width: 160px; }
.mv-x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.mv-st { font-size: .72rem; padding: .12rem .5rem; border-radius: 999px; background: #ffffff12; color: var(--muted); white-space: nowrap; }
.mv-st.running, .mv-st.queued { background: #22d3ee22; color: #67e8f9; }
.mv-st.done { background: #4ade8022; color: #86efac; }
.mv-st.failed { background: #ff5c7a22; color: #fda4af; }
.mv-prog { margin-top: .8rem; }
.mv-bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin-bottom: .3rem; }
.mv-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.mv-video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
#mvClips a { margin-right: .5rem; }
@media (max-width: 700px) { .mv-shot { flex-direction: column; } .mv-thumb { width: 100%; } .mv-chars { grid-template-columns: 1fr; } }

.wt-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.wt-tab { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: .55rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; }
.wt-tab.active { border-color: var(--accent); background: linear-gradient(135deg, #7c5cff2e, #22d3ee14); }
.wt-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.wt-head h2 { margin: 0; }
.wt-opts { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; margin: .6rem 0; }
.wt-opts label:not(.btn):not(.mv-check) { flex-direction: row; align-items: center; }
.wt-opts select { width: auto !important; }
.wt-own { display: flex; flex-wrap: wrap; gap: .4rem; }
.wt-chip { background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .4rem .25rem .7rem; font-size: .85rem; display: inline-flex; gap: .4rem; align-items: center; }
.wt-chip small { color: var(--muted); }
.wt-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; }
.wt-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.wt-pills.small { margin: 0; }
.wt-pills button { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: .35rem .85rem; font: inherit; font-size: .88rem; cursor: pointer; }
.wt-pills button.active { border-color: var(--accent); background: #7c5cff33; }
.wt-split { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .6rem; }
.wt-out { min-height: 300px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: .7rem; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.wt-out ins { text-decoration: none; background: #22d3ee26; color: #a5f3fc; border-radius: 3px; }
@media (max-width: 800px) { .wt-split { grid-template-columns: 1fr; } }
.wt-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.wt-score { display: flex; gap: 1rem; align-items: center; background: var(--panel-2); border-radius: 12px; padding: .9rem; }
.wt-score small { display: block; color: var(--muted); margin-top: .2rem; font-size: .83rem; }
.wt-ring { --p: 0; --c: var(--accent); width: 86px; height: 86px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #ffffff14 0); position: relative; }
.wt-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel-2); }
.wt-ring b { position: relative; font-size: 1.15rem; }
.wt-report h3 { margin: 1.3rem 0 .5rem; font-size: 1rem; }
.wt-note { background: #fbbf241a; border-left: 3px solid #fbbf24; padding: .5rem .7rem; border-radius: 6px; font-size: .88rem; margin: .6rem 0 0; }
.wt-warn { background: #ff5c7a14; border-left: 3px solid var(--danger); padding: .6rem .8rem; border-radius: 6px; font-size: .88rem; }
.wt-sources { padding-left: 1.4rem; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.wt-sources li { display: flex; gap: .6rem; align-items: center; }
.wt-sources li i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.wt-sources li span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wt-sources li small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-doc { background: var(--panel-2); border-radius: 10px; padding: .9rem 1rem; line-height: 1.7; max-height: 70vh; overflow: auto; }
.wt-doc mark { color: inherit; border-radius: 3px; padding: 0 .1rem; }
.wt-doc mark.m { background: color-mix(in srgb, var(--c) 38%, transparent); }
.wt-doc mark.pm { background: color-mix(in srgb, var(--c) 16%, transparent); border-bottom: 2px dotted var(--c); }
.wt-doc sup { font-size: .65rem; font-weight: 700; margin-left: .1rem; }
.wt-legend { font-size: .83rem; color: var(--muted); }
.wt-legend span { padding: 0 .3rem; border-radius: 3px; }
.wt-legend .m { background: #f8717160; color: var(--text); } .wt-legend .pm { background: #f8717126; border-bottom: 2px dotted #f87171; color: var(--text); }
.wt-paras { display: flex; flex-direction: column; gap: .5rem; }
.wt-para { display: grid; grid-template-columns: 120px 44px 1fr; gap: .6rem; align-items: center; }
.wt-para small { display: block; }
.wt-bar { height: 8px; border-radius: 99px; background: #ffffff14; overflow: hidden; }
.wt-bar i { display: block; height: 100%; }
@media print { .nav, .site-footer, .wt-tabs, #wtCheck, .page-hero, .wt-actions { display: none !important; } body { background: #fff; color: #000; } .mv-card, .wt-doc, .wt-score { background: #fff !important; border-color: #ccc; } .wt-doc { max-height: none; } }
.wt-doc p { margin: 0 0 .8rem; }
.mv-cbody > .mv-st { align-self: flex-start; } .mv-cbody .mv-row select { min-width: 120px; }

/* ===== v21: App maker ===== */
.am-wrap { max-width: 1300px; padding-top: 1.5rem; }
.am-app { display: grid; grid-template-columns: 230px 1fr; gap: 1rem; align-items: start; }
.am-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: .7rem; }
.am-list { display: flex; flex-direction: column; gap: .3rem; max-height: 60vh; overflow: auto; }
.am-item { display: flex; gap: .6rem; align-items: center; text-align: left; background: none; border: 1px solid transparent; border-radius: 10px; padding: .4rem; color: var(--text); font: inherit; cursor: pointer; }
.am-item:hover, .am-item.active { background: var(--panel-2); border-color: var(--border); }
.am-item span:last-child { display: flex; flex-direction: column; min-width: 0; font-size: .9rem; }
.am-item small { color: #86efac; font-size: .72rem; }
.am-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 1.1rem; color: #fff; font-weight: 700; }
.am-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.am-idea { text-align: left; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: .8rem; font: inherit; cursor: pointer; }
.am-idea:hover { border-color: var(--accent); }
.am-work { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.am-stage { display: flex; flex-direction: column; align-items: center; }
.am-stagebar select { width: auto; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .5rem; font: inherit; }
.am-frame { margin-top: .7rem; background: #000; border: 10px solid #1f1f2b; box-shadow: 0 0 0 2px #3a3a50, 0 20px 50px #0008; overflow: hidden; transition: width .3s, height .3s; }
.am-frame.phone { width: 375px; height: 740px; border-radius: 42px; }
.am-frame.tablet { width: 600px; height: 800px; border-radius: 28px; }
.am-frame.desktop { width: 760px; height: 560px; border-radius: 12px; border-width: 8px; }
.am-frame iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.am-panel { min-width: 0; }
.am-details { display: flex; gap: 1rem; align-items: center; }
.am-details label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.am-details .mv-row label { flex-direction: row; align-items: center; gap: .4rem; }
.am-details input[type=color] { width: 44px !important; height: 34px; padding: 2px !important; }
.am-emoji { width: 60px !important; text-align: center; }
.am-icon { border-radius: 18px; flex: none; box-shadow: 0 6px 16px #0006; }
.am-url { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0 .3rem; font-weight: 600; word-break: break-all; }
.am-steps { padding-left: 1.1rem; font-size: .9rem; display: flex; flex-direction: column; gap: .25rem; }
.am-history { padding-left: 1.2rem; font-size: .88rem; color: var(--muted); display: flex; flex-direction: column; gap: .3rem; max-height: 220px; overflow: auto; }
.am-dlg { width: min(1000px, 94vw); background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); }
.am-dlg::backdrop { background: #000a; }
.am-dlg textarea { width: 100%; height: 60vh; box-sizing: border-box; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; background: #0a0a12; color: #d6d6e6; border: 1px solid var(--border); border-radius: 8px; padding: .6rem; }
@media (max-width: 1150px) { .am-work { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .am-app { grid-template-columns: 1fr; } .am-side { position: static; } .am-list { flex-direction: row; overflow-x: auto; } .am-frame.phone { width: min(375px, 88vw); height: 680px; } .am-frame.tablet, .am-frame.desktop { width: 92vw; } }

/* ===== v21: publishing guide ===== */
.pg-wrap { max-width: 900px; padding-top: 1.5rem; }
.pg-wrap h3 { font-size: 1rem; margin: 1.1rem 0 .4rem; color: var(--accent-2); }
.pg-steps { padding-left: 1.3rem; display: flex; flex-direction: column; gap: .45rem; line-height: 1.55; }
.pg-steps code, .pg-wrap code { background: var(--panel-2); padding: .05rem .35rem; border-radius: 5px; font-size: .88em; }
.pg-cost { font-size: .92rem; color: var(--muted); }
.pg-note { background: #fbbf2414; border-left: 3px solid #fbbf24; padding: .6rem .8rem; border-radius: 6px; font-size: .92rem; margin: .6rem 0; }
.pg-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.pg-table th, .pg-table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.pg-table th { color: var(--muted); font-weight: 600; }
.pg-app { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
@media (max-width: 640px) { .pg-table table, .pg-table tbody, .pg-table tr, .pg-table td { display: block; } .pg-table thead { display: none; } .pg-table tr { padding: .5rem 0; border-bottom: 1px solid var(--border); } .pg-table td { border: 0; padding: .15rem 0; } }
.am-stores { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.am-store { display: flex; flex-direction: column; gap: .15rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem; color: var(--text); text-decoration: none; }
.am-store:hover { border-color: var(--accent); }
.am-store small { color: var(--muted); }
#amStoreCard h3 { font-size: .95rem; margin: 1rem 0 .3rem; }
.am-field { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); margin-top: .7rem; }
#amLinks { font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; }
.am-guide { display: flex; flex-direction: column; gap: .15rem; border-top: 1px solid var(--border); padding-top: .7rem; }
.am-guide h3 { font-size: .9rem; margin: 0 0 .3rem; }
.am-guide a { display: grid; grid-template-columns: 1.5rem 1fr; align-items: center; column-gap: .3rem; padding: .35rem .4rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .88rem; }
.am-guide a:hover { background: var(--panel-2); }
.am-guide small { grid-column: 2; color: var(--muted); font-size: .74rem; }
.mv-outline { background: var(--panel-2); border-radius: 10px; padding: .7rem .9rem; margin-top: .6rem; font-size: .9rem; display: flex; flex-direction: column; gap: .35rem; }
.mv-outline div { display: grid; grid-template-columns: 4.5rem 1fr; gap: .5rem; color: var(--muted); }
.mv-outline div.done { color: var(--text); }
.mv-outline span { font-weight: 600; color: var(--accent-2); }
#mvNextPart { margin: 0 0 1rem; }

/* ===== v21: Ideas & samples ===== */
.sc-wrap { max-width: 1200px; padding-top: 1.2rem; }
.sc-tabs { margin-bottom: 1rem; }
.sc-admin { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; border-color: var(--accent); }
.sc-group { margin-bottom: 2rem; }
.sc-group h2 { margin: 0 0 .3rem; }
.sc-group > p { margin: 0 0 1rem; max-width: 760px; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.sc-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.sc-media { position: relative; aspect-ratio: 16/9; background: #000; cursor: pointer; }

.sc-media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.sc-play { position: absolute; right: .6rem; bottom: .6rem; width: 34px; height: 34px; border-radius: 50%; background: #000a; display: grid; place-items: center; font-size: .8rem; pointer-events: none; }
.sc-ph { width: 100%; height: 100%; display: grid; place-content: center; text-align: center; gap: .3rem; background: linear-gradient(135deg, #7c5cff33, #22d3ee1f); }
.sc-ph span { font-size: 2.6rem; }
.sc-ph small { color: var(--muted); }
.sc-text { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.sc-text h3 { margin: 0; font-size: 1.05rem; }
.sc-prompt { margin: 0; font-size: .85rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.sc-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; padding-top: .4rem; }
.sc-status { color: var(--muted); }

/* ===== v21: share button on every page ===== */
.share-fab { position: fixed; left: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border-radius: 999px; border: 1px solid #ffffff2a; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 10px 30px #0008; }
.share-fab span { display: inline-block; transform: rotate(-30deg); }
.share-fab:hover { filter: brightness(1.1); }
.share-sheet { position: fixed; left: 18px; bottom: 74px; z-index: 61; width: min(380px, calc(100vw - 36px)); background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; box-shadow: 0 20px 60px #000b; }
.share-head { display: flex; justify-content: space-between; align-items: center; }
.share-x { background: none; border: 0; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.share-text { font-size: .88rem; color: var(--muted); margin: .4rem 0 .8rem; }
.share-nets { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.share-nets a { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: .75rem; color: var(--text); text-decoration: none; }
.share-nets i { width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 1.1rem; }
.share-nets a:hover i { filter: brightness(1.15); }
.share-link { display: flex; gap: .4rem; margin: .9rem 0 .5rem; }
.share-link input { flex: 1; min-width: 0; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .6rem; font-size: .8rem; }
.share-earn { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }
.page-chat .share-fab, .page-studio .share-fab { bottom: 84px; }
@media (max-width: 640px) { .share-fab { padding: .55rem .8rem; left: 12px; bottom: 12px; } .page-chat .share-fab { display: none; } }
@media print { .share-fab, .share-sheet { display: none !important; } }
.share-nets i { box-shadow: inset 0 0 0 1px #ffffff30; }
.ct-rules { max-width: 720px; margin: 1rem auto; text-align: left; display: flex; flex-direction: column; gap: .35rem; }
.ex-card { position: relative; }
.ex-rank { position: absolute; z-index: 2; left: .6rem; top: .6rem; background: #000b; color: #fff; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; }
.ex-card.top1 .ex-rank { background: #f5b301; color: #111; } .ex-card.top2 .ex-rank { background: #cbd5e1; color: #111; } .ex-card.top3 .ex-rank { background: #d97706; }
.ex-card.top1 { border-color: #f5b301; }

/* ===== v21: guide / SEO pages ===== */
.seo-page { max-width: 820px; padding-top: 2rem; line-height: 1.7; }
.seo-page h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); line-height: 1.2; margin: .3rem 0 .8rem; }
.seo-page h2 { margin: 2rem 0 .5rem; font-size: 1.3rem; }
.seo-lead { font-size: 1.1rem; color: var(--muted); }
.seo-crumb { font-size: .85rem; color: var(--muted); }
.seo-faq details { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: .7rem 1rem; margin-bottom: .5rem; }
.seo-faq summary { cursor: pointer; font-weight: 600; }
.seo-faq p { margin: .5rem 0 0; color: var(--muted); }
.seo-cta { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: 2rem; }
.seo-related { margin-top: 1.5rem; font-size: .92rem; }

/* ===== v21: brand share icons + share on every card ===== */
.share-fab svg { width: 18px; height: 18px; }
.share-fab span { transform: none; }
.share-nets .sn-whatsapp { background: #25D366; }
.share-nets .sn-facebook { background: #0866FF; }
.share-nets .sn-messenger { background: #0866FF; }
.share-nets .sn-x { background: #000000; }
.share-nets .sn-telegram { background: #26A5E4; }
.share-nets .sn-viber { background: #7360F2; }
.share-nets .sn-threads { background: #000000; }
.share-nets .sn-reddit { background: #FF4500; }
.share-nets .sn-x, .share-nets .sn-threads { background: #000; box-shadow: inset 0 0 0 1px #ffffff40; }
.share-nets .sn-email { background: #64748b; } .share-nets .sn-more { background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); }
.share-nets i svg { width: 22px; height: 22px; }
.share-nets { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
.share-copy svg { width: 15px; height: 15px; vertical-align: -3px; }
.share-sheet.near { position: fixed; }
.share-mini-wrap { position: relative; display: flex; min-width: 0; }
.share-mini-wrap > :first-child { flex: 1; min-width: 0; }
.share-mini { position: absolute; top: 8px; right: 8px; z-index: 3; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: #0b0b14cc; color: var(--text); display: grid; place-items: center; cursor: pointer; opacity: .55; transition: opacity .15s, transform .15s; padding: 0; }
.share-mini svg { width: 15px; height: 15px; }
.share-mini-wrap:hover .share-mini, .share-mini:focus-visible { opacity: 1; }
.share-mini:hover { transform: scale(1.08); border-color: var(--accent); }
#modeTabs .share-mini { top: 6px; right: 6px; width: 26px; height: 26px; }
@media (hover: none) { .share-mini { opacity: .9; } }
.sc-share svg { width: 14px; height: 14px; vertical-align: -2px; }
.sc-card.sc-hi { border-color: var(--accent); box-shadow: 0 0 0 3px #7c5cff55; }
#gallery { scroll-margin-top: 80px; }

/* ===== v21: Video editor (editor.html) ===== */
.page-editor { overflow: hidden; }
.page-editor .share-fab { display: none; }
.ed { --tl: 250px; display: grid; grid-template-columns: 300px minmax(0, 1fr) 290px; grid-template-rows: minmax(0, 1fr) var(--tl); height: calc(100vh - 70px); height: calc(100dvh - 70px); background: #07070d; }
.ed-left, .ed-right { background: var(--panel); border-right: 1px solid var(--border); min-height: 0; display: flex; flex-direction: column; }
.ed-right { border-right: 0; border-left: 1px solid var(--border); overflow: auto; }
.ed-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--border); }
.ed-tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-size: .72rem; padding: .55rem 0 .45rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; cursor: pointer; border-bottom: 2px solid transparent; }
.ed-tabs button span { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.ed-tabs button.active { color: var(--text); border-bottom-color: var(--accent); background: #7c5cff14; }
.ed-panel { padding: .8rem; overflow: auto; flex: 1; }
.ed-upload { display: flex; flex-direction: column; align-items: center; gap: .15rem; border: 1.5px dashed var(--border); border-radius: 12px; padding: .9rem; cursor: pointer; margin-bottom: .8rem; text-align: center; }
.ed-upload:hover { border-color: var(--accent); }
.ed-upload small { color: var(--muted); }
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ed-grid.audio { grid-template-columns: 1fr; }
.ed-item { position: relative; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: grab; }
.ed-item:hover { border-color: var(--accent); }
.ed-thumb { aspect-ratio: 16/10; background: #000; display: grid; place-items: center; position: relative; }
.ed-grid.audio .ed-thumb { aspect-ratio: auto; height: 38px; justify-items: start; padding-left: .6rem; }
.ed-thumb img, .ed-thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ed-badge { position: absolute; left: 6px; bottom: 4px; font-size: .6rem; background: #000a; border-radius: 4px; padding: 0 .3rem; }
.ed-aud { font-size: 1.2rem; }
.ed-item small { display: block; padding: .3rem .45rem; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.ed-grid.audio .ed-item { display: grid; grid-template-columns: 44px 1fr; align-items: center; }
.ed-add { position: absolute; right: 5px; top: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ed-item:hover .ed-add, .ed-add:focus-visible { opacity: 1; }
@media (hover: none) { .ed-add { opacity: 1; } }
.ed-presets { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ed-preset { aspect-ratio: 16/9; border-radius: 10px; border: 1px solid var(--border); background: #111827; color: #fff; font: inherit; cursor: pointer; display: grid; place-items: center; padding: .3rem; text-align: center; font-size: .85rem; }
.ed-preset:hover { border-color: var(--accent); transform: translateY(-1px); }
.ed-preset.tr { aspect-ratio: auto; padding: .7rem .3rem; background: var(--panel-2); }
.ed-preset.f { aspect-ratio: auto; padding: .7rem .3rem; background: linear-gradient(135deg, #0ea5e9, #f97316, #22c55e); }
.f-bw { filter: grayscale(1); } .f-sepia { filter: sepia(.8); } .f-warm { filter: sepia(.3) saturate(1.3); } .f-cool { filter: hue-rotate(-15deg); } .f-vivid { filter: saturate(1.6); } .f-fade { filter: contrast(.8) brightness(1.1) saturate(.7); } .f-dark { filter: brightness(.7) contrast(1.2); }
.ed-center { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ed-top { display: flex; align-items: center; gap: .3rem; padding: .45rem .7rem; border-bottom: 1px solid var(--border); }
.ed-sp { flex: 1; }
.ed-ib { background: none; border: 1px solid transparent; color: var(--text); border-radius: 8px; padding: .3rem .55rem; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.ed-ib:hover:not(:disabled) { background: var(--panel-2); border-color: var(--border); }
.ed-ib:disabled { opacity: .35; cursor: default; }
.ed-stagewrap { flex: 1; min-height: 0; display: grid; place-items: center; padding: .8rem; }
.ed-stage { position: relative; height: 100%; max-width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 6px; overflow: hidden; box-shadow: 0 10px 40px #0009; }
.ed-stage canvas { width: 100%; height: 100%; display: block; }
.ed-stage:fullscreen { border-radius: 0; height: 100vh; margin: auto; }
.ed-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: .4rem; padding: 1rem; background: #000c; color: var(--muted); font-size: .9rem; }
.ed-empty b { color: var(--text); font-size: 1.1rem; }
.ed-empty[hidden], .ed-loading[hidden] { display: none; }
.ed-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #000b; }
.ed-transport { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .35rem; border-top: 1px solid var(--border); }
.ed-play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--text); color: #000; font-size: 1rem; cursor: pointer; }
.ed-time { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--muted); min-width: 120px; text-align: center; }
.ed-props { padding: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.ed-props h3 { margin: 0; font-size: 1rem; }
.ed-props label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); }
.ed-props label output { color: var(--text); float: right; }
.ed-props input:not([type=range]):not([type=checkbox]):not([type=color]), .ed-props select, .ed-props textarea, .ed-dlg select { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .45rem .55rem; font: inherit; font-size: .88rem; width: 100%; box-sizing: border-box; }
.ed-props input[type=range] { width: 100%; accent-color: var(--accent); }
.ed-props input[type=color] { width: 100%; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); padding: 2px; }
.ed-props .ed-chk { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); }
.ed-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ed-acts { grid-template-columns: repeat(3, auto); justify-content: start; margin-top: .4rem; }
.ed-acts .danger { color: #fda4af; }
.ed-tip, .ed-stat { font-size: .78rem; color: var(--muted); line-height: 1.6; margin: .3rem 0 0; }
.ed-tip kbd { background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 .3rem; font-size: .72rem; }
.ed-warn { background: #ff5c7a1c; border-left: 3px solid var(--danger); padding: .4rem .6rem; border-radius: 6px; font-size: .8rem; margin: 0; }
.ed-name { margin: 0; font-size: .85rem; color: var(--muted); }
.ed-bottom { grid-column: 1 / -1; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border-top: 1px solid var(--border); }
.ed-tlbar { display: flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border-bottom: 1px solid var(--border); }
.ed-tlbar input[type=range] { width: 140px; accent-color: var(--accent); }
.ed-snap { display: flex; align-items: center; gap: .3rem; font-size: .82rem; color: var(--muted); margin-left: .4rem; }
.ed-tlwrap { flex: 1; min-height: 0; display: flex; }
.ed-trackheads { width: 86px; flex: none; border-right: 1px solid var(--border); }
.ed-rh { height: 24px; border-bottom: 1px solid var(--border); }
.th { height: calc((var(--tl) - 24px - 42px) / 4); display: flex; align-items: center; gap: .35rem; padding-left: .55rem; font-size: .75rem; color: var(--muted); border-bottom: 1px solid #ffffff08; }
.th.video { height: calc((var(--tl) - 24px - 42px) / 4 * 1.4); }
.th.text, .th.voice, .th.music { height: calc((var(--tl) - 24px - 42px) / 4 * 0.866); }
.th b { color: var(--text); width: 1.1rem; text-align: center; }
.ed-tl { flex: 1; overflow-x: auto; overflow-y: hidden; position: relative; }
.ed-ruler { height: 24px; position: relative; border-bottom: 1px solid var(--border); cursor: pointer; background: #ffffff05; }
.ed-ruler span { position: absolute; top: 0; height: 100%; border-left: 1px solid #ffffff22; font-size: .65rem; color: var(--muted); padding: 3px 0 0 4px; font-variant-numeric: tabular-nums; }
.ed-lanes { position: relative; }
.tl-lane { position: relative; height: calc((var(--tl) - 24px - 42px) / 4 * 0.866); border-bottom: 1px solid #ffffff08; }
.tl-lane.video { height: calc((var(--tl) - 24px - 42px) / 4 * 1.4); background: #ffffff04; }
.tl-clip { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; overflow: hidden; cursor: grab; user-select: none; touch-action: none; border: 2px solid transparent; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 8px 3px; color: #fff; text-shadow: 0 1px 3px #000; }
.tl-clip:active { cursor: grabbing; }
.tl-clip b { font-size: .72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 1; }
.tl-clip small { font-size: .62rem; opacity: .85; position: relative; z-index: 1; white-space: nowrap; }
.tl-clip.v { background-color: #312e81; background-repeat: repeat-x; background-size: auto 100%; }
.tl-clip.v::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, #000a); }
.tl-clip.image { background-color: #134e4a; }
.tl-clip.a { background: #0e7490; justify-content: center; }
.tl-clip.a.music { background: #7e22ce; }
.tl-clip.a b, .tl-clip.a small { position: absolute; left: 8px; }
.tl-clip.a b { top: 2px; } .tl-clip.a small { bottom: 2px; right: 8px; left: auto; }
.tl-clip .wf { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-clip.t { background: #b45309; justify-content: center; }
.tl-clip.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.tl-clip.missing { outline: 2px dashed var(--danger); outline-offset: -4px; }
.tl-clip .h { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 2; }
.tl-clip .h.l { left: 0; } .tl-clip .h.r { right: 0; }
.tl-clip.sel .h { background: #ffffffd0; }
.tl-clip.sel .h::after { content: ""; position: absolute; left: 3px; top: 35%; bottom: 35%; width: 3px; border-left: 1px solid #0007; border-right: 1px solid #0007; }
.tl-tr { position: absolute; left: -2px; top: 3px; z-index: 3; font-style: normal; font-size: .65rem; background: #fff; color: #000; border-radius: 4px; padding: 0 .2rem; text-shadow: none; }
.tl-head { position: absolute; top: -24px; bottom: 0; width: 0; z-index: 6; pointer-events: none; }
.tl-head::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; border-left: 2px solid #f43f5e; }
.tl-head i { position: absolute; left: -7px; top: 0; width: 14px; height: 14px; background: #f43f5e; clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
.tl-drop { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #22d3ee; z-index: 7; box-shadow: 0 0 10px #22d3ee; }
.ed-dlg .mv-video { margin-top: .6rem; }
@media (max-width: 1100px) { .ed { grid-template-columns: 250px minmax(0, 1fr) 240px; } }
@media (max-width: 900px) {
  .page-editor { overflow: auto; }
  .ed { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .ed-center { order: 1; } .ed-bottom { order: 2; height: var(--tl); } .ed-left { order: 3; max-height: 60vh; } .ed-right { order: 4; border-left: 0; }
  .ed-stagewrap { height: 52vw; max-height: 60vh; }
}

/* ===== v21: Research writing assistant ===== */
.rs-wrap { max-width: 1100px; padding-top: 1rem; }
.rs-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; margin-bottom: 1rem; }
.rs-steps button { background: var(--panel); border: 1px solid var(--border); color: var(--muted); border-radius: 12px; padding: .6rem .4rem; font: inherit; font-size: .85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.rs-steps button b { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; font-size: .75rem; color: var(--text); }
.rs-steps button.active { color: var(--text); border-color: var(--accent); background: #7c5cff1f; }
.rs-steps button.active b { background: var(--accent); }
.rs-badge { background: var(--accent-2); color: #000; border-radius: 99px; padding: 0 .45rem; font-size: .72rem; font-weight: 700; }
@media (max-width: 760px) { .rs-steps { grid-template-columns: repeat(3, 1fr); } }
.rs-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.rs-row h2, .rs-row h3 { margin: 0; }
.rs-full { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); margin: .7rem 0; }
.rs-inline { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }
.rs-inline select, .rs-inline input { width: auto !important; }
.rs-projbar { margin-bottom: .8rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border); }
.rs-q { flex: 1; min-width: 220px; }
.rs-filters { margin: .6rem 0 0; gap: .4rem 1rem; }
.rs-results { display: flex; flex-direction: column; gap: .6rem; margin-top: .6rem; }
.rs-res { display: grid; grid-template-columns: 1fr auto; gap: .8rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; align-items: start; }
.rs-res.added { border-color: #4ade8077; }
.rs-res h4 { margin: 0 0 .25rem; font-size: .98rem; line-height: 1.35; }
.rs-meta { font-size: .8rem; color: var(--muted); margin: 0 0 .3rem; }
.rs-res details { font-size: .85rem; } .rs-res details p { color: var(--muted); line-height: 1.55; margin: .3rem 0; }
.rs-links { font-size: .82rem; margin: .3rem 0 0; } .rs-links a { color: var(--accent-2); }
.rs-tag { display: inline-block; margin-left: .35rem; font-size: .68rem; padding: 0 .4rem; border-radius: 99px; background: #fbbf2433; color: #fde68a; }
.rs-tag.oa { background: #4ade8022; color: #86efac; }
.rs-sources { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.rs-src { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: .6rem; background: var(--panel-2); border-radius: 10px; padding: .6rem .7rem; align-items: start; }
.rs-src p { margin: 0 0 .2rem; font-size: .9rem; }
.rs-n { background: var(--accent); color: #fff; border-radius: 6px; text-align: center; font-size: .8rem; padding: .15rem 0; }
.rs-note { width: 100%; margin-top: .3rem; font-size: .82rem !important; }
.rs-srcbtns { display: flex; flex-direction: column; }
.rs-sugg, .rs-gaps { font-size: .88rem; margin: .5rem 0; }
.rs-chip { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 99px; padding: .2rem .7rem; font: inherit; font-size: .78rem; cursor: pointer; margin: .2rem .2rem 0 0; }
.rs-chip:hover { border-color: var(--accent); }
.rs-sec { background: var(--panel-2); border-radius: 10px; padding: .7rem; margin-top: .5rem; }
.rs-sec.lvl2 { margin-left: 2rem; }
.rs-sec .rs-h { flex: 1; min-width: 200px; font-weight: 600; }
.rs-sec .rs-w { width: 6rem !important; } .rs-sec .rs-lvl { width: auto !important; }
.rs-sec textarea { margin-top: .4rem; font-size: .85rem !important; }
.rs-wsec { border-top: 1px solid var(--border); padding: 1rem 0 .5rem; }
.rs-wsec.lvl2 { padding-left: 1.5rem; }
.rs-wsec h3 { font-size: 1.05rem; }
.rs-wsec .rs-text { font-family: Georgia, "Times New Roman", serif !important; font-size: 1rem !important; line-height: 1.65; margin-top: .5rem; }
.rs-notes { margin-top: .4rem; font-size: .85rem !important; }
.rs-flag { color: #fde68a; font-size: .82rem; margin: .3rem 0 0; }
.rs-note-box { background: #22d3ee12; border-left: 3px solid var(--accent-2); border-radius: 6px; padding: .6rem .8rem; font-size: .86rem; }
.rs-checklist { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .35rem; font-size: .92rem; }
.rs-checklist li::before { margin-right: .5rem; } .rs-checklist .ok::before { content: "✅"; } .rs-checklist .warn::before { content: "⚠️"; } .rs-checklist .info::before { content: "ℹ️"; }
.rs-preview { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-top: .7rem; }
.rs-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: .6rem; }
.rs-table td, .rs-table th { border-bottom: 1px solid var(--border); padding: .5rem; text-align: left; vertical-align: top; }
.rs-table td:first-child { font-weight: 700; color: var(--accent-2); }
.rs-posterbox { margin-top: .8rem; background: #0005; border-radius: 10px; padding: 1rem; overflow: hidden; }
.rs-poster { width: 1189mm; height: 841mm; border: 0; transform-origin: 0 0; background: #fff; }
.rs-code { font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace !important; }

/* ===== v21: bank transfer / deposit ===== */
.bank-box { display: flex; flex-direction: column; gap: .5rem; margin-top: .4rem; }
.bank-or { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .8rem; margin: .3rem 0; }
.bank-or::before, .bank-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.bank-steps { display: flex; flex-direction: column; gap: .55rem; }
.bank-steps h4 { margin: .4rem 0 0; font-size: 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bank-amt { color: #86efac; font-size: 1.15rem; }
.bank-dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: 0; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; font-size: .92rem; }
.bank-dl dt { color: var(--muted); } .bank-dl dd { margin: 0; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.bank-no { font-size: 1.12rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.bank-copy { background: none; border: 1px solid var(--border); color: var(--accent-2); border-radius: 6px; padding: .05rem .45rem; font: inherit; font-size: .72rem; cursor: pointer; }
.bank-copy:hover { border-color: var(--accent-2); }
.bank-ref { font-size: .88rem; background: #fbbf2414; border-left: 3px solid #fbbf24; border-radius: 6px; padding: .5rem .7rem; margin: 0; }
.bank-file { display: block; border: 1.5px dashed var(--border); border-radius: 10px; padding: .8rem; text-align: center; cursor: pointer; font-size: .9rem; }
.bank-file:hover { border-color: var(--accent); }
.bank-refin { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem; font: inherit; font-size: .88rem; }
.btn-wa { background: #25d366; color: #fff; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; text-decoration: none; }
.btn-wa:hover { filter: brightness(1.06); }
.bank-done { background: #16351f; border: 1px solid #2f7a45; border-radius: 10px; padding: .6rem .8rem; margin: 0; font-size: .9rem; }
.bank-row { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; background: var(--panel-2); border-radius: 10px; padding: .5rem .7rem; margin-top: .4rem; font-size: .85rem; }
.bank-row small { width: 100%; color: var(--muted); }
.bank-st { font-size: .75rem; padding: .05rem .5rem; border-radius: 99px; background: #fbbf2433; color: #fde68a; }
.bank-st.rejected { background: #ff5c7a33; color: #fda4af; } .bank-st.review { background: #22d3ee26; color: #67e8f9; }

/* ===== v21: voiceover for videos ===== */
.vo-auto { margin-top: .3rem; font-size: .9rem; }
.vo-dlg { margin: auto; width: min(1180px, 96vw); max-height: 94vh; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 0; }
.vo-dlg::backdrop { background: #000b; }
.vo-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.2rem; border-bottom: 1px solid var(--border); }
.vo-head h2 { margin: 0; font-size: 1.15rem; }
.vo-x { background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.vo-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; padding: 1rem 1.2rem 1.2rem; overflow: auto; max-height: calc(94vh - 60px); }
@media (max-width: 860px) { .vo-body { grid-template-columns: 1fr; } }
.vo-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; }
.vo-stage video { width: 100%; max-height: 52vh; display: block; }
.vo-sub { position: absolute; left: 6%; right: 6%; bottom: 7%; text-align: center; color: #fff; font-weight: 700; font-size: clamp(.85rem, 2vw, 1.15rem); text-shadow: 0 2px 6px #000, 0 0 2px #000; pointer-events: none; }
.vo-tl { position: relative; height: 26px; background: var(--panel-2); border-radius: 8px; margin: .6rem 0; cursor: pointer; overflow: hidden; }
.vo-blk { position: absolute; top: 4px; bottom: 4px; border-radius: 5px; background: #0e7490; opacity: .75; }
.vo-blk.done { background: #16a34a; opacity: 1; } .vo-blk.tight { background: #ca8a04; } .vo-blk.long { background: #dc2626; }
.vo-tl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: #f43f5e; left: 0; z-index: 2; }
.vo-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0; }
.vo-opts { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }
.vo-chk { display: flex; align-items: center; gap: .45rem; font-size: .88rem; }
.vo-chk input[type=range] { width: 110px; accent-color: var(--accent); }
.vo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.vo-grid label, .vo-about { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; color: var(--muted); }
.vo-wide { grid-column: 1 / -1; }
.vo-dlg select, .vo-dlg textarea, .vo-dlg input[type=number] { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .5rem; font: inherit; font-size: .88rem; width: 100%; box-sizing: border-box; }
.vo-about { margin-top: .5rem; }
.vo-lines { display: flex; flex-direction: column; gap: .35rem; margin-top: .6rem; }
.vo-lh { display: grid; grid-template-columns: 4.2rem 4.2rem 1fr 3.4rem; gap: .35rem; font-size: .72rem; color: var(--muted); }
.vo-line { display: grid; grid-template-columns: 4.2rem 4.2rem 1fr auto auto auto; gap: .35rem; align-items: center; }
.vo-line textarea { resize: vertical; min-height: 2.4rem; }
.vo-line.running { opacity: .65; } .vo-line.done textarea { border-color: #16a34a88; } .vo-line.failed textarea { border-color: var(--danger); }
.vo-fit { width: 11px; height: 11px; border-radius: 50%; background: #4ade80; } .vo-fit.tight { background: #fbbf24; } .vo-fit.long { background: #f87171; }
.vo-play, .vo-del { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; font-size: .75rem; padding: 0; }
.vo-err { background: #ff5c7a1c; border-left: 3px solid var(--danger); border-radius: 6px; padding: .45rem .6rem; font-size: .85rem; margin: .5rem 0 0; }
.vo-make { margin-top: .8rem; }
.vo-out { border-top: 1px solid var(--border); margin-top: .8rem; padding-top: .6rem; }
.vo-out #voResult { margin-top: .6rem; display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
/* Ideas page player: no autoplay, play/pause, seek, mute, subtitles */
.sc-media video { cursor: pointer; }
.sc-big { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; border: 0; background: #000a; color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .15s, opacity .2s; backdrop-filter: blur(4px); }
.sc-big svg { width: 30px; height: 30px; margin-left: 3px; }
.sc-big:hover { transform: scale(1.08); background: var(--accent); }
.sc-card.playing .sc-big { opacity: 0; pointer-events: none; }

.sc-card.playing .sc-big svg { margin-left: 0; }
.sc-ctl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; background: linear-gradient(transparent, #000c); color: #fff; opacity: 0; transition: opacity .2s; }
.sc-media:hover .sc-ctl, .sc-card.playing .sc-ctl, .sc-ctl:focus-within { opacity: 1; }
@media (hover: none) { .sc-ctl { opacity: 1; } }
.sc-ctl button { background: none; border: 0; color: #fff; width: 28px; height: 28px; padding: 0; cursor: pointer; display: grid; place-items: center; }
.sc-ctl svg { width: 20px; height: 20px; }
.sc-bar { flex: 1; height: 5px; background: #ffffff40; border-radius: 99px; cursor: pointer; position: relative; }
.sc-bar::before { content: ""; position: absolute; inset: -8px 0; }
.sc-bar i { display: block; height: 100%; width: 0; background: var(--accent-2); border-radius: 99px; }
.sc-time { font-size: .72rem; font-variant-numeric: tabular-nums; min-width: 4.6rem; text-align: right; }
.sc-cap { position: absolute; left: 6%; right: 6%; bottom: 44px; text-align: center; color: #fff; font-weight: 700; font-size: .95rem; text-shadow: 0 2px 6px #000, 0 0 2px #000; pointer-events: none; }
.sc-vo { position: absolute; left: .5rem; top: .5rem; font-size: .7rem; background: #000a; color: #fff; padding: .1rem .5rem; border-radius: 99px; }
.sc-script { margin: 0; font-size: .82rem; font-style: italic; color: #c4b5fd; }

/* ===== v21: talking / singing videos ===== */
.talk-field { margin-top: .2rem; }
.talk-box { margin-top: .6rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: .8rem; display: flex; flex-direction: column; gap: .55rem; }
.talk-hint { margin: 0; font-size: .85rem; color: var(--muted); }
.talk-lines { display: flex; flex-direction: column; gap: .4rem; }
.talk-line { display: grid; grid-template-columns: 1fr 5.2rem 1fr 2rem; gap: .35rem; background: var(--panel); border-radius: 10px; padding: .4rem; }
.talk-line .tl-text { grid-column: 1 / -1; order: 5; }
.talk-box input, .talk-box select { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .42rem .55rem; font: inherit; font-size: .88rem; min-width: 0; }
.tl-x { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; width: 2rem; cursor: pointer; }
.talk-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.talk-chk { display: flex; align-items: center; gap: .35rem; font-size: .85rem; }
.talk-in { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; color: var(--muted); }
.talk-lab { font-size: .82rem; color: var(--muted); }
.segmented.small button { padding: .3rem .7rem; font-size: .82rem; }
.talk-cost { margin: 0; font-size: .85rem; }
.talk-warn { color: #fbbf24; font-weight: 500; }

/* Ideas: picture and audio samples, "How it works" badge */
.sc-img { display: block; width: 100%; height: 100%; }
.sc-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sc-audio { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px;
  background: radial-gradient(ellipse at 30% 20%, rgba(124, 92, 255, .45), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(34, 211, 238, .3), transparent 60%), #12121c; }
.sc-audio span { font-size: 44px; }
.sc-audio audio { width: 100%; max-width: 320px; }
.sc-vo.sc-guide { background: rgba(34, 211, 238, .85); color: #0b0b12; }
.sc-up { cursor: pointer; }
#avSwapPreview { max-height: 220px; width: 100%; border-radius: 10px; background: #000; }
