/* PCAP Analyzer: one stylesheet, no build step, no external assets. */
:root {
  --bg: #f6f8fb; --bg2: #ffffff; --bg3: #eef2f7; --line: #dbe2ec; --line2: #c8d2df;
  --ink: #0f1b2a; --ink2: #3d4b5e; --ink3: #6a788b;
  --accent: #0d9488; --accent2: #0f766e; --accent-bg: #e6f6f4; --link: #0b6bcb;
  --crit: #b4232a; --high: #d9480f; --med: #b7791f; --low: #2f6fb3; --info: #5b6b80; --ok: #15803d;
  --crit-bg: #fde8e8; --high-bg: #fff0e6; --med-bg: #fff7e0; --low-bg: #e8f1fb; --info-bg: #eef1f5; --ok-bg: #e7f6ec;
  --code-bg: #0f1b2a; --code-ink: #e3ecf7; --code-key: #7dd3fc; --code-str: #86efac; --code-com: #8396ad;
  --shadow: 0 1px 2px rgba(15,27,42,.06), 0 4px 16px rgba(15,27,42,.06);
  --radius: 10px; --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --c-client: #2563eb; --c-server: #0d9488; --c-mid: #7c3aed;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220; --bg2: #0f1a2b; --bg3: #15233a; --line: #22324b; --line2: #2c3f5e;
    --ink: #e6edf7; --ink2: #b4c1d4; --ink3: #8192aa; --accent: #2dd4bf; --accent2: #5eead4; --accent-bg: #0f2f33; --link: #7cc4ff;
    --crit: #ff6b6b; --high: #ff9f5a; --med: #f2c14e; --low: #7cb7ff; --info: #9aa8bb; --ok: #4ade80;
    --crit-bg: #3a1418; --high-bg: #3a2113; --med-bg: #362b10; --low-bg: #132a46; --info-bg: #1a2638; --ok-bg: #0f2e1d;
    --code-bg: #060c16; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25);
    --c-client: #60a5fa; --c-server: #2dd4bf; --c-mid: #a78bfa; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1220; --bg2: #0f1a2b; --bg3: #15233a; --line: #22324b; --line2: #2c3f5e;
  --ink: #e6edf7; --ink2: #b4c1d4; --ink3: #8192aa; --accent: #2dd4bf; --accent2: #5eead4; --accent-bg: #0f2f33; --link: #7cc4ff;
  --crit: #ff6b6b; --high: #ff9f5a; --med: #f2c14e; --low: #7cb7ff; --info: #9aa8bb; --ok: #4ade80;
  --crit-bg: #3a1418; --high-bg: #3a2113; --med-bg: #362b10; --low-bg: #132a46; --info-bg: #1a2638; --ok-bg: #0f2e1d;
  --code-bg: #060c16; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25);
  --c-client: #60a5fa; --c-server: #2dd4bf; --c-mid: #a78bfa; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.4em 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; margin-top: .2em; } h2 { font-size: 1.4rem; } h3 { font-size: 1.12rem; } h4 { font-size: 1rem; }
p { margin: .5em 0 .9em; }
code, kbd, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--bg3); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; overflow-wrap: anywhere; }
kbd { background: var(--bg2); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: .05em .4em; font-size: .78em; color: var(--ink2); }
pre { background: var(--code-bg); color: var(--code-ink); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; position: relative; margin: .6em 0 1.1em; }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: .86rem; }
pre .c { color: var(--code-com); } pre .k { color: var(--code-key); } pre .s { color: var(--code-str); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink3); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg3); position: sticky; top: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); margin: .6em 0 1.2em; max-height: 560px; }
.table-wrap table th:first-child, .table-wrap table td:first-child { padding-left: 14px; }
ul, ol { padding-left: 1.3em; } li { margin: .2em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
img { max-width: 100%; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--bg2); padding: 6px 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink3); } .small { font-size: .85rem; } .mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 60px; background: color-mix(in srgb, var(--bg2) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.08rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand-bg { fill: #0b1f33; } .brand-line { stroke: #2dd4bf; }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 7px 11px; border-radius: 8px; color: var(--ink2); font-weight: 550; font-size: .92rem; white-space: nowrap; }
.tabs a:hover { background: var(--bg3); text-decoration: none; color: var(--ink); }
.tabs a.active { background: var(--accent-bg); color: var(--accent2); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.search-btn { display: flex; align-items: center; gap: 8px; background: var(--bg3); border: 1px solid var(--line); color: var(--ink3); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; font-size: .88rem; }
.search-btn svg, .icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--ink2); border-radius: 8px; padding: 6px; cursor: pointer; display: grid; place-items: center; }
.menu-btn { display: none; }

/* ---------- layout ---------- */
main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 26px 24px 60px; outline: none; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 24px; border-top: 1px solid var(--line); color: var(--ink3); font-size: .82rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--ink2); max-width: 820px; margin: .3em 0 0; }
.eyebrow { color: var(--accent2); font-weight: 650; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.doc { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
.toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 6px; font-size: .88rem; }
.toc .toc-group { color: var(--ink3); text-transform: uppercase; font-size: .72rem; font-weight: 700; letter-spacing: .07em; margin: 14px 0 4px; }
.toc a { display: block; color: var(--ink2); padding: 4px 10px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--ink); text-decoration: none; border-color: var(--line2); }
.toc a.active { color: var(--accent2); border-color: var(--accent); font-weight: 600; }
.toc-filter { width: 100%; margin-bottom: 8px; }
.doc-body { min-width: 0; }
.doc-body > section { scroll-margin-top: 76px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.doc-body > section:last-child { border-bottom: 0; }
.doc-body > section > h2:first-child { margin-top: .2em; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card h3, .card h4 { margin-top: 0; }
.card.link-card { color: inherit; transition: border-color .15s, transform .15s; display: block; }
.card.link-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: .75rem; font-weight: 650; border: 1px solid var(--line); background: var(--bg3); color: var(--ink2); white-space: nowrap; }
.pill.crit, .sev-critical { background: var(--crit-bg); color: var(--crit); border-color: transparent; }
.pill.high, .sev-high { background: var(--high-bg); color: var(--high); border-color: transparent; }
.pill.med, .sev-medium { background: var(--med-bg); color: var(--med); border-color: transparent; }
.pill.low, .sev-low { background: var(--low-bg); color: var(--low); border-color: transparent; }
.pill.info, .sev-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.pill.ok, .st-pass { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.st-fail { background: var(--crit-bg); color: var(--crit); border-color: transparent; }
.st-warn { background: var(--med-bg); color: var(--med); border-color: transparent; }
.st-na { background: var(--bg3); color: var(--ink3); }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--bg2); border-radius: 8px; padding: 10px 14px; margin: .8em 0 1.1em; }
.callout.warn { border-left-color: var(--med); } .callout.bad { border-left-color: var(--crit); } .callout.tip { border-left-color: var(--low); }
.callout > b:first-child { display: block; margin-bottom: 2px; }
.callout p:last-child { margin-bottom: 0; }

/* filter chip with copy */
.f { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; vertical-align: middle; margin: 1px 0; background: var(--bg3); }
.f code { border: 0; border-radius: 0; background: transparent; padding: 2px 8px; white-space: pre-wrap; }
.f button { border: 0; border-left: 1px solid var(--line2); background: var(--bg2); color: var(--ink3); cursor: pointer; padding: 0 7px; font-size: .74rem; }
.f button:hover { color: var(--accent2); background: var(--accent-bg); }
.copy-pre { position: absolute; top: 8px; right: 8px; border: 1px solid #2a3b55; background: #13213a; color: #b9c8de; border-radius: 6px; font-size: .72rem; padding: 2px 8px; cursor: pointer; opacity: .8; }
.copy-pre:hover { opacity: 1; }

/* figure / screenshot */
figure.shot { margin: 1em 0 1.4em; }
figure.shot img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; box-shadow: var(--shadow); background: #fff; }
figure.shot figcaption { font-size: .84rem; color: var(--ink3); margin-top: 6px; }
.lightbox { position: fixed; inset: 0; background: rgba(5,10,18,.86); z-index: 60; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 6px; }

/* ladder diagram */
.ladder { width: 100%; max-width: 820px; height: auto; display: block; margin: .6em 0 1.2em; font-family: var(--sans); }
.ladder .actor { font-weight: 700; font-size: 13px; fill: var(--ink); }
.ladder .life { stroke: var(--line2); stroke-width: 2; stroke-dasharray: 4 4; }
.ladder .msg { font-size: 12.5px; font-weight: 650; fill: var(--ink); }
.ladder .note { font-size: 11px; fill: var(--ink3); font-family: var(--mono); }
.ladder .t { font-size: 11px; fill: var(--ink3); font-family: var(--mono); }
.ladder .arrow { stroke-width: 1.8; fill: none; }
.ladder .a-c { stroke: var(--c-client); } .ladder .a-s { stroke: var(--c-server); } .ladder .a-m { stroke: var(--c-mid); } .ladder .a-bad { stroke: var(--crit); stroke-dasharray: 5 4; }
.ladder .head-c { fill: var(--c-client); } .ladder .head-s { fill: var(--c-server); } .ladder .head-m { fill: var(--c-mid); } .ladder .head-bad { fill: var(--crit); }
.ladder .phase { font-size: 11px; font-weight: 700; fill: var(--accent2); text-transform: uppercase; letter-spacing: .06em; }
.ladder .phase-line { stroke: var(--line); }
.ladder .box { fill: var(--bg3); stroke: var(--line2); }

/* inputs */
input[type=text], input[type=search], textarea, select { font: inherit; color: var(--ink); background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 11px; width: 100%; }
textarea { resize: vertical; min-height: 92px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
label.lbl { display: block; font-weight: 600; font-size: .84rem; margin-bottom: 4px; color: var(--ink2); }
.btn { font: inherit; font-weight: 650; border-radius: 8px; padding: 9px 16px; cursor: pointer; border: 1px solid var(--line2); background: var(--bg2); color: var(--ink); display: inline-flex; gap: 8px; align-items: center; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #062a26; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #062a26; } }
.btn.primary:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: .84rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line2); background: var(--bg2); color: var(--ink2); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .84rem; cursor: pointer; }
.chip.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent2); font-weight: 650; }

/* ---------- analyzer ---------- */
.an-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; }
.drop { border: 2px dashed var(--line2); border-radius: 12px; padding: 28px 18px; text-align: center; background: var(--bg2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-bg); }
.drop svg { width: 38px; height: 38px; stroke: var(--accent); fill: none; stroke-width: 1.6; }
.drop b { display: block; font-size: 1.02rem; margin-top: 6px; }
.files { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.files li { display: grid; grid-template-columns: auto minmax(0, 1fr) 170px auto; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.files .ficon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: .66rem; font-weight: 800; color: #fff; }
.ficon.capture { background: var(--accent); } .ficon.image { background: var(--c-mid); } .ficon.text { background: var(--low); } .ficon.unknown { background: var(--info); }
.files .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.files .fmeta { color: var(--ink3); font-size: .78rem; }
.files input { padding: 5px 8px; font-size: .84rem; }
.files .rm { background: none; border: 0; color: var(--ink3); cursor: pointer; font-size: 1.1rem; }
.samples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.progress { height: 4px; background: var(--bg3); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.progress div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.report { margin-top: 26px; }
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.score { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; border: 6px solid var(--ok); }
.score.mid { border-color: var(--med); } .score.bad { border-color: var(--crit); }
.score small { display: block; font-size: .64rem; font-weight: 600; color: var(--ink3); margin-top: -8px; text-align: center; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: .86rem; }
.check .pill { flex: none; margin-top: 2px; }
.finding { border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); margin-bottom: 10px; overflow: hidden; }
.finding > summary { list-style: none; cursor: pointer; padding: 11px 14px; display: flex; gap: 10px; align-items: center; }
.finding > summary::-webkit-details-marker { display: none; }
.finding > summary .ttl { font-weight: 650; flex: 1; min-width: 0; }
.finding > summary .tag { font-size: .74rem; color: var(--ink3); }
.finding[open] > summary { border-bottom: 1px solid var(--line); background: var(--bg3); }
.finding .fbody { padding: 12px 16px 14px; font-size: .92rem; }
.finding .rel { color: var(--accent2); font-size: .72rem; font-weight: 700; border: 1px solid var(--accent); border-radius: 999px; padding: 0 7px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kv div { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.kv b { display: block; font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.kv span { font-size: .74rem; color: var(--ink3); text-transform: uppercase; letter-spacing: .05em; }
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 18px 0 14px; }
.subtabs button { font: inherit; font-size: .88rem; font-weight: 600; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--ink3); cursor: pointer; }
.subtabs button.on { color: var(--accent2); border-color: var(--accent); }
.chart { width: 100%; height: 170px; display: block; }
.chart .bar { fill: var(--accent); opacity: .75; } .chart .bad { fill: var(--crit); } .chart .ax { stroke: var(--line2); } .chart text { fill: var(--ink3); font-size: 10px; font-family: var(--mono); }
.hbar { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: .84rem; margin: 3px 0; }
.hbar .track { height: 10px; background: var(--bg3); border-radius: 5px; overflow: hidden; }
.hbar .track div { height: 100%; background: var(--accent); }
.hbar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: .8rem; }
.empty { text-align: center; color: var(--ink3); padding: 30px; }
.narrative { white-space: pre-wrap; }

/* ---------- search ---------- */
.search-overlay { position: fixed; inset: 0; background: rgba(5,10,18,.55); z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding-top: 9vh; }
.search-overlay[hidden] { display: none; }
.search-panel { width: min(680px, 94vw); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
.search-panel input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 18px; font-size: 1.05rem; }
.search-panel input:focus { box-shadow: none; }
#searchResults { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
#searchResults li a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); }
#searchResults li a:hover, #searchResults li.sel a { background: var(--accent-bg); text-decoration: none; }
#searchResults .where { font-size: .74rem; color: var(--accent2); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
#searchResults .snip { font-size: .82rem; color: var(--ink3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hint { font-size: .76rem; color: var(--ink3); padding: 8px 14px; border-top: 1px solid var(--line); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 8px; font-size: .86rem; opacity: 0; pointer-events: none; transition: all .2s; z-index: 70; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- filters / cheat sheet ---------- */
.ftable td:first-child { min-width: 260px; }
.ftable td { font-size: .88rem; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 380px; }
.sheet { columns: 3 330px; column-gap: 16px; }
.sheet .card { break-inside: avoid; margin-bottom: 16px; }
.sheet .card h3 { font-size: .98rem; margin-bottom: 8px; color: var(--accent2); }
.sheet table td, .sheet table th { padding: 4px 6px; font-size: .82rem; }
.sheet table td:first-child { white-space: nowrap; }

/* ---------- course ---------- */
.course-hero { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: stretch; }
.progress-ring { display: grid; place-items: center; text-align: center; }
.module { border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.module > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; }
.module > summary::-webkit-details-marker { display: none; }
.module .num { width: 46px; height: 46px; border-radius: 10px; background: var(--accent-bg); color: var(--accent2); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.module.done .num { background: var(--ok); color: #fff; }
.module .lessons { padding: 0 16px 14px 76px; }
.module .lessons a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 7px; color: var(--ink); }
.module .lessons a:hover { background: var(--bg3); text-decoration: none; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.quiz .q { margin-bottom: 16px; }
.quiz label { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 5px 0; cursor: pointer; background: var(--bg2); }
.quiz label.right { border-color: var(--ok); background: var(--ok-bg); }
.quiz label.wrong { border-color: var(--crit); background: var(--crit-bg); }
.quiz .why { font-size: .86rem; color: var(--ink2); margin-top: 4px; }
.lab { border: 1px solid var(--accent); border-radius: 12px; padding: 14px 18px; background: var(--accent-bg); margin: 1.2em 0; }
.lab h3 { margin-top: 0; color: var(--accent2); }
details.answer { margin: 6px 0 10px; }
details.answer > summary { cursor: pointer; color: var(--accent2); font-weight: 600; font-size: .88rem; }
.done-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; }

@media (max-width: 1100px) {
  .tabs a { padding: 7px 8px; font-size: .86rem; }
  .search-btn span, .search-btn kbd { display: none; }
}
@media (max-width: 960px) {
  .doc { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--bg2); }
  .an-grid, .course-hero { grid-template-columns: 1fr; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-btn { display: grid; }
  .tabs { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 16px; }
  .tabs.open { display: flex; }
}
@media (max-width: 640px) {
  main { padding: 18px 16px 50px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .g2, .g3, .g4, .form-row { grid-template-columns: 1fr; }
  .files li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .files li input { grid-column: 1 / -1; }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 54px; }
  .verdict { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
}
@media print {
  .topbar, .footer, .toc, .no-print, .drop, .subtabs { display: none !important; }
  body { background: #fff; } main { max-width: none; padding: 0; }
  .finding .fbody { display: block !important; }
}
