/* Studiora — clean, social-app look: system type, hairline borders, gradient accents. Light + dark. */
/* Studiora brand: violet + warm coral. Every text/background pair below passes WCAG AA (4.5:1). */
:root {
  --bg: #f7f7fa; --panel: #ffffff; --panel2: #f3f3f7; --hover: #ececf2; --soft: #eeeef3; --line: #e2e2ea;
  --text: #111118; --text2: #2a2a35; --muted: #5c5c6b;
  --brand: #6442e8; --brand-h: #5534d6; --link: #4b2fc4; --accent: #6442e8; --accent2: #ff6b4a; --ok: #18793a; --err: #d6203e; --warn: #b45309;
  --grad: linear-gradient(110deg, #6442e8 0%, #a24cf0 55%, #ff6b4a 100%);
  --glow: radial-gradient(1100px 520px at 78% -12%, rgb(100 66 232 / .08), transparent 62%);
  --r: 12px; --shadow: 0 1px 2px rgb(17 17 24 / .05), 0 8px 24px rgb(17 17 24 / .07);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e12; --panel: #16161c; --panel2: #1c1c24; --hover: #22222c; --soft: #262632; --line: #2c2c38;
    --text: #ededf2; --text2: #d6d6e0; --muted: #a3a3b2; --brand: #6a45f0; --brand-h: #7a5af5; --link: #b9a8ff; --accent: #8b6dff;
    --ok: #4ade80; --err: #ff6b81; --warn: #fbbf24; --shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 8px 28px rgb(0 0 0 / .45);
    --glow: radial-gradient(1100px 520px at 78% -12%, rgb(124 92 255 / .16), transparent 62%), radial-gradient(800px 420px at 0% 110%, rgb(255 107 74 / .07), transparent 60%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0e0e12; --panel: #16161c; --panel2: #1c1c24; --hover: #22222c; --soft: #262632; --line: #2c2c38;
    --text: #ededf2; --text2: #d6d6e0; --muted: #a3a3b2; --brand: #6a45f0; --brand-h: #7a5af5; --link: #b9a8ff; --accent: #8b6dff;
    --ok: #4ade80; --err: #ff6b81; --warn: #fbbf24; --shadow: 0 1px 0 rgb(255 255 255 / .04) inset, 0 8px 28px rgb(0 0 0 / .45);
    --glow: radial-gradient(1100px 520px at 78% -12%, rgb(124 92 255 / .16), transparent 62%), radial-gradient(800px 420px at 0% 110%, rgb(255 107 74 / .07), transparent 60%);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; max-width: 100%; overflow-x: clip; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; max-width: 100%; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sidebar ---------- */
.side { width: 244px; flex: none; background: var(--bg); border-right: 1px solid var(--line); padding: 26px 12px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 22px; letter-spacing: -.3px; display: flex; gap: 10px; align-items: center; padding: 0 12px; margin-bottom: 26px; }
.logo { width: 32px; height: 32px; border-radius: 9px; display: block; }
nav a { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 10px; color: var(--text); margin-bottom: 2px; font-size: 15px; transition: background .15s; }
nav a:hover { background: var(--hover); }
nav a:hover .ic { transform: scale(1.06); }
nav a .ic { transition: transform .15s; }
nav a.on { font-weight: 700; }
nav a.on .ic { stroke-width: 2.4; }
.side-foot { margin-top: auto; padding-top: 14px; }
.theme-btn { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 15px; text-align: left; }
.theme-btn:hover { background: var(--hover); }
.svc-status { font-size: 13px; color: var(--muted); padding: 6px 12px; line-height: 1.6; }
.svc-status summary { cursor: pointer; list-style: none; } .svc-status summary::before { content: '▸ '; } .svc-status[open] summary::before { content: '▾ '; }

/* ---------- layout & type ---------- */
main { flex: 1; padding: 32px 40px 60px; min-width: 0; max-width: 1280px; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.3px; margin: 0 0 6px; }
h2 { font-size: 18px; font-weight: 600; margin: 30px 0 14px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.sub { color: var(--muted); margin: 0 0 24px; font-size: 15px; max-width: 70ch; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.muted a, small a, .auth a, .link { color: var(--link); font-weight: 600; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row > .grow { flex: 1; min-width: 160px; } .row.nowrap { flex-wrap: nowrap; }
.form { max-width: 720px; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card.link { cursor: pointer; transition: border-color .15s, background .15s; } .card.link:hover { background: var(--hover); }
.card .ico { font-size: 26px; margin-bottom: 8px; } .card p { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* Home "stories" row: circular gradient rings */
.stories { display: flex; gap: 22px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 8px; scrollbar-width: thin; }
.story { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; flex: none; text-align: center; font-size: 13px; color: var(--text2); }
.story .ring { width: 80px; height: 80px; border-radius: 50%; padding: 3px; background: var(--grad); transition: transform .15s; }
.story .ring > span { width: 100%; height: 100%; border-radius: 50%; background: var(--bg); border: 3px solid var(--bg); display: grid; place-items: center; }
.story .ring > span > i { width: 100%; height: 100%; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-style: normal; font-size: 28px; }
.story:hover .ring { transform: scale(1.05); }
.story b { font-weight: 600; line-height: 1.25; }

/* Projects: profile-style grid */
.proj { padding: 0; overflow: hidden; position: relative; border-radius: 6px; border: 0; background: var(--panel2); }
.proj .th { aspect-ratio: 1 / 1; background: var(--soft) center/cover; transition: filter .2s; }
.proj .meta { position: absolute; inset: auto 0 0 0; padding: 26px 12px 10px; background: linear-gradient(transparent, rgb(0 0 0 / .72)); color: #fff; }
.proj .meta b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj .meta span { font-size: 13px; color: rgb(255 255 255 / .85); }
.proj:hover .th { filter: brightness(.82); }
.grid:has(.proj) { gap: 4px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--soft); border: 0; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--text); transition: background .15s, opacity .15s; }
.btn:hover { background: var(--line); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-h); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.danger { color: var(--err); } .btn.danger:hover { background: color-mix(in srgb, var(--err) 12%, transparent); }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin: 16px 0 6px; }
input[type=text], input[type=url], input[type=number], input[type=password], select, textarea {
  width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; outline: none; font-size: 14px; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--muted); }
textarea { resize: vertical; min-height: 70px; line-height: 1.55; }
input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); padding: 2px; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.chk { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 400; margin: 10px 0 0; }
.chk input { accent-color: var(--brand); width: 16px; height: 16px; }
.title-input { font-size: 22px; font-weight: 700; background: none !important; border: 1px solid transparent !important; padding: 4px 8px !important; margin-left: -8px; }
.title-input:hover { border-color: var(--line) !important; }

.aspects { display: flex; gap: 10px; flex-wrap: wrap; }
.aspect { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; text-align: center; font-size: 13px; color: var(--muted); background: var(--panel); transition: border-color .15s; }
.aspect:hover { border-color: var(--muted); }
.aspect.on { border-color: var(--text); color: var(--text); font-weight: 600; }
.aspect i { display: block; margin: 0 auto 6px; border: 2px solid currentColor; border-radius: 3px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 0; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border: 0; border-top: 1px solid transparent; margin-bottom: -1px; padding: 12px 8px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.tabs button.on { color: var(--text); border-bottom: 1px solid var(--text); }
.card .tabs { margin: -6px -6px 14px; }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 24px; align-items: start; }
.scene { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 12px; }
.scene .vis { aspect-ratio: 16/9; border-radius: 8px; background: var(--soft) center/cover; position: relative; cursor: pointer; display: grid; place-items: center; color: var(--muted); font-size: 13px; overflow: hidden; text-align: center; }
.scene .vis:hover::after { content: 'Preview'; position: absolute; inset: 0; background: rgb(0 0 0 / .55); display: grid; place-items: center; color: #fff; font-weight: 600; }
.badge { position: absolute; left: 6px; top: 6px; background: rgb(0 0 0 / .7); padding: 2px 7px; border-radius: 99px; font-size: 12px; color: #fff; }
.scene .num { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.scene textarea { min-height: 64px; }
.scene .tools { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.scene .kw { width: 190px !important; padding: 5px 9px !important; font-size: 13px; }
.panel { position: sticky; top: 20px; }
.progress { height: 4px; background: var(--soft); border-radius: 9px; overflow: hidden; margin: 12px 0 6px; }
.progress div { height: 100%; width: 100%; transform-origin: left; background: var(--grad); transition: transform .4s; }
video { width: 100%; max-height: 480px; border-radius: 10px; background: #000; display: block; }
.render { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; background: rgb(0 0 0 / .65); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal-box { background: var(--panel); border-radius: 14px; width: min(980px, 100%); max-height: 88vh; overflow: auto; padding: 24px; position: relative; box-shadow: var(--shadow); }
[data-theme="dark"] .modal-box, .modal-box { border: 1px solid var(--line); }
.modal-x { position: absolute; right: 14px; top: 12px; background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.modal-x:hover { background: var(--hover); color: var(--text); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; margin-top: 14px; }
.mitem { aspect-ratio: 16/10; border-radius: 6px; background: var(--soft) center/cover; cursor: pointer; position: relative; border: 2px solid transparent; }
.mitem:hover { filter: brightness(.9); } .mitem.sel { border-color: var(--brand); }
.mitem small { position: absolute; right: 6px; bottom: 6px; background: rgb(0 0 0 / .7); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 99px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#toast div { background: #262626; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; max-width: min(460px, 92vw); box-shadow: var(--shadow); text-align: center; }
#toast .err { background: #b3122e; }
.spinner { width: 18px; height: 18px; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; gap: 14px; padding: 80px 0; color: var(--muted); text-align: center; }

/* ---------- auth ---------- */
body.authed-out .side { display: none; }
body.authed-out main { display: grid; place-items: center; max-width: none; }
.auth { width: min(380px, 100%); padding: 36px 40px; text-align: left; }
.auth .brand { justify-content: center; font-size: 26px; margin-bottom: 18px; padding: 0; }
.auth .logo { width: 44px; height: 44px; border-radius: 12px; }

/* ---------- clip studio ---------- */
.drop { display: block; text-align: center; padding: 34px; margin: 0; border-style: dashed; }
.words { line-height: 2; font-size: 15px; max-height: 60vh; overflow: auto; padding: 4px; user-select: none; }
.words span { cursor: pointer; border-radius: 4px; padding: 1px 2px; }
.words span:hover { background: var(--hover); }
.words span.cut { text-decoration: line-through; color: var(--err); opacity: .6; }
.words span.now { background: color-mix(in srgb, var(--brand) 25%, transparent); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 13px; }

/* ---------- settings ---------- */
.set-tabs { max-width: 620px; }
.svc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.svc.disabled { background: var(--panel2); border-style: dashed; }
.svc .tres { margin-top: 10px; font-size: 13px; min-height: 18px; }
.okc { color: var(--ok); } .badc { color: var(--err); }
.src { font-size: 12px; font-weight: 500; color: var(--ok); margin-left: 6px; }
.uses { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.uses .chk { margin: 0; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.bad { color: var(--err); background: color-mix(in srgb, var(--err) 14%, transparent); }
.pill.off { opacity: .8; }
.switch { position: relative; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .2s; }
.switch span::before { content: ''; position: absolute; width: 22px; height: 22px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgb(0 0 0 / .3); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.hrow { justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hrow:last-child { border-bottom: 0; }

/* ---------- music library ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--soft); border: 0; border-radius: 99px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--line); } .chip.on { background: var(--text); color: var(--bg); }
.tracks { margin-top: 14px; max-height: 52vh; overflow: auto; }
.trk { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.trk .play { width: 38px; height: 38px; border-radius: 50%; padding: 0; }
.music-now { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.music-now audio { width: 100%; height: 34px; }
.credit { margin-top: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.credit code { white-space: normal; overflow-wrap: anywhere; color: var(--text); }
.credit .btn { align-self: flex-start; }

/* ---------- channel studio ---------- */
.ch-logo { width: 48px; height: 48px; border-radius: 50%; background: var(--soft) center/cover; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand); }
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 16px; overflow-x: auto; }
.board .col h3 { display: flex; justify-content: space-between; font-size: 13px; }
.board .idea { cursor: pointer; padding: 14px; margin-bottom: 10px; transition: background .15s; }
.board .idea:hover { background: var(--hover); }
.board .idea p { margin: 6px 0; font-size: 13px; }
.titles { display: flex; flex-direction: column; gap: 4px; }
.titles .chk { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1260px) { .side { width: 212px; } }
@media (max-width: 1000px) { .side { width: 76px; } .side .brand span, nav a span, .theme-btn span, .svc-status { display: none; } .brand { padding: 0 10px; } nav a, .theme-btn { justify-content: center; } .navh { font-size: 0; height: 1px; background: var(--line); margin: 10px 14px; padding: 0; } }
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } .panel { position: static; } }
@media (max-width: 900px) { .board { grid-template-columns: repeat(4, 240px); } }
@media (max-width: 760px) {
  body { flex-direction: column; }
  .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 40; flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { margin: 0 6px 0 0; } .side nav { display: flex; gap: 2px; } nav a { padding: 9px; margin: 0; }
  .side-foot { margin: 0 0 0 auto; padding: 0; }
  main { padding: 18px 16px 60px; } .scene { grid-template-columns: 1fr; } .svc-grid { grid-template-columns: 1fr; }
  .story { width: 76px; } .story .ring { width: 66px; height: 66px; }
}

/* how it works */
.how-steps { display: grid; gap: 2px; max-width: 860px; }
.how-step { display: flex; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.how-step p { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.how-num { width: 46px; height: 46px; border-radius: 50%; padding: 2px; background: var(--grad); flex: none; }
.how-num span { width: 100%; height: 100%; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 20px; }
.how-demo { border-top: 1px solid var(--line); padding: 16px 0 6px; margin-top: 12px; }
.how-scene p { margin: 8px 0; font-size: 15px; }
.how-search { margin: 6px 0 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kwchip { display: inline-block; background: var(--text); color: var(--bg); border-radius: 99px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.kwchip.alt { background: var(--soft); color: var(--text); font-weight: 500; }
.how-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.how-cands figure { margin: 0; } .how-cands figcaption { font-size: 13px; margin-top: 6px; line-height: 1.4; }
.how-cands figure.win .mitem { border-color: var(--ok); }
.winner { position: absolute; left: 6px; top: 6px; background: var(--ok); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* ---- My renders ---- */
.rq-row { padding: 12px 14px; margin-bottom: 10px; }
.rq-thumb { width: 96px; height: 54px; border-radius: 8px; object-fit: cover; flex: none; background: var(--soft); }
.rq-ph { display: grid; place-items: center; font-size: 20px; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-text { color: var(--err); }
.navbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--grad); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.navbadge[hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 12px; font: inherit; color: inherit; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--text); color: var(--bg); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 600px) { .rq-row .row { flex-wrap: wrap; } .rq-thumb { width: 72px; height: 40px; } }

/* ---- SEO & Research ---- */
.warnbox { border-color: #f5c26b; background: color-mix(in srgb, #f5c26b 12%, var(--panel)); margin-bottom: 12px; }
.seo-tabs { overflow-x: auto; white-space: nowrap; }
.seo-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 12px 0; }
.seo-meter .progress { margin: 8px 0 4px; }
.checks { list-style: none; padding: 0; margin: 10px 0 0; }
.checks li { padding: 6px 0 6px 22px; position: relative; border-top: 1px solid var(--line); }
.checks li::before { position: absolute; left: 0; top: 6px; }
.checks li.good::before { content: "✅"; } .checks li.warn::before { content: "⚠️"; } .checks li.bad::before { content: "❌"; }
.pill.bad { background: #fde7e7; color: #b42318; }
.seo-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 10px; }
.seo-top.big { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.seo-vid { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.seo-vid img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--soft); }
.seo-title { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.seo-title.ab { background: color-mix(in srgb, var(--brand) 6%, transparent); border-radius: 8px; padding: 10px; }
.niche { padding: 14px 0; border-top: 1px solid var(--line); }
.niche .kit { margin-top: 10px; }
details.card > summary { cursor: pointer; list-style: none; }

/* ---- Thumbnail Studio ---- */
.tset { margin-top: 14px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; margin-top: 12px; }
.topt { border: 2px solid transparent; border-radius: 12px; padding: 10px; background: color-mix(in srgb, var(--panel2) 55%, transparent); }
.topt.chosen { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.timgs { display: flex; gap: 8px; align-items: flex-start; }
.timg { flex: 1 1 auto; min-width: 0; }
.timg.tall { flex: 0 0 28%; }
.timg img { width: 100%; border-radius: 8px; display: block; background: var(--soft); }
.topt input[type=color] { width: 36px; height: 34px; padding: 2px; border-radius: 8px; }
.tidea-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.tidea-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel2); display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, background .15s; }
.tidea-card.picked { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--panel2)); }
.tidea-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }

/* ---- Podcast Studio ---- */
.host { padding: 12px; margin-bottom: 10px; }
.pline { border: 1px solid var(--line); padding: 8px 10px; margin-bottom: 8px; background: var(--panel); border-radius: 10px; }
.spk-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pline textarea { margin-top: 6px; min-height: 44px; resize: vertical; }

/* ---- Avatar Studio ---- */
.avlay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.avl { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; font: inherit; cursor: pointer; }
.avl.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }

/* ---- cloud rendering ---- */
.cloudcard { margin-bottom: 14px; }
.cbatch { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }

/* ---- Home ---- */
.home { max-width: 1120px; }
.home-hero { padding: 8px 0 6px; }
.home-hi { margin: 0 0 4px; color: var(--muted); font-size: 15px; font-weight: 500; }
.home-title { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.6px; line-height: 1.12; margin: 0 0 18px; }
.composer { padding: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 10px 30px rgb(0 0 0 / .06); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent), 0 10px 30px rgb(0 0 0 / .06); }
.composer textarea { display: block; width: 100%; border: 0 !important; background: transparent !important; padding: 18px 20px 8px !important; font-size: 18px; line-height: 1.5; resize: none; min-height: 88px; outline: none; box-shadow: none !important; }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px 20px; flex-wrap: wrap; }
.composer-bar .kind { font-size: 13px; }
.home-try { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0 6px; }
.home-try .chip { font-weight: 500; background: transparent; border: 1px solid var(--line); }
.home-try .chip:hover { background: var(--hover); }
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; margin-top: 8px; }
.home-tools h2 { margin: 24px 0 10px; font-size: 15px; color: var(--text2); font-weight: 600; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tool { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: background .15s, border-color .15s, transform .15s; }
.tool:hover { background: var(--hover); transform: translateY(-1px); }
.tool b { display: block; font-size: 14px; font-weight: 600; }
.tool small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.tool-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--panel2); border: 1px solid var(--line); }
.tool-ic .ic { width: 21px; height: 21px; }
.home-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.home-side h3 { margin: 0 0 10px; font-size: 15px; }
.now-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; }
.now-row:hover { background: var(--hover); }
.now-row b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-row small, .setup-row small { display: block; color: var(--muted); font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); animation: pulse 1.6s ease-in-out infinite; }
.dot.cloud { background: #7c5cff; } .dot.ok { background: var(--ok); } .dot.idea { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 6%, transparent); } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } .tool:hover { transform: none; } }
.lnk { color: var(--link); }
.setup .progress { margin: 4px 0 10px; }
.setup-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.setup-row .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 12px; flex: none; }
.setup-row.ok { color: var(--muted); } .setup-row.ok .tick { background: #15803d; border-color: #15803d; color: #fff; }
.home-recent-h { justify-content: space-between; align-items: center; margin-top: 34px; }
.home-recent-h h2 { margin: 0; }
.home .grid#plist { margin-top: 12px; }
.card.empty { grid-column: 1 / -1; text-align: center; padding: 28px; }
@media (max-width: 960px) { .home-cols { grid-template-columns: 1fr; } .home-side { position: static; margin-top: 8px; order: -1; } }
@media (max-width: 600px) { .composer-bar .btn:not(.primary) { flex: 1 1 calc(33% - 8px); } .composer-bar .btn.primary { flex: 1 1 100%; } .composer-bar .grow { display: none; } .composer-bar .kind { flex: 1 1 100%; } }

/* ---- My footage ---- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px; border-style: dashed; text-align: center; }
.dropzone.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--panel)); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.lib-item { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.lib-th { aspect-ratio: 16/9; border-radius: 8px; background: var(--soft) center/cover; position: relative; }
.lib-badge { position: absolute; left: 6px; bottom: 6px; background: rgb(0 0 0 / .65); color: #fff; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.lib-tags { font-size: 13px; resize: vertical; }

/* ---- video quality level (home) ---- */
.quality .q-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.quality h3 { margin: 2px 0 0; font-size: 20px; }
.q-score { font-size: 13px; font-weight: 500; color: var(--muted); }
.q-badge { font-size: 13px; letter-spacing: 1px; padding: 4px 9px; border-radius: 99px; background: var(--soft); color: var(--text2); white-space: nowrap; }
.q-badge.q-pro, .q-badge.q-studio { background: var(--grad); color: #fff; }
.q-bar { position: relative; overflow: visible; margin: 12px 0 4px; }
.q-bar > div { border-radius: 9px; }
.q-bar i { position: absolute; top: -3px; width: 2px; height: 10px; background: var(--muted); opacity: .55; border-radius: 2px; }
.q-next { display: block; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.q-next:hover { background: var(--hover); }
.q-next b { display: block; font-size: 13px; color: var(--link); }
.q-next span { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; }
.q-next small { display: block; color: var(--muted); font-size: 13px; }
.q-list { margin-top: 10px; }
.q-list summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 0; color: var(--text2); }

/* ---- Banner Studio ---- */
.bset { margin-top: 14px; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; margin-top: 12px; }
.bprev { position: relative; border-radius: 10px; overflow: hidden; background: var(--soft); max-height: 520px; margin: 0 auto; }
.bprev img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bprev.round, .bsz.round img { border-radius: 50%; }
.bprev .safe { position: absolute; border: 1.5px dashed rgb(255 255 255 / .75); box-shadow: 0 0 0 1px rgb(0 0 0 / .35); border-radius: 4px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.bprev:hover .safe { opacity: 1; }
.bedit { margin-top: 8px; } .bedit summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.colorpick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; }
.colorpick input { width: 34px; height: 30px; padding: 2px; border-radius: 8px; }
.bsizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.bsz { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.bsz img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--soft); border-radius: 6px; }
.sizelist { display: grid; gap: 2px; margin: 4px 0 10px; }

.bexact { margin-top: 10px; } .bexact summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text2); }
.bcheck { margin-top: 8px; font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); }
.bcheck.good b { color: var(--ok); } .bcheck.ok b { color: var(--warn); } .bcheck.weak b { color: var(--err); }

/* ---- manual shot list ---- */
.scenemode { margin-top: 4px; }
.shotrow { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; background: var(--panel); }
.shotrow label.small { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.shotrow textarea { min-height: 64px; }
.shotnum { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: 22px; }
.shotlbl { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.shotlbl input { flex: 1; font-size: 13px; }
@media (max-width: 700px) { .shotrow { flex-direction: column; } .shotnum { margin-top: 0; } }

.shotlbl span { white-space: nowrap; }
.shotlbl .btn { flex: none; }
.fsrc { margin-top: 4px; }

/* ===== SEO & Research (redesign) ===== */
.seo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.seo-head .sub { margin-bottom: 14px; }
.seo-status { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.stat-chip { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.stat-chip.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.seo-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 4px 0 18px; }
.seo-nav button { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; font: inherit; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.seo-nav button:hover { background: var(--hover); }
.seo-nav button.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; background: color-mix(in srgb, var(--brand) 6%, var(--panel)); }
.seo-nav b { display: block; font-size: 14px; }
.seo-nav small { display: block; color: var(--muted); font-size: 13px; }
.seo-nav-ic { font-size: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--panel2); flex: none; }
.seo-hero { padding: 16px; }
.seo-search { display: flex; gap: 8px; flex-wrap: wrap; }
.seo-search input { flex: 1 1 260px; font-size: 16px; padding: 12px 14px !important; border-radius: 12px !important; }
.seo-search select { width: auto; border-radius: 12px; }
.seo-search .btn { padding: 0 22px; border-radius: 12px; min-height: 44px; }
.seo-try { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.seo-try .chip { background: transparent; border: 1px solid var(--line); font-weight: 500; }
#kout > .card, #oout > .card, #aout > .card, #cout > .card, #sout > .card, #sout > details { margin-top: 14px; }
.seo-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.seo-split #sout > :first-child { margin-top: 0; }
.seo-form { position: sticky; top: 16px; }
.seo-write { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 1000px) { .seo-split { grid-template-columns: 1fr; } .seo-form { position: static; } }
/* score ring */
.ring { display: flex; align-items: center; gap: 12px; --c: var(--muted); position: relative; }
.ring.ok { --c: var(--ok); }
.ring.warn { --c: var(--warn); }
.ring.bad { --c: var(--err); }
.ring > svg { width: var(--sz); height: var(--sz); transform: rotate(-90deg); flex: none; }
.ring-bg { fill: none; stroke: var(--soft); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-n { position: absolute; left: 0; top: 0; width: var(--sz); height: var(--sz); display: grid; place-items: center; font-size: calc(var(--sz) * 0.28); pointer-events: none; }
.ring-n b { color: var(--text); }
.ring-l b { display: block; font-size: 15px; }
.ring-l small { display: block; color: var(--muted); font-size: 13px; }
.rings { display: flex; gap: 22px; flex-wrap: wrap; margin: 12px 0; }
.seo-overall { display: flex; flex-direction: column; gap: 8px; }
.ccard summary { list-style: none; cursor: pointer; }
.ccard summary::-webkit-details-marker { display: none; }
.checks li span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
/* video cards */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 10px; }
.vgrid.big { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.vcard { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vthumb { position: relative; display: block; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--soft); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.vcard:hover .vthumb img { transform: scale(1.04); }
.vbadge { position: absolute; left: 8px; bottom: 8px; background: rgb(0 0 0 / .78); color: #fff; font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.vtitle { font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vmeta { color: var(--muted); font-size: 13px; }
.vmeta b { color: var(--text2); }
.vact { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
/* states */
.seo-empty { text-align: center; padding: 38px 20px; border: 1px dashed var(--line); border-radius: 14px; margin-top: 14px; color: var(--muted); }
.seo-split .seo-empty { margin-top: 0; }
.seo-empty-ic { font-size: 34px; margin-bottom: 6px; }
.seo-empty b { color: var(--text); font-size: 16px; }
.seo-empty p { max-width: 46ch; margin: 6px auto 0; }
.seo-working { display: flex; gap: 14px; align-items: flex-start; }
.seo-working p { margin: 4px 0 0; }
.seo-working .progress { margin: 8px 0 0; }
.seo-err { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.seo-err b { color: var(--err); }
/* keyword header */
.kw-head h3 { margin: 6px 0 0; font-size: 22px; }
.kw-verdict { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0; padding: 4px 10px; border-radius: 99px; }
.kw-verdict.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.kw-verdict.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.kw-verdict.bad { background: color-mix(in srgb, var(--err) 15%, transparent); color: var(--err); }
/* titles */
.tcard { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.tcard.ab { background: color-mix(in srgb, var(--brand) 6%, transparent); border-radius: 10px; padding: 12px; }
.ttitle { font-weight: 600; font-size: 15px; }
.tlen { font-size: 12px; color: var(--muted); margin-left: 4px; }
.tlen.bad { color: var(--err); }
.tmeta { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0; }
.mini { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--text2); white-space: nowrap; }
.mini.f { background: transparent; border: 1px solid var(--line); }
.mini.ab { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.mini.bad { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
/* analysis */
.an-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.an-head h3 { margin: 0 0 4px; }
.an-thumb { flex: 0 0 260px; max-width: 100%; border-radius: 10px; overflow: hidden; }
.an-thumb img { width: 100%; display: block; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.stat { padding: 8px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); min-width: 92px; }
.stat b { display: block; font-size: 18px; }
.stat small { color: var(--muted); font-size: 12px; }
.an-verdict { font-size: 15px; font-weight: 500; margin: 8px 0 4px; }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.igrid:empty { display: none; }
.icard h4 { margin: 0 0 8px; }
.icard ul { margin: 0; padding-left: 18px; }
.icard li { margin: 4px 0; }
.icard.good h4 { color: var(--ok); }
.icard.bad h4 { color: var(--err); }
.formula { font-family: ui-monospace, Consolas, monospace; background: var(--panel2); padding: 8px 10px; border-radius: 8px; }
.idea-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.idea-row span small { display: block; color: var(--muted); font-size: 13px; }
/* niches */
.ngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 12px; }
.nrun summary { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.nrun summary .btn { margin-left: auto; }
.niche { display: flex; flex-direction: column; gap: 6px; }
.niche p { margin: 4px 0; }
.nch { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.nch small { color: var(--muted); font-size: 12px; width: 100%; }
.kit { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }

/* ---- channel AI setup ---- */
.setup-empty { text-align: center; padding: 32px; max-width: 720px; }
.setup-empty p { max-width: 60ch; margin: 8px auto 16px; }
.setup-sum { display: flex; flex-direction: column; gap: 10px; }
.setup-sum p { margin: 4px 0 0; font-size: 15px; }
.setup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.setup-item { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin: 0; font-weight: normal; }
.setup-item input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.setup-item:has(input:not(:checked)) { background: var(--panel2); }
.si-head { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.si-head b { color: var(--text2); }
.si-val { font-size: 15px; font-weight: 600; margin: 4px 0; }
.setup-item p { margin: 0 0 6px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid var(--line); margin-right: 2px; }

.setup-done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); margin: 12px 0; }
.setup-done > b { color: var(--ok); }
.setup-done .tmeta { margin: 8px 0; }

.chsum { margin-top: 8px; font-size: 13px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 7%, var(--panel)); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); line-height: 1.6; }

/* editor: render button + latest video sit at the top of the side panel */
.outcard #renders .render:first-child { border-top: 0; }
.outcard video { display: block; width: 100%; max-height: 56vh; object-fit: contain; background: #000; border-radius: 12px; }
.outcard #renders .render:not(:first-child) { font-size: 13px; }
@media (max-width: 1100px) { .editor .panel { display: contents; } .editor .outcard { order: -1; } .editor .panel > .card + .card { margin-top: 0 !important; } }

.plogo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line); }
.setup-item.locked { border-style: dashed; }
.lock-tag { margin-left: auto; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent, #7c5cff) 18%, transparent); white-space: nowrap; }
.lock-note { margin: 0 0 12px; color: var(--muted); }

#psave.pulse { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #7c5cff) 40%, transparent); }
#pdirty { color: var(--warn, #f59e0b); }

/* channel cards: same size whatever the description length */
.ch-grid { align-items: start; } /* opening one card never stretches its neighbours */
.ch-card { display: flex; flex-direction: column; gap: 10px; }
.ch-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ch-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ch-title b { font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-plat { align-self: flex-start; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.ch-desc { margin: 0; min-height: 4.5em; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ch-card.open .ch-desc { -webkit-line-clamp: unset; line-clamp: unset; display: block; }
.ch-more { align-self: flex-start; background: none; border: 0; padding: 0; margin-top: -4px; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.ch-more:hover { text-decoration: underline; }
.ch-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ch-counts { display: flex; gap: 12px; font-size: 14px; }
.ch-acts { display: flex; gap: 6px; }
#chniche.clamp { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
#chniche-more { margin: 0 0 14px; }

.setup-item .si-head { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.setup-item .si-acts { gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.setup-item .si-ai { font-style: italic; }
.setup-item .si-edit { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.setup-item .si-edit label { margin-top: 8px; }
.setup-item .si-edit select, .setup-item .si-edit textarea { width: 100%; }

.ss-chips { margin-top: 6px; flex-wrap: wrap; }
.ss-chips .chip.on { outline: 2px solid var(--accent); }
.ss-ai { font-size: 12px; }

.idea-thumb { display: block; width: 240px; max-width: 100%; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); }
.t-dl { font-weight: 600; }

/* 🔭 competitors */
.cp-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 5px; border-radius: 99px; background: var(--soft); }
.cp-chip span { display: flex; flex-direction: column; line-height: 1.15; } .cp-chip b { font-size: 13px; } .cp-chip small { color: var(--muted); font-size: 12px; }
.cp-x-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 99px; } .cp-x-btn:hover { background: var(--line); color: var(--text); }
.cp-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line); }
.cp-av-l { display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.cp-sugs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 10px; }
.cp-sug { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.cp-sug.added { background: var(--panel2); border-style: dashed; } .cp-sug .cp-av { width: 40px; height: 40px; }
.cp-desc { margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .cp-why { margin: 4px 0 0; color: var(--accent); }
.cp-sum p { margin: 6px 0; font-size: 15px; line-height: 1.5; }
.cp-pat { margin: 6px 0 0; padding-left: 18px; line-height: 1.6; }
.cp-h { margin: 22px 0 10px; }
.cp-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cp-idea { margin: 0; display: flex; flex-direction: column; } .cp-idea > .row:last-child { margin-top: auto !important; padding-top: 10px; }
.cp-pri { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--soft); white-space: nowrap; } .cp-pri.high { background: color-mix(in srgb, #ef4444 18%, transparent); }
.cp-hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.cp-hit { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
.cp-thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16/9; background: var(--soft); }
.cp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp-x { position: absolute; top: 6px; left: 6px; background: #16a34a; color: #fff; font-weight: 800; font-size: 13px; padding: 2px 7px; border-radius: 6px; }
.cp-gap { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,.75); color: #facc15; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.cp-title { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp-hit:hover .cp-title { text-decoration: underline; }
.cp-bench { width: 100%; border-collapse: collapse; } .cp-bench th, .cp-bench td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); font-size: 14px; } .cp-bench th { color: var(--muted); font-weight: 600; font-size: 13px; }

/* ✨ before you render: quality checks */
.qbar { margin-bottom: 14px; padding: 12px 14px; }
.qbar-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.qbar-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.qb { display: inline-block; margin-left: 4px; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--soft); }
.qb.good, .qs.good { background: color-mix(in srgb, #16a34a 22%, transparent); color: #16a34a; }
.qb.mid, .qs.mid { background: color-mix(in srgb, #d97706 22%, transparent); color: #d97706; }
.qb.bad, .qs.bad { background: color-mix(in srgb, #dc2626 22%, transparent); color: #dc2626; }
.qs { font-size: 13px; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-left: 6px; }
.qhead { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.qring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; flex: none; border: 5px solid currentColor; }
.qring.good { color: #16a34a; } .qring.mid { color: #d97706; } .qring.bad { color: #dc2626; }
.qsec { margin-top: 14px; } .qsec h4 { margin: 0 0 6px; } .qsec p { margin: 4px 0; line-height: 1.5; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.qitem { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.qitem p { margin: 6px 0 0; line-height: 1.5; }
.qrw { margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); background: var(--soft); border-radius: 6px; }
.qrw p { margin: 0 0 8px; }
.qrisk { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, #d97706 22%, transparent); color: #d97706; }
.qrisk.high { background: color-mix(in srgb, #dc2626 22%, transparent); color: #dc2626; }
.qv-wrong { border-color: color-mix(in srgb, #dc2626 50%, var(--line)); } .qv-unclear { border-color: color-mix(in srgb, #d97706 50%, var(--line)); }
.qverd { font-weight: 700; font-size: 13px; }
.qfoot { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 52vh; overflow: auto; }
.qfi { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; } .qfi.weak { border-color: color-mix(in srgb, #d97706 55%, var(--line)); }
.qfthumb { position: relative; width: 120px; aspect-ratio: 16/9; flex: none; border-radius: 6px; background: var(--soft) center/cover; }
.qfthumb .qs { position: absolute; top: 4px; left: 4px; margin: 0; background: rgba(0,0,0,.7); }

/* ✨ editor extras: graphics, sound, intro & end screen */
.xsec { padding: 12px 0; border-bottom: 1px solid var(--line); } .xsec:last-child { border-bottom: 0; }
.xsec .muted.small { margin: 4px 0 6px; }
.xhead { margin: 0 !important; }
.xglist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.xgi { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.xgi select { width: auto; flex: 1; } .xgi input { padding: 6px 8px; font-size: 13px; }
.warn-text { color: #d97706 !important; }

/* 💰 costs */
.cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 16px 0; }
.cgrid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.cgrid2 .card, .cgrid .card { margin: 0; }
.cbig .cnum { font-size: 34px; font-weight: 800; margin: 4px 0 8px; letter-spacing: -0.02em; }
.cbud { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-bottom: 6px; }
.cbud > div { height: 100%; background: #16a34a; border-radius: 99px; } .cbud > .warn { background: #d97706; } .cbud > .over { background: #dc2626; }
.cbar { display: grid; grid-template-columns: minmax(110px, 40%) 1fr auto; gap: 10px; align-items: center; margin: 7px 0; font-size: 14px; }
.cbar > div { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; } .cbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.cdays { display: flex; align-items: flex-end; gap: 4px; height: 120px; overflow-x: auto; }
.cdays > div { flex: 1 0 18px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.cdays i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; } .cdays small { font-size: 12px; color: var(--muted); }
.ctable { width: 100%; border-collapse: collapse; } .ctable td, .ctable th { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); font-size: 14px; } .ctable th { font-size: 13px; color: var(--muted); }
.crates { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 24px; } .crates h4 { margin: 14px 0 6px; }
.crow { display: flex; gap: 6px; align-items: center; margin: 4px 0; font-size: 13px; } .crow span { flex: 1; min-width: 0; overflow-wrap: anywhere; } .crow input { width: 84px; padding: 5px 7px; }
.vcost { margin: 8px 0 0; }

.mon-risk { border-color: color-mix(in srgb, #dc2626 55%, var(--line)); } .mon-warn { border-color: color-mix(in srgb, #d97706 45%, var(--line)); }
#moncred { width: 100%; font-size: 13px; margin: 6px 0; }

/* ▶ YouTube publishing */
.ytsteps { line-height: 1.6; padding-left: 20px; } .ytsteps li { margin: 6px 0; }
.ytcode { display: inline-block; margin-top: 4px; padding: 4px 8px; background: var(--soft); border-radius: 6px; user-select: all; word-break: break-all; }
.ytacc { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--soft); border-radius: 10px; margin-bottom: 6px; }
.ytacc img { width: 32px; height: 32px; border-radius: 50%; }
.ytthumb { height: 34px; border-radius: 4px; vertical-align: middle; margin-left: 6px; }
.ytdone { margin-top: 12px; border-color: color-mix(in srgb, #16a34a 45%, var(--line)); }
#ytd { font-size: 13px; }
.ytrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ytrow-l { font-weight: 700; font-size: 14px; }

/* line icons that replace emojis in headings, buttons and tabs */
.ic-i { width: 1.15em; height: 1.15em; stroke-width: 2; vertical-align: -0.2em; margin-right: .42em; }
.btn .ic-i { margin-right: 0; } /* buttons already space their contents */
h1 .ic-i { width: 1em; height: 1em; stroke-width: 2.2; vertical-align: -0.12em; }
.tabs button .ic-i { width: 1.05em; height: 1.05em; }

/* ---------- editor: pinned top bar, settings drawer, compact scenes ---------- */
.edbar { position: sticky; top: 0; z-index: 30; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: -32px -40px 18px; padding: 14px 40px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.edbar .title-input { flex: 1 1 260px; min-width: 0; font-size: 20px; font-weight: 700; }
.edbar-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.menu a, .menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu .danger { color: var(--err); } .menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu .ic-i { margin-right: 0; }
.editor .panel { top: 86px; }
.outhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.drawer-bg { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow); z-index: 61; display: flex; flex-direction: column; animation: drawin .18s ease-out; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 18px; }
.drawer .tabs { margin: 0 18px; flex-wrap: wrap; }
.drawer #tab { padding: 4px 18px 24px; overflow-y: auto; flex: 1; }
@keyframes drawin { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
/* compact scene cards */
.scene { grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px; margin-bottom: 10px; }
.scene textarea { min-height: 54px; }
.scene .tools { margin-top: 6px; }
.scene .shotlbl { margin-top: 6px; }
@media (max-width: 760px) { .edbar { margin: -18px -16px 14px; padding: 10px 16px; } .edbar-acts { width: 100%; } .edbar-acts .btn.primary { flex: 1; } .scene { grid-template-columns: 1fr; } }

/* ---------- side menu: groups ---------- */
.navh { font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 12px 4px; letter-spacing: .02em; }
nav a { padding: 8px 12px; font-size: 14px; gap: 12px; margin-bottom: 1px; }
nav a .ic { width: 21px; height: 21px; }
nav a.on { background: var(--hover); }
.brand { margin-bottom: 14px; }
@media (max-width: 760px) { .navh { display: none; } nav a { padding: 9px; margin: 0; } }

/* ---------- calmer cards & clear buttons ---------- */
/* buttons: one filled (primary) action; everything else is a quiet outline; delete stays red */
.btn { background: transparent; border: 1px solid var(--line); padding: 7px 15px; }
.btn:hover { background: var(--hover); border-color: color-mix(in srgb, var(--text) 25%, var(--line)); }
.btn.primary { border-color: transparent; box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.btn.sm { padding: 4px 10px; }
.btn.danger { border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.btn.danger:hover { border-color: var(--err); }
.seg button.on, .chip.on { font-weight: 700; }
/* cards: one level of borders; cards inside cards become soft panels instead of boxes in boxes */
.card { border-radius: 14px; }
.card .card { border-color: transparent; background: var(--panel2); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .cgrid > .card + .card, .cgrid2 > .card + .card, .setup-grid > .card + .card, .cp-ideas > .card + .card, .ch-grid > .card + .card { margin-top: 0; }
.card.link:hover { border-color: color-mix(in srgb, var(--text) 22%, var(--line)); }
h2 { margin-top: 34px; }
/* channel page: second-level view switch under the tabs */
.chsub { margin: 4px 0 18px; }
/* collapsed (icons-only) menu: group names become thin dividers */
@media (max-width: 1000px) and (min-width: 761px) { .navh { font-size: 0; line-height: 0; height: 1px; padding: 0; margin: 10px 14px; background: var(--line); overflow: hidden; } }

/* ---------- progress with steps + "Working on…" panel ---------- */
.pjob { margin: 10px 0; }
.pjob .progress { margin: 0 0 8px; height: 6px; }
.pjob-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.psteps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.psteps li { font-size: 13px; color: var(--muted); padding-left: 20px; position: relative; }
.psteps li.done::before { content: '✓'; position: absolute; left: 2px; color: var(--ok); font-weight: 700; }
.jtray { position: fixed; right: 18px; bottom: 18px; z-index: 55; width: min(340px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.jtray-head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 12px 14px; cursor: pointer; text-align: left; font-size: 14px; color: var(--text); }
.jtray-head b { flex: 1; } .jtray-car { color: var(--muted); }
.jtray-list { border-top: 1px solid var(--line); max-height: 50vh; overflow-y: auto; }
.jtray-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: inherit; } .jtray-item:last-child { border-bottom: 0; }
a.jtray-item[href]:hover { background: var(--hover); }
.jtray-item .progress { margin: 6px 0 4px; height: 4px; }
.jt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.drawer-open .jtray { display: none; }
@media (max-width: 760px) { .jtray { right: 10px; bottom: 10px; } }

/* ---------- friendly empty states ---------- */
.ebox { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 34px 20px; border: 1px dashed var(--line); border-radius: 14px; }
.ebox-ic { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); margin-bottom: 6px; }
.ebox-ic .ic { width: 26px; height: 26px; color: var(--link); }
.ebox b { font-size: 16px; } .ebox p { margin: 0 0 8px; max-width: 46ch; color: var(--muted); font-size: 14px; }

/* ---------- phone: nothing wider than the screen ---------- */
img, video, canvas { max-width: 100%; }
@media (max-width: 760px) {
  .tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; padding: 10px 12px; }
  .seg { max-width: 100%; overflow-x: auto; }
  .row > .grow { min-width: 0; }
  table { display: block; overflow-x: auto; max-width: 100%; }
  .modal-body, #modal-body { max-width: 100vw; }
  h1 { font-size: 22px; }
}
@media (max-width: 760px) {
  .modal { padding: 0; place-items: end center; }
  .modal-box { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; padding: 18px 16px 24px; }
}

/* ---------- contrast: status colours follow the theme (each theme's green/orange/red are tuned to be readable) ---------- */
.qb.good, .qs.good { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.qb.mid, .qs.mid { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.qb.bad, .qs.bad { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.qring.good { color: var(--ok); } .qring.mid { color: var(--warn); } .qring.bad { color: var(--err); }
.qrisk { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.qrisk.high { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.lock-tag { color: var(--text2); }
.cp-x { background: #15803d; }

/* ---------- brand look: type, depth, colour ---------- */
body { background: var(--glow), var(--bg); background-attachment: fixed; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .brand, .title-input, .cnum, .qring, .drawer-head b, .ebox b, .ch-title b { font-family: var(--font-head); letter-spacing: -0.015em; }
h1 { font-weight: 700; } h2, h3 { font-weight: 600; }
/* sidebar: its own layer; the current page is tinted violet */
.side { background: color-mix(in srgb, var(--panel) 70%, transparent); backdrop-filter: blur(12px); }
nav a.on { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--text); }
nav a.on .ic { color: var(--link); }
nav a:hover { background: var(--hover); }
/* cards sit on the page with a soft shadow (and a faint top highlight in dark mode) */
.card { box-shadow: var(--shadow); }
.card .card, .modal-box .card { box-shadow: none; }
.modal-box, .drawer, .menu, .jtray { border: 1px solid var(--line); }
/* primary actions: brand violet with a gentle sheen */
.btn.primary { background: linear-gradient(180deg, rgb(255 255 255 / .10), rgb(255 255 255 / 0)), var(--brand); }
.btn.primary:hover { background: linear-gradient(180deg, rgb(255 255 255 / .14), rgb(255 255 255 / 0)), var(--brand-h); }
:focus-visible { outline-color: var(--brand); }
/* chips/segments: the selected one carries the brand */
.chip.on { background: var(--brand); color: #fff; }
.seg button.on { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--text); }
.tabs button.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--brand); }
/* inputs: a clear field on every layer */
input[type=text], input[type=number], input[type=email], input[type=password], input[type=url], input[type=search], input[type=datetime-local], select, textarea { background: var(--panel2); border-color: var(--line); }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); outline: none; }
/* the brand gradient as a thin signature line under the editor bar and on progress */
.edbar { border-bottom: 0; box-shadow: 0 1px 0 var(--line); }
.progress div { background: var(--grad); }
::selection { background: color-mix(in srgb, var(--brand) 35%, transparent); }

/* ---------- video cards with hover preview ---------- */
.pgrid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pcard { display: flex; flex-direction: column; gap: 8px; color: inherit; border-radius: 14px; }
.pthumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--panel2); display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard.tall .pthumb img, .pcard.tall .pthumb video { object-fit: contain; background: #000; }
.pthumb > .ic { width: 34px; height: 34px; color: var(--muted); }
.pthumb video.pprev { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; background: #000; }
.pthumb video.pprev.on { opacity: 1; }
.pcard:hover .pthumb { transform: translateY(-2px); box-shadow: 0 10px 28px rgb(0 0 0 / .28); }
.pbadge { position: absolute; top: 8px; left: 8px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgb(0 0 0 / .72); color: #fff; z-index: 2; }
.pbadge.live { background: #15803d; } .pbadge.sched { background: #5534d6; } .pbadge.draft { background: rgb(0 0 0 / .72); }
.pdur { position: absolute; right: 8px; bottom: 8px; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgb(0 0 0 / .78); color: #fff; z-index: 2; font-variant-numeric: tabular-nums; }
.pmeta { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; min-width: 0; }
.pmeta b { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta span { font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .pthumb { transition: none; } .pcard:hover .pthumb { transform: none; } }

/* ---------- home: your channels ---------- */
.dchans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 8px; }
.dchan { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: inherit; }
.dchan-cover { height: 86px; background: var(--grad) center/cover; position: relative; }
.dchan-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--panel) 85%, transparent)); }
.dchan-body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.dchan-head { display: flex; gap: 12px; align-items: flex-end; margin-top: -24px; position: relative; z-index: 1; }
.dchan-head .ch-logo { width: 52px; height: 52px; box-shadow: 0 0 0 3px var(--panel); }
.dchan-name { display: flex; flex-direction: column; min-width: 0; padding-bottom: 2px; }
.dchan-name b { font-family: var(--font-head); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dchan-name span { font-size: 13px; color: var(--muted); }
.dstats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.dstats b { color: var(--text); font-size: 15px; margin-right: 3px; }
.dnext { font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 8px; min-width: 0; }
.dnext b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.dfoot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.dopen { font-size: 13px; font-weight: 600; color: var(--link); }
#plist { margin-bottom: 8px; }

/* ---------- big previews ---------- */
.modal-box.wide { width: min(1180px, 100%); }
.modal-box.tallbox { width: min(560px, 100%); }
.theatre video { width: 100%; max-height: 76vh; background: #000; border-radius: 12px; display: block; }
.spframe { position: relative; width: 100%; max-height: 72vh; margin: 0 auto; background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.modal-box.tallbox .spframe { max-height: 74vh; width: auto; height: 74vh; }
.spframe img, .spframe video { width: 100%; height: 100%; object-fit: cover; display: block; }
.spframe img.kb { animation: kenburns 9s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12) translate(-2%, -1%); } }
@media (prefers-reduced-motion: reduce) { .spframe img.kb { animation: none; } }
.spempty { color: #bbb; padding: 30px; text-align: center; font-size: 14px; }
.spcap { position: absolute; left: 6%; right: 6%; text-align: center; font-weight: 800; line-height: 1.2; text-shadow: 0 2px 6px rgb(0 0 0 / .85), 0 0 2px #000; }
.spcap.bottom { bottom: 9%; } .spcap.center { top: 50%; transform: translateY(-50%); } .spcap.top { top: 8%; }
.spcap.box { background: rgb(0 0 0 / .62); padding: .3em .6em; border-radius: 8px; left: 50%; right: auto; transform: translateX(-50%); max-width: 88%; }
.spcap.center.box { transform: translate(-50%, -50%); }
.outhead .btn { margin-left: auto; }
.spframe { container-type: inline-size; }

/* ======================= polish ======================= */
/* --- studio colours: icon/heading accents per area (graphics contrast 3:1+ in each theme) --- */
:root { --c-video: #2563eb; --c-pod: #ea580c; --c-presenter: #0d9488; --c-design: #db2777; --c-seo: #16a34a; --c-channels: #6442e8; --c-clips: #b45309; --c-footage: #0891b2; --c-brand: #6442e8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-video: #60a5fa; --c-pod: #fb923c; --c-presenter: #2dd4bf; --c-design: #f472b6; --c-seo: #4ade80; --c-channels: #a78bfa; --c-clips: #fbbf24; --c-footage: #22d3ee; --c-brand: #a78bfa; } }
:root[data-theme="dark"] { --c-video: #60a5fa; --c-pod: #fb923c; --c-presenter: #2dd4bf; --c-design: #f472b6; --c-seo: #4ade80; --c-channels: #a78bfa; --c-clips: #fbbf24; --c-footage: #22d3ee; --c-brand: #a78bfa; }
body { --studio: var(--c-brand); }
body[data-studio="video"] { --studio: var(--c-video); } body[data-studio="pod"] { --studio: var(--c-pod); } body[data-studio="presenter"] { --studio: var(--c-presenter); }
body[data-studio="design"] { --studio: var(--c-design); } body[data-studio="seo"] { --studio: var(--c-seo); } body[data-studio="channels"] { --studio: var(--c-channels); }
body[data-studio="clips"] { --studio: var(--c-clips); } body[data-studio="footage"] { --studio: var(--c-footage); }
main h1 .ic-i { color: var(--studio); }
nav a[data-nav="idea"] .ic, nav a[data-nav="script"] .ic, nav a[data-nav="url"] .ic, nav a[data-nav="projects"] .ic, nav a[data-nav="renders"] .ic { color: var(--c-video); }
nav a[data-nav="podcasts"] .ic, nav a[data-nav="tts"] .ic { color: var(--c-pod); }
nav a[data-nav="avatar"] .ic { color: var(--c-presenter); }
nav a[data-nav="thumbs"] .ic, nav a[data-nav="banners"] .ic { color: var(--c-design); }
nav a[data-nav="seo"] .ic { color: var(--c-seo); }
nav a[data-nav="channels"] .ic { color: var(--c-channels); }
nav a[data-nav="studio"] .ic { color: var(--c-clips); }
nav a[data-nav="library"] .ic { color: var(--c-footage); }
nav a.on { background: color-mix(in srgb, var(--studio) 14%, transparent); }
nav a.on .ic { color: var(--studio) !important; }
.tabs button.on { box-shadow: inset 0 -2px 0 var(--studio); }

/* --- motion: page entrance, card lift, button press, progress shimmer --- */
#app.page-in > * { animation: pagein .26s ease-out both; }
#app.page-in > *:nth-child(2) { animation-delay: .03s; } #app.page-in > *:nth-child(3) { animation-delay: .06s; } #app.page-in > *:nth-child(n+4) { animation-delay: .09s; }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card.link, .tool, .dchan, .ch-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.card.link:hover, .tool:hover, .dchan:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgb(0 0 0 / .22); }
.btn { transition: background .15s, border-color .15s, transform .08s ease, box-shadow .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.progress { position: relative; }
.progress div { position: relative; overflow: hidden; }
.progress div::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .35), transparent); transform: translateX(-100%); animation: shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 200; }

/* --- loading placeholders --- */
.skwrap { padding: 6px 0; display: flex; flex-direction: column; gap: 12px; }
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--soft) 0%, var(--hover) 50%, var(--soft) 100%); background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 14px; }
.sk-card { display: flex; flex-direction: column; gap: 8px; }
.sk-card .sk-thumb, .sk-thumb { aspect-ratio: 16 / 9; border-radius: 12px; }
.sk-ed { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; margin-top: 10px; }
.sk-scene { display: flex; gap: 12px; margin-bottom: 12px; } .sk-scene > div { display: flex; flex-direction: column; gap: 8px; }
.sk-vis { width: 140px; aspect-ratio: 16 / 9; flex: none; border-radius: 8px; }
.sk-panel { height: 340px; border-radius: 14px; }
.sk-row { display: flex; gap: 12px; align-items: center; } .sk-row > div { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { .sk-ed { grid-template-columns: 1fr; } .sk-panel { height: 200px; } }

/* --- illustrated empty states --- */
.ebox-ic { width: 92px; height: 92px; position: relative; background: none; margin-bottom: 10px; }
.ebox-ic::before { content: ''; position: absolute; inset: 0; border-radius: 42% 58% 55% 45% / 50% 42% 58% 50%; background: linear-gradient(135deg, color-mix(in srgb, var(--studio) 30%, transparent), color-mix(in srgb, var(--accent2, #ff6b4a) 22%, transparent)); }
.ebox-ic::after { content: ''; position: absolute; inset: 14px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow); }
.ebox-ic .ic { position: relative; z-index: 1; width: 30px; height: 30px; color: var(--studio); }

/* --- first-run tour --- */
.modal-box.tourbox { width: min(520px, 100%); text-align: center; padding: 30px 28px 22px; }
.tour-art { width: 120px; height: 120px; margin: 4px auto 14px; position: relative; display: grid; place-items: center; }
.tour-art span { position: absolute; inset: 0; border-radius: 46% 54% 52% 48% / 50% 44% 56% 50%; background: var(--grad); opacity: .9; animation: blob 8s ease-in-out infinite alternate; }
.tour-art .ic { position: relative; width: 44px; height: 44px; color: #fff; stroke-width: 2; }
@keyframes blob { to { border-radius: 58% 42% 46% 54% / 44% 56% 44% 56%; transform: rotate(8deg); } }
.tour h2 { margin: 4px 0 8px; font-size: 22px; } .tour-step { margin: 0; } .tour-text { color: var(--text2); line-height: 1.6; margin: 0 auto 16px; max-width: 42ch; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; } .tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .tour-dots i.on { background: var(--brand); width: 22px; border-radius: 99px; }
.tour-acts { gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  #app.page-in > *, .tour-art span, .progress div::after, .sk { animation: none !important; }
  .card.link:hover, .tool:hover, .dchan:hover { transform: none; }
  .btn:active:not(:disabled) { transform: none; }
}
.tour-acts { justify-content: center; } .tour-acts .grow { display: none; }

/* ---------- genre packs & characters ---------- */
.genre-card { max-width: 980px; margin-bottom: 16px; }
.genres { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 12px; }
.genre { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, transform .15s; }
.genre:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); transform: translateY(-1px); }
.genre.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.genre b { font-family: var(--font-head); font-size: 15px; } .genre > span:not(.genre-ic):not(.spinner) { font-size: 13px; color: var(--muted); line-height: 1.45; }
.genre em { position: absolute; top: 12px; right: 12px; font-style: normal; font-size: 12px; font-weight: 700; color: var(--link); }
.genre-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 16%, transparent); }
.genre-ic .ic { width: 20px; height: 20px; color: var(--link); }
.chars-card { margin-top: 16px; }
.chars { display: flex; flex-direction: column; gap: 12px; }
.char { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.char-pic { width: 96px; height: 96px; flex: none; border-radius: 12px; background: var(--soft) center/cover; display: grid; place-items: center; }
.char-pic .ic { width: 34px; height: 34px; color: var(--muted); }
.char-name { font-weight: 700; margin-bottom: 6px; } .char-look { width: 100%; font-size: 13px; }
@media (max-width: 600px) { .char { flex-direction: column; } }

/* shared spacing helpers (replace one-off inline styles) */
.u-mt0 { margin-top:0 !important; }
.u-m0 { margin:0 !important; }
.u-wauto { width:auto !important; }
.u-grow { flex:1 !important; }
.u-mt6 { margin-top:6px !important; }
.u-mt8 { margin-top:8px !important; }
.u-mt10 { margin-top:10px !important; }
.u-mt12 { margin-top:12px !important; }
.u-mt14 { margin-top:14px !important; }
.u-mt16 { margin-top:16px !important; }
.u-mt4x { margin:4px 0 0 !important; }
.u-mt6x { margin:6px 0 0 !important; }
.u-mt8x { margin:8px 0 0 !important; }
.u-mt10x { margin:10px 0 0 !important; }
.u-my4 { margin:4px 0 !important; }
.u-my6 { margin:6px 0 !important; }
.u-gap6 { gap:6px !important; }
.u-gap8 { gap:8px !important; }
.u-gap10 { gap:10px !important; }
.u-between { justify-content:space-between !important; }
.u-end { justify-content:flex-end !important; }
.u-wrap { flex-wrap:wrap !important; }
.u-center { align-items:center !important; }
