:root {
  --navy: #0a0d3d; --navy-2: #1b1263; --ink: #1c1d2e; --ink-2: #5a5d78; --line: #dcdde8; --bg: #f3f3f8; --panel: #ffffff;
  --blue: #2f7bff; --yellow: #ffd54a; --pink: #d84ec9; --ok: #1f9d55; --warn: #d9850b; --bad: #d23f3f;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Outfit, system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 700; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.warn-text { color: var(--warn); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
code { background: #ebecf4; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
ul.plain { padding-left: 18px; }

/* top bar */
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; height: 54px; position: sticky; top: 0; z-index: 20; }
.topbar::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, #ff6a3d, #d84ec9, #3fb9ff); }
.brand { color: #fff; font-weight: 700; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #ff6a3d, #d84ec9 55%, #3fb9ff); }
.brand-sub { color: #9aa0d6; font-weight: 400; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: #d6d8f3; }
.topbar nav a:hover { color: #fff; }
.who { color: #9aa0d6; }
.foot { text-align: center; color: var(--ink-2); font-size: 13px; padding: 30px 0 40px; }

.page { max-width: 1100px; margin: 0 auto; padding: 26px 22px; }
body.wide .page { max-width: 1500px; }
.narrow { max-width: 440px; margin: 40px auto; }

/* cards, forms */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.card.empty { color: var(--ink-2); text-align: center; padding: 40px; }
.form label, .card label { display: block; font-size: 13px; color: var(--ink-2); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink);
}
input[type=color] { width: 100%; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
input[readonly], textarea[readonly] { background: #f7f7fb; color: #555; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd3ff; border-color: var(--blue); }
input.num { width: 90px; }
input.big { font-size: 17px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; margin-bottom: 12px; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.row.gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.label { font-size: 13px; color: var(--ink-2); margin: 10px 0 4px; }
.chk { display: inline-flex !important; align-items: center; gap: 6px; margin: 6px 12px 4px 0 !important; color: var(--ink) !important; font-size: 14px !important; }
.inline-form { display: inline; }
.inline-form .chk { margin-right: 10px !important; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; line-height: 1.2; }
.btn:hover { border-color: #b9bbd0; background: #fafaff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.tiny { padding: 2px 8px; font-size: 13px; margin-left: 2px; }
.btn input[type=file] { display: none; }

.alert { background: #fdeaea; color: #8d1f1f; border: 1px solid #f3c6c6; border-radius: 8px; padding: 10px 14px; }
.notice { background: #e9f6ee; color: #175e34; border: 1px solid #bfe3cc; border-radius: 8px; padding: 10px 14px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: #e6e7f2; color: var(--ink-2); text-transform: capitalize; }
.pill.approved, .pill.exported { background: #d9f2e3; color: #175e34; }
.pill.reviewed, .pill.review { background: #fff1d6; color: #7a4b00; }
.pill.slides, .pill.scripted, .pill.planned { background: #e1ebff; color: #1f4aa3; }
.timing { font-weight: 600; font-size: 13px; padding: 2px 8px; border-radius: 6px; }
.timing.ok { background: #d9f2e3; color: #175e34; }
.timing.warn { background: #fff1d6; color: #7a4b00; }
.timing.bad { background: #fdeaea; color: #8d1f1f; }
.timing.none { color: var(--ink-2); }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; color: var(--ink-2); font-weight: 600; background: #f8f8fc; }
.table tr:last-child td { border-bottom: 0; }
.table input { padding: 5px 8px; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.course-card { display: block; color: inherit; }
.course-card:hover { border-color: #b9bbd0; }
.course-card-title { font-weight: 700; font-size: 17px; }
.course-card-meta { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }

dialog.modal { border: 0; border-radius: 12px; padding: 22px 26px; width: 440px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,13,61,.5); }

/* app shell */
.course-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 14px; }
.head-meta { display: flex; align-items: center; gap: 8px; }
.cost { margin-left: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tab { font: inherit; font-weight: 600; background: none; border: 0; padding: 10px 14px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.loading { color: var(--ink-2); padding: 40px; text-align: center; }
.col section { margin-bottom: 16px; }
.style-preview { width: 100%; max-width: 420px; border-radius: 8px; display: block; margin-top: 8px; border: 1px solid var(--line); }
.logo-thumb { height: 40px; vertical-align: middle; background: #0a0d3d; padding: 4px; border-radius: 4px; }
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 12px; }
.fig img { width: 100%; height: 100px; object-fit: contain; background: #eef; border-radius: 6px; }
.fig input { margin: 6px 0; font-size: 13px; }

/* plan */
.runtime { display: flex; justify-content: space-between; align-items: center; }
.module { border-left: 4px solid var(--navy); }
.modnum { font-size: 12px; font-weight: 700; color: #fff; background: var(--navy); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.plan-pages { margin: 12px 0; }

/* scripts & slides */
.pages-layout { display: grid; grid-template-columns: 270px 1fr; gap: 18px; align-items: start; }
.side { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.side-mod-title { font-weight: 700; font-size: 13px; padding: 10px 8px 4px; color: var(--ink-2); }
.side-page { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 14px; background: none; border: 0; padding: 7px 8px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.side-page:hover { background: #f1f2fa; }
.side-page.active { background: #e5e9ff; font-weight: 600; }
.side-page .timing { padding: 0 5px; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #c7c9da; flex: none; }
.dot.scripted { background: #7fa6ff; } .dot.slides { background: var(--blue); } .dot.reviewed { background: var(--warn); } .dot.approved { background: var(--ok); }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.script { border-left: 4px solid var(--pink); }
.script-body { font-size: 16px; line-height: 1.6; }
.slide-row { display: grid; grid-template-columns: 1fr 360px 60px; gap: 16px; padding: 14px 0; border-top: 1px dashed var(--line); margin-top: 8px; }
.slide-row.none .cues { opacity: .9; }
.cue { display: grid; grid-template-columns: 44px 1fr 28px; gap: 8px; align-items: start; margin-bottom: 6px; }
.cue textarea { font-size: 15px; line-height: 1.55; min-height: 64px; overflow: hidden; }
.reveal input { text-align: center; padding: 6px 2px; }
.reveal.muted { text-align: center; padding-top: 8px; }
.slide-fields label { margin-top: 6px; }
.slide-fields textarea.bullets { font-family: inherit; }
.thumb { width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-top: 10px; display: block; }
.thumb.none { aspect-ratio: 1; display: none; flex-direction: column; align-items: center; justify-content: center; background: #15172b; color: #9aa0d6; font-weight: 700; letter-spacing: .08em; }
.thumb.none small { font-weight: 400; letter-spacing: 0; margin-top: 4px; }
.slide-tools { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* toasts, busy */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 50; max-width: 90vw; }
.toast.bad { background: var(--bad); }
.busy { position: fixed; inset: 0; background: rgba(243,243,248,.7); z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-weight: 600; color: var(--navy); text-align: center; padding: 20px; }
.spinner { width: 34px; height: 34px; border: 4px solid #cfd3ee; border-top-color: var(--navy); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* prompter */
.prompter-body { background: #000; color: #fff; }
.prompter { display: grid; grid-template-columns: 1fr 1fr; height: 100vh; }
.prompter-script { display: flex; align-items: center; padding: 4vh 5vw; cursor: pointer; }
.prompter-text { font-weight: 700; font-size: 4.3vh; line-height: 1.3; text-transform: uppercase; letter-spacing: .01em; }
.prompter-slide { background: #05061a; display: flex; align-items: center; justify-content: center; position: relative; }
.prompter-slide canvas { max-width: 100%; max-height: 100%; }
.prompter-noslide { display: none; flex-direction: column; align-items: center; justify-content: center; color: #8a90c4; font-size: 3vh; font-weight: 700; letter-spacing: .1em; text-align: center; line-height: 1.5; }
.prompter-noslide small { font-size: 2vh; font-weight: 400; letter-spacing: 0; }
.prompter-bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.75); padding: 6px 14px; display: flex; gap: 16px; align-items: center; font-size: 13px; }
.prompter-bar .muted { color: #9aa0d6; flex: 1; }
.atem-pill { background: #333; border-radius: 12px; padding: 2px 10px; font-weight: 700; font-size: 12px; }
.atem-pill.twobox { background: #1f4aa3; } .atem-pill.presenter { background: #175e34; } .atem-pill.slide { background: #7a4b00; } .atem-pill.wide { background: #6a2a8f; }

@media (max-width: 900px) {
  .two-col, .pages-layout, .grid4, .grid3, .grid2 { grid-template-columns: 1fr; }
  .slide-row { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .course-head { flex-direction: column; align-items: flex-start; }
}
