/* ==========================================================================
   CreatorsPlot design tokens
   Dark (default, signed-in app) · Light (landing, login, public pages, or by choice).
   Components use tokens only. Spacing is a 4px scale; radii 12–16px.
   ========================================================================== */
:root {
  /* surfaces */
  --bg: #12141C;
  --surface: #1C1F2B;
  --surface-2: #262A38;       /* hover, chips, inputs */
  --surface-3: #171A24;       /* sunken: board columns, editor */
  --line: #303341;
  --line-strong: #434759;
  /* text */
  --text: #F4F4F5;
  --text-2: #D4D4D8;
  --muted: #A1A1AA;
  --faint: #71717A;
  /* brand */
  --accent: #A78BFA;          /* violet: primary action, selected */
  --on-accent: #14102A;
  --accent-soft: #241F3D;
  --accent-line: #4B4175;
  --link: #C4B5FD;
  --highlight: #C4B5FD;
  --coral: #F47B82;           /* used sparingly: hooks, emphasis */
  /* status */
  --ok: #34D399;  --ok-soft: #12302A;  --ok-line: #1F5A47;  --ok-text: #6EE7B7;
  --warn: #FBBF24; --warn-soft: #33290F; --warn-line: #66511A; --warn-text: #FCD34D;
  --danger: #F87171; --danger-soft: #3A1B20; --danger-line: #6B2A30; --danger-text: #FCA5A5;
  --info: #60A5FA; --info-soft: #172A44;
  /* pipeline stages — each also has a text label, never colour alone */
  --idea: #A1A1AA; --script: #60A5FA; --shoot: #FBBF24; --edit: #F47B82;
  --package: #C4B5FD; --scheduled: #2DD4BF; --published: #34D399;
  /* misc */
  --overlay: rgba(6, 7, 12, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
  --media-bg: #000;
  /* type */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --display-weight: 650;
  /* shape + spacing */
  --r: 14px;
  --r-sm: 10px;
  --r-lg: 18px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --side-w: 248px; --side-w-min: 68px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --surface-2: #EDEEF3;
  --surface-3: #F0F1F5;
  --line: #E0E2EA;
  --line-strong: #C9CCD8;
  --text: #14161F;
  --text-2: #2F3242;
  --muted: #5B5F73;
  --faint: #8A8EA3;
  --accent: #6D4AE0;
  --on-accent: #FFFFFF;
  --accent-soft: #EFEAFD;
  --accent-line: #CFC3F7;
  --link: #5636C4;
  --highlight: #5636C4;
  --coral: #E5484D;
  --ok: #0E9F6E;  --ok-soft: #E3F6EE;  --ok-line: #A9DEC8;  --ok-text: #0B6B4A;
  --warn: #B7791F; --warn-soft: #FBF1DA; --warn-line: #EBD08F; --warn-text: #7A4E0B;
  --danger: #D92D3A; --danger-soft: #FDECEE; --danger-line: #F2B8BD; --danger-text: #9E1D28;
  --info: #2563EB; --info-soft: #E6EEFD;
  --idea: #6B7085; --script: #2563EB; --shoot: #B7791F; --edit: #E5484D;
  --package: #6D4AE0; --scheduled: #0F8F86; --published: #0E9F6E;
  --overlay: rgba(20, 22, 31, .4);
  --shadow: 0 1px 2px rgba(20, 22, 31, .06), 0 6px 20px rgba(20, 22, 31, .05);
  --shadow-lg: 0 16px 48px rgba(20, 22, 31, .16);
  --media-bg: #14161F;
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
h1 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(26px, 4.4vw, 36px); line-height: 1.15; }
h2 { font-size: 16px; font-weight: 700; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; font-family: var(--font-mono); }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 8px 12px; min-width: 0; }
input:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .fine { font-size: 12.5px; margin: 6px 0 0; }
.center { min-height: 100vh; display: grid; place-items: center; }

.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: var(--r-sm); background: url(/logo.svg) center/cover no-repeat; font-size: 0; color: transparent; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 19px; }

.btn { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 8px 16px; color: var(--text); }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: none; border-color: transparent; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.wide { width: 100%; padding: 12px 16px; font-size: 16px; }

.banner { padding: 10px 14px; border-radius: var(--r-sm); margin: 12px 0 0; font-size: 13.5px; }
.banner.error { background: var(--danger-soft); color: var(--danger-text); border: 1px solid var(--danger-line); }
.ok-note { background: var(--ok-soft); color: var(--ok-text); border: 1px solid var(--ok-line); border-radius: var(--r-sm); padding: 10px 14px; margin: 0; }

.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; }
.login-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin-top: 10px; }
.lede { margin: 0 0 6px; color: var(--text-2); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.magic { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; gap: 8px; } .row input { flex: 1; }

.shell { min-height: 100vh; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-email { overflow-wrap: anywhere; min-width: 0; }
.page { max-width: 880px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 16px; }
.page > p { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.card p { margin: 0; }
.card .btn { align-self: flex-start; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0; overflow-wrap: anywhere; }
.good { color: var(--ok-text); } .bad { color: var(--danger-text); }
@media (max-width: 520px) { .top { padding: 12px 16px; } .login-card { padding: 24px 20px; } .kv { grid-template-columns: 1fr; } }

.row.between { justify-content: space-between; align-items: center; }
.channel-row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); object-fit: cover; flex: none; }
.thumb { width: 96px; height: 54px; border-radius: 6px; background: var(--surface-2); object-fit: cover; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-family: var(--font-display); font-size: 24px; font-weight: var(--display-weight); }
.tile span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.tbl .r { text-align: right; white-space: nowrap; }
@media (max-width: 520px) { .thumb { width: 72px; height: 41px; } }

.pub { min-height: 100vh; display: flex; flex-direction: column; }
.pub .brand { text-decoration: none; color: inherit; }
.pub-main { max-width: 880px; width: 100%; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.hero { padding: 24px 0 8px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.hero .lede { font-size: 18px; max-width: 62ch; }
a.btn { text-decoration: none; display: inline-block; }
.pub-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pub-cols .card h2 { font-size: 15px; }
.prose { gap: 8px; }
.prose h1 { margin-bottom: 4px; }
.prose h2 { margin-top: 18px; font-size: 17px; }
.prose p { margin: 0; max-width: 72ch; }
.prose code { overflow-wrap: anywhere; }
.pub-foot { display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: center; padding: 18px 16px 28px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.pub-foot a { color: var(--muted); }
.login .pub-foot { border: 0; padding-top: 0; }
a { color: var(--accent); }

/* workspace: tabs, playbook, topics, job progress */
.row.gap { gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; }
.row.start { align-items: flex-start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 18px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; color: var(--muted); font-weight: 600; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); } .tab.on { color: var(--text); border-bottom-color: var(--accent); }
.progress { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 10px 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-sm); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.md h2, .md h3 { font-family: var(--font-display); font-weight: var(--display-weight); margin: 18px 0 6px; color: var(--text); }
.md h3 { font-size: 17px; } .md p { margin: 6px 0; } .md ul { margin: 4px 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.editor { width: 100%; font: 14px/1.55 var(--font-mono); padding: 12px; background: var(--surface-3); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm); resize: vertical; }
.topic { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); display: grid; gap: 6px; }
.topic.pick { border-color: var(--ok-line); background: var(--ok-soft); } .topic.reject { opacity: .6; }
.topic p { margin: 0; } .hook { font-family: var(--font-display); color: var(--highlight); }
.badge { background: var(--accent-soft); color: var(--highlight); border: 1px solid var(--accent-line); border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 13px; }
.linklike { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; }
.code-input { font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

/* episodes */
.field-label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.editor.text { font: 15px/1.6 var(--font-body); }
.ep-title { font-weight: 700; text-align: left; font-size: 15.5px; }
select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 7px 10px; }
.num { width: 76px; }
textarea.editor:focus, select:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.row input.num { flex: none; width: 76px; }

/* studio: sidebar, overview, board */
.meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.lede2 { margin: 0; font-size: 17px; color: var(--text-2); }
.btn.big { padding: 14px 28px; font-size: 16.5px; font-weight: 700; border-radius: 12px; }
.btn.strong { border-color: var(--text); font-weight: 700; }
.btn { min-height: 40px; }
.btn.small { min-height: 34px; }

.overview { display: flex; flex-direction: column; gap: 32px; max-width: 960px; }
.bigcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.bigcard p { margin: 0; }
.bigcard-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.bigcard-head h2 { font-size: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { display: flex; align-items: center; gap: 16px; font-size: 16.5px; }
.tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 14px; flex: none; }
.steps li.done .tick { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-text); }
.steps li.done .grow { color: var(--muted); text-decoration: line-through; }
.continue { border: 2px solid var(--accent); }
.continue-body { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.continue-body .grow { display: flex; flex-direction: column; gap: 6px; }
.continue-title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; line-height: 1.2; }
.progressbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.progressbar i { height: 6px; border-radius: 3px; background: var(--surface-2); }
.progressbar i.on { background: var(--ok); }
.statgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.statcard { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; display: flex; flex-direction: column; gap: 6px; }
.statcard:hover { border-color: var(--muted); }
.statnum { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 44px; line-height: 1.05; }
.actions { display: flex; gap: 16px; flex-wrap: wrap; }

.pipe { display: flex; flex-direction: column; gap: 24px; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: 0; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 18px; color: var(--muted); font-weight: 600; font-size: 15.5px; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); } .tab.on { color: var(--text); border-bottom-color: var(--accent); }
.kboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.kcol { background: var(--surface-3); border: 1px solid var(--line); border-radius: 16px; padding: 8px 20px 24px; min-height: 440px; display: flex; flex-direction: column; gap: 16px; transition: border-color .12s, background .12s; }
.kcol.over { border-color: var(--accent); background: var(--accent-soft); }
.kcol-head { display: flex; align-items: center; gap: 10px; padding: 16px 0 4px; font-size: 16px; }
.kcol-head .muted { margin-left: auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.scripting { background: var(--link); } .dot.ready { background: var(--accent); } .dot.published { background: var(--ok-text); }
.kcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.pubgrid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 20px 12px; display: grid; gap: 16px; cursor: grab; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--line-strong); }
.kcard.drag { opacity: .45; }
.kcard-main { background: none; border: 0; padding: 0; text-align: left; display: grid; gap: 6px; }
.kcard-num { font-size: 12px; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.kcard-title { font-weight: 600; font-size: 16.5px; line-height: 1.4; overflow-wrap: anywhere; }
.kcard-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.chip { background: var(--surface-2); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok-text); }
.kmove { display: inline-flex; gap: 4px; }
.icon-btn { background: none; border: 0; border-radius: 8px; width: 36px; height: 36px; color: var(--muted); font-size: 20px; line-height: 1; display: grid; place-items: center; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.kempty { margin: 8px 0; }
.kadd { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--accent-line); border-radius: 12px; padding: 16px; }
.kadd input { padding: 12px 14px; }

.progress { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 18px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-sm); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge-ep { background: var(--surface-2); border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.eyebrow { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: block; margin: 0; }
.eyebrow .plain { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* episode pages: full page, no sidebar */
.epflow { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.epbar { position: sticky; top: 0; z-index: 10; height: 72px; flex: none; padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.backlink { background: none; border: 0; padding: 8px 0; font-size: 16px; font-weight: 600; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backlink:hover { color: var(--accent); }
.epbar-right { display: flex; align-items: center; gap: 16px; flex: none; }
.epcol { width: min(960px, 100%); margin: 0 auto; padding: 56px 0 72px; display: flex; flex-direction: column; gap: 32px; flex: 1; }
.epcol.wide { width: min(1200px, 100%); gap: 40px; }
.epcol.setup { gap: 40px; padding-bottom: 48px; }
.epheader { display: flex; flex-direction: column; gap: 12px; }
.epheader h1 { font-size: clamp(30px, 4vw, 40px); }
.ep-h1 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(30px, 4vw, 44px); line-height: 1.15; border: 1px solid transparent; background: none; padding: 4px 8px; margin: 0 -8px; border-radius: 10px; width: calc(100% + 16px); }
.ep-h1:hover { border-color: var(--line); } .ep-h1:focus { background: var(--surface); }
.hook { margin: 0; font-family: var(--font-display); color: var(--highlight); font-size: 18px; }
.stepbar { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.stepbar li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--muted); }
.stepbar li + li::before { content: ''; flex: 1; width: clamp(24px, 6vw, 80px); height: 2px; background: var(--line-strong); margin: 0 16px; }
.stepbar li.done + li::before, .stepbar li.now::before { background: var(--ok); }
.stepbar li.done + li.now::before { background: var(--ok); }
.stepdot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 15px; font-weight: 700; flex: none; }
.stepbar li.done { color: var(--text); } .stepbar li.done .stepdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepbar li.now { color: var(--text); } .stepbar li.now .stepdot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stepbar li { flex: none; } .stepbar li + li { flex: 1 1 auto; }
.stepbar li + li { justify-content: flex-start; }

.steprow { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.steprow.now { border: 2px solid var(--accent); padding: 27px 31px; }
.steprow.quiet:not(.now) { background: none; border-style: dashed; }
.steprow-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.steprow-head .grow { display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.steprow-big { font-size: 19px; font-weight: 600; line-height: 1.3; }
.steprow .steprow-big:first-of-type { font-family: var(--font-display); font-size: 24px; }
.statuschips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.schip { background: var(--bg); border-radius: 10px; padding: 14px 16px; font-size: 15px; color: var(--text-2); }
.schip.ok { background: var(--ok-soft); color: var(--ok-text); }
.strongtext { font-weight: 700; justify-self: start; text-align: left; }
.optlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.opt { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; }
.opt.pick { border-color: var(--ok-line); background: var(--ok-soft); }
.opt p { margin: 4px 0 0; }
.opt > .grow > b { font-size: 15.5px; line-height: 1.35; }
.opt p { margin: 4px 0 0; line-height: 1.5; }
.opt > .btn { flex: none; }
.notesbox { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 32px; }
.notesbox summary { cursor: pointer; font-weight: 600; font-size: 16px; }
.notesbox[open] summary { margin-bottom: 16px; }
.dangerzone { padding-top: 8px; }
.editor { width: 100%; font: 14.5px/1.6 var(--font-mono); padding: 16px 18px; background: var(--surface-3); color: var(--text); border: 1px solid var(--line); border-radius: 12px; resize: vertical; }
.editor.text { font: 16px/1.7 var(--font-body); }
textarea.editor:focus, select:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 7px 10px; }

.setgroup { display: flex; flex-direction: column; gap: 16px; }
.setgroup p { margin: 0; }
.stylegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.stylecard { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; color: var(--text-2); }
.stylecard:hover { border-color: var(--muted); }
.stylecard.on { border: 2px solid var(--accent); padding: 23px; box-shadow: var(--shadow); }
.stylecard-head { display: flex; justify-content: space-between; align-items: center; }
.stylecard-head b { font-family: var(--font-display); font-size: 20px; color: var(--text); }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; }
.stylecard.on .radio { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chiprow { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.choice { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 11px 22px; font-size: 16px; font-weight: 500; }
.choice:hover { border-color: var(--muted); }
.choice.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 700; }
.choice-input { border-radius: 999px; padding: 11px 22px; font-size: 16px; width: 220px; }
.choice-input.narrow { width: 120px; }
.epfoot { position: sticky; bottom: 0; z-index: 10; min-height: 92px; padding: 16px 48px; display: flex; justify-content: center; align-items: center; border-top: 1px solid var(--line); background: var(--surface); }
.epfoot-in { width: min(960px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.epfoot-in.wide { width: min(1200px, 100%); }

.sw { background: var(--bg); }
.sw-grid { flex: 1; display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 24px; padding: 0 24px 72px; align-items: start; }
.sw-rail { position: sticky; top: 96px; padding: 40px 4px; display: flex; flex-direction: column; gap: 16px; }
.sw-main { display: flex; justify-content: center; padding: 32px 0; }
.sw-page { width: min(780px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 64px 72px; font: 20px/1.8 var(--font-body); color: var(--text); resize: none; overflow: hidden; display: block; min-height: 420px; }
.sw-page:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.swerr { padding: 0 48px; margin: 12px 0 0; }
.sw.focus .sw-grid { grid-template-columns: minmax(0, 1fr); }
.outline-link { display: flex; justify-content: space-between; gap: 12px; text-align: left; background: none; border: 0; border-radius: 10px; padding: 12px 14px; font-size: 15px; color: var(--text-2); }
.outline-link:hover { background: var(--surface); color: var(--text); }
.railcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.railcard .btn { text-align: left; }

.pkg { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.pkg-col { display: flex; flex-direction: column; gap: 32px; }
.pkgcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; }
.pkghead { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pkgtitle { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; line-height: 1.25; }
.pkgtext { min-height: 260px; }
.pkgcard p { margin: 0; }

.channelcard { background: var(--accent-soft); border-color: var(--accent-line); }
.channelcard .bigcard-head { align-items: flex-start; flex-wrap: wrap; }
.channelcard .bigcard-head > div { display: flex; flex-direction: column; gap: 4px; }
.channelcard .channelname { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; line-height: 1.2; }
.minitiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.minitiles div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.minitiles b { font-family: var(--font-display); font-size: 26px; font-weight: var(--display-weight); }
.minitiles span { color: var(--muted); font-size: 13.5px; }
@media (max-width: 720px) { .minitiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .channelcard .btn.big { width: 100%; } }
@media (max-width: 1099px) {
  .sw-grid { grid-template-columns: minmax(0, 1fr); padding: 0 16px 48px; }
  .sw-rail { position: static; padding: 24px 0 0; }
  .sw-rail.right { order: 3; padding-top: 0; }
  .sw-page { padding: 40px 32px; }
}
@media (max-width: 999px) {
  .kboard { grid-template-columns: minmax(0, 1fr); }
  .kcol { min-height: 0; }
  .statgrid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pkg { grid-template-columns: minmax(0, 1fr); }
  .stylegrid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .epbar { height: 60px; padding: 0 20px; }
  .epcol, .epcol.wide { padding: 28px 20px 40px; gap: 24px; width: 100%; }
  .epfoot { padding: 16px 20px 24px; }
  .epfoot-in { flex-direction: column-reverse; align-items: stretch; gap: 12px; text-align: center; }
  .epfoot .btn.big { width: 100%; min-height: 52px; }
  .steprow, .pkgcard, .bigcard { padding: 20px 18px; }
  .steprow.now { padding: 19px 17px; }
  .steprow-head .btn { min-height: 44px; }
  .statuschips { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .stepbar li b { display: none; } .stepbar li.now b { display: inline; }
  .stepbar li + li::before { width: 100%; margin: 0 8px; }
  .swerr { padding: 0 20px; }
  .sw-page { padding: 28px 20px; font-size: 18px; }
  .epbar-right .muted { display: none; }
  .continue-body .btn { width: 100%; }
  .pagehead.row { align-items: stretch; }
  .opt { flex-direction: column; align-items: stretch; gap: 12px; }
  .opt > .btn { width: 100%; min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .kcol { transition: none; } .spinner { animation-duration: 3s; } }

/* onboarding: first screens for a creator with no channel yet */
.onboard { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding: 8px 0 40px; }
.onboard h1 { margin: 0; }
.onboard .stylegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.onboard textarea.editor.text, .onboard input:not(.choice-input) { width: 100%; box-sizing: border-box; }
@media (max-width: 640px) { .onboard .stylegrid { grid-template-columns: 1fr; } }
button.tick { background: var(--surface); cursor: pointer; padding: 0; color: inherit; }

/* Calendar */
.cal { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.cal-nav { margin-bottom: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.cal-day { min-height: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-day.off { background: transparent; border-color: transparent; }
.cal-day.today { border-color: var(--accent); }
.cal-day.over { background: var(--accent-soft); border-color: var(--accent-line); }
.cal-num { font-size: 12px; color: var(--muted); }
.cal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cal-ep { border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 4px; cursor: grab; }
.cal-ep.published { border-left-color: var(--published); }
.cal-ep.drag { opacity: .45; }
.cal-ep > button:first-child { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 4px 6px; font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.cal-side h2 { font-size: 15px; margin: 0; }
.cal-side .cal-ep > button:first-child { white-space: normal; }
@media (max-width: 800px) { .cal { grid-template-columns: 1fr; } .cal-day { min-height: 64px; } .cal-ep > button:first-child { font-size: 11px; } }
.cal-main { min-width: 0; }
.cal-day { min-width: 0; overflow: hidden; }
.cal-day ul, .cal-day .cal-ep { min-width: 0; max-width: 100%; }
.cal-day .cal-ep > button:first-child { max-width: 100%; box-sizing: border-box; }
/* Calendar: show the whole title, wrapped */
.cal-ep > button:first-child, .cal-day .cal-ep > button:first-child { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.3; }
.cal-day { overflow: visible; }

/* Channel Insights */
.ins { display: flex; flex-direction: column; gap: 20px; }
.ins-top { gap: 12px; }
.ins-bars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 190px; padding: 8px 0 0; border-bottom: 1px solid var(--line); }
.ins-bar { flex: 1 1 0; min-width: 6px; border: 0; border-radius: 4px 4px 0 0; padding: 0; cursor: pointer; background: var(--line-strong); opacity: .85; }
.ins-bar.high { background: var(--ok); } .ins-bar.low { background: var(--danger); } .ins-bar.mid { background: var(--faint); }
.ins-bar.on, .ins-bar:hover, .ins-bar:focus-visible { opacity: 1; outline: 2px solid var(--text); outline-offset: 1px; }
.ins-median { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); pointer-events: none; }
.ins-median i { position: absolute; left: 0; top: -18px; font-size: 11px; font-style: normal; color: var(--muted); background: var(--surface); padding: 0 4px; }
.ins-read { margin: 4px 0 0; min-height: 22px; }
.ins-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.ins-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.sw.high { background: var(--ok); } .sw.mid { background: var(--faint); } .sw.low { background: var(--danger); }
.ins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ins-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.ins-card header { display: flex; align-items: center; gap: 10px; }
.ins-card h3 { margin: 0; font-size: 16px; }
.ins-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface-2); color: var(--text-2); flex: none; }
.ins-card.good { background: var(--ok-soft); border-color: var(--ok-line); } .ins-card.good .ins-ico { background: var(--ok); color: #fff; }
.ins-card.bad { background: var(--danger-soft); border-color: var(--danger-line); } .ins-card.bad .ins-ico { background: var(--danger); color: #fff; }
.ins-card.next { background: var(--accent-soft); border-color: var(--accent-line); grid-column: 1 / -1; } .ins-card.next .ins-ico { background: var(--accent); color: var(--on-accent); }
.ins-lead { margin: 0; font-weight: 600; line-height: 1.4; }
.ins-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); line-height: 1.45; }
.ins-list.steps { list-style: decimal; }
.ins-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ins-chips li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
@media (max-width: 800px) { .ins-grid { grid-template-columns: 1fr; } .ins-bars { height: 150px; gap: 2px; } }

/* Results and reports */
.results { display: grid; gap: 14px; }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.res-list li { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
.res-paste input { flex: 1; min-width: 0; }
.res-empty { display: grid; gap: 10px; justify-items: start; }
.rep { display: grid; gap: 16px; }
.rep h3 { margin: 0; font-size: 16px; } .rep h4 { margin: 0; font-size: 15px; }
.rep-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 10px; }
.rep-card p, .rep-next p { margin: 0; }
.rep-verdict { background: var(--accent-soft); border-color: var(--accent-line); }
.rep-verdict p { font-size: 17px; font-weight: 600; line-height: 1.45; }
.tile em { font-style: normal; font-size: 12.5px; font-weight: 600; } .tile em.up { color: var(--ok); } .tile em.down { color: var(--danger); } .tile em.same { color: var(--muted); }
.rep-svg { width: 100%; height: auto; display: block; }
.rep-grid { stroke: var(--line); } .rep-axis { font-size: 11px; fill: var(--muted); }
.rep-line { fill: none; stroke: var(--accent); stroke-width: 3; }
.rep-band.drop { fill: var(--danger); opacity: .1; } .rep-band.rewatch { fill: var(--ok); opacity: .12; }
.rep-dot.drop { fill: var(--danger); } .rep-dot.rewatch { fill: var(--ok); }
.rep-dotnum { font-size: 9px; font-weight: 700; fill: #fff; }
.rep-moments { display: grid; gap: 10px; }
.rep-moment { display: grid; grid-template-columns: 72px 1fr; gap: 12px; border-radius: var(--r-sm); padding: 12px; border: 1px solid var(--line); }
.rep-moment > div:last-child { display: grid; gap: 4px; }
.rep-moment.bad { background: var(--danger-soft); border-color: var(--danger-line); } .rep-moment.warn { background: var(--warn-soft); border-color: var(--warn-line); } .rep-moment.good { background: var(--ok-soft); border-color: var(--ok-line); }
.rep-time { font: 600 17px var(--font-display); display: flex; align-items: flex-start; gap: 6px; }
.rep-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--text); color: var(--bg); font: 700 11px var(--font-body); flex: none; margin-top: 3px; }
.rep-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rep-bars { display: grid; gap: 8px; }
.rep-bar { display: grid; grid-template-columns: 120px 1fr 42px; gap: 10px; align-items: center; font-size: 14px; }
.rep-track { background: var(--surface-2); border-radius: 6px; height: 12px; overflow: hidden; } .rep-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.rep-split { display: flex; height: 26px; border-radius: 8px; overflow: hidden; font-size: 12px; color: #fff; font-weight: 600; }
.rep-split div { display: grid; place-items: center; white-space: nowrap; overflow: hidden; } .rep-split .a { background: var(--accent); } .rep-split .b { background: var(--faint); }
.rep-next { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 10px; }
.rep-next ol { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.rep-next li > div { display: inline-block; vertical-align: top; max-width: calc(100% - 140px); } .rep-next li .btn { float: right; }
@media (max-width: 700px) { .rep-two { grid-template-columns: 1fr; } .rep-bar { grid-template-columns: 96px 1fr 40px; } .rep-moment { grid-template-columns: 56px 1fr; } .rep-next li > div { max-width: 100%; display: block; } .rep-next li .btn { float: none; margin-top: 6px; } }
.rep-moment p { color: var(--text-2); }

/* Insights: the quick read */
.ins-glance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.glance { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r); padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); }
.glance b { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.glance p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
.glance.good { background: var(--ok-soft); border-color: var(--ok-line); } .glance.good .ins-ico { background: var(--ok); color: #fff; }
.glance.bad { background: var(--danger-soft); border-color: var(--danger-line); } .glance.bad .ins-ico { background: var(--danger); color: #fff; }
.glance.next { background: var(--accent-soft); border-color: var(--accent-line); } .glance.next .ins-ico { background: var(--accent); color: var(--on-accent); }
.ins-card.compact { padding: 12px 16px; gap: 6px; }
.ins-card.compact .ins-lead { font-weight: 500; font-size: 14.5px; color: var(--text-2); }
.ins-card.next { grid-column: auto; }
@media (max-width: 800px) { .ins-glance { grid-template-columns: 1fr; } }
.ins-card .linklike { justify-self: start; } .ins-list.steps { list-style: decimal; }

/* Home screen placeholders while sign-in and account data load */
.sk { display: block; background: var(--surface-2); border-radius: 6px; position: relative; overflow: hidden; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent); animation: sk-shimmer 1.3s ease-in-out infinite; }
.sk-line { height: 12px; max-width: 100%; }
.sk-title { height: 30px; width: min(320px, 70%); border-radius: 8px; }
.sk-btn { width: 72px; height: 32px; border-radius: var(--r-sm); flex: none; }
.sk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
@keyframes sk-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }

/* Results: show WHICH YouTube video is linked, with a thumbnail and a link to it. */
.res-linked { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; color: inherit; text-decoration: none; margin-top: 10px; transition: border-color .12s; }
.res-linked:hover { border-color: var(--accent); }
.res-linked .grow { display: flex; flex-direction: column; min-width: 0; }
.res-linked .grow .muted { word-break: break-all; }

/* ==========================================================================
   App shell + shared components (loaded after styles.css, so these win)
   ========================================================================== */
.icon { flex: none; }
.stack { display: flex; flex-direction: column; gap: var(--s5); }
.stack.tight { gap: var(--s3); }
.page-narrow { max-width: 880px; width: 100%; display: flex; flex-direction: column; gap: var(--s5); }
.page-wide { max-width: 1200px; width: 100%; display: flex; flex-direction: column; gap: var(--s5); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel h2 { font-size: 16px; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* controls */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 12px; min-width: 0; }
input:focus, select:focus, textarea:focus, textarea.editor:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.editor { background: var(--surface-3); border-color: var(--line); border-radius: var(--r-sm); }
.btn { border-radius: var(--r-sm); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--surface); transition: background .12s, border-color .12s; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.btn.danger { color: var(--danger-text); border-color: var(--danger-line); background: var(--danger-soft); }
.btn.ghost { background: none; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.big { padding: 12px 22px; font-size: 15px; font-weight: 600; border-radius: var(--r-sm); }
.btn.strong { border-color: var(--line-strong); }
.icon-btn { border-radius: var(--r-sm); }
.choice { border-radius: 999px; padding: 9px 18px; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.choice.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.tab { font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.tab.on { border-bottom-color: var(--accent); }
.tab-count { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.tabs { margin: 0; }

.bdg { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); color: var(--text-2); border: 1px solid transparent; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.bdg.ok { background: var(--ok-soft); color: var(--ok-text); border-color: var(--ok-line); }
.bdg.warn { background: var(--warn-soft); color: var(--warn-text); border-color: var(--warn-line); }
.bdg.bad { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-line); }
.bdg.accent { background: var(--accent-soft); color: var(--highlight); border-color: var(--accent-line); }
.bdg.stage-idea { color: var(--idea); } .bdg.stage-scripting { color: var(--script); } .bdg.stage-ready { color: var(--shoot); } .bdg.stage-published { color: var(--published); }

.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; border-radius: 7px; padding: 6px 12px; font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: var(--shadow); }
.seg button:hover:not(.on) { color: var(--text); }

.skel { display: block; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-stack { display: grid; gap: var(--s3); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s2); padding: var(--s7) var(--s5); border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface); }
.empty p { margin: 0; max-width: 52ch; }
.empty-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--highlight); }
.empty.err .empty-ico { background: var(--danger-soft); color: var(--danger-text); }

.dlg-back { position: fixed; inset: 0; background: var(--overlay); z-index: 60; display: grid; place-items: center; padding: var(--s4); overflow: auto; }
.dlg { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.dlg header { display: flex; justify-content: space-between; align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.dlg .dlg-body { padding: var(--s5); }
.dlg footer { padding: var(--s4) var(--s5); border-top: 1px solid var(--line); display: flex; gap: var(--s2); justify-content: flex-end; }
.toasts { position: fixed; right: var(--s4); bottom: var(--s4); display: grid; gap: var(--s2); z-index: 80; }
.toast { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); border-left: 3px solid var(--ok); border-radius: var(--r-sm); padding: 10px 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; }
.toast.bad { border-left-color: var(--danger); }

.menu { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: var(--r-sm); padding: 4px; }
.menu-btn:hover { background: var(--surface-2); }
.menu-panel { position: absolute; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; display: flex; flex-direction: column; }
.menu-panel.right { right: 0; } .menu-panel.left { left: 0; }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 6px; overflow-wrap: anywhere; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; color: var(--text-2); font-size: 14px; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); color: var(--text); }
.menu-item.on { color: var(--text); font-weight: 600; }
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--highlight); border: 1px solid var(--accent-line); display: grid; place-items: center; font-weight: 700; }

/* shell */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.app.min { grid-template-columns: var(--side-w-min) minmax(0, 1fr); }
.ws-side { position: sticky; top: 0; height: 100vh; background: var(--surface-3); border-right: 1px solid var(--line); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s5); overflow-y: auto; z-index: 40; }
.ws-brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--s2); }
.ws-brand .brand-name { font-size: 17px; flex: 1; letter-spacing: -.01em; }
.ws-home { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.ws-close { display: none; }
.ws-nav { display: flex; flex-direction: column; gap: 2px; }
.ws-link { display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0; border-radius: var(--r-sm); padding: 10px 12px; color: var(--muted); font-weight: 500; font-size: 14px; position: relative; }
.ws-link:hover { background: var(--surface-2); color: var(--text); }
.ws-link.on { background: var(--accent-soft); color: var(--highlight); font-weight: 600; }
.ws-foot { margin-top: auto; display: grid; gap: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s4); }
.ws-busy { display: flex; align-items: center; gap: 8px; }
.ws-mark { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 13px var(--font-body); }
.app.min .ws-label { display: none; }
.app.min .ws-link { justify-content: center; padding: 11px 0; }
.app.min .ws-brand { flex-direction: column; padding: 0; }
.app.min .ws-brand .ws-collapse { order: 3; }
.app.min .ws-foot .ws-busy { justify-content: center; }
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 39; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s6); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 64px; }
.crumb { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.page-title { font-size: 20px; font-weight: 650; line-height: 1.2; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: var(--s3); }
.chsel .menu-btn { border-color: var(--line); background: var(--surface); padding: 4px 10px 4px 6px; }
.chsel-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.menu-toggle { display: none; }
.ws-main { padding: var(--s6); display: flex; flex-direction: column; gap: var(--s5); min-width: 0; max-width: 1280px; width: 100%; }
.ws-main > .overview { max-width: none; }

@media (max-width: 960px) {
  .app, .app.min { grid-template-columns: minmax(0, 1fr); }
  .ws-side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .ws-side.open { transform: none; }
  .app.min .ws-label { display: inline; } .app.min .ws-link { justify-content: flex-start; padding: 10px 12px; } .app.min .ws-brand { flex-direction: row; }
  .ws-collapse { display: none; } .ws-close { display: grid; }
  .menu-toggle { display: grid; }
  .topbar { padding: var(--s3) var(--s4); }
  .ws-main { padding: var(--s4); }
  .chsel-name { display: none; } .btn-label { display: none; }
}

/* catalogue */
.toolbar { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 12px; flex: 1; min-width: 200px; color: var(--muted); }
.search input { border: 0; background: none; padding: 9px 0; flex: 1; outline: none; }
.search:focus-within { border-color: var(--accent); outline: 2px solid var(--accent-line); }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.cat-card { width: 100%; text-align: left; display: flex; flex-direction: column; gap: var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); height: 100%; }
.cat-card:hover { border-color: var(--accent-line); background: var(--surface-2); }
.cat-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--surface-2); display: block; }
.cat-thumb.blank { display: grid; place-items: center; color: var(--faint); }
.cat-title { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-h { margin: 0; font-size: 17px; line-height: 1.35; }
.cat-desc { white-space: pre-wrap; margin: 0; }
.cat-perf { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); }
.cat-perf p { margin: 6px 0 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: var(--s4); }
.rowlink { cursor: pointer; } .rowlink:hover td { background: var(--surface-2); }
.linklike.plain { text-decoration: none; color: var(--text); text-align: left; }
.tbl th { background: var(--surface-3); }

/* calendar additions */
.cal-label { min-width: 150px; text-align: center; }
.cal-day.tall { min-height: 260px; }
.cal-grid.week { gap: 8px; }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.cal-list li { display: flex; align-items: center; gap: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); flex-wrap: wrap; }
.cal-list-title { background: none; border: 0; text-align: left; flex: 1; min-width: 160px; font-weight: 500; }
.cal-ep.idea { border-left-color: var(--idea); } .cal-ep.scripting { border-left-color: var(--script); } .cal-ep.ready { border-left-color: var(--shoot); }
@media (max-width: 960px) { .cal { grid-template-columns: minmax(0, 1fr); } .cal-grid.week { grid-template-columns: minmax(0, 1fr); } }
.pipe { gap: var(--s5); }
.kcol { border-radius: var(--r); }
.kcard { border-radius: var(--r-sm); }

/* overview */
.pagehead { display: flex; flex-direction: column; gap: 4px; }
.lede2 { margin: 0; font-size: 15px; color: var(--muted); }
.overview { gap: var(--s5); }
.overview h2 { font-size: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi > span { color: var(--muted); font-size: 13px; }
.kpi b { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.delta.up { color: var(--ok-text); } .delta.down { color: var(--warn-text); } .delta.flat { color: var(--muted); }
.work-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s4); }
.work-card { display: flex; flex-direction: column; gap: var(--s2); }
.opp-row { display: flex; gap: var(--s3); align-items: center; width: 100%; text-align: left; padding: var(--s3); background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); color: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.opp-row:hover { border-color: var(--accent); background: var(--surface-2); }
.opp-row > svg { flex: none; color: var(--muted); }
.bigcard { border-radius: var(--r); padding: var(--s5); gap: var(--s4); box-shadow: var(--shadow); }
.statgrid { gap: var(--s3); }
.statcard { border-radius: var(--r); padding: var(--s4) var(--s5); box-shadow: var(--shadow); }
.statnum { font-size: 34px; }
.continue { border: 1px solid var(--accent-line); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.continue-title { font-size: 24px; }
.cal-side input[type="date"] { width: 150px; }
.minitiles > div { background: var(--surface-3); border-radius: var(--r-sm); }

/* opportunities */
.opp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s4); }
.opp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); box-shadow: var(--shadow); }
.opp.pick { border-color: var(--ok-line); } .opp.reject { opacity: .6; }
.opp-title { font-size: 15.5px; line-height: 1.35; }
.opp p { margin: 0; } .opp .hook { color: var(--coral); font-style: italic; }
.why { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); display: grid; gap: var(--s2); font-size: 13.5px; }
.opp .linklike { align-self: flex-start; }

/* video studio */
.brief summary { cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 600; list-style: none; }
.brief[open] summary { margin-bottom: var(--s4); }
.brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); margin-bottom: var(--s4); }
.field { display: grid; gap: 4px; } .field textarea, .field input { width: 100%; }
.sub { font-size: 13px; margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 800px) { .brief-grid { grid-template-columns: 1fr; } }
.epbar { background: var(--surface); }
[id^="episode-tool-"] { scroll-margin-top: 88px; }

/* landing (light theme) */
.land { min-height: 100vh; display: flex; flex-direction: column; }
.land > main { flex: 1; }
.land-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s4) var(--s6); max-width: 1180px; width: 100%; margin: 0 auto; }
.land-nav .brand { text-decoration: none; color: var(--text); }
.land-nav nav { display: flex; gap: var(--s5); flex: 1; justify-content: center; }
.land-nav nav a { color: var(--muted); text-decoration: none; font-size: 14px; } .land-nav nav a:hover { color: var(--text); }
.land-hero { max-width: 1180px; margin: 0 auto; padding: var(--s7) var(--s6); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s7); align-items: center; }
.land-copy { display: flex; flex-direction: column; gap: var(--s4); align-items: flex-start; }
.land-copy h1 { font-size: clamp(32px, 4.2vw, 46px); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }
.land-lede { font-size: 18px; color: var(--text-2); margin: 0; max-width: 56ch; line-height: 1.6; }
.preview { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--s4); display: grid; gap: var(--s4); }
.pv-bar { display: flex; align-items: center; gap: 6px; } .pv-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); } .pv-bar span { margin-left: 8px; font-size: 13px; color: var(--muted); }
.pv-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.pv-kpis div { background: var(--surface-3); border-radius: var(--r-sm); padding: var(--s3); display: flex; flex-direction: column; } .pv-kpis small { color: var(--muted); font-size: 12px; } .pv-kpis b { font-size: 24px; }
.pv-bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; border-bottom: 1px solid var(--line); }
.pv-bars i { flex: 1; background: var(--faint); opacity: .5; border-radius: 4px 4px 0 0; } .pv-bars i.hi { background: var(--accent); opacity: 1; } .pv-bars i.lo { background: var(--coral); opacity: .7; }
.pv-row { display: flex; gap: var(--s3); align-items: center; font-size: 14px; }
.preview figcaption { font-size: 12px; color: var(--muted); }
.land-sec { max-width: 1180px; margin: 0 auto; padding: var(--s7) var(--s6); display: flex; flex-direction: column; gap: var(--s5); }
.land-plans { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.land-plans > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); box-shadow: var(--shadow); align-items: flex-start; min-width: 0; }
.land-plans > li.featured { border-color: var(--accent, #7c5cff); }
.land-plans h3 { margin: 0; font-size: 20px; } .land-plans p { margin: 0; }
.land-plans .plan-price b { font-size: 34px; letter-spacing: -.02em; } .land-plans .plan-price span { color: var(--muted); font-size: 14px; }
.land-plans ul { list-style: disc; padding-left: 18px; margin: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.land-plans .btn { margin-top: var(--s3); }
.land-billing { margin: var(--s4) 0; }
.land-plans .plan-save { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.why-viz { display: flex; flex-direction: column; gap: var(--s4); }
.why-grid { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.why-card { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.why-card.chat { background: var(--surface-2, var(--surface)); opacity: .96; }
.why-card.coach { border-color: var(--accent, #7c5cff); box-shadow: 0 0 0 1px var(--accent, #7c5cff) inset, var(--shadow); }
.why-card header { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.why-tag { font-weight: 700; font-size: 16px; } .why-note { color: var(--muted); font-size: 13px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--accent, #7c5cff); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--line); color: var(--text-2, var(--text)); border-bottom-left-radius: 4px; display: flex; flex-direction: column; gap: 6px; }
.bubble.ai i { display: block; height: 7px; border-radius: 4px; background: var(--muted); opacity: .35; width: 100%; } .bubble.ai i.s { width: 60%; }
.why-q { margin: 0; color: var(--muted); font-size: 14px; font-style: italic; }
.why-chips { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.why-chips li { font-size: 13px; padding: 5px 10px 5px 26px; border-radius: 999px; position: relative; border: 1px solid var(--line); }
.why-chips li::before { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-weight: 700; font-size: 12px; }
.why-chips.no li { color: var(--muted); } .why-chips.no li::before { content: '\2715'; color: #d9534f; }
.why-chips.yes li { background: color-mix(in srgb, #2ea36b 12%, transparent); border-color: color-mix(in srgb, #2ea36b 40%, var(--line)); } .why-chips.yes li::before { content: '\2713'; color: #2ea36b; }
.why-chart { position: relative; border-radius: var(--r-sm, 10px); background: var(--surface-2, var(--bg)); border: 1px solid var(--line); padding: var(--s3); }
.why-chart svg { width: 100%; height: 130px; display: block; }
.ret-line { stroke: var(--accent, #7c5cff); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.ret-fill { fill: color-mix(in srgb, var(--accent, #7c5cff) 14%, transparent); }
.ret-mark { stroke: #d9534f; stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.ret-dot { fill: #d9534f; }
.ret-tip { position: absolute; right: 8%; top: 10px; font-size: 12px; font-weight: 600; color: #d9534f; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.why-says { display: flex; flex-direction: column; gap: 4px; padding: var(--s3) var(--s4); border-radius: var(--r-sm, 10px); background: color-mix(in srgb, var(--accent, #7c5cff) 12%, transparent); border-left: 3px solid var(--accent, #7c5cff); }
.why-says b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent, #7c5cff); } .why-says span { font-size: 15px; font-weight: 600; }
.why-loop { list-style: none; padding: 0; margin: 0; display: flex; align-items: stretch; gap: 22px; flex-wrap: wrap; }
.why-loop li { flex: 1 1 130px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 14px; font-weight: 500; position: relative; min-width: 0; }
.why-loop li:not(:nth-last-child(-n+2))::after { content: '\2192'; position: absolute; right: -17px; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 1; background: var(--bg); }
.loop-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent, #7c5cff); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.why-loop li.loop-back { flex: 1 1 100%; justify-content: center; border-style: dashed; color: var(--muted); }
.why-loop li.loop-back::before { content: '\21BB'; font-size: 16px; }
@media (max-width: 900px) { .land-plans { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .why-grid { grid-template-columns: 1fr; } .why-loop li:not(:nth-last-child(-n+2))::after { display: none; } .why-loop li { flex-basis: 100%; } }
.land-sec h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.02em; font-weight: 700; }
.land-steps, .land-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.land-steps li, .land-feats li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); box-shadow: var(--shadow); }
.land-steps h3, .land-feats h3 { margin: 0; font-size: 17px; } .land-steps p, .land-feats p { margin: 0; color: var(--muted); }
.step-n { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.land-trust { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); max-width: 1120px; margin-top: var(--s5); }
.land-trust p { margin: 0; max-width: 78ch; }
.land-final { text-align: center; padding: var(--s7) var(--s6); display: flex; flex-direction: column; gap: var(--s4); align-items: center; }
.land-final h2 { font-size: clamp(26px, 3.4vw, 34px); }
.top { background: var(--surface); }
@media (max-width: 900px) {
  .land-hero { grid-template-columns: 1fr; padding: var(--s6) var(--s4); gap: var(--s6); }
  .land-steps, .land-feats, .land-plans { grid-template-columns: 1fr; }
  .land-nav { padding: var(--s3) var(--s4); } .land-nav nav { display: none; }
  .land-sec { padding: var(--s6) var(--s4); }
}
.choice.ghosty { border-style: dashed; color: var(--muted); }

/* ---- mobile pass: nothing may run past the screen edge ---- */
.bdg { white-space: normal; max-width: 100%; overflow-wrap: anywhere; line-height: 1.35; }
.panel, .opp, .kpi, .cat-card, .kcard, .why, .land-steps li, .land-feats li { min-width: 0; overflow-wrap: anywhere; }
.mobile-only { display: none; }
.ws-chan { display: grid; gap: 2px; padding-bottom: var(--s3); border-bottom: 1px solid var(--line); }
img, svg, video { max-width: 100%; }
.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kv dd, .kv dt { min-width: 0; overflow-wrap: anywhere; }
.opp .row.wrap { min-width: 0; }
@media (max-width: 960px) {
  .mobile-only { display: grid; }
  .chsel { display: none; }
  .crumb .muted { display: none; }
  .page-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar { min-height: 56px; gap: var(--s2); }
  .topbar-right { gap: var(--s2); }
  .topbar .btn.primary { padding: 0; width: 40px; }
  input, select, textarea { font-size: 16px; }
  .btn, .tab, .ws-link, .menu-item, .choice, .seg button { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .btn.small { min-height: 40px; }
  .toolbar > * { flex: 1 1 100%; }
  .toolbar .seg { overflow-x: auto; }
  .seg { max-width: 100%; }
  .tabs { overflow-x: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 24px; }
  .opp-list, .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .row.between { flex-wrap: wrap; }
  .panel { padding: var(--s4); }
  .dlg { width: 100%; }
  .dlg-back { align-items: end; padding: 0; }
  .dlg { border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; }
  .cal-label { min-width: 0; }
  .land-hero h1 { overflow-wrap: anywhere; }
  .menu-panel { max-width: calc(100vw - 24px); }
  .toasts { left: var(--s3); right: var(--s3); }
}
@media (max-width: 520px) {
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .ws-main { padding: var(--s4) var(--s3); }
  .chiprow { gap: var(--s2); }
  .choice { padding: 9px 14px; font-size: 14px; }
  .choice-input { width: 100%; }
  .pv-kpis { grid-template-columns: 1fr; }
}
.opp .hook { font-size: 15px; line-height: 1.5; font-family: var(--font-body); }
@media (max-width: 960px) {
  .page-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; line-height: 1.25; }
  .row.gap.wrap > input.grow { flex: 1 1 100%; min-width: 0; }
}

/* charts and tiles must shrink to the screen, however many bars there are */
.ins-bars { gap: 2px; min-width: 0; overflow: hidden; }
.ins-bar { min-width: 0; }
.perf, .perf-plot { min-width: 0; max-width: 100%; }
@media (max-width: 960px) {
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .ins-bars { height: 140px; }
  .epheader { min-width: 0; }
  .epheader input { min-width: 0; max-width: 100%; }
}
@media (max-width: 960px) {
  .ep-h1 { margin: 0; width: 100%; font-size: 24px; padding: 6px 8px; box-sizing: border-box; }
  .epheader h1 { font-size: 24px; }
}
@media (max-width: 520px) {
  .epbar { padding: 0 12px; gap: 8px; min-width: 0; }
  .epbar-right { gap: 8px; flex: none; }
  .epbar-right .btn { padding: 0 12px; white-space: nowrap; }
  .epbar-right .btn.small[aria-pressed] { display: none; }
  .stepbar { min-width: 0; max-width: 100%; }
  .stepbar li { gap: 6px; min-width: 0; }
  .stepbar li + li::before { margin: 0 4px; min-width: 8px; width: auto; }
  .pubgrid { grid-template-columns: minmax(0, 1fr); }
  .kcards { min-width: 0; }
}

textarea.ep-h1 { resize: none; overflow: hidden; display: block; box-sizing: border-box; color: var(--text); }
.cal-daylist { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
.cal-daylist-item { display: flex; gap: var(--s2); align-items: center; text-align: left; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); min-height: 44px; }
.cal-day.sel { border-color: var(--accent-line); }
@media (max-width: 720px) {
  .cal-daylist { display: flex; }
  .cal-grid:not(.week) .cal-day { min-height: 52px; padding: 4px; cursor: pointer; align-items: center; }
  .cal-grid:not(.week) .cal-day ul { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
  .cal-grid:not(.week) .cal-ep { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--accent); overflow: hidden; }
  .cal-grid:not(.week) .cal-ep.idea { background: var(--idea); } .cal-grid:not(.week) .cal-ep.scripting { background: var(--script); }
  .cal-grid:not(.week) .cal-ep.ready { background: var(--shoot); } .cal-grid:not(.week) .cal-ep.published { background: var(--published); }
  .cal-grid:not(.week) .cal-ep > button { font-size: 0; padding: 0; width: 8px; height: 8px; pointer-events: none; }
  .cal-dow { padding: 4px 0; text-align: center; font-size: 11px; }
  .cal-grid:not(.week) .cal-num { font-size: 12px; }
  .toolbar > .seg:last-child { flex: 0 0 auto; }
}
@media (max-width: 960px) { .cal-day.tall { min-height: 84px; } }

/* Plan & billing */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface-2, transparent); min-width: 0; }
.plan-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card h3 { margin: 0 0 4px; font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-price { margin: 0 0 8px; font-size: 1.4rem; }
.plan-role { margin: -2px 0 8px; color: var(--accent, inherit); font-weight: 600; font-size: .9rem; }
.plan-card ul { margin: 0; padding-left: 18px; }
.plan-card li { margin: 4px 0; }
@media (max-width: 640px) { .plan-grid { grid-template-columns: 1fr; } }

/* Views-per-video chart (src/ui/PerfChart.jsx) */
.perf { --perf-h: 200px; --perf-gutter: 40px; display: flex; flex-direction: column; gap: 10px; }
.perf-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); }
.perf-legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.perf .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.perf-plot { display: grid; grid-template-columns: var(--perf-gutter) minmax(0, 1fr); height: var(--perf-h); margin-top: 6px; }
.perf-y { position: relative; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.perf-y span { position: absolute; right: 8px; transform: translateY(50%); line-height: 1; }
.perf-y .perf-y-med { color: var(--text-2); font-weight: 600; }
.perf-area { position: relative; border-bottom: 1px solid var(--line-strong); min-width: 0; }
.perf-grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); opacity: .6; pointer-events: none; }
.perf-med { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--text-2); opacity: .7; pointer-events: none; z-index: 2; }
.perf-cols { position: absolute; inset: 0; display: flex; align-items: stretch; }
.perf-col { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; border: 0; background: transparent; border-radius: 4px 4px 0 0; cursor: pointer; }
.perf-col:hover, .perf-col.on { background: color-mix(in srgb, var(--text) 7%, transparent); }
.perf-col:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.perf-bar { display: block; width: 100%; max-width: 18px; border-radius: 3px 3px 0 0; background: var(--faint); opacity: .55; transition: opacity .12s; }
.perf-bar.high { background: var(--ok); opacity: .85; }
.perf-bar.low { background: var(--danger); opacity: .7; }
.perf-bar.raw { background: var(--accent); opacity: .75; }
.perf-col.on .perf-bar, .perf-col:hover .perf-bar { opacity: 1; }
.perf .sw.high { background: var(--ok); } .perf .sw.mid { background: var(--faint); } .perf .sw.low { background: var(--danger); }
.perf-x { display: flex; justify-content: space-between; padding-left: var(--perf-gutter); font-variant-numeric: tabular-nums; margin-top: -4px; }
.perf-note { margin: 0; padding-left: var(--perf-gutter); }
.perf-read { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.perf-read-title { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.perf-read-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.perf-read-views { font-weight: 600; font-variant-numeric: tabular-nums; }
.perf-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
@media (max-width: 600px) { .perf { --perf-h: 170px; --perf-gutter: 34px; } .perf-col { padding: 0 .5px; } }
@media (prefers-reduced-motion: reduce) { .perf-bar { transition: none; } }

.tbl td.nowrap { white-space: nowrap; }

/* Script page (src/views/ScriptWrite.jsx) */
.sw-grid { grid-template-columns: 250px minmax(0, 1fr) 300px; }
.sw-rail.left { gap: 12px; }
.sw-length { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
.sw-length-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sw-length-num { font-variant-numeric: tabular-nums; font-size: 15px; }
.sw-meter { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sw-meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .2s; }
.sw-length.on .sw-meter i { background: var(--ok); }
.sw-length.long .sw-meter i { background: var(--warn); }
.sw-outline-head { margin-top: 8px; padding: 0 4px; }
.sw-hint { padding: 0 4px; margin: 0; }
.sw-outline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sw .outline-link { width: 100%; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14.5px; position: relative; }
.sw .outline-link.on { background: var(--surface); color: var(--text); }
.sw .outline-link.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.ol-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.outline-link.on .ol-num { background: var(--accent); color: var(--on-accent); }
.ol-body { display: grid; gap: 6px; min-width: 0; }
.ol-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-bar { height: 3px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.ol-bar i { display: block; height: 100%; background: var(--line-strong); border-radius: 3px; }
.outline-link.on .ol-bar i { background: var(--accent-line); }
.ol-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* the writing page: a coloured layer under a transparent textarea, same font and box so they match exactly */
.sw-paper { position: relative; width: min(780px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.sw-paper:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.sw-hl, .sw-input { box-sizing: border-box; margin: 0; border: 0; padding: 56px 72px 72px; font: 19px/1.8 var(--font-body); letter-spacing: normal; word-spacing: normal; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; text-rendering: optimizeLegibility; }
.sw-hl { color: var(--text); min-height: 480px; pointer-events: none; }
.sw-input { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; overflow: hidden; background: transparent; color: transparent; caret-color: var(--text); outline: none; border-radius: 16px; }
.sw-input::placeholder { color: var(--faint); }
.sw-input::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: transparent; }
.hl-headline { color: var(--highlight); }
.hl-mark { color: var(--faint); }
.hl-head { color: var(--highlight); }
.hl-note { color: var(--muted); background: color-mix(in srgb, var(--warn) 9%, transparent); border-radius: 4px; }
.sw-hl .hl-headline { display: inline; }

.sw-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.sw-dot.saved { background: var(--ok); }
.sw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-chips .chip.tone { text-transform: capitalize; }
.railcard .sw-restore { align-self: flex-start; padding-left: 0; padding-right: 0; }
.sw-redraft { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); font-weight: 600; }
.sw-btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-key { gap: 10px; }
.sw-key-row { display: grid; gap: 4px; }
.sw-key code { justify-self: start; font-size: 13px; padding: 2px 8px; background: var(--surface-2); }
.sw.focus .sw-paper { width: min(820px, 100%); }

@media (max-width: 960px) {
  .sw-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* the outline becomes one sticky strip of parts above the page */
  .sw-rail.left { position: sticky; top: 60px; z-index: 5; flex-direction: row; align-items: center; gap: 8px; padding: 10px 0; margin: 0 -16px; padding-left: 16px; padding-right: 16px; background: var(--bg); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .sw-rail.left::-webkit-scrollbar { display: none; }
  .sw-rail.left .sw-outline-head, .sw-rail.left .sw-hint, .sw-length .eyebrow, .sw-length > .muted, .ol-bar, .ol-num { display: none; }
  .sw-length { flex: none; padding: 6px 12px; border-radius: 999px; grid-template-columns: auto 48px; align-items: center; gap: 8px; }
  .sw-length-num { font-size: 13px; }
  .sw-meter { height: 4px; }
  .sw-outline { display: flex; gap: 6px; }
  .sw .outline-link { display: inline-flex; width: auto; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
  .sw .outline-link.on { border-color: var(--accent-line); background: var(--accent-soft); }
  .sw .outline-link.on::before { display: none; }
  .ol-name { overflow: visible; }
  .sw-main { padding: 16px 0; }
  .sw-hl, .sw-input { padding: 28px 22px 40px; font-size: 17.5px; line-height: 1.75; }
  .sw-hl { min-height: 360px; }
  .sw-rail.right { padding-top: 8px; }
  .epbar-right .sw-status { display: none; }
}

/* Settings > Preferences > Coach emails */
.toggle-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.toggle-row:hover { border-color: var(--line-strong); }
.toggle-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; min-width: 0; padding: 0; }
.toggle-row > span { display: grid; gap: 2px; }

.plan-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-card .btn { margin-top: var(--s3); align-self: flex-start; }
@media (max-width: 900px) { .plan-grid.three { grid-template-columns: 1fr; } }

/* Pricing: centred, in the app's own palette; the middle plan is lifted by an accent border, not by glow */
.land-pricing { align-items: stretch; text-align: left; }
.land-billing { margin: var(--s3) 0 var(--s4); display: flex; justify-content: center; }
.bill-toggle { position: relative; display: inline-flex; gap: 3px; padding: 4px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); }
.bill-toggle button { background: none; border: 0; border-radius: 999px; padding: 8px 24px; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.bill-toggle button.on { background: var(--accent); color: var(--on-accent); }
.bill-off { position: absolute; top: -14px; right: -22px; background: var(--accent-soft); color: var(--highlight); border: 1px solid var(--accent-line); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.land-pricing .land-plans { width: 100%; align-items: stretch; margin-top: var(--s5); text-align: left; }
.land-plans > li { position: relative; }
.land-plans > li[data-tier="creator"] { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 40%); transform: translateY(-10px); }
.land-plans > li .plan-role { color: var(--highlight); }
.tier-pill { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.land-plans > li[data-tier="studio"] .tier-pill { background: var(--surface-3); color: var(--text); border: 1px solid var(--line); }
.land-plans .btn { width: 100%; }
.land-plans > li > ul { list-style: none; padding: 0; } .land-plans > li > ul > li { position: relative; padding-left: 24px; }
.land-plans > li > ul > li::before { content: '✓'; position: absolute; left: 0; top: 1px; width: 17px; height: 17px; border-radius: 50%; background: var(--accent-soft); color: var(--highlight); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
@media (max-width: 900px) { .land-plans > li[data-tier="creator"] { transform: none; } .bill-off { right: -6px; } }
.feat-where { margin-top: auto; padding-top: var(--s2); color: var(--highlight); font-size: 12.5px; font-weight: 600; }

/* Coach home */
.coach-card { display: flex; flex-direction: column; gap: var(--s4); border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 55%); }
.coach-top { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; }
.coach-loop { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s2); flex-wrap: wrap; }
.coach-loop li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 600; }
.coach-loop .loop-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 11.5px; }
.coach-loop li.done { color: var(--text); } .coach-loop li.done .loop-dot { background: var(--accent-soft); color: var(--highlight); }
.coach-loop li.now { border-color: var(--accent); color: var(--text); } .coach-loop li.now .loop-dot { background: var(--accent); color: var(--on-accent); }
.coach-body { display: flex; gap: var(--s4); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.coach-head { margin: 4px 0; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -.01em; }
.coach-body p { margin: 0; max-width: 60ch; }
@media (max-width: 640px) { .coach-body { flex-direction: column; align-items: stretch; } .coach-body > .grow { width: 100%; } .coach-body .btn { width: 100%; } }

.ws-group { margin: var(--s3) 0 2px; padding: 0 var(--s3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint, var(--muted)); font-weight: 700; }
.read-card { display: flex; flex-direction: column; gap: var(--s3); }
.read-card.done { border-color: var(--accent-line); }
.loop-subs { display: inline-flex; gap: 6px; margin-left: 4px; font-style: normal; font-weight: 500; font-size: 12px; } .loop-subs i { font-style: normal; color: var(--muted); } .loop-subs i.on { color: var(--highlight); } .loop-subs i + i::before { content: '·'; margin-right: 6px; color: var(--faint, var(--muted)); }
.kempty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); padding: var(--s2) 0; } .kempty p { margin: 0; font-size: 13px; }
.land-promise { margin: 0; font-size: clamp(18px, 2.2vw, 22px); font-weight: 600; color: var(--highlight); letter-spacing: -.01em; }

/* Big loading screen for the long AI jobs (JobLoader.jsx). Theme colours only. */
.jl { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s6); align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: var(--s6); }
.jl-copy { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.jl-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--highlight); border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; }
.jl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: jl-pulse 1.6s ease-in-out infinite; }
.jl h2 { margin: 0; font-size: clamp(24px, 3.6vw, 36px); line-height: 1.15; letter-spacing: -.015em; }
.jl-sub { margin: 0; max-width: 46ch; color: var(--text-2); line-height: 1.55; }
.jl-live { margin: 0; font-size: 13px; color: var(--muted); }
.jl-live b { color: var(--text); font-weight: 600; }
.jl-foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s2); }
.jl-card { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.jl-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.jl-steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14.5px; }
.jl-steps li.now { color: var(--text); font-weight: 600; }
.jl-steps li.done { color: var(--text-2); }
.jl-mark { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; flex: none; color: var(--on-accent); }
.jl-steps li.done .jl-mark { background: var(--ok); border-color: var(--ok); }
.jl-steps li.now .jl-mark { border-color: var(--accent); border-top-color: transparent; animation: jl-spin .9s linear infinite; }
.jl-track { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.jl-track span { display: block; height: 100%; border-radius: 6px; background: var(--accent); transition: width .7s ease; }
@keyframes jl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes jl-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) { .jl { grid-template-columns: 1fr; padding: var(--s5); } }
@media (prefers-reduced-motion: reduce) { .jl-dot, .jl-steps li.now .jl-mark { animation: none; } .jl-track span { transition: none; } }

/* Small running bar (JobBar) and the "Loading" state (kit.jsx). Moving parts only, no fake numbers. */
.jb { align-items: center; }
.jb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.jb-phrase { font-weight: 600; font-size: 14px; animation: jb-in .5s ease both; }
.jb-real { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jb-track { position: relative; height: 3px; border-radius: 3px; background: var(--accent-line); overflow: hidden; }
.jb-track i { position: absolute; inset: 0 auto 0 0; width: 38%; border-radius: 3px; background: var(--accent); animation: jb-slide 1.5s ease-in-out infinite; }
@keyframes jb-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(270%); } }
@keyframes jb-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.loading { display: flex; flex-direction: column; gap: 10px; padding: var(--s4) 0; color: var(--muted); }
.loading-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.loading-line { height: 12px; border-radius: 6px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: dot-bounce 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot-bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .jb-track i, .dots i, .jb-phrase { animation: none; } .jb-track i { width: 100%; opacity: .5; } }

/* The coach's step strip (CoachSteps.jsx). */
.csteps { display: flex; align-items: center; gap: var(--s3); justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--s4); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.csteps ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
.csteps li { display: flex; align-items: center; }
.csteps li + li::before { content: ''; width: 18px; height: 1px; background: var(--line-strong); margin-right: 4px; }
.csteps li button { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: 999px; padding: 4px 12px 4px 4px; color: var(--muted); text-align: left; }
.csteps li button:hover { background: var(--surface-2); color: var(--text); }
.cs-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; flex: none; }
.cs-text { display: flex; flex-direction: column; line-height: 1.2; }
.cs-text b { font-size: 13.5px; font-weight: 600; }
.cs-text small { font-size: 11.5px; color: var(--muted); }
.csteps li.done .cs-dot { background: var(--accent-soft); border-color: var(--accent-line); color: var(--highlight); }
.csteps li.now button { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.csteps li.now .cs-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (max-width: 760px) { .csteps li + li::before { display: none; } .cs-text small { display: none; } .cs-next { width: 100%; } }

/* First-visit tour */
.tour { position: fixed; inset: 0; z-index: 200; }
.tour-dim { position: fixed; background: rgba(0, 0, 0, .55); }
.tour-catch { position: fixed; inset: 0; }
.tour-ring { position: fixed; border: 2px solid var(--accent); border-radius: var(--r); pointer-events: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
.tour-card { position: fixed; width: min(320px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); outline: none; height: auto; max-height: calc(100vh - 24px); overflow: auto; }
.tour-mid { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--s4); pointer-events: none; }
.tour-mid .tour-card { position: static; width: min(380px, 100%); pointer-events: auto; }
.tour-card h3 { margin: 0; }
.tour-card p { margin: 0 0 var(--s2); }
.feat-more { padding-top: var(--s2); font-size: 14px; font-weight: 600; }

/* Confirm dialogs on mobile: a compact bottom sheet (label + value on one line) instead of a tall, sparse list. */
@media (max-width: 640px) {
  .dlg header { padding: var(--s3) var(--s4); }
  .dlg .dlg-body { padding: var(--s4); }
  .dlg footer { padding: var(--s3) var(--s4); }
  .dlg .kv { grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; align-items: baseline; }
  .dlg .kv dt { margin-top: 0; }
  .dlg .kv dd { text-align: right; font-weight: 500; }
}

/* Voice-sample capture in Settings → Channel. The single biggest personalization lever. */
.voice-block { border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s2); }
.voice-block h3 { margin: 0; }
.voice-block textarea.editor { box-sizing: border-box; }

/* Cookie-consent banner: opt-in for the optional public-page analytics. Slim, bottom, theme-aware. */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--surface); border-top: 1px solid var(--line-strong); box-shadow: 0 -6px 24px rgba(0,0,0,.14); }
.consent-in { max-width: 920px; margin: 0 auto; padding: 14px 20px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.consent-text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); flex: 1; min-width: 240px; }
.consent-text a { color: var(--accent); }
.consent-btns { display: flex; gap: 10px; flex: none; }
.consent-btns .btn { min-height: 38px; }
@media (max-width: 560px) {
  .consent-in { padding: 12px 16px; gap: 10px; }
  .consent-btns { width: 100%; }
  .consent-btns .btn { flex: 1; }
}

/* Blog admin dashboard: editor + live preview. */
.field .lbl { font-size: 13px; font-weight: 600; color: var(--text); }
.field .lbl .muted { font-weight: 400; }
.blog-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; margin-top: var(--s4); }
.blog-edit-grid > .card { min-width: 0; }
.blog-edit-grid .blog-body-input { min-height: 320px; font: 14px/1.6 var(--font-mono); }
.blog-edit-grid .blog-article { max-height: 70vh; overflow: auto; }
.blog-edit-actions { margin-top: var(--s4); position: sticky; bottom: 0; background: var(--bg); padding: var(--s3) 0; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .blog-edit-grid { grid-template-columns: 1fr; }
  .blog-edit-grid .blog-article { max-height: none; }
}

/* AI Seed Section — the glassmorphism card with animated gradient. */
.seed-section { margin: var(--s4) 0; }
.seed-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
  padding: var(--s5);
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 32px -8px color-mix(in srgb, var(--accent) 18%, transparent);
}
.seed-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%);
  pointer-events: none;
}
.seed-header { display: flex; gap: var(--s4); align-items: flex-start; position: relative; }
.seed-icon-wrap {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}
.seed-icon { width: 22px; height: 22px; }
.seed-title { font-size: 16px; font-weight: 650; color: var(--text); margin: 0 0 4px; }
.seed-desc { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; max-width: 56ch; }
.seed-actions { position: relative; margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.seed-progress { margin: 0; }

/* The seed button: animated gradient background, vibrant */
.seed-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border: none; border-radius: var(--r);
  font: 600 14px/1 var(--font-body);
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #8B5CF6, #A78BFA);
  background-size: 200% 200%;
  animation: seed-gradient 4s ease infinite;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .15s, box-shadow .15s, opacity .15s;
  width: max-content;
}
.seed-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 50%, transparent); }
.seed-btn:active:not(:disabled) { transform: translateY(0); }
.seed-btn:disabled { opacity: .7; cursor: wait; }
.seed-btn.seeding { background: var(--surface-2); color: var(--text); box-shadow: none; animation: none; }

@keyframes seed-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Spinner for the loading state */
.seed-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  border-radius: 50%;
  animation: seed-spin .7s linear infinite;
}
@keyframes seed-spin { to { transform: rotate(360deg); } }

/* Results panel */
.seed-results { position: relative; margin-top: var(--s4); display: flex; flex-direction: column; gap: 8px; }
.seed-success {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--ok-text);
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}
.seed-post-link {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.seed-post-link:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.seed-post-title { font-size: 14px; font-weight: 600; color: var(--text); }
.seed-post-url { font-size: 12px; color: var(--muted); }
.seed-error {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--danger-text);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}

@media (max-width: 560px) {
  .seed-header { flex-direction: column; gap: var(--s3); }
  .seed-card { padding: var(--s4); }
}

/* Welcome toolkit: the "Your plan" screen. */
.plan-head { margin-bottom: var(--s2); }
.plan-head h1 { margin: 6px 0 8px; }
.plan .lede2 { color: var(--muted); max-width: 60ch; line-height: 1.6; }
.plan-sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: slot; }
.plan-sched li { display: flex; align-items: center; gap: 14px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.plan-sched li.next { border-color: var(--accent); background: var(--surface-2); }
.plan-when { display: flex; flex-direction: column; gap: 3px; min-width: 128px; }
.plan-when .bdg { align-self: flex-start; }
.plan-title { font-weight: 600; }
.plan-sched .grow { min-width: 0; }
.plan-chart { width: 100%; height: auto; display: block; }
.plan-grid { stroke: var(--line); stroke-width: 1; }
.plan-axis { fill: var(--muted); font-size: 11px; }
.plan-val { fill: var(--text); font-size: 12px; font-weight: 600; }
.plan-area { fill: var(--accent); opacity: .12; }
.plan-line { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.plan-dot { fill: var(--accent); }
.plan-road { display: flex; gap: var(--s4); flex-wrap: wrap; margin-top: 4px; }
.plan-road > div { display: flex; flex-direction: column; }
.plan-road b { font-size: 26px; line-height: 1.1; color: var(--text); }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-steps li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.plan-steps li > svg { color: var(--accent); flex: none; margin-top: 3px; }
@media (max-width: 560px) {
  .plan-sched li { flex-wrap: wrap; }
  .plan-when { min-width: 0; flex-direction: row; align-items: center; gap: 8px; width: 100%; }
  .plan-road { gap: var(--s3); }
  .plan-road > div { flex: 1; min-width: 80px; }
}

/* Give the Disconnect & delete button room from the channel list above it. */
.yt-conn > .btn { margin-top: 12px; }

/* Custom calendar entries (the creator's own notes/plans), distinct from scheduled videos. */
.cal-note { border-left: 3px dashed var(--muted); background: var(--surface-3); border-radius: 4px; min-width: 0; max-width: 100%; }
.cal-note > span { display: block; width: 100%; box-sizing: border-box; padding: 4px 6px; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot.note { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); }
.cal-daylist-item.note { color: var(--text); }
.cal-note-x { margin-left: auto; width: 28px; height: 28px; min-height: 0; padding: 0; color: var(--muted); flex: none; }
.cal-addnote { display: flex; gap: var(--s2); margin-top: var(--s2); }
.cal-addnote input { flex: 1; min-width: 0; }
.cal-addnote .btn { flex: none; }
@media (max-width: 800px) {
  .cal-grid:not(.week) .cal-note { width: 10px; height: 10px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1.5px var(--muted); background: none; overflow: hidden; }
  .cal-grid:not(.week) .cal-note > span { font-size: 0; padding: 0; width: 10px; height: 10px; pointer-events: none; }
}

/* Google-Calendar-style: click a day to open a quick add/view dialog. */
.cal-day { cursor: pointer; }
.cal-day .cal-ep, .cal-day .cal-note { cursor: default; }
.cal-daymodal { display: flex; flex-direction: column; gap: var(--s2); }
.cal-daymodal .cal-addnote { margin-top: var(--s2); }

/* Channel audit */
.audit-main { width: 100%; max-width: 1232px; }
.audit-channel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.audit-channel h1, .audit-channel p { margin: 0; }
.audit-channel .eyebrow { margin-bottom: 4px; }
.audit-report { display: grid; gap: 20px; margin-top: 16px; }
.audit-report > *, .audit-report .glance > div { min-width: 0; }
.audit-report h2, .audit-report .small, .audit-uploads h3, .audit-uploads h4, .audit-uploads p, .audit-report > p { margin: 0; }
.audit-report .glance h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 2px; }
.audit-report .glance p { overflow-wrap: anywhere; }
.audit-report .glance .btn { margin-top: 12px; white-space: normal; }
.audit-continue { margin-top: 12px; }
.audit-continue h2, .audit-continue p { margin: 0; }
.audit-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.audit-totals dt { order: 1; color: var(--muted); font-size: 13px; }
.audit-totals dd { margin: 0; font: var(--display-weight) 24px var(--font-display); }
@media (max-width: 640px) { .audit-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.audit-uploads { gap: 12px; }
.audit-uploads summary { cursor: pointer; font-weight: 650; }
.audit-uploads[open] > summary { margin-bottom: 12px; }
.audit-traffic-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.audit-upload-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.audit-upload-list h3 { margin: 0 0 4px; overflow-wrap: anywhere; }
.audit-upload-list p { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.audit-section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.audit-section-title .icon { color: var(--accent); }

/* Extras for the static feature pages; everything else comes from the app's own stylesheets. */
.fp .land-sec { padding-top: var(--s6); padding-bottom: var(--s2); }
.fp .fp-hero { padding-top: var(--s6); align-items: flex-start; }
.fp h1 { font-size: clamp(30px, 4.2vw, 44px); line-height: 1.1; letter-spacing: -.03em; font-weight: 700; margin: 0; max-width: 24ch; }
.fp-tag { align-self: flex-start; }
.fp-text { margin: 0; max-width: 72ch; font-size: 17px; color: var(--text-2); line-height: 1.7; }
.fp-note { margin: 0; max-width: 64ch; }
.fp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
.fp-tick { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.fp-tick li { position: relative; padding-left: 26px; color: var(--text-2); }
.fp-tick li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.fp-faq .fp-q { padding: var(--s3) 0; border-top: 1px solid var(--line); max-width: 78ch; }
.fp-faq .fp-q h3 { margin: 0 0 4px; font-size: 17px; }
.fp-faq .fp-q p { margin: 0; color: var(--muted); }
.feat-more { margin-top: auto; font-size: 14px; font-weight: 600; }
.land-nav .row { display: flex; align-items: center; gap: var(--s3); }
@media (max-width: 960px) { .fp-two { grid-template-columns: 1fr; } .fp .land-sec { padding-left: var(--s4); padding-right: var(--s4); } }

/* Card links used by feature "keep exploring" and blog lists */
.fcard { display: block; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); transition: border-color .12s, background .12s; }
.fcard:hover { border-color: var(--accent); background: var(--surface-2); }
.fcard small { color: var(--highlight); font-weight: 600; font-size: 12.5px; }
.fcard h3 { margin: 6px 0 4px; font-size: 18px; }
.fcard p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* Blog */
.blog-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.blog-card { display: block; }
.blog-card small { color: var(--highlight); font-weight: 600; }
.blog-card h3 { margin: 6px 0 4px; }
.blog-article { max-width: 760px; }
.blog-article > h1 { margin-bottom: var(--s2); }
.blog-meta { margin: 0 0 var(--s3); font-size: 14px; }
.blog-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--s4); }
.blog-body { font-size: 17px; line-height: 1.75; color: var(--text-2); }
.blog-body > * { margin: 0 0 var(--s4); }
.blog-body h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.01em; color: var(--text); margin-top: var(--s6); }
.blog-body h3 { font-size: 19px; color: var(--text); margin-top: var(--s5); }
.blog-body a { color: var(--accent); }
.blog-body ul, .blog-body ol { padding-left: 1.4em; display: grid; gap: 6px; }
.blog-body li { margin: 0; }
.blog-body blockquote { margin: var(--s4) 0; padding: var(--s2) var(--s4); border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text); font-style: italic; }
.blog-body blockquote p { margin: 0; }
.blog-body code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .9em; }
.blog-body pre { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s4); overflow-x: auto; }
.blog-body pre code { background: none; border: 0; padding: 0; }
.blog-body img { max-width: 100%; height: auto; border-radius: var(--r-sm); border: 1px solid var(--line); }
.blog-body hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }
@media (max-width: 640px) { .blog-body { font-size: 16px; } }
