/* ToolSchool — charcoal, plum and mint (design/dark-reference.png) */
:root {
  color-scheme: dark;
  --bg: #151119; --bg2: #17121b; --panel: #201924; --panel2: #261d2b; --line: #3d3144; --line2: #4d3d57;
  --text: #f8f4f8; --sub: #cbbfd0; --dim: #9d8fa6; --mint: #a8f0c1; --mint-ink: #112017; --purple: #d8b2fa; --plum: #503565; --plum2: #6a4683;
  --warn: #ffd58a; --bad: #ff9b9b; --good: #a8f0c1;
  --radius: 16px; font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(ellipse at 86% 0%, #2a1c32, transparent 55%), var(--bg); color: var(--text); min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
a { color: var(--mint); }
h1, h2, h3, p { margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.2; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p, li { color: var(--sub); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--mint); color: var(--mint-ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

/* sidebar */
body > aside { align-self: start; padding: 30px 14px; border-right: 1px solid var(--line); background: var(--bg2); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
.brand { color: var(--text); font-weight: 850; font-size: 1.6rem; text-decoration: none; margin: 0 0 26px 12px; letter-spacing: -.02em; position: relative; display: inline-block; }
.brand::after { content: ''; position: absolute; left: 0; bottom: -6px; width: 46px; height: 4px; border-radius: 4px; background: var(--purple); }
nav { display: flex; flex-direction: column; gap: 4px; }
nav a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); padding: 11px 14px; border-radius: 11px; font-weight: 550; }
nav a svg { width: 20px; height: 20px; flex: none; }
nav a:hover { background: #2a2030; }
nav a[aria-current] { background: var(--plum); }
.side-bottom { margin-top: auto; display: grid; gap: 10px; padding: 0 6px; }
.side-bottom label { font-size: .85rem; color: var(--dim); }
.side-bottom select { width: 100%; }
.who { font-size: .85rem; color: var(--dim); word-break: break-all; }

main { width: min(1180px, 100%); margin: 0 auto; padding: 42px clamp(18px, 4.5vw, 64px) 80px; align-self: start; min-width: 0; }
.sub { font-size: 1.12rem; color: var(--sub); margin-bottom: 1.4em; }

/* buttons + forms */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--mint-ink); background: var(--mint); border: 1px solid transparent; border-radius: 10px; padding: 11px 18px; text-decoration: none; font: inherit; font-weight: 700; cursor: pointer; line-height: 1.2; }
.btn:hover, button:hover { filter: brightness(1.06); }
.btn.secondary, button.secondary { background: transparent; color: var(--text); border-color: #6c5a78; }
.btn.ghost, button.ghost { background: #2c2233; color: var(--text); border-color: var(--line); }
.btn.small, button.small { padding: 7px 12px; font-size: .9rem; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
label { font-weight: 600; }
input, select, textarea { font: inherit; border: 1px solid #705980; border-radius: 9px; background: #18121e; color: var(--text); padding: 10px 12px; }
textarea { width: 100%; min-height: 120px; resize: vertical; }
input[type=radio], input[type=checkbox] { accent-color: var(--mint); width: 18px; height: 18px; }
.field { display: grid; gap: 6px; margin: 0 0 16px; }
.field input, .field select, .field textarea { width: 100%; }
.err { color: var(--bad); font-weight: 600; min-height: 1.4em; }
.note { color: var(--dim); font-size: .92rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--mint); color: var(--mint-ink); font-weight: 700; padding: 10px 18px; border-radius: 10px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }

/* cards */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 22px; margin: 0 0 16px; }
.badge { display: inline-flex; align-items: center; border-radius: 9px; padding: 5px 13px; font-weight: 700; font-size: .92rem; white-space: nowrap; }
.badge.free { background: var(--mint); color: var(--mint-ink); }
.badge.member { background: var(--purple); color: #261633; }
.badge.path { background: #f2d38a; color: #2b2010; }
.badge.sample { background: #2f4438; color: var(--mint); }
.badge.draft { background: #4a3a1e; color: var(--warn); }
.badge.pub { background: #1f3a2b; color: var(--good); }
.chip { display: inline-flex; gap: 4px; align-items: center; font-size: .78rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #2c2233; color: var(--sub); }
.chip.ok { color: var(--good); } .chip.partial { color: var(--warn); background: #3a2f1c; }
.eyebrow { color: var(--purple); font-weight: 700; }
.crumbs { display: flex; gap: 10px; align-items: center; color: var(--sub); margin-bottom: 10px; font-size: 1.05rem; }
.crumbs a { color: var(--purple); text-decoration: none; }
.notice { border-left: 4px solid var(--warn); background: #2b2318; padding: 12px 16px; border-radius: 10px; color: #f1e2c4; margin: 0 0 16px; }
.notice.good { border-color: var(--mint); background: #1b2a22; color: #d7f6e2; }
.notice.bad { border-color: var(--bad); background: #2e1b1d; color: #f6d7d7; }

/* library hero + chapter rows */
.hero { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 4.5vw, 44px); background: linear-gradient(105deg, #261a2b 30%, #48315c); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; margin: 0 0 18px; }
.hero .k { color: var(--purple); font-weight: 700; font-size: 1.25rem; margin-bottom: 6px; }
.hero h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 10px; }
.bar { height: 14px; border-radius: 10px; background: #5a4569; overflow: hidden; max-width: 260px; }
.bar i { display: block; height: 100%; background: var(--mint); border-radius: 10px; }
.notebook { background: #efe6d8; color: #3a2e2a; border-radius: 10px; padding: 18px 20px 14px; transform: rotate(-6deg); box-shadow: 0 18px 40px #0009; font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; max-width: 280px; justify-self: end; }
.notebook b { display: block; font-size: 1.05rem; margin-bottom: 6px; border-bottom: 1px solid #c9bba7; }
.notebook div { font-size: .92rem; padding: 2px 0; }
.rows { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto 28px; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 10px 18px 10px 10px; text-decoration: none; color: var(--text); }
.row:hover { border-color: var(--line2); background: var(--panel2); }
.row h3 { font-size: 1.45rem; margin: 0; font-weight: 700; }
.row p { margin: 2px 0 0; }
.chev { color: var(--sub); font-size: 1.6rem; }
.thumb { aspect-ratio: 16 / 9; border-radius: 11px; position: relative; overflow: hidden; background: linear-gradient(140deg, #2a2d3a, #12141c); display: grid; place-items: center; }
.thumb .screen { width: 72%; height: 64%; border-radius: 6px; background: #0d0e14; border: 2px solid #3b3e4c; display: grid; place-items: center; font-weight: 800; font-size: .9rem; letter-spacing: .02em; }
.thumb.mint .screen { color: #eafff1; }
.thumb.plum .screen { background: linear-gradient(120deg, #1fb6e8, #7b3bf0 60%, #b64be8); color: #fff; font-style: italic; font-family: Georgia, serif; font-size: 1.15rem; }
.thumb.violet .screen { background: linear-gradient(180deg, #2b5c8f 0 50%, #1a1a1a 50%); color: #fff; }
.thumb.gold .screen { background: linear-gradient(120deg, #3a2a10, #7a5a1e); color: #ffe7b0; }

/* lesson */
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.player { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(160deg, #3a2a20, #1b1410 55%, #0f0c0a); margin-bottom: 18px; }
.stage { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 6% 9% 12%; }
.monitor { width: 100%; height: 100%; background: #12131a; border: 10px solid #1d1e25; border-radius: 12px; box-shadow: 0 20px 50px #000a; display: flex; flex-direction: column; overflow: hidden; }
.mbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #1b1c25; color: #c9c9d6; font-size: .8rem; font-weight: 700; }
.mbar .dots { margin-left: auto; letter-spacing: 4px; color: #555; }
.mbody { flex: 1; padding: 4% 6%; display: flex; flex-direction: column; gap: 10px; justify-content: center; position: relative; }
.bubble { align-self: flex-end; max-width: 80%; background: #5b3e88; color: #f2e9ff; padding: 10px 14px; border-radius: 12px; font-size: clamp(.75rem, 1.4vw, .98rem); }
.answer { align-self: flex-start; width: 78%; background: #23253a; border-radius: 12px; padding: 12px 14px; display: grid; gap: 7px; }
.answer i { display: block; height: 7px; border-radius: 6px; background: #6a6d8c; }
.canvas { align-self: center; width: 52%; aspect-ratio: 1; background: linear-gradient(140deg, #f7e9d4, #f1c9a8); border-radius: 8px; display: grid; place-items: center; color: #4a2a40; font-weight: 900; text-align: center; padding: 8px; font-size: clamp(.8rem, 1.6vw, 1.15rem); }
.timeline { display: grid; gap: 6px; }
.timeline .clip { height: 22px; border-radius: 5px; background: linear-gradient(90deg, #5a8fd8, #3a6ab0); position: relative; }
.timeline .clip.b { background: linear-gradient(90deg, #e8a13a, #b06f1a); width: 70%; }
.timeline .head { position: absolute; top: -6px; bottom: -36px; width: 2px; background: #fff; left: 18%; }
.preview9 { align-self: center; height: 58%; aspect-ratio: 9 / 16; border-radius: 8px; background: linear-gradient(180deg, #6e5a3a, #3a2a1a); display: grid; place-items: end center; padding: 8px; color: #fff; font-weight: 800; font-size: clamp(.6rem, 1.2vw, .85rem); text-align: center; }
.sheet { display: grid; gap: 6px; }
.sheet div { background: #1f2230; border-radius: 6px; padding: 8px 10px; font-size: clamp(.7rem, 1.3vw, .92rem); color: #dfe3f2; }
.focus { position: absolute; right: 6%; bottom: 8%; background: var(--mint); color: var(--mint-ink); font-weight: 800; padding: 6px 12px; border-radius: 8px; font-size: clamp(.65rem, 1.2vw, .85rem); box-shadow: 0 0 0 4px #a8f0c155; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px #a8f0c100; } }
.cap { position: absolute; left: 8%; right: 8%; bottom: 4%; text-align: center; }
.cap span { background: #000c; color: #fff; padding: 6px 12px; border-radius: 8px; font-size: clamp(.8rem, 1.5vw, 1.05rem); line-height: 1.5; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.controls { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #0c0a0d; }
.controls button { background: none; color: #fff; padding: 6px; border: 0; }
.controls .time { color: #ddd; font-variant-numeric: tabular-nums; font-size: .92rem; }
.controls .track { flex: 1; height: 5px; border-radius: 4px; background: #444; overflow: hidden; }
.controls .track i { display: block; height: 100%; background: var(--purple); transition: width .3s; }
.controls .cc[aria-pressed=true] { color: var(--mint); }
.player video { display: block; width: 100%; background: #000; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; color: var(--sub); border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 12px 24px; font-weight: 600; font-size: 1.05rem; }
.tabs button[aria-selected=true] { color: var(--purple); border-bottom-color: var(--purple); }
.outline { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 12px; position: sticky; top: 20px; }
.outline h3 { padding: 6px 10px 4px; margin: 0; color: var(--sub); font-size: .95rem; font-weight: 600; }
.outline ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.outline a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--text); }
.outline a:hover { background: #2a2030; }
.outline a[aria-current] { background: var(--plum2); font-weight: 650; }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #8a7a96; display: grid; place-items: center; font-size: .85rem; }
.outline a[aria-current] .num { background: #7d55a0; border-color: #b58fd6; }
.outline .done .num { background: var(--mint); color: var(--mint-ink); border-color: var(--mint); }
.outline .lock { margin-left: auto; color: var(--dim); font-size: .8rem; }
.steps-list { padding-left: 22px; }
.steps-list li { margin: 8px 0; color: var(--text); }
.example { background: #160f1b; border: 1px dashed #6c5a78; border-radius: 12px; padding: 14px; color: var(--text); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; white-space: pre-wrap; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; color: var(--text); }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; cursor: pointer; color: var(--text); font-weight: 500; }
.choice input { margin-top: 3px; flex: none; }
.result { margin-top: 8px; padding: 10px 12px; border-radius: 10px; }
.result.ok { background: #1b2a22; color: #d7f6e2; } .result.no { background: #2e1b1d; color: #f6d7d7; }

/* assessment */
.wizard { max-width: 760px; }
.stepper { height: 8px; border-radius: 8px; background: #3a2c44; overflow: hidden; margin: 6px 0 26px; }
.stepper i { display: block; height: 100%; background: var(--mint); transition: width .3s; }
.options { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px 18px; cursor: pointer; color: var(--text); font-weight: 600; font-size: 1.05rem; text-align: left; }
.opt:hover { border-color: var(--line2); }
.opt:has(input:checked), .opt.on { border-color: var(--mint); background: #1f2a24; }
.opt input { flex: none; }
.langs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.langs button { flex-direction: column; padding: 26px 12px; font-size: 1.3rem; background: var(--panel); color: var(--text); border: 1.5px solid var(--line); border-radius: 16px; }
.langs button small { font-weight: 500; color: var(--dim); font-size: .85rem; }
.langs button:hover, .langs button.on { border-color: var(--mint); background: #1f2a24; }
.tool-block { border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); padding: 14px 18px; margin-bottom: 10px; }
.tool-block .levels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tool-block .levels label { border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; display: flex; gap: 8px; align-items: center; font-weight: 550; cursor: pointer; }
.tool-block .levels label:has(input:checked) { border-color: var(--mint); color: var(--mint); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips label { border: 1.5px solid var(--line); background: var(--panel); border-radius: 999px; padding: 10px 16px; display: flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 600; }
.chips label:has(input:checked) { border-color: var(--mint); background: #1f2a24; }
.time-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.time-row .field { margin: 0; }

/* plan + pricing */
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.result-grid .card { margin: 0; }
.big { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.order { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.order span.arrow { color: var(--dim); }
.week { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-bottom: 10px; }
.week summary { cursor: pointer; padding: 14px 18px; display: flex; justify-content: space-between; gap: 10px; font-weight: 700; list-style: none; }
.week summary::-webkit-details-marker { display: none; }
.week ul { list-style: none; margin: 0; padding: 0 18px 14px; display: grid; gap: 6px; }
.week li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; background: #1a141e; border-radius: 9px; color: var(--text); }
.week li a { color: var(--text); text-decoration: none; }
.week li .meta { color: var(--dim); font-size: .88rem; white-space: nowrap; }
.blur { filter: blur(5px); user-select: none; pointer-events: none; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 16px 0; }
.plan-card { border: 2px solid var(--line); border-radius: 18px; background: var(--panel); padding: 22px; cursor: pointer; display: grid; gap: 6px; }
.plan-card:has(input:checked) { border-color: var(--mint); background: #1f2a24; }
.plan-card .price { font-size: 2rem; font-weight: 850; color: var(--text); }
.plan-card input { justify-self: start; }
.terms { background: #1a141e; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }

/* progress */
progress { width: 100%; height: 12px; accent-color: var(--mint); }
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--dim); font-weight: 600; font-size: .9rem; }

/* admin */
.admin-grid { display: grid; gap: 12px; }
.lang-tabs { display: flex; gap: 6px; margin: 10px 0; }
.lang-tabs button { background: #2c2233; color: var(--text); border: 1px solid var(--line); }
.lang-tabs button[aria-selected=true] { background: var(--plum); border-color: var(--purple); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.q-block { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #1a141e; }

/* phones */
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  body > aside { position: sticky; top: 0; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 12px; gap: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); z-index: 20; }
  body > aside nav { order: 3; width: 100%; justify-content: space-between; }
  .brand { margin: 0 8px 0 4px; font-size: 1.2rem; }
  .brand::after { display: none; }
  nav { flex-direction: row; gap: 2px; }
  nav a { padding: 8px 10px; gap: 6px; font-size: .9rem; white-space: nowrap; }
  nav a span { display: none; }
  nav a[aria-current] span { display: inline; }
  .side-bottom { margin: 0 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0; }
  .side-bottom label, .who { display: none; }
  .side-bottom select { width: auto; padding: 7px 8px; }
  main { padding: 24px 16px 70px; }
  .hero { grid-template-columns: 1fr; }
  .notebook { display: none; }
  .row { grid-template-columns: 96px minmax(0, 1fr) 24px; gap: 12px; }
  .row .badge { grid-column: 2; justify-self: start; }
  .row .chev { grid-column: 3; grid-row: 1; }
  .row h3 { font-size: 1.15rem; }
  .lesson-grid { grid-template-columns: 1fr; }
  .outline { position: static; }
  .result-grid, .plans, .two, .three, .langs { grid-template-columns: 1fr; }
  .tabs button { padding: 10px 14px; }
}

/* utility classes (no inline styles: CSP style-src 'self') */
.mt { margin-top: 18px; }
.big.smaller { font-size: 1.25rem; }
.wizard.narrow { max-width: 480px; }
.two.center { align-items: center; }
.m0 { margin: 0; }
.actions.end { justify-content: flex-end; }
.order a.chip { text-decoration: none; font-size: .9rem; padding: 6px 11px; color: var(--text); } .order a.chip:hover { background: var(--plum); }
main:focus { outline: none; }
