:root {
  --bg: #fbf4e8;
  --paper: #fffdf8;
  --ink: #2f2622;
  --muted: #7d726a;
  --line: #eadfcf;
  --orange: #e8650f;
  --orange-soft: #ffe2c6;
  --green: #2f8f3a;
  --purple: #8a3fc4;
  --blue: #1f6fd1;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(90, 60, 20, 0.10);
  --font-display: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  background:
    radial-gradient(1200px 500px at 85% -10%, #ffe7c9 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 20%, #e5f3dc 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
a { color: var(--orange); }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 48px); position: sticky; top: 0; z-index: 20; background: rgba(251,244,232,.85); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(234,223,207,.6); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--orange); color: #fff; font-size: 20px; box-shadow: 0 4px 12px rgba(232,101,15,.35); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .2px; }
.topnav { display: flex; align-items: center; gap: 14px; }
.topnav > a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.topnav > a:hover { color: var(--orange); }
.badge { background: linear-gradient(135deg, #ffcf5c, #e8650f); color: #fff; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 999px; }

.btn { font: 700 15px/1 var(--font-body); border: 0; border-radius: 999px; padding: 11px 18px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(232,101,15,.3); }
.btn-primary:hover:not(:disabled) { background: #d45a0b; }
.btn-accent { background: var(--purple); color: #fff; box-shadow: 0 6px 16px rgba(138,63,196,.28); }
.btn-accent:hover { background: #7a35b0; }
.btn-soft { background: var(--orange-soft); color: #a8470a; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-lg { padding: 15px 26px; font-size: 17px; }
.btn-round { width: 46px; height: 46px; padding: 0; background: var(--ink); color: #fff; font-size: 16px; }
.link-btn { background: none; border: 0; color: var(--orange); font: 700 14px var(--font-body); cursor: pointer; padding: 0; }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 40px; }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 48px 0 28px; }
.eyebrow { font-weight: 800; color: var(--green); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; margin: 0 0 10px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); font-weight: 700; }
.hl { color: var(--orange); background: linear-gradient(transparent 62%, #ffd9b4 62%); }
.lede { font-size: 18px; color: #574a42; max-width: 36em; }
.hero-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-points span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; }
.hero-art { position: relative; }
.mock-card { position: relative; background: #fff; padding: 7px; border-radius: 22px; box-shadow: var(--shadow); transform: rotate(-1.2deg); }
.mock-card canvas { width: 100%; height: auto; display: block; border-radius: 16px; background: #e9f2dc; }
.mock-chip { position: absolute; top: 18px; left: 18px; background: var(--green); color: #fff; font: 600 14px var(--font-display); padding: 6px 12px; border-radius: 999px; z-index: 1; }
.mock-caption { margin: 14px 18px 0; background: #fff; border: 2.5px solid var(--green); border-radius: 16px; padding: 12px; text-align: center; font: 600 clamp(16px, 2vw, 21px)/1.5 var(--font-display); display: grid; gap: 4px; }
.mock-active { background: #d7f0d2; color: var(--green); border-radius: 10px; padding: 2px 10px; justify-self: center; }
.mock-next { color: #a9b3bc; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; margin-top: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.form-panel label { display: grid; gap: 6px; font-weight: 800; font-size: 14px; margin-bottom: 14px; }
input, textarea, select { font: 600 16px var(--font-body); color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; width: 100%; }
textarea { font: 600 17px/1.6 var(--font-body); resize: vertical; min-height: 230px; }
input:focus, textarea:focus, select:focus { outline: 3px solid #ffd9b4; border-color: var(--orange); }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.counter { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }
.counter.over { color: #c43b2f; font-weight: 800; }

fieldset.voice { border: 1.5px dashed var(--line); border-radius: 14px; padding: 12px 14px 4px; margin: 0 0 16px; }
fieldset.voice legend { font-weight: 800; font-size: 14px; padding: 0 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.seg label { margin: 0; display: block; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-block; padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; font-size: 14px; }
.seg input:checked + span { background: var(--orange-soft); border-color: var(--orange); color: #a8470a; }
.seg input:focus-visible + span { outline: 3px solid #ffd9b4; }
.voice-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.voice-opt label.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.voice-opt select { width: auto; }
.hint { color: var(--muted); font-size: 13px; font-weight: 600; }
.file { margin: 0 !important; }
.file input { display: none; }
.file span { display: inline-block; background: #fff; border: 1.5px solid var(--line); padding: 9px 14px; border-radius: 999px; font-weight: 800; cursor: pointer; }

.submit-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.quota-note { color: var(--muted); font-weight: 700; font-size: 14px; }
.quota-note b { color: var(--green); }
.error { color: #b42318; background: #fff1ef; border: 1px solid #fbd1cb; border-radius: 12px; padding: 10px 12px; font-weight: 700; margin: 14px 0 0; }

.side { display: grid; gap: 18px; position: sticky; top: 84px; }
.tips ol { padding-left: 20px; margin: 0; display: grid; gap: 8px; }

.ad-slot { display: none; }
body.show-ads .ad-slot.filled, body.show-ads .ad-slot.placeholder { display: block; }
.ad-slot.placeholder { border: 2px dashed #e0d3bf; border-radius: 14px; color: #b3a48f; font: 700 12px var(--font-body); text-transform: uppercase; letter-spacing: .1em; display: grid; place-items: center; }
.ad-top { margin: 6px 0 10px; min-height: 90px; }
.ad-side { min-height: 250px; }
.ad-render { min-height: 100px; width: min(100%, 480px); margin: 14px auto 0; background: rgba(255,255,255,.7); }

.studio { margin-top: 26px; }
.stage { position: relative; background: #f3ead9; border-radius: 16px; overflow: hidden; display: grid; place-items: center; }
.stage canvas { width: 100%; height: auto; max-height: 72vh; display: block; object-fit: contain; }
.stage.portrait canvas { width: auto; height: 72vh; }
.stage-overlay { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: rgba(251,244,232,.94); padding: 20px; gap: 6px; }
.stage-overlay p { margin: 0; font: 600 20px var(--font-display); }
.stage-overlay .sub { font: 600 14px var(--font-body); color: var(--muted); }
.bar { width: min(420px, 70vw); height: 10px; border-radius: 99px; background: #eadfcf; overflow: hidden; margin: 8px auto; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb45e, var(--orange)); transition: width .3s ease; }
.loader { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.loader span { width: 12px; height: 12px; border-radius: 50%; background: var(--orange); animation: bob 1s infinite ease-in-out; }
.loader span:nth-child(2) { background: var(--green); animation-delay: .15s; }
.loader span:nth-child(3) { background: var(--purple); animation-delay: .3s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.controls input[type=range] { flex: 1; min-width: 160px; accent-color: var(--orange); padding: 0; border: 0; background: none; }
.time { font: 700 14px var(--font-body); color: var(--muted); font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 12px; }
.upsell { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #f5ecff; border: 1px solid #e2cdf7; border-radius: 14px; padding: 14px 16px; flex-wrap: wrap; }
body.premium .free-only { display: none !important; }

.pricing { margin-top: 64px; text-align: center; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 22px; justify-content: center; margin-top: 18px; }
.plan { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 28px; text-align: left; box-shadow: var(--shadow); display: grid; gap: 6px; }
.plan.featured { border: 2px solid var(--purple); }
.plan ul { padding-left: 18px; margin: 6px 0 16px; display: grid; gap: 6px; }
.price { font: 700 32px var(--font-display); margin: 0; }
.ribbon { position: absolute; top: -13px; right: 20px; background: var(--purple); color: #fff; font: 700 12px var(--font-body); padding: 5px 12px; border-radius: 999px; }
.faq { max-width: 760px; margin: 60px auto 0; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 800; cursor: pointer; }
.foot { display: flex; gap: 18px; justify-content: center; padding: 30px; color: var(--muted); font-weight: 700; font-size: 14px; }
.foot a { color: var(--muted); }

.modal { border: 0; border-radius: 22px; padding: 0; width: min(440px, 92vw); box-shadow: 0 30px 80px rgba(40,20,0,.3); background: var(--paper); color: var(--ink); }
.modal.wide { width: min(760px, 94vw); }
.modal::backdrop { background: rgba(47,38,34,.45); backdrop-filter: blur(3px); }
.modal-body { padding: 28px; display: grid; gap: 12px; position: relative; }
.modal-body label { display: grid; gap: 6px; font-weight: 800; font-size: 14px; }
.x { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--muted); line-height: 1; }
.switch { font-size: 14px; color: var(--muted); margin: 0; text-align: center; }
.big-emoji { font-size: 44px; }

.teleprompter { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 18px; max-height: 46vh; overflow: auto; display: grid; gap: 6px; }
.teleprompter p { margin: 0; font: 600 20px/1.5 var(--font-display); color: #a9b3bc; padding: 2px 10px; border-radius: 10px; transition: all .2s; }
.teleprompter p.done { color: var(--ink); }
.teleprompter p.now { color: var(--orange); background: var(--orange-soft); font-size: 26px; }
.teleprompter p.gap { height: 8px; padding: 0; }
.rec-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #e0352b; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; z-index: 50; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .workspace { grid-template-columns: 1fr; }
  .side { position: static; }
  .plans { grid-template-columns: 1fr; }
  .topnav > a { display: none; }
}
@media (max-width: 520px) {
  .row.two { grid-template-columns: 1fr; }
  #upgradeTopBtn { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
