/* Exploit-Realität — calm, one accent, light/dark, mobile-first. */
:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --border: #e2e5ea;
  --text: #1a1d23;
  --muted: #5b6270;
  --accent: #1f6feb;
  --accent-weak: #e8f0fe;
  --ok: #1a7f37;
  --warn: #9a6700;
  --danger: #cf222e;
  --radius: 10px;
  --maxw: 1040px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --surface: #161b22; --border: #30363d; --text: #e6edf3;
    --muted: #9aa4b2; --accent: #4493f8; --accent-weak: #13233b;
    --ok: #3fb950; --warn: #d29922; --danger: #f85149;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --surface: #161b22; --border: #30363d; --text: #e6edf3;
  --muted: #9aa4b2; --accent: #4493f8; --accent-weak: #13233b;
  --ok: #3fb950; --warn: #d29922; --danger: #f85149;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: 1.55; font-size: 17px;
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff;
  padding: 8px 12px; border-radius: 0 0 var(--radius) 0; z-index: 10;
}
.skip-link:focus { left: 0; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; color: var(--text); font-size: 1.1rem; }
.nav { list-style: none; display: flex; gap: 4px 14px; flex-wrap: wrap; margin: 0; padding: 0; }
.nav a { color: var(--muted); padding: 4px 2px; font-size: 0.95rem; }
.nav a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }
.theme-toggle { margin-left: auto; background: transparent; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius); width: 38px; height: 34px; cursor: pointer; font-size: 1rem; }

main { padding: 28px 0 56px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 1.25rem; margin: 2.2rem 0 0.4rem; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 24px; }
.muted { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.card .k { font-size: 1.7rem; font-weight: 700; }
.card .l { color: var(--muted); font-size: 0.85rem; }

.figure { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 16px 0 28px; }
.figure h2 { margin-top: 0; }
.figure .note { color: var(--muted); font-size: 0.95rem; margin: 0 0 12px; }
.chart { min-height: 220px; overflow-x: auto; }
.chart figure { margin: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; align-items: center; }
.controls label { font-size: 0.9rem; color: var(--muted); }
select, input[type="text"], input[type="password"], textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 9px;
}
textarea { width: 100%; }

details.data { margin-top: 10px; }
details.data > summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.78rem; border: 1px solid var(--border); }
.badge.kev { background: var(--accent-weak); border-color: transparent; color: var(--accent); }
.badge.ransom { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); border-color: transparent; }
.badge.ok { color: var(--ok); }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 14px; font: inherit; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }

.prose p { max-width: 68ch; }
.prose ul { max-width: 68ch; }

.glossary dt { font-weight: 600; margin-top: 14px; }
.glossary dd { margin: 2px 0 0; max-width: 72ch; }

.bars { display: flex; flex-direction: column; gap: 6px; }
.barrow { display: grid; grid-template-columns: 56px 1fr 52px; align-items: center; gap: 10px; font-size: 0.9rem; }
.barrow .track { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; height: 18px; overflow: hidden; }
.barrow .fill { background: var(--accent); height: 100%; }
.barrow .val { text-align: right; font-variant-numeric: tabular-nums; }

.flash { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); margin: 0 0 16px; }
.flash.error { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: transparent; }
.flash.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); border-color: transparent; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { gap: 2px 10px; }
  th, td { white-space: normal; }
}
