/* ScriptAI — light UI */
:root {
  --bg: #f5f6fb;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #f7f8fc;
  --line: #e7e8f0;
  --line2: #d9dbe7;
  --text: #23263a;
  --heading: #0f1222;
  --muted: #5d6279;
  --dim: #8c91a7;
  --v: #7c3aed;
  --p: #db2777;
  --o: #ea580c;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --info: #0284c7;
  --grad: linear-gradient(135deg, #7c3aed 0%, #db2777 55%, #f97316 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,58,237,.07), rgba(219,39,119,.05) 55%, rgba(249,115,22,.05));
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 20px rgba(16,24,40,.05);
  --shadow-lg: 0 24px 60px rgba(30,20,70,.14);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--v); text-decoration: none; }
a:hover { color: #5b21b6; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; color: var(--heading); }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.strong { color: var(--heading); font-weight: 600; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-s { gap: 6px; } .gap-l { gap: 18px; }
.mt0 { margin-top: 0 !important; } .mt1 { margin-top: 8px; } .mt2 { margin-top: 16px; } .mt3 { margin-top: 24px; } .mt4 { margin-top: 40px; }
.mb0 { margin-bottom: 0 !important; } .mb1 { margin-bottom: 8px; } .mb2 { margin-bottom: 16px; } .mb3 { margin-bottom: 24px; }
.w100 { width: 100%; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.stars-txt { color: #f59e0b; letter-spacing: 1px; }

/* grids */
.g2, .g3, .g4 { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line2); background: #fff; color: var(--heading); font: 600 14px/1.2 var(--font); cursor: pointer; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s, opacity .15s; white-space: nowrap; text-decoration: none; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.btn:hover { border-color: #c4c7d8; color: var(--heading); background: var(--card2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 22px rgba(219,39,119,.22); }
.btn-primary:hover { background: var(--grad); color: #fff; filter: brightness(1.06); box-shadow: 0 10px 28px rgba(219,39,119,.32); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--card2); border-color: var(--line); }
.btn-outline { background: transparent; }
.btn-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; box-shadow: none; }
.btn-danger:hover { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.btn-ok { background: #ecfdf3; border-color: #bbf0cf; color: #15803d; box-shadow: none; }
.btn-ok:hover { background: #dcfce7; color: #166534; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

/* forms */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--heading); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line2); background: #fff; color: var(--heading); font: 400 14.5px/1.5 var(--font); outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: #a3a7ba; }
.input:focus { border-color: var(--v); box-shadow: 0 0 0 3px rgba(124,58,237,.14); }
textarea.input { resize: vertical; min-height: 90px; }
textarea.code { font-family: var(--mono); font-size: 13px; line-height: 1.6; min-height: 380px; background: #fbfbfe; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235d6279' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.hint { font-size: 12.5px; color: var(--dim); margin-top: 5px; }
.input-group { display: flex; gap: 8px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; color: var(--text); }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: #d9dbe7; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .track { background: var(--v); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3, .card-head h4 { margin: 0; }
.card-body { padding: 20px; }
.card-glow { position: relative; background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 1.5px solid transparent; box-shadow: 0 12px 34px rgba(124,58,237,.12); }
.card-soft { background: var(--grad-soft), #fff; border: 1px solid #e9defd; }
@media (max-width: 640px) { .card-pad, .card-body { padding: 16px; } .card-head { padding: 14px 16px; } }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--card2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge-v { background: #f3edff; border-color: #e4d8fe; color: #6d28d9; }
.badge-p { background: #fdeef6; border-color: #f9d0e4; color: #be185d; }
.badge-ok { background: #ecfdf3; border-color: #bbf0cf; color: #15803d; }
.badge-warn { background: #fff8eb; border-color: #fde3a7; color: #b45309; }
.badge-err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.badge-grad { background: var(--grad); color: #fff; border: 0; }

/* alerts */
.alert { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card2); margin-bottom: 14px; font-size: 14px; }
.alert-success { border-color: #bbf0cf; background: #ecfdf3; color: #166534; }
.alert-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.alert-info { border-color: #cde7fb; background: #f0f8ff; color: #075985; }
.alert-warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfd; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafaff; }
.table .title-link { color: var(--heading); font-weight: 600; }

/* ---------- public ---------- */
.topnav { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(180%) blur(14px); background: rgba(255,255,255,.82); border-bottom: 1px solid var(--line); }
.topnav .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--heading); letter-spacing: -.02em; }
.brand:hover { color: var(--heading); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(219,39,119,.28); flex: none; }
.brand-mark svg { width: 19px; height: 19px; }
.topnav nav { display: flex; align-items: center; gap: 4px; }
.topnav nav a.link { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: 14px; }
.topnav nav a.link:hover { color: var(--heading); background: var(--card2); }
@media (max-width: 760px) { .topnav nav a.link { display: none; } }

.hero { position: relative; padding: 80px 0 60px; overflow: hidden; background: radial-gradient(900px 480px at 15% -10%, rgba(124,58,237,.12), transparent 60%), radial-gradient(800px 460px at 90% 10%, rgba(219,39,119,.10), transparent 60%), radial-gradient(700px 400px at 60% 110%, rgba(249,115,22,.08), transparent 60%); }
.hero .container { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5.2vw, 58px); line-height: 1.05; letter-spacing: -.035em; margin-bottom: 18px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.pill b { background: var(--grad); color: #fff; padding: 2px 9px; border-radius: 99px; font-size: 12px; }
.trust { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: 13px; }
.trust span::before { content: "✓ "; color: var(--ok); font-weight: 700; }
@media (max-width: 960px) { .hero .container { grid-template-columns: 1fr; } .hero { padding-top: 48px; } }

.demo { position: relative; border-radius: 20px; padding: 18px; background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 1.5px solid transparent; box-shadow: var(--shadow-lg); }
.demo-idea { background: var(--card2); border: 1px dashed var(--line2); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.demo-idea b { color: var(--heading); }
.demo-arrow { text-align: center; color: var(--dim); font-size: 12px; margin: 10px 0; letter-spacing: .15em; text-transform: uppercase; }
.demo-scene { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-size: 13.5px; }
.demo-scene .k { color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.demo-scene .hookline { font-size: 16px; font-weight: 700; color: var(--heading); margin: 4px 0 8px; }
.demo-prompt { font-family: var(--mono); font-size: 11.5px; color: #5b21b6; background: #faf7ff; border: 1px solid #e6dcfe; border-radius: 8px; padding: 8px 10px; line-height: 1.5; }

.section { padding: 80px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head p { color: var(--muted); font-size: 17px; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 12px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.feature { padding: 24px; transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(16,24,40,.08); }
.feature .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--grad-soft), #fff; border: 1px solid #ece3fd; margin-bottom: 14px; }
.feature p { color: var(--muted); margin: 0; font-size: 14.5px; }
.steps { counter-reset: s; }
.step { position: relative; padding: 24px 24px 24px 74px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 22px; top: 22px; width: 36px; height: 36px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step p { color: var(--muted); margin: 0; font-size: 14.5px; }

.pricing { align-items: stretch; }
.price-card { padding: 26px; display: flex; flex-direction: column; position: relative; }
.price-card.popular { background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 2px solid transparent; box-shadow: 0 24px 60px rgba(124,58,237,.16); }
.price-card .tag { position: absolute; top: -12px; right: 20px; }
.price { font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; color: var(--heading); }
.price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.price-card li { padding: 6px 0 6px 26px; position: relative; font-size: 14.5px; color: var(--text); }
.price-card li::before { content: ""; position: absolute; left: 0; top: 10px; width: 16px; height: 16px; border-radius: 50%; background: #dcfce7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3.5'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/10px no-repeat; }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 4px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; color: var(--heading); }
.faq summary::after { content: "+"; color: var(--dim); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 10px 0 0; }
.cta-band { padding: 48px; text-align: center; border-radius: 22px; }
.footer { border-top: 1px solid var(--line); padding: 34px 0; color: var(--dim); font-size: 14px; background: #fff; }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--muted); margin-left: 16px; }
.announce { background: var(--grad); color: #fff; text-align: center; font-size: 13.5px; font-weight: 600; padding: 8px 16px; }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; position: relative; overflow: hidden; background: radial-gradient(800px 500px at 50% -10%, rgba(124,58,237,.13), transparent 60%), radial-gradient(600px 400px at 90% 100%, rgba(219,39,119,.08), transparent 60%), var(--bg); }
.auth-card { position: relative; width: 100%; max-width: 440px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-card.wide { max-width: 640px; }
.auth-card .brand { margin-bottom: 24px; }
.auth-card h1 { font-size: 26px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px; overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 18px; }
.nav-sec { font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: var(--muted); font-weight: 500; font-size: 14.5px; margin-bottom: 2px; border: 1px solid transparent; }
.nav-item:hover { background: var(--card2); color: var(--heading); }
.nav-item.active { background: #f4efff; color: #5b21b6; border-color: #e6dcfe; font-weight: 600; }
.nav-item .ic { width: 20px; text-align: center; font-size: 16px; }
.nav-item .count { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 16px; }
.credit-box { padding: 14px; border-radius: 14px; }
.credit-box .num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--heading); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 10px; border-radius: 12px; }
.user-chip .nm { font-weight: 600; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: 14px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { padding: 28px 32px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; }
.mobilebar { display: none; }
.imp-bar { background: #fef3c7; color: #78350f; border-bottom: 1px solid #fde68a; padding: 8px 16px; font-size: 13.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.imp-bar a { color: #78350f; text-decoration: underline; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 80; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { position: fixed; inset: 0; background: rgba(15,18,34,.35); z-index: 70; }
  .mobilebar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 60; }
  .page { padding: 20px 16px 60px; }
}

/* stats */
.stat { padding: 18px 20px; }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; color: var(--heading); }
.stat .s { font-size: 12.5px; color: var(--dim); }
.progress { height: 8px; border-radius: 99px; background: #eceef5; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .6s; }

/* list rows */
.row-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); color: var(--text); }
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: #fafaff; color: var(--text); }
.row-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--heading); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 8px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 11px 16px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: var(--font); }
.tab:hover { color: var(--heading); }
.tab.active { color: var(--heading); border-bottom-color: var(--p); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .25s; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line2); background: #fff; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; transition: all .15s; font-family: var(--font); }
.chip:hover { color: var(--heading); border-color: #c4c7d8; }
.chip.on { background: #f3edff; border-color: var(--v); color: #5b21b6; font-weight: 600; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice .box { display: block; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line2); background: #fff; transition: all .15s; height: 100%; }
.choice .box b { display: block; font-size: 14px; color: var(--heading); }
.choice .box small { color: var(--dim); font-size: 12px; line-height: 1.4; display: block; margin-top: 3px; }
.choice input:checked + .box { border-color: var(--v); background: #faf7ff; box-shadow: 0 0 0 3px rgba(124,58,237,.12); }

/* stars */
.stars { display: inline-flex; gap: 4px; direction: ltr; }
.stars button { background: none; border: 0; font-size: 28px; cursor: pointer; color: #d9dbe7; padding: 0 2px; line-height: 1; transition: transform .1s, color .1s; }
.stars button.on { color: #f59e0b; }
.stars button:hover { transform: scale(1.15); }

/* script view */
.script-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hook-card { padding: 16px 18px; position: relative; }
.hook-card.best { background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box; border: 1.5px solid transparent; box-shadow: 0 10px 30px rgba(124,58,237,.10); }
.hook-line { font-size: 18px; font-weight: 700; color: var(--heading); margin: 8px 0 10px; line-height: 1.4; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 13.5px; }
.kv .k { color: var(--dim); font-weight: 600; }
.narration { font-size: 16.5px; line-height: 1.8; white-space: pre-wrap; color: var(--heading); }
.scene { margin-bottom: 16px; overflow: hidden; }
.scene-top { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: #fafbfd; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.scene-top b { color: var(--heading); }
.scene-no { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; flex: none; }
.scene-vo { padding: 16px 18px 6px; font-size: 17px; font-weight: 600; line-height: 1.55; color: var(--heading); }
.scene-vo::before { content: "🎙 "; }
.scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 6px 8px 10px; }
.cell { padding: 8px 10px; font-size: 13.5px; }
.cell .k { display: block; font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.cell.full { grid-column: 1 / -1; }
@media (max-width: 640px) { .scene-grid { grid-template-columns: 1fr; } }
.prompt { position: relative; background: #faf8ff; border: 1px solid #e6dcfe; border-radius: 12px; padding: 12px 14px; padding-right: 86px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: #4c1d95; white-space: pre-wrap; word-break: break-word; }
.prompt.alt { background: #fff7fb; border-color: #fbd5e7; color: #9d174d; }
.prompt .copy { position: absolute; top: 8px; right: 8px; }
.prompt-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; display: flex; align-items: center; gap: 6px; }
.copy-line { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 14px; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.copy-line .txt { white-space: pre-wrap; word-break: break-word; font-size: 14px; color: var(--heading); }
.side-sticky { position: sticky; top: 20px; }
.script-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .script-layout { grid-template-columns: 1fr; } .side-sticky { position: static; } }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 440px; overflow-y: auto; padding: 2px 2px 6px; }
.msg { max-width: 90%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--card2); border: 1px solid var(--line); color: var(--heading); border-bottom-left-radius: 4px; }
.msg.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.msg .t { display: block; font-size: 11px; opacity: .65; margin-top: 4px; }
.chat-empty { font-size: 13px; color: var(--dim); text-align: center; padding: 14px 6px; border: 1px dashed var(--line2); border-radius: 12px; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-form textarea { min-height: 46px; max-height: 160px; resize: vertical; }

/* generator */
.gen-idea { font-size: 16.5px; min-height: 130px; padding: 16px; line-height: 1.6; }
.idea-chips .chip { font-size: 12.5px; }
.adv summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 0; }
.adv[open] summary { color: var(--heading); }

/* loader overlay */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(245,246,251,.82); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; padding: 20px; }
.overlay.show { display: flex; }
.loader-card { width: 100%; max-width: 460px; padding: 30px; text-align: center; }
.orb { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; background: var(--grad); position: relative; animation: pulse 1.6s ease-in-out infinite; display: grid; place-items: center; font-size: 34px; box-shadow: 0 12px 30px rgba(219,39,119,.3); }
.orb::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(219,39,119,.35); animation: ring 1.6s ease-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); filter: brightness(1.1); } }
@keyframes ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.lsteps { text-align: left; margin: 20px 0 10px; }
.lstep { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: var(--dim); font-size: 14px; transition: color .2s; }
.lstep .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line2); flex: none; display: grid; place-items: center; font-size: 11px; }
.lstep.on { color: var(--heading); font-weight: 600; }
.lstep.on .dot { border-color: var(--p); border-top-color: transparent; animation: spin .8s linear infinite; }
.lstep.done { color: var(--muted); }
.lstep.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.lstep.done .dot::after { content: "✓"; font-weight: 900; }
@keyframes spin { to { transform: rotate(360deg); } }
.tip { font-size: 13px; color: var(--muted); min-height: 40px; margin-top: 8px; }

/* toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1d2033; border: 1px solid #1d2033; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: up .25s; max-width: 92vw; }
.toast.err { background: #b91c1c; border-color: #b91c1c; }
.toast.ok { background: #15803d; border-color: #15803d; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

/* modal */
.modal { position: fixed; inset: 0; z-index: 150; background: rgba(15,18,34,.4); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.show { display: flex; }
.modal-card { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); }

/* skill */
.skill-md { font-size: 14.5px; line-height: 1.7; }
.skill-md h2, .skill-md h3 { font-size: 15px; margin: 18px 0 6px; color: var(--heading); }
.skill-md h2:first-child, .skill-md h3:first-child { margin-top: 0; }
.skill-md ul { margin: 0 0 8px; padding-left: 20px; }
.skill-md li { margin: 3px 0; color: var(--text); }
.level-ring { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--p) calc(var(--pct) * 1%), #eceef5 0); flex: none; }
.level-ring > div { width: 76px; height: 76px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.level-ring b { font-size: 24px; color: var(--heading); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--v); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line2); }
.timeline li.auto::before { background: var(--p); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 54px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 8px; }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.chart .bar { width: 100%; max-width: 26px; border-radius: 6px 6px 2px 2px; background: var(--grad); min-height: 2px; position: relative; }
.chart .bar.u { background: #7dd3fc; max-width: 10px; }
.chart .lbl { font-size: 10px; color: var(--dim); white-space: nowrap; }
.chart .bars { display: flex; align-items: flex-end; gap: 3px; height: 100%; width: 100%; justify-content: center; }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.check-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.check-item:last-child { border-bottom: 0; }
.check-item .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex: none; }
.check-item .st.y { background: #dcfce7; color: var(--ok); }
.check-item .st.n { background: #fef3c7; color: var(--warn); }
.err-text { color: #b91c1c; }
.model-chips .chip { font-family: var(--mono); font-size: 12px; }

/* print */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .mobilebar, .no-print, .tabs, .side-sticky, .imp-bar, .announce { display: none !important; }
  .tab-panel { display: block !important; }
  .card, .prompt { box-shadow: none !important; border-color: #ccc !important; }
  .page { padding: 0; }
  .script-layout { display: block; }
}
