/* FF addon suite documentation — self-contained, offline-safe, IIS friendly. */
:root {
  --bg: #07080b;
  --bg-soft: #0b0d12;
  --bg-elev: #10131a;
  --card: #12161e;
  --card-hover: #171c26;
  --line: #242a36;
  --line-soft: #1a1f29;
  --text: #e8e6e2;
  --muted: #99a1ae;
  --dim: #6c7380;
  --accent: #e0564a;
  --accent-soft: rgba(224, 86, 74, 0.14);
  --core: #8fa4c4;
  --utils: #5fd4e6;
  --cinematic: #f2a65a;
  --cbrn: #9ee06a;
  --zeus: #b38cff;
  --horror: #e0564a;
  --spectator: #7fd1b0;
  --ok: #7ad69c;
  --warn: #e8b15a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Bahnschrift", "DIN Alternate", "Segoe UI Semibold", var(--sans);
  --max: 1240px;
  --topbar: 60px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 18px); }
body {
  margin: 0;
  background:
    radial-gradient(1100px 620px at 10% -8%, rgba(224, 86, 74, 0.09), transparent 62%),
    radial-gradient(900px 520px at 92% -4%, rgba(179, 140, 255, 0.06), transparent 64%),
    linear-gradient(180deg, #0a0b0f 0%, var(--bg) 42%, #06070a 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.66 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 76%);
}
::selection { background: rgba(224, 86, 74, 0.36); color: #fff; }
a { color: var(--utils); text-decoration: none; }
a:hover { color: #9ae8f4; }
p, li, dd, dt, th, td, summary { overflow-wrap: break-word; }
img { max-width: 100%; }

code, kbd, pre, samp { font-family: var(--mono); }
code {
  font-size: 0.87em;
  color: #f0c9a0;
  background: rgba(232, 177, 90, 0.075);
  border: 1px solid rgba(232, 177, 90, 0.15);
  border-radius: 5px;
  padding: 0.08em 0.34em;
  overflow-wrap: anywhere;
}
pre {
  margin: 1rem 0;
  padding: 0.95rem 1.1rem;
  overflow: auto;
  max-width: 100%;
  background: #080a0e;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13.4px;
  line-height: 1.6;
  color: #d9d6d0;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
kbd {
  display: inline-block;
  min-width: 1.8em;
  padding: 0.08em 0.4em;
  border: 1px solid #39414f;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #161a22;
  color: #e2e6ec;
  font-size: 0.78em;
  text-align: center;
  line-height: 1.4;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 2.2rem 0; }
h1, h2, h3, h4, h5 { font-family: var(--display); font-weight: 600; letter-spacing: 0.01em; text-wrap: balance; }
h2 { font-size: clamp(24px, 3vw, 32px); margin: 2.4rem 0 0.8rem; line-height: 1.16; }
h3 { font-size: 19px; margin: 1.8rem 0 0.5rem; }
h4 { font-size: 15px; margin: 1.3rem 0 0.4rem; }
p { margin: 0 0 0.9rem; }
ul, ol { margin: 0 0 1rem; padding-left: 22px; }
li + li { margin-top: 5px; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.small { font-size: 13px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar);
  backdrop-filter: blur(14px);
  background: rgba(7, 8, 11, 0.88);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 0 0 auto; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid rgba(224, 86, 74, 0.55);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(224, 86, 74, 0.22), rgba(224, 86, 74, 0.02));
  color: var(--accent);
  font: 700 14px/1 var(--display);
  letter-spacing: 0.05em;
  box-shadow: inset 0 0 18px rgba(224, 86, 74, 0.18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font: 600 14px/1.1 var(--display); letter-spacing: 0.15em; }
.brand-text small { color: var(--dim); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 1px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { color: var(--muted); font-size: 13px; padding: 7px 10px; border-radius: 7px; white-space: nowrap; }
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); }
.main-nav a.is-active { color: var(--text); background: rgba(224, 86, 74, 0.13); box-shadow: inset 0 0 0 1px rgba(224, 86, 74, 0.24); }
.nav-toggle {
  display: none; margin-left: auto;
  background: #131720; color: var(--text);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 10px; font: 600 12px var(--sans); cursor: pointer;
}

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 1; max-width: var(--max); margin: 0 auto; padding: 0 22px; }
.section { padding: 56px 0 10px; }
.section + .section { border-top: 1px solid var(--line-soft); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.section-head > div { max-width: 780px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); font: 600 10.5px/1 var(--sans);
  letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 9px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.lede { color: var(--muted); font-size: 16.5px; max-width: 800px; margin: 8px 0 0; }
.breadcrumbs {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  color: var(--dim); font: 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  margin: 0 0 14px;
}
.breadcrumbs a { color: var(--dim); }
.breadcrumbs a:hover { color: var(--text); }

/* ---------- hero ---------- */
.hero { padding: 58px 0 34px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: 42px; align-items: center; }
.hero h1 { margin: 0; font-size: clamp(34px, 5.4vw, 62px); line-height: 1; letter-spacing: -0.015em; text-transform: uppercase; }
.hero h1 .accent {
  display: block; color: transparent;
  background: linear-gradient(92deg, var(--accent) 0%, #ff9b6a 55%, var(--warn) 100%);
  -webkit-background-clip: text; background-clip: text;
}
.hero-sub { margin: 18px 0 0; max-width: 640px; color: #c3c0ba; font-size: 17.5px; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025);
  color: var(--muted); font-size: 11.5px; letter-spacing: 0.03em;
}
.badge strong { color: var(--text); font-weight: 600; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 9px var(--ok); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 15px;
  border-radius: 9px; border: 1px solid var(--line);
  background: #141822; color: var(--text);
  font: 600 13px var(--sans); cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.btn:hover { background: #1a1f2a; border-color: #3a4252; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #b8402f, #d7614f); border-color: #d7614f; color: #fff; }
.btn.primary:hover { background: linear-gradient(135deg, #c64a37, #e5705c); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 30px; padding: 4px 9px; font-size: 11.5px; }
.btn:disabled { opacity: 0.6; cursor: default; }

.panel {
  position: relative; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(160deg, rgba(224, 86, 74, 0.07), transparent 44%), linear-gradient(180deg, #10131a, #0a0c11);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-top { display: flex; align-items: center; gap: 7px; padding: 11px 15px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.016); }
.panel-top .led { width: 8px; height: 8px; border-radius: 50%; background: #39414e; }
.panel-top .led.red { background: var(--accent); box-shadow: 0 0 10px rgba(224, 86, 74, 0.8); }
.panel-top .led.amber { background: var(--warn); }
.panel-top .led.green { background: var(--ok); }
.panel-title { margin-left: 5px; font: 600 10.5px var(--mono); letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }
.panel-body { padding: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.stat { padding: 12px 13px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255, 255, 255, 0.016); }
.stat b { display: block; font: 600 22px/1.1 var(--display); }
.stat span { display: block; margin-top: 4px; color: var(--dim); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.panel-note { margin: 13px 0 0; color: var(--dim); font-size: 11px; font-family: var(--mono); }

/* ---------- component colors ---------- */
.c-core { --mod: var(--core); --mod-soft: rgba(143, 164, 196, 0.13); }
.c-utils { --mod: var(--utils); --mod-soft: rgba(95, 212, 230, 0.12); }
.c-cinematic { --mod: var(--cinematic); --mod-soft: rgba(242, 166, 90, 0.13); }
.c-cbrn { --mod: var(--cbrn); --mod-soft: rgba(158, 224, 106, 0.12); }
.c-zeus { --mod: var(--zeus); --mod-soft: rgba(179, 140, 255, 0.13); }
.c-horror { --mod: var(--horror); --mod-soft: rgba(224, 86, 74, 0.13); }
.c-spectator { --mod: var(--spectator); --mod-soft: rgba(127, 209, 176, 0.13); }

/* ---------- cards & grids ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid-2 > *, .grid-3 > *, .grid-4 > *, .hero-grid > *, .doc-layout > *, .footer-inner > *,
.card, .mod-card, .role-card, .feature, .api-fn, .lazy-panel, .check, .table-wrap, pre, .step { min-width: 0; }

.card {
  padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}
.card.accent { border-left: 3px solid var(--accent); }
a.card.link-card { display: block; text-decoration: none; color: inherit; transition: border-color 0.16s, transform 0.16s, background 0.16s; }
a.card.link-card:hover { border-color: rgba(224, 86, 74, 0.45); transform: translateY(-2px); background: #14171f; }
a.card.link-card h3::after { content: "↗"; margin-left: auto; color: var(--dim); font: 400 13px var(--mono); }
a.card.link-card:hover h3::after { color: var(--horror); }
.card h3 { display: flex; align-items: center; gap: 9px; margin-top: 0; font-size: 17px; }
.card p { margin: 0 0 9px; color: var(--muted); font-size: 13.6px; }
.card p:last-child { margin-bottom: 0; }
.card ul, .card ol { color: var(--muted); font-size: 13.4px; }
.icon-badge {
  width: 28px; height: 28px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--mod, var(--accent));
  font: 600 11px var(--mono);
}

.mod-card {
  --mod: var(--accent); --mod-soft: rgba(255, 255, 255, 0.04);
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 17px; border: 1px solid var(--line); border-radius: 13px;
  background: linear-gradient(170deg, var(--mod-soft), transparent 58%), var(--card);
  color: var(--text);
  transition: border-color 0.17s ease, transform 0.17s ease, background 0.17s ease;
}
.mod-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--mod) 55%, var(--line)); background: linear-gradient(170deg, var(--mod-soft), transparent 64%), var(--card-hover); color: var(--text); }
.mod-card .kicker { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mod-card .kicker span:first-child { font: 600 10px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mod); }
.mod-card .kicker em { font: 600 10px var(--mono); color: var(--dim); font-style: normal; }
.mod-card h3 { margin: 1px 0 0; font-size: 18px; }
.mod-card p { margin: 0; color: var(--muted); font-size: 13px; }
.mod-card .counts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 8px; }
.mod-art {
  float: right; width: 64px; height: 64px; margin: 0 0 8px 12px;
  border: 1px solid color-mix(in srgb, var(--mod) 32%, var(--line)); border-radius: 9px;
  background: #0b0d0f; object-fit: cover; display: block;
}
.comp-art {
  float: right; width: 168px; height: 168px; margin: 0 0 14px 20px;
  border: 1px solid color-mix(in srgb, var(--mod, var(--accent)) 32%, var(--line)); border-radius: 14px;
  background: #0b0d0f; object-fit: cover; display: block;
}
@media (max-width: 720px) {
  .comp-art { float: none; margin: 0 0 14px; width: 128px; height: 128px; }
  .mod-art { width: 52px; height: 52px; }
}
.pill {
  display: inline-block; padding: 2.5px 7px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft);
  color: var(--dim); font: 500 10.5px var(--mono);
}
.pill.mod { color: var(--mod); border-color: color-mix(in srgb, var(--mod) 28%, transparent); background: color-mix(in srgb, var(--mod) 10%, transparent); }
.pill.ok { color: var(--ok); border-color: rgba(122, 214, 156, 0.26); background: rgba(122, 214, 156, 0.08); }
.pill.warn { color: var(--warn); border-color: rgba(232, 177, 90, 0.26); background: rgba(232, 177, 90, 0.08); }

.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.role-card {
  --role: var(--muted); --role-soft: rgba(255, 255, 255, 0.04);
  display: flex; flex-direction: column; gap: 9px;
  padding: 19px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(170deg, var(--role-soft), transparent 56%), var(--card);
  color: var(--text);
}
.role-card:hover { border-color: color-mix(in srgb, var(--role) 50%, var(--line)); background: linear-gradient(170deg, var(--role-soft), transparent 62%), var(--card-hover); color: var(--text); }
.role-card[data-role="dev"] { --role: var(--utils); --role-soft: rgba(95, 212, 230, 0.11); }
.role-card[data-role="mm"] { --role: var(--warn); --role-soft: rgba(232, 177, 90, 0.11); }
.role-card[data-role="zeus"] { --role: var(--zeus); --role-soft: rgba(179, 140, 255, 0.11); }
.role-card .rk { display: flex; align-items: center; justify-content: space-between; }
.role-card .rk span:first-child { font: 600 10px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--role); }
.role-card .rk span:last-child { font: 600 10.5px var(--mono); color: var(--dim); }
.role-card h3 { margin: 0; font-size: 20px; }
.role-card p { margin: 0; color: var(--muted); font-size: 13.4px; }
.role-card .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }
.tag {
  display: inline-block; padding: 2.5px 7px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft);
  color: var(--dim); font: 500 10.5px var(--mono);
  max-width: 100%; overflow-wrap: anywhere;
}
.tag.dev { color: var(--utils); border-color: rgba(95, 212, 230, 0.24); background: rgba(95, 212, 230, 0.09); }
.tag.mm { color: var(--warn); border-color: rgba(232, 177, 90, 0.24); background: rgba(232, 177, 90, 0.09); }
.tag.zeus { color: var(--zeus); border-color: rgba(179, 140, 255, 0.24); background: rgba(179, 140, 255, 0.09); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 11px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
th { color: var(--dim); font: 600 10.5px var(--mono); letter-spacing: 0.09em; text-transform: uppercase; background: rgba(255, 255, 255, 0.016); }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td code { white-space: nowrap; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); }
.table-wrap table { min-width: 100%; }
.table-wrap table.wide { min-width: 980px; }
.table-wrap table.compact td, .table-wrap table.compact th { padding: 7px 10px; }
.table-wrap table.wide td:first-child { min-width: 190px; }
.table-scroll-hint { display: none; margin: 6px 0 0; font-size: 11px; color: var(--dim); font-family: var(--mono); }

/* ---------- callouts ---------- */
.callout {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 11px;
  margin: 13px 0; padding: 13px 15px;
  border: 1px solid var(--line); border-left: 3px solid var(--utils);
  border-radius: var(--radius-sm); background: rgba(95, 212, 230, 0.045);
}
.callout .ci { color: var(--utils); font: 600 14px var(--mono); }
.callout.warn { border-left-color: var(--warn); background: rgba(232, 177, 90, 0.05); }
.callout.warn .ci { color: var(--warn); }
.callout.danger { border-left-color: var(--accent); background: rgba(224, 86, 74, 0.055); }
.callout.danger .ci { color: var(--accent); }
.callout.ok { border-left-color: var(--ok); background: rgba(122, 214, 156, 0.05); }
.callout.ok .ci { color: var(--ok); }
.callout p { margin: 0; color: #c8c5bf; font-size: 13.4px; }
.callout p + p { margin-top: 6px; }
.callout strong { color: var(--text); }

/* ---------- doc layout ---------- */
.doc-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 30px; align-items: start; }
.sidebar {
  position: sticky; top: calc(var(--topbar) + 18px);
  align-self: start; max-height: calc(100vh - var(--topbar) - 36px);
  overflow: auto; padding: 14px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--card); scrollbar-width: thin;
}
.sidebar h4 { margin: 0 0 8px; color: var(--dim); font: 600 9.5px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.sidebar a { display: block; padding: 4px 6px; margin: 0 -6px; border-radius: 5px; color: var(--muted); font-size: 12.6px; }
.sidebar a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.sidebar a.is-active { color: var(--text); background: rgba(224, 86, 74, 0.12); }
.sidebar a[aria-current="page"] { color: var(--text); background: rgba(224, 86, 74, 0.12); }
.sidebar a[aria-current="page"]::before { content: "▸ "; color: var(--accent); }

/* ---------- API hierarchy ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.cat-col {
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  padding: 14px 16px; border-top: 2px solid var(--mod, var(--line));
}
.cat-col h3 { margin: 0 0 8px; font-size: 15px; }
.cat-col h3 a { color: var(--text); text-decoration: none; }
.cat-col h3 a:hover { color: var(--mod, var(--accent)); }
.cat-col a { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; color: var(--muted); font-size: 12.6px; text-decoration: none; }
.cat-col a:hover { color: var(--text); }
.api-cat { margin: 0 0 26px; scroll-margin-top: calc(var(--topbar) + 14px); }
.api-cat h2 { margin-bottom: 2px; }
.api-cat .table-wrap { margin-top: 10px; }
.api-table td:first-child { white-space: nowrap; }
.api-table td.num { text-align: right; color: var(--dim); font-family: var(--mono); font-size: 11.5px; }

/* ---------- catalogue cards ---------- */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.item-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card);
  text-decoration: none; color: inherit; transition: border-color 0.16s, background 0.16s, transform 0.16s;
}
.item-card:hover { border-color: rgba(224, 86, 74, 0.45); background: #14171f; transform: translateY(-1px); }
.item-card img { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.item-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-card-text strong { font-size: 13.6px; color: var(--text); }
.item-card-text code { font-size: 11px; color: var(--muted); background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.item-card-meta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.item-hero img {
  flex: 0 0 auto; width: 180px; height: 180px; object-fit: contain;
  border: 1px solid var(--line); border-radius: 14px; background: #0a0c11; padding: 8px;
}
@media (max-width: 640px) {
  .item-hero img { width: 120px; height: 120px; }
}
.sidebar .group { margin-top: 14px; }
.doc-body > h2:first-child { margin-top: 0.4rem; }
.doc-body h2, .doc-body h3 { scroll-margin-top: calc(var(--topbar) + 16px); }
.lead { font-size: 16px; color: var(--muted); }

/* ---------- steps ---------- */
.steps { counter-reset: step; }
.step { position: relative; padding: 0 0 18px 44px; counter-increment: step; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 29px; height: 29px; display: grid; place-items: center;
  border: 1px solid rgba(224, 86, 74, 0.4); border-radius: 8px;
  background: rgba(224, 86, 74, 0.1); color: var(--accent);
  font: 600 10px var(--mono);
}
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 33px; bottom: 2px; width: 1px;
  background: linear-gradient(180deg, rgba(224, 86, 74, 0.3), transparent);
}
.step h4 { margin: 2px 0 4px; font-size: 14.5px; }
.step p { margin: 0 0 7px; color: var(--muted); font-size: 13.2px; }
.step p:last-child { margin-bottom: 0; }

/* ---------- API ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.filterbar input[type="search"], .filterbar select {
  min-height: 34px; padding: 6px 10px;
  border-radius: 7px; border: 1px solid var(--line);
  background: #0a0c11; color: var(--text); font: 13px var(--sans);
}
.filterbar input[type="search"] { flex: 1 1 240px; }
.filterbar input:focus, .filterbar select:focus {
  outline: none; border-color: var(--utils); box-shadow: 0 0 0 3px rgba(95, 212, 230, 0.12);
}
.count { color: var(--dim); font: 11px var(--mono); }
.empty-row td { color: var(--dim); font: 12px var(--mono); text-align: center; padding: 18px; }

.api-fn {
  --mod: var(--accent);
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 44%), var(--card);
  scroll-margin-top: calc(var(--topbar) + 16px);
}
.api-fn + .api-fn { margin-top: 10px; }
.api-fn:target { border-color: color-mix(in srgb, var(--mod) 60%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--mod) 25%, transparent); }
.api-fn header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.api-fn header > * { min-width: 0; }
.api-fn h3 { margin: 0; font: 600 14.5px var(--mono); letter-spacing: 0; color: #e9d7b9; overflow-wrap: anywhere; }
.api-fn .sig { margin: 0 0 8px; font: 12.5px var(--mono); color: var(--muted); }
.api-fn p { margin: 0 0 8px; color: #c6c3bd; font-size: 13.4px; }
.api-fn .kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0; font-size: 12.8px; }
.api-fn .kv dt { color: var(--dim); font: 10.5px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; padding-top: 2px; }
.api-fn .kv dd { margin: 0; color: #c6c3bd; }
.api-fn .kv dt, .api-fn .kv dd { min-width: 0; overflow-wrap: anywhere; }
.api-fn .foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.fn-anchor { color: var(--dim); font: 11px var(--mono); }
.fn-anchor:hover { color: var(--utils); }

/* ---------- checklist ---------- */
.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check {
  display: flex; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line-soft); border-radius: 9px;
  background: rgba(255, 255, 255, 0.014); color: var(--muted); font-size: 12.8px;
}
.check input { margin-top: 3px; accent-color: var(--accent); }
.check b { color: var(--text); font-weight: 600; }
.check:has(input:checked) { border-color: rgba(122, 214, 156, 0.3); background: rgba(122, 214, 156, 0.07); }

/* ---------- disclosures ---------- */
details.disclosure {
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  margin: 7px 0; overflow: hidden;
}
details.disclosure summary {
  cursor: pointer; padding: 12px 15px; color: var(--text);
  font: 600 13.2px var(--sans); list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary::after { content: "+"; color: var(--accent); font: 600 17px var(--mono); line-height: 1; }
details.disclosure[open] summary::after { content: "−"; }
details.disclosure[open] summary { border-bottom: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.018); }
details.disclosure .detail-body { padding: 14px 15px; color: var(--muted); font-size: 13.3px; }
details.disclosure .detail-body > :first-child { margin-top: 0; }
details.disclosure .detail-body > :last-child { margin-bottom: 0; }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 5px 14px; font-size: 13px; }
.kv dt { color: var(--dim); font: 10.5px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; padding-top: 2px; }
.kv dd { margin: 0; color: #c6c3bd; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; color: var(--dim); font: 600 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.flow .arrow { color: var(--accent); }
.anchor-link { margin-left: 6px; color: var(--dim); font-size: 0.7em; opacity: 0; transition: opacity 0.15s ease; }
h2:hover .anchor-link, h3:hover .anchor-link, .api-fn:hover .anchor-link { opacity: 1; }
.copy-btn {
  margin-left: 5px; border: 1px solid var(--line); background: #151a23;
  color: var(--dim); border-radius: 4px; padding: 1px 5px;
  font: 10px var(--mono); cursor: pointer; vertical-align: 1px;
}
.copy-btn:hover { color: var(--text); border-color: #3a4252; }
.copy-btn.copied { color: var(--ok); border-color: rgba(122, 214, 156, 0.4); }
.top-link { display: inline-block; margin-top: 26px; font-size: 12px; color: var(--dim); font-family: var(--mono); }
.top-link:hover { color: var(--text); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { display: inline-flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 13px; }
.pager a:hover { color: var(--text); }
.pager span { color: var(--dim); font: 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- footer ---------- */
.footer { margin-top: 56px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 30px 22px 38px; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 26px; }
.footer h4 { color: var(--text); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 6px; }
.footer a { display: block; color: var(--muted); font-size: 12.7px; padding: 2.5px 0; }
.footer a:hover { color: var(--text); }
.footer p { color: var(--dim); font-size: 12px; margin: 8px 0 0; }
.footer-bottom {
  max-width: var(--max); margin: 0 auto; padding: 13px 22px 26px;
  border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 11.3px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
}

/* ---------- utilities ---------- */
.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: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 12px; border-radius: 6px; background: var(--accent); color: #fff; }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 2px solid var(--utils); outline-offset: 2px; }
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.45s ease, transform 0.45s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .panel { max-width: 520px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-grid, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .sidebar h4 { width: 100%; }
  .sidebar .group { margin-top: 0; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  :root { --topbar: 56px; }
  .topbar-inner { padding: 0 15px; gap: 10px; }
  .brand-text small { display: none; }
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none; position: absolute; top: var(--topbar); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 9px 15px 13px;
    background: #0a0c11; border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.45);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 9px 10px; }
  .wrap { padding: 0 15px; }
  .section { padding: 42px 0 8px; }
  .hero { padding: 40px 0 22px; }
  .role-grid, .grid-2, .grid-3, .grid-4, .checklist { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-scroll-hint { display: block; }
  .table-wrap table, .table-wrap table.wide { min-width: 620px; }
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { padding-top: 7px; }
  .api-fn .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  .topbar, .sidebar, .nav-toggle, .actions, .filterbar, .copy-btn, .footer, .pager { display: none !important; }
  body { background: #fff; color: #111; }
  body::before { display: none; }
  .card, .mod-card, .api-fn, .table-wrap, .callout, .check, .role-card { background: #fff; border-color: #ccc; box-shadow: none; }
  a { color: #0645ad; }
  code, pre { background: #f4f4f4; color: #111; border-color: #ccc; }
}

/* component color re-assertion: keep after the card rules so --mod wins */
.c-core { --mod: var(--core); --mod-soft: rgba(143, 164, 196, 0.13); }
.c-utils { --mod: var(--utils); --mod-soft: rgba(95, 212, 230, 0.12); }
.c-cinematic { --mod: var(--cinematic); --mod-soft: rgba(242, 166, 90, 0.13); }
.c-cbrn { --mod: var(--cbrn); --mod-soft: rgba(158, 224, 106, 0.12); }
.c-zeus { --mod: var(--zeus); --mod-soft: rgba(179, 140, 255, 0.13); }
.c-horror { --mod: var(--horror); --mod-soft: rgba(224, 86, 74, 0.13); }
.c-spectator { --mod: var(--spectator); --mod-soft: rgba(127, 209, 176, 0.13); }
.mod-card .kicker span:first-child, .card .icon-badge { color: var(--mod); }

/* ---------- lore section ---------- */
.badge-strip { display: flex; flex-wrap: wrap; gap: 12px; }
.badge-card {
  --mod: var(--horror);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 190px; padding: 16px 14px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(224, 86, 74, 0.10), transparent 60%), var(--card);
  color: var(--text); text-align: center;
}
.badge-card:hover { border-color: rgba(224, 86, 74, 0.5); color: var(--text); background: radial-gradient(120% 90% at 50% 0%, rgba(224, 86, 74, 0.16), transparent 60%), var(--card-hover); }
.badge-card img { display: block; width: 132px; height: 132px; object-fit: contain; }
.badge-card span { font: 600 15px var(--display); letter-spacing: 0.12em; }
.badge-card small { color: var(--dim); font-size: 11px; line-height: 1.35; }

.doc-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.doc-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}
.doc-tile:hover { border-color: rgba(224, 86, 74, 0.45); color: var(--text); background: var(--card-hover); }
.doc-tile img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; background: #0a0c11; }
.doc-tile span { font-size: 11.5px; line-height: 1.3; color: var(--text); }
.doc-tile small { font: 10px var(--mono); color: var(--dim); }

.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.doc-card {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px;
  padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--card);
  scroll-margin-top: calc(var(--topbar) + 16px);
}
.doc-card:target { border-color: rgba(224, 86, 74, 0.55); box-shadow: 0 0 0 1px rgba(224, 86, 74, 0.22); }
.doc-image img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 7px; border: 1px solid var(--line-soft); background: #0a0c11; }
.doc-body h3 { margin: 2px 0 6px; font-size: 16px; }
.doc-body > p { color: var(--muted); font-size: 13px; }
.doc-card > .disclosure { grid-column: 1 / -1; margin-top: 2px; }
.doc-card > p.small.dim { grid-column: 1 / -1; margin: 0; }
.doc-text {
  max-height: 420px; overflow: auto; margin: 0; padding: 12px;
  font-size: 11.6px; line-height: 1.5; white-space: pre-wrap;
  background: #06080c; border-left-color: var(--horror);
}

.figure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.figure { margin: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--card); overflow: hidden; }
.figure a { display: block; aspect-ratio: 4 / 3; background: #06080c; }
.figure img { display: block; width: 100%; height: 100%; object-fit: contain; }
.figure figcaption { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.figure figcaption b { font-size: 13.5px; }
.figure figcaption span { color: var(--muted); font-size: 12.5px; }

.division-card { display: flex; flex-direction: column; gap: 10px; }
.division-head { display: flex; align-items: center; gap: 14px; }
.division-head img { width: 96px; height: 96px; object-fit: contain; flex: 0 0 auto; }
.doc-link { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.doc-link img { width: 54px; height: 81px; object-fit: cover; border-radius: 4px; }
.doc-link b { font-size: 12.5px; }
audio { width: 100%; margin-top: 6px; filter: invert(0.86) hue-rotate(180deg) saturate(0.6); }

@media (max-width: 1080px) {
  .doc-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .doc-grid, .figure-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .doc-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-card { grid-template-columns: 130px minmax(0, 1fr); }
  .badge-strip { justify-content: center; }
}
