/* ============ Tokens ============ */
:root {
  --bg: #0b0d10;
  --bg-2: #10141a;
  --panel: #151a21;
  --panel-2: #1b222b;
  --line: #29313c;
  --line-2: #343e4b;
  --text: #e9eef3;
  --text-2: #b3bdc8;
  --muted: #818d9a;
  --accent: #f5a524;
  --accent-2: #ffc35c;
  --accent-ink: #1b1204;
  --aether: #a77bff;
  --ok: #43d08f;
  --ok-bg: rgba(67, 208, 143, .1);
  --warn: #ffb547;
  --warn-bg: rgba(255, 181, 71, .1);
  --danger: #ff6b6b;
  --danger-bg: rgba(255, 107, 107, .1);
  --info: #6cb6ff;
  --info-bg: rgba(108, 182, 255, .1);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --topbar-h: 58px;
  --font-head: 'Oswald', 'Arial Narrow', 'Segoe UI', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* element colours used by staffs, bows and other upgrades */
  --el-fire: #ff6a3d;
  --el-ice: #5cc8ff;
  --el-wind: #f1d04b;
  --el-lightning: #b47dff;
  --el-storm: #6aa8ff;
  --el-void: #b05cff;
  --el-wolf: #4fd6c3;
  --el-aether: #a77bff;
  --el-gold: #f5a524;
  --el-green: #6fdc6f;
  --el-red: #ff5d5d;
  --yt: #e62117;
  --yt-text: #ff6b62;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-2: #eceef2;
  --panel: #ffffff;
  --panel-2: #f6f7f9;
  --line: #dde1e7;
  --line-2: #cbd2db;
  --text: #15191f;
  --text-2: #3e4752;
  --muted: #69737f;
  --accent: #c47600;
  --accent-2: #e08a00;
  --accent-ink: #ffffff;
  --ok: #138a55;
  --ok-bg: rgba(19, 138, 85, .09);
  --warn: #a96300;
  --warn-bg: rgba(196, 118, 0, .1);
  --danger: #c43434;
  --danger-bg: rgba(196, 52, 52, .08);
  --info: #1f6fc4;
  --info-bg: rgba(31, 111, 196, .08);
  --shadow: 0 8px 24px rgba(20, 30, 45, .12);
  --el-fire: #d9481c;
  --el-ice: #1b8fcf;
  --el-wind: #a88a00;
  --el-lightning: #7d3fd6;
  --el-storm: #2f6fd6;
  --el-void: #8231d6;
  --el-wolf: #138f80;
  --el-aether: #7a4ee0;
  --el-gold: #c47600;
  --el-green: #2e9b2e;
  --el-red: #c43434;
  --yt-text: #c4170f;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f7;
    --bg-2: #eceef2;
    --panel: #ffffff;
    --panel-2: #f6f7f9;
    --line: #dde1e7;
    --line-2: #cbd2db;
    --text: #15191f;
    --text-2: #3e4752;
    --muted: #69737f;
    --accent: #c47600;
    --accent-2: #e08a00;
    --accent-ink: #ffffff;
    --ok: #138a55;
    --ok-bg: rgba(19, 138, 85, .09);
    --warn: #a96300;
    --warn-bg: rgba(196, 118, 0, .1);
    --danger: #c43434;
    --danger-bg: rgba(196, 52, 52, .08);
    --info: #1f6fc4;
    --info-bg: rgba(31, 111, 196, .08);
    --shadow: 0 8px 24px rgba(20, 30, 45, .12);
    --el-fire: #d9481c;
    --el-ice: #1b8fcf;
    --el-wind: #a88a00;
    --el-lightning: #7d3fd6;
    --el-storm: #2f6fd6;
    --el-void: #8231d6;
    --el-wolf: #138f80;
    --el-aether: #7a4ee0;
    --el-gold: #c47600;
    --el-green: #2e9b2e;
    --el-red: #c43434;
    color-scheme: light;
  }
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 64px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
html.drawer-open { overflow: hidden; }
main { flex: 1; outline: none; }
img { max-width: 100%; display: block; }
a { color: var(--accent-2); }
:root[data-theme="light"] a { color: var(--accent); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) a { color: var(--accent); } }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: .01em; line-height: 1.2; margin: 0; }
p { margin: 0 0 .75em; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .86em; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 760px) { .wrap { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 45; background: var(--bg); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--accent); margin: 0 0 6px; }
.lede { color: var(--text-2); font-size: 1.05rem; max-width: 70ch; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink) !important; text-decoration: none; font-weight: 700; border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.btn:hover { filter: brightness(1.08); }
.btn-small { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; border-radius: 8px; font-size: .85rem; }
.link-btn:hover { color: var(--text); background: var(--panel-2); }
.link-btn.armed { color: var(--danger); background: var(--danger-bg); }
.chip-label { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--muted); margin-right: 4px; }

/* ============ Top bar ============ */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
@media (min-width: 760px) { .topbar-inner { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; min-width: 0; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-mark rect { fill: var(--panel-2); stroke: var(--line-2); }
.brand-mark path { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text b { color: var(--accent); font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--line); }
#theme-toggle[data-mode="dark"] .icon-moon, #theme-toggle[data-mode="light"] .icon-sun { display: none; }

.search { position: relative; width: min(380px, 40vw); }
.search input { width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 12px 0 38px; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; padding: 6px; z-index: 60; }
.search-hit { display: flex; flex-direction: column; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.search-hit span { font-size: .82rem; color: var(--muted); }
.search-hit:hover, .search-hit:focus { background: var(--panel-2); }
.search-empty { padding: 10px; color: var(--muted); }
#search-toggle { display: none; }
@media (max-width: 759px) {
  #search-toggle { display: inline-grid; }
  .search { display: none; position: absolute; left: 0; right: 0; top: var(--topbar-h); width: auto; padding: 8px 12px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .search-icon { left: 23px; top: 19px; }
  .search-results { left: 12px; right: 12px; }
  html.search-open .search { display: block; }
}

/* ============ Game tabs ============ */
.gametabs { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.gametabs-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; padding-block: 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); scrollbar-width: none; }
.gametabs-inner::-webkit-scrollbar { display: none; }
@media (min-width: 760px) { .gametabs-inner { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); } }
.gametab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; color: var(--text-2); padding: 8px 14px; border-radius: 10px; font-family: var(--font-head); letter-spacing: .04em; text-transform: uppercase; font-size: .9rem; min-height: 40px; border: 1px solid transparent; }
.gametab:hover { background: var(--panel); color: var(--text); }
.gametab.active { background: var(--panel); color: var(--accent); border-color: var(--line-2); }
.gametab.soon { color: var(--muted); }
.gametab em { font-style: normal; font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: .7rem; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 6px; color: var(--muted); }

/* ============ Page heroes ============ */
.page-hero { padding: 40px 0 8px; }
.page-hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); text-transform: uppercase; margin-bottom: 10px; }
.group-h { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 32px 0 14px; display: flex; align-items: center; gap: 12px; }
.group-h::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ============ Map cards ============ */
.map-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-bottom: 8px; }
.map-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s ease, border-color .15s ease; }
.map-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.map-card-img { aspect-ratio: 16 / 8; background: var(--bg-2); overflow: hidden; }
.map-card-img img { width: 100%; height: 100%; object-fit: cover; }
.map-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.map-card h3 { font-size: 1.45rem; text-transform: uppercase; }
.map-card-ee { color: var(--text-2); font-size: .92rem; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: .74rem; border: 1px solid var(--line-2); color: var(--text-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.badge-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-bg); }
.badge-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-bg); }

/* ============ Progress ============ */
.progress { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.progress .bar { flex: 1; height: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .25s ease; }
.progress .count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress.small { margin-top: 10px; }

/* ============ Map page ============ */
.crumbs { display: flex; gap: 8px; align-items: center; padding-top: 14px; font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.map-hero { position: relative; overflow: hidden; margin-top: 10px; border-bottom: 1px solid var(--line); }
.map-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 60%); mask-image: linear-gradient(90deg, rgba(0,0,0,.35), #000 60%); }
:root[data-theme="light"] .map-hero-bg { opacity: .16; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .map-hero-bg { opacity: .16; } :root:not([data-theme="dark"]) .map-hero h1 { text-shadow: none; } }
.map-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, var(--bg)); pointer-events: none; }
.map-hero-inner { position: relative; z-index: 1; padding-top: 34px; padding-bottom: 24px; }
.map-hero h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); text-transform: uppercase; margin-bottom: 8px; text-shadow: 0 2px 18px rgba(0,0,0,.5); }
:root[data-theme="light"] .map-hero h1 { text-shadow: none; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; max-width: 900px; }
.quick-item { background: color-mix(in srgb, var(--panel) 82%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.quick-item span { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.quick-item strong { font-size: .95rem; font-weight: 600; }

.maptabs { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.maptabs-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.maptabs-inner::-webkit-scrollbar { display: none; }
.maptab { white-space: nowrap; text-decoration: none; color: var(--text-2); padding: 14px 14px 12px; border-bottom: 3px solid transparent; font-family: var(--font-head); text-transform: uppercase; letter-spacing: .05em; font-size: .92rem; min-height: 48px; display: inline-flex; align-items: center; }
.maptab:hover { color: var(--text); }
.maptab.active { color: var(--accent); border-bottom-color: var(--accent); }

.map-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 22px; padding-bottom: 60px; }
@media (min-width: 1080px) { .map-body:not(.no-toc) { grid-template-columns: minmax(0, 1fr) 220px; } }
.content { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.tab-intro { color: var(--text-2); max-width: 80ch; }
.toc { display: none; }
@media (min-width: 1080px) {
  .toc { display: block; }
  .toc-inner { position: sticky; top: calc(var(--topbar-h) + 70px); display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); padding-left: 12px; }
  .toc-h { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; color: var(--muted); margin-bottom: 6px; }
  .toc a { color: var(--text-2); text-decoration: none; font-size: .9rem; padding: 4px 0; border-left: 3px solid transparent; margin-left: -15px; padding-left: 12px; }
  .toc a:hover { color: var(--text); border-left-color: var(--c, var(--accent)); }
  .jump { display: none !important; }
}
.jump { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; align-items: center; scrollbar-width: thin; }
.jump a { white-space: nowrap; text-decoration: none; color: var(--text-2); border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-size: .85rem; }
.jump a:hover { border-color: var(--c, var(--accent)); color: var(--text); }

/* ============ Item cards ============ */
.item { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.item::before { content: ''; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c, var(--accent)); }
@media (min-width: 760px) { .item { padding: 22px 24px; } }
.item.in-drawer { border: 0; padding: 0; background: none; }
.item.in-drawer::before { display: none; }
.item-head { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: start; }
.item.no-img .item-head { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .item-head { grid-template-columns: 170px minmax(0, 1fr); gap: 20px; } }
.item-img { background: radial-gradient(circle at 50% 40%, var(--panel-2), var(--bg-2)); border: 1px solid var(--line); border-radius: 12px; padding: 6px; cursor: zoom-in; aspect-ratio: 4 / 3; overflow: hidden; }
.item-img img { width: 100%; height: 100%; object-fit: contain; }
.item-type { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; color: var(--c, var(--accent)); }
.item-name { font-size: clamp(1.35rem, 3.6vw, 1.75rem); text-transform: uppercase; margin: 2px 0 2px; }
.item-aka { color: var(--muted); font-size: .88rem; font-style: italic; margin-bottom: 6px; }
.item-summary { color: var(--text-2); margin: 6px 0 0; }
.block-h { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text); margin-top: 6px; }
.bullets { margin: 0 0 .5em; padding-left: 1.2em; }
.bullets li { margin: 4px 0; }
.bullets li::marker { color: var(--c, var(--accent)); }
.bullets .bullets { margin-top: 4px; }
.numbered { margin: 0 0 .5em; padding-left: 1.4em; }
.numbered li { margin: 4px 0; }
.content > .item p:last-child, .step-body p:last-child { margin-bottom: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; }
.facts div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-size: .95rem; }

/* refs / chips */
.ref { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 45%, var(--line)); color: var(--text); border-radius: 999px; padding: 1px 10px 1px 8px; font-size: .88em; font-weight: 600; line-height: 1.6; vertical-align: baseline; }
.ref::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.ref:hover { background: color-mix(in srgb, var(--c, var(--accent)) 24%, var(--panel-2)); }
.needs, .usedin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.needs { margin: 2px 0 8px; }
.needs .ref { padding: 4px 12px 4px 10px; min-height: 34px; }
.usedin { background: var(--bg-2); border: 1px dashed var(--line-2); border-radius: 12px; padding: 8px 10px; }
.usedin-link { display: inline-flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; font-size: .85rem; font-weight: 600; line-height: 1.3; }
.usedin-link:hover { border-color: var(--accent); }
.usedin-step { font-weight: 400; color: var(--muted); font-size: .8rem; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* callouts */
.callout { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; border: 1px solid; font-size: .95rem; margin: 6px 0; }
.callout .icon { margin-top: 2px; }
.callout > div > :last-child { margin-bottom: 0; }
.callout.tip { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.callout.tip .icon { color: var(--ok); }
.callout.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.callout.warn .icon { color: var(--warn); }
.callout.note { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.callout.note .icon { color: var(--info); }

/* figures */
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 8px 0; }
.fig { margin: 0; }
.fig.wide { grid-column: 1 / -1; }
.fig .zoom { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2); cursor: zoom-in; }
.fig img { width: 100%; height: 170px; object-fit: contain; }
.fig.wide img { height: auto; max-height: 520px; }
.fig figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; color: var(--muted); background: var(--bg-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) {
  .table-wrap { border: 0; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; padding: 6px 0; background: var(--panel-2); }
  td { border: 0; padding: 4px 12px; }
  td::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
}

/* ============ Checklists ============ */
.checklist { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.checklist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.checklist-head h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; margin-right: auto; }
.checklist-head .progress { flex: 1 1 160px; max-width: 280px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 14px 14px 14px 10px; border-bottom: 1px solid var(--line); transition: background .2s ease; }
.step:last-child { border-bottom: 0; }
.step-check { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; padding-top: 2px; }
.step-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.step-check .box { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line-2); background: var(--panel); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.step-check .box::after { content: ''; width: 12px; height: 7px; border-left: 3px solid var(--accent-ink); border-bottom: 3px solid var(--accent-ink); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.step-check input:checked + .box { background: var(--accent); border-color: var(--accent); }
.step-check input:checked + .box::after { opacity: 1; }
.step-check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.step-check:hover .box { border-color: var(--accent); }
.step-num { font-family: var(--font-head); font-size: .78rem; color: var(--muted); }
.step-title { font-family: var(--font-body); font-weight: 700; font-size: 1.04rem; letter-spacing: 0; margin: 4px 0 6px; line-height: 1.35; }
.step-body > p { color: var(--text-2); }
.step-body .bullets, .step-body .numbered { color: var(--text-2); }
.step.done .step-body { opacity: .5; }
.step.done .step-title { text-decoration: line-through; text-decoration-color: var(--muted); }
.step.done .step-body .figs, .step.done .step-body .spots { display: none; }
.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 30% { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 0 0 2px var(--accent); } 100% { background: transparent; box-shadow: none; } }

/* ============ Parts / spots / screenshots ============ */
.parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.part { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.part-head { display: flex; gap: 12px; align-items: center; }
.part-icon { width: 64px; height: 64px; flex: none; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: zoom-in; }
.part-icon img { width: 100%; height: 100%; object-fit: contain; }
.part h4 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em; }
.part-area { font-size: .85rem; color: var(--accent); }
.part-note { font-size: .88rem; color: var(--text-2); margin: 0; }
.spots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.spot { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: flex; flex-direction: column; gap: 6px; }
.spot-text { font-size: .93rem; color: var(--text-2); }
.spot-label { display: inline-block; margin-right: 6px; font-family: var(--font-head); text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; vertical-align: 1px; }

/* ============ Upgrade box ============ */
.upgrade { border: 1px solid color-mix(in srgb, var(--c, var(--accent)) 40%, var(--line)); border-radius: 14px; padding: 14px; background: color-mix(in srgb, var(--c, var(--accent)) 5%, var(--panel)); display: flex; flex-direction: column; gap: 12px; }
.upgrade-head { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 14px; align-items: start; }
.upgrade-head.no-img { grid-template-columns: minmax(0, 1fr); }
.upgrade-img { aspect-ratio: 4 / 3; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); cursor: zoom-in; }
.upgrade-img img { width: 100%; height: 100%; object-fit: contain; }
.upgrade-name { font-size: 1.3rem; text-transform: uppercase; }
.upgrade-head p { color: var(--text-2); margin: 6px 0 0; }

/* ============ Video links ============ */
.video { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text) !important; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); padding: 12px 14px; }
.video:hover { border-color: var(--yt); }
.video-icon { flex: none; width: 52px; height: 36px; border-radius: 10px; background: var(--yt); color: #fff; display: grid; place-items: center; }
.video-icon .icon { fill: currentColor; stroke: none; width: 22px; height: 22px; }
.video-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.video-kicker { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; color: var(--yt-text); }
.video-title { font-weight: 700; line-height: 1.35; }
.video-sub { font-size: .85rem; color: var(--muted); }
.video-go { flex: none; color: var(--muted); }
.watch { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; text-decoration: none; color: var(--text) !important; font-size: .85rem; font-weight: 600; border: 1px solid var(--line-2); background: var(--panel-2); border-radius: 999px; padding: 5px 12px 5px 8px; min-height: 34px; }
.watch:hover { border-color: var(--yt); }
.watch .icon { width: 18px; height: 18px; fill: var(--yt); stroke: none; }
.watch-t { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.part > .watch { align-self: flex-start; margin-top: 0; }

/* ============ Floating "next step" ============ */
.fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 35; display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; min-height: 48px; }
.fab[hidden] { display: none; }

/* ============ Drawer (quick look) ============ */
.drawer { position: fixed; inset: 0; z-index: 70; }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 9, .55); opacity: 0; transition: opacity .2s ease; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; outline: none; }
.drawer.open .drawer-panel { transform: none; }
.drawer-grip { display: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-head > div:first-child { flex: 1; min-width: 0; }
.drawer-kicker { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--accent); }
.drawer-head h2 { font-size: 1.5rem; text-transform: uppercase; }
.drawer-actions { display: flex; align-items: center; gap: 6px; }
.drawer-body { overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 40px; flex: 1; }
@media (max-width: 759px) {
  .drawer-panel { top: auto; left: 0; width: 100%; height: 90dvh; max-height: 90vh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .drawer-grip { display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line-2); margin: 8px auto 0; }
  .drawer-head { padding: 8px 10px 10px 16px; }
  .drawer-head h2 { font-size: 1.25rem; }
  .drawer-body { padding: 14px 14px calc(30px + env(safe-area-inset-bottom)); }
}

/* ============ Lightbox ============ */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .9); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1200px, 100%); }
.lightbox img { max-height: 84vh; width: auto; margin: 0 auto; border-radius: 8px; }
.lightbox figcaption { color: #ddd; text-align: center; margin-top: 8px; font-size: .9rem; }
.lightbox-close { position: absolute; top: 10px; right: 10px; color: #fff; }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding-top: 22px; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); text-align: center; }
.footer p { max-width: 900px; margin: 0 auto 6px; }
.footer-small { font-size: .78rem; }

/* ============ Small phones ============ */
@media (max-width: 480px) {
  .item { padding: 14px 14px 16px; border-radius: 12px; }
  .item-head { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .part { padding: 10px; }
  .step { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; padding: 12px 10px 12px 6px; }
  .upgrade { padding: 10px; }
  .upgrade-head { grid-template-columns: 70px minmax(0, 1fr); }
  .checklist-head .progress { max-width: none; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* ============ Step order ============ */
.order-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; color: var(--text-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px 2px 8px; white-space: nowrap; }
.order-chip .icon { width: 14px; height: 14px; }
.order-chip.any { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: var(--ok-bg); }
.any-group { list-style: none; margin: 10px 10px 10px 8px; border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); border-left: 4px solid var(--ok); border-radius: 12px; background: var(--ok-bg); overflow: hidden; }
.any-group > .steps > .step { background: var(--bg-2); }
.any-group > .steps > .step:last-child { border-bottom: 0; }
.any-group-label { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: .85rem; color: var(--ok); border-bottom: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.any-group-label .icon { width: 16px; height: 16px; flex: none; }
.any-group-label span { color: var(--text-2); }
.any-group-label strong { color: var(--ok); }
.order-note { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--ok); background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); border-radius: 999px; padding: 2px 10px 2px 8px; margin: 2px 0 6px; }
.order-note .icon { width: 14px; height: 14px; }
.order-legend { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--text-2); }
.order-legend > span { flex: none; color: var(--ok); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.order-legend .icon { width: 16px; height: 16px; }
.order-legend p { margin: 0; max-width: 80ch; }
@media (max-width: 480px) { .any-group { margin: 8px 6px; } }

/* ============ Inline clips ============ */
.watch.playing { border-color: var(--yt); background: color-mix(in srgb, var(--yt) 12%, var(--panel-2)); }
.clip { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #000; max-width: 720px; }
.clip-frame { aspect-ratio: 16 / 9; max-width: 100%; }
.clip-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.clip-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; background: var(--panel-2); font-size: .82rem; color: var(--muted); }
.clip-bar a { display: inline-flex; align-items: center; gap: 4px; }
.clip-bar .icon { width: 14px; height: 14px; }
.content > .item > .clip, .upgrade > .clip { max-width: none; }
.video.has-thumb { padding: 10px; }
.video-thumb { position: relative; flex: none; width: 160px; max-width: 40%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .video-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 30px; }
