:root {
  --bg: #060a12;
  --bg-2: #080e19;
  --panel: #0c1424;
  --panel-2: #101b2f;
  --panel-3: #14223a;
  --line: #1d2c46;
  --line-soft: #152238;
  --text: #dce8f8;
  --muted: #8ea4c2;
  --dim: #637a99;
  --cyan: #4fd6ff;
  --cyan-soft: #1f7d9d;
  --amber: #ffb454;
  --green: #6ee7a8;
  --red: #ff6b7d;
  --violet: #b78cff;

  --sear: #ff7a45;
  --corrosion: #9ee04a;
  --breach: #ff5c8a;
  --virus: #b78cff;
  --emp: #4cc9ff;
  --irradiation: #ffe066;
  --rupture: #ff9f43;
  --disruption: #7de2d1;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
  --font: "Inter", "Segoe UI", "Helvetica Neue", Arial, "Liberation Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
  --topbar-h: 66px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(30, 111, 154, .18), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(88, 56, 160, .12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(79, 214, 255, .28); color: #fff; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
p { margin: 0 0 .85em; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding-left: 1.15em; }
li { margin-bottom: .4em; }
b, strong { color: #fff; font-weight: 650; }
small { font-size: .82em; }
em { color: #fff; font-style: normal; border-bottom: 1px dotted var(--cyan-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--cyan); color: #04121a; font-weight: 700;
  padding: .6rem 1rem; border-radius: 8px; transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6, 10, 18, .82);
  backdrop-filter: blur(14px) saturate(130%);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; height: var(--topbar-h);
  display: flex; align-items: center; gap: 22px; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--cyan); flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-size: 14px; letter-spacing: .18em; font-weight: 750; }
.brand-text small { font-size: 8.5px; letter-spacing: .3em; color: var(--dim); margin-top: 4px; }

.topnav { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  color: var(--muted); font-size: 13px; font-weight: 550;
  padding: 8px 10px; border-radius: 7px; white-space: nowrap;
}
.topnav a:hover { color: #fff; background: var(--panel-2); text-decoration: none; }
.topnav a.active { color: var(--cyan); background: rgba(79, 214, 255, .09); }

.search-wrap {
  position: relative; flex: 0 0 300px; display: flex; align-items: center;
}
.search-wrap svg {
  position: absolute; left: 11px; width: 16px; height: 16px; color: var(--dim); pointer-events: none;
}
.search-wrap input {
  width: 100%; height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-family: var(--font); font-size: 13px;
  padding: 0 40px 0 34px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input::placeholder { color: var(--dim); }
.search-wrap input:focus {
  border-color: var(--cyan-soft);
  box-shadow: 0 0 0 3px rgba(79, 214, 255, .12);
}
.search-wrap kbd {
  position: absolute; right: 9px; font-family: var(--mono); font-size: 10px;
  color: var(--dim); border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; background: var(--bg-2); pointer-events: none;
}
.search-status {
  max-width: 1440px; margin: 0 auto; padding: 0 24px; font-size: 12px; color: var(--amber);
}
.search-status:not(:empty) { padding-bottom: 8px; }

/* ---------- shell / toc ---------- */

.shell {
  max-width: 1440px; margin: 0 auto; padding: 0 24px 60px;
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 36px;
  align-items: start;
}
.toc {
  position: sticky; top: calc(var(--topbar-h) + 26px);
  padding-top: 34px; display: flex; flex-direction: column; gap: 2px;
}
.toc-title {
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--dim); margin: 0 0 8px 12px; font-weight: 700;
}
.toc a {
  color: var(--muted); font-size: 12.5px; padding: 6px 12px;
  border-left: 2px solid var(--line-soft); transition: color .12s, border-color .12s;
}
.toc a:hover { color: #fff; text-decoration: none; border-left-color: var(--cyan-soft); }
.toc a.active { color: var(--cyan); border-left-color: var(--cyan); background: linear-gradient(90deg, rgba(79,214,255,.08), transparent); }

main { min-width: 0; padding-top: 34px; }

/* ---------- hero ---------- */

.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 20px;
  background:
    radial-gradient(700px 340px at 78% 20%, rgba(79, 214, 255, .14), transparent 65%),
    radial-gradient(560px 300px at 10% 100%, rgba(255, 180, 84, .07), transparent 60%),
    linear-gradient(155deg, #0b1526, #070c18 62%);
  padding: 54px 54px 42px;
  box-shadow: var(--shadow);
}
.hero-glow {
  position: absolute; width: 460px; height: 460px; right: -120px; top: -180px;
  background: radial-gradient(circle, rgba(79, 214, 255, .18), transparent 70%);
  filter: blur(10px); pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image:
    linear-gradient(rgba(79, 214, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 214, 255, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(88% 78% at 70% 10%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(88% 78% at 70% 10%, #000 25%, transparent 78%);
}
.hero-inner { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cyan);
  border: 1px solid rgba(79, 214, 255, .28); border-radius: 999px;
  padding: 5px 12px; background: rgba(79, 214, 255, .05); margin-bottom: 22px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 10px var(--green);
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 62px); font-weight: 780; letter-spacing: -.035em;
  max-width: 900px; margin-bottom: 18px;
}
.hero h1 span {
  color: transparent;
  background: linear-gradient(100deg, var(--cyan), #9be8ff 45%, var(--amber));
  -webkit-background-clip: text; background-clip: text;
}
.lede { color: #a9bcd6; font-size: 17px; max-width: 700px; margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 38px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 650; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 18px; background: rgba(255, 255, 255, .02);
  transition: transform .12s, border-color .12s, background .12s;
}
.btn:hover { text-decoration: none; border-color: var(--cyan-soft); background: rgba(79, 214, 255, .07); transform: translateY(-1px); }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #03131b; }
.btn-primary:hover { background: #7ee2ff; border-color: #7ee2ff; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 38px; margin: 0; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats dt {
  font-family: var(--mono); font-size: 26px; font-weight: 700; color: #fff; line-height: 1;
}
.hero-stats dd {
  margin: 5px 0 0; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dim);
}

/* ---------- sections ---------- */

.section { padding-top: 62px; }
.section-head { margin-bottom: 26px; }
.section-kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 8px;
}
.section h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 760; }
.section-sub { color: var(--muted); margin-top: 9px; max-width: 760px; }
.subhead {
  font-size: 18px; font-weight: 680; margin: 38px 0 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-soft);
}

.grid { display: grid; gap: 14px; margin-bottom: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compact .card { padding: 16px 18px; }
.compact h3 { font-size: 14.5px; margin-bottom: 6px; }

.card {
  background: linear-gradient(160deg, var(--panel), #0a111f);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; min-width: 0;
}
.card h3 { font-size: 16.5px; margin-bottom: 8px; }
.card p { color: #b7c8df; font-size: 14px; }
.card p b { color: #fff; }

.fine { color: var(--dim); font-size: 12.5px; line-height: 1.55; }

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  background: linear-gradient(90deg, rgba(255, 180, 84, .07), transparent 60%), var(--panel);
  border-radius: var(--radius-sm);
  padding: 18px 22px; margin: 22px 0;
  font-size: 14px; color: #c6d5e9;
}
.callout strong { display: block; margin-bottom: 5px; color: var(--amber); font-size: 13px; letter-spacing: .02em; }
.callout p { margin: 0; }
.callout-key { margin-top: 18px; }
.callout-key ul { margin-top: 6px; }
.callout-inline {
  border-left: 2px solid var(--line);
  padding: 8px 0 8px 14px; color: #b9cbe4; font-size: 13.5px;
}

/* ---------- tables ---------- */

.table-wrap {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: auto; margin-bottom: 14px;
  max-height: none;
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.table caption { text-align: left; }
.table th, .table td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.table th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel-2); color: var(--dim);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; white-space: nowrap;
}
.table th.sort { cursor: pointer; user-select: none; padding-right: 26px; position: sticky; }
.table th.sort::after {
  content: "↕"; position: absolute; right: 9px; opacity: .35; font-size: 12px;
}
.table th.sort[data-dir="asc"]::after { content: "↑"; opacity: .9; color: var(--cyan); }
.table th.sort[data-dir="desc"]::after { content: "↓"; opacity: .9; color: var(--cyan); }
.table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .012); }
.table tbody tr:hover { background: rgba(79, 214, 255, .04); }
.table td { color: #c3d3e8; }
.table td b { color: #fff; }
.table td:first-child { white-space: nowrap; }
.quick-table td:nth-child(2) { color: var(--muted); }

.yes { color: var(--green) !important; font-weight: 600; }
.no { color: var(--red) !important; }
.na { color: var(--dim) !important; }

.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; vertical-align: 1px;
  background: var(--dim); box-shadow: 0 0 8px currentColor;
}
.status-dot.sear { background: var(--sear); color: var(--sear); }
.status-dot.corrosion { background: var(--corrosion); color: var(--corrosion); }
.status-dot.breach { background: var(--breach); color: var(--breach); }
.status-dot.virus { background: var(--virus); color: var(--virus); }
.status-dot.emp { background: var(--emp); color: var(--emp); }
.status-dot.irradiation { background: var(--irradiation); color: var(--irradiation); }
.status-dot.rupture { background: var(--rupture); color: var(--rupture); }
.status-dot.disruption { background: var(--disruption); color: var(--disruption); }

/* ---------- flow diagram ---------- */

.flow {
  display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
  margin: 22px 0 0; padding: 18px; border: 1px dashed var(--line);
  border-radius: var(--radius); background: rgba(10, 17, 31, .5);
}
.flow-step {
  flex: 1 1 150px; display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
  background: var(--panel); min-width: 0;
}
.flow-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 3px;
}
.flow-step strong { font-size: 14px; }
.flow-step small { color: var(--dim); font-size: 11px; margin-top: 2px; }
.flow-shield { border-color: rgba(76, 201, 255, .35); }
.flow-hull { border-color: rgba(110, 231, 168, .3); }
.flow-core { border-color: rgba(255, 180, 84, .35); }
.flow-arrow { align-self: center; color: var(--dim); font-size: 16px; }

/* ---------- status cards ---------- */

.status-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.status-card {
  --accent: var(--dim);
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--panel), #090f1b 70%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px 18px;
}
.status-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent 85%);
}
.status-card::after {
  content: ""; position: absolute; width: 190px; height: 190px; right: -90px; top: -100px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  opacity: .07; pointer-events: none;
}
.status-card.sear { --accent: var(--sear); }
.status-card.corrosion { --accent: var(--corrosion); }
.status-card.breach { --accent: var(--breach); }
.status-card.virus { --accent: var(--virus); }
.status-card.emp { --accent: var(--emp); }
.status-card.irradiation { --accent: var(--irradiation); }
.status-card.rupture { --accent: var(--rupture); }
.status-card.disruption { --accent: var(--disruption); }

.status-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.status-icon {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px;
  display: grid; place-items: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.status-icon svg { width: 22px; height: 22px; }
.status-head h3 { font-size: 19px; margin: 0; }
.status-role { margin: 1px 0 0; font-size: 11.5px; color: var(--dim); letter-spacing: .02em; }
.status-tag {
  margin-left: auto; font-family: var(--mono); font-size: 9px;
  letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
  background: rgba(255, 255, 255, .02); white-space: nowrap;
}
.tag-dot { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.tag-amp { color: var(--amber); border-color: rgba(255, 180, 84, .35); }
.tag-cc { color: var(--cyan); border-color: rgba(79, 214, 255, .35); }
.tag-unk { color: var(--muted); border-style: dashed; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.chip {
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.02);
}
.chip.good { color: var(--green); border-color: rgba(110, 231, 168, .28); background: rgba(110, 231, 168, .06); }
.chip.bad { color: var(--red); border-color: rgba(255, 107, 125, .28); background: rgba(255, 107, 125, .06); }
.status-card > p { font-size: 13.8px; color: #b9cbe4; }

.mini { margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.mini div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; }
.mini dt {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--dim); padding-top: 3px;
}
.mini dd { margin: 0; font-size: 12.8px; color: #a7bad3; }

/* ---------- combos ---------- */

.combo {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--panel), #090f1b);
  padding: 18px 20px;
}
.combo-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; font-weight: 700;
  padding: 4px 9px; border-radius: 5px;
  border: 1px solid var(--line); color: var(--text); background: var(--panel-2);
}
.pill.sear { color: var(--sear); border-color: color-mix(in srgb, var(--sear) 35%, transparent); }
.pill.corrosion { color: var(--corrosion); border-color: color-mix(in srgb, var(--corrosion) 35%, transparent); }
.pill.breach { color: var(--breach); border-color: color-mix(in srgb, var(--breach) 35%, transparent); }
.pill.virus { color: var(--virus); border-color: color-mix(in srgb, var(--virus) 35%, transparent); }
.pill.emp { color: var(--emp); border-color: color-mix(in srgb, var(--emp) 35%, transparent); }
.pill.irradiation { color: var(--irradiation); border-color: color-mix(in srgb, var(--irradiation) 35%, transparent); }
.pill.rupture { color: var(--rupture); border-color: color-mix(in srgb, var(--rupture) 35%, transparent); }
.pill.all { color: var(--cyan); border-color: rgba(79, 214, 255, .3); }
.combo-plus { color: var(--dim); font-size: 13px; }
.combo-badge {
  margin-left: auto; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); border-bottom: 1px dotted var(--line); padding-bottom: 2px;
}
.combo h3 { font-size: 15.5px; margin-bottom: 6px; }
.combo p { font-size: 13.5px; color: #b9cbe4; }
.combo .fine { margin-top: 8px; }

/* ---------- ship ---------- */

.ship-card .tag {
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid rgba(79, 214, 255, .3);
  border-radius: 4px; padding: 2px 6px; vertical-align: 3px; margin-left: 6px;
}
.ship-role { font-size: 12px; color: var(--dim); margin-bottom: 10px; }
.specs { list-style: none; padding: 0; margin: 0 0 12px; border-top: 1px solid var(--line-soft); }
.specs li {
  display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 12.5px; color: var(--muted); margin: 0;
}
.specs b { color: var(--cyan); font-family: var(--mono); }
.bullets { font-size: 13.5px; color: #b9cbe4; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { margin-bottom: 12px; }
.links a { font-weight: 600; font-size: 13.5px; }
.links span { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }

/* ---------- modules ---------- */

.module-group {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 10px; overflow: hidden;
}
.module-group summary {
  cursor: pointer; list-style: none; padding: 14px 18px;
  font-weight: 650; font-size: 14.5px; display: flex; align-items: center; gap: 4px;
  background: var(--panel-2); user-select: none;
}
.module-group summary::-webkit-details-marker { display: none; }
.module-group summary::after {
  content: "+"; margin-left: auto; color: var(--dim); font-family: var(--mono); font-size: 16px;
}
.module-group[open] summary::after { content: "−"; }
.module-group summary:hover { background: var(--panel-3); }
.module-group .table-wrap { border: 0; border-radius: 0; margin: 0; }
.module-group .table th { background: #0b1322; }
.module-group .table tr:last-child td { border-bottom: 0; }

/* ---------- faq ---------- */

.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); overflow: hidden;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 18px;
  font-weight: 600; font-size: 14.5px; display: flex; align-items: center;
  user-select: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--dim); font-family: var(--mono); font-size: 16px;
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { background: var(--panel-2); }
.faq details > p { padding: 0 18px 16px; font-size: 13.8px; color: #b9cbe4; margin: 0; }

/* ---------- footer / misc ---------- */

.footer {
  margin-top: 64px; padding: 34px 0 0; border-top: 1px solid var(--line-soft);
  text-align: center;
}
.footer-mark { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--cyan); }
.footer-mark svg { width: 100%; height: 100%; }
.footer b { letter-spacing: .18em; font-size: 12px; }
.footer .fine { margin-top: 4px; }

.no-results[hidden] { display: none; }
.no-results {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 150; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 18px; box-shadow: var(--shadow);
  font-size: 13px; display: flex; align-items: center; gap: 14px;
}
.no-results button {
  background: var(--cyan); color: #03131b; border: 0; border-radius: 6px;
  padding: 6px 10px; font-family: var(--font); font-weight: 700; font-size: 12px; cursor: pointer;
}

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 120;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .18s, transform .18s, color .15s;
}
.to-top.visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--cyan); border-color: var(--cyan-soft); }
.to-top svg { width: 20px; height: 20px; }

mark { background: rgba(255, 180, 84, .3); color: #fff; border-radius: 2px; }

/* ---------- responsive ---------- */

@media (max-width: 1160px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .search-wrap { flex-basis: 230px; }
}
@media (max-width: 900px) {
  .topbar-inner { gap: 12px; padding: 0 16px; }
  .topnav { display: none; }
  .search-wrap { flex: 1 1 auto; }
  .shell { padding: 0 16px 40px; }
  .hero { padding: 36px 26px 30px; }
  .grid-3, .grid-2, .status-grid { grid-template-columns: 1fr; }
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .brand-text small { display: none; }
  .hero h1 { font-size: 32px; }
  .lede { font-size: 15px; }
  .hero-stats { gap: 22px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .mini div { grid-template-columns: 1fr; gap: 1px; }
  .status-head { flex-wrap: wrap; }
  .status-tag { margin-left: 0; }
  .combo-badge { margin-left: 0; }
  .no-results { width: calc(100% - 32px); justify-content: space-between; }
}

@media (max-width: 720px) {
  .table-wrap {
    overflow: visible; border: 0; background: transparent; border-radius: 0;
  }
  .table { display: block; min-width: 0; }
  .table thead { display: none; }
  .table tbody { display: flex; flex-direction: column; gap: 8px; }
  .table tr {
    display: block; background: var(--panel) !important;
    border: 1px solid var(--line); border-radius: 10px;
    padding: 11px 14px;
  }
  .table td {
    display: grid; grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line-soft);
    white-space: normal;
  }
  .table td:last-child { border-bottom: 0; }
  .table td::before {
    content: attr(data-label);
    font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--dim); padding-top: 3px;
  }
  .table td:first-child {
    display: block; font-size: 15px; padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
  }
  .table td:first-child::before { display: none; }
  .table td:empty { display: none; }
  .module-group .table-wrap { border: 0; }
  .module-group .table tr { background: #0a111f; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .toc, .to-top, .no-results, .hero-actions, .search-status { display: none; }
  body { background: #fff; color: #111; }
  .shell { display: block; padding: 0; }
  .hero, .card, .status-card, .combo, .table-wrap, .module-group, .faq details { background: #fff; box-shadow: none; border-color: #bbb; }
  .section { page-break-inside: avoid; padding-top: 28px; }
  .table th { background: #eee; color: #333; }
  .table td { color: #222; }
  b, strong, .card h3, .status-head h3, .section h2 { color: #000; }
  .status-card::after { display: none; }
  details { display: block; }
  details > * { display: revert; }
}
