/* FODIFF — Vault-Tec terminal theme (phosphor green on near-black, VT323 display + Share Tech Mono) */
:root {
  --bg: #020805;
  --bg2: rgba(3, 14, 8, 0.86);
  --panel: rgba(8, 26, 16, 0.78);
  --panel-solid: #07150d;
  --panel2: rgba(18, 52, 31, 0.85);
  --line: rgba(82, 255, 143, 0.16);
  --line2: rgba(82, 255, 143, 0.38);
  --text: #c8f5d5;
  --muted: #74c592;
  --dim: #3f7d56;
  --accent: #52ff8f;
  --accent-ink: #012010;
  --new: #52ff8f;
  --changed: #ffb641;
  --removed: #ff5f56;
  --link: #8dffb7;
  --glow: 0 0 1px rgba(82, 255, 143, .8), 0 0 10px rgba(82, 255, 143, .35);
  --glow-box: 0 0 0 1px rgba(82, 255, 143, .35), 0 0 18px rgba(82, 255, 143, .14);
  --radius: 4px;
  --mono: "Share Tech Mono", ui-monospace, Consolas, monospace;
  --display: "VT323", "Share Tech Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--mono); overflow: hidden; display: flex; flex-direction: column; }
/* topographic contour backdrop + vignette */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 0%, rgba(1, 4, 2, .55) 70%, rgba(1, 3, 2, .9) 100%),
    linear-gradient(rgba(82, 255, 143, .035) 1px, transparent 1px) 0 0 / 100% 64px,
    linear-gradient(90deg, rgba(82, 255, 143, .035) 1px, transparent 1px) 0 0 / 64px 100%,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='720' viewBox='0 0 720 720'%3E%3Cg fill='none' stroke='%2352ff8f' stroke-opacity='.075' stroke-width='1.2'%3E%3Cpath d='M170 120c80-40 190-30 230 40s-10 160-100 180-200-10-220-80 10-110 90-140z'/%3E%3Cpath d='M175 150c60-30 150-22 180 32s-8 122-76 138-152-8-168-62 6-82 64-108z'/%3E%3Cpath d='M190 178c42-20 104-15 125 22s-6 84-52 95-104-5-115-42 4-57 42-75z'/%3E%3Cpath d='M205 205c24-11 58-8 70 12s-3 47-29 53-58-3-64-23 2-32 23-42z'/%3E%3Cpath d='M480 420c90-30 200 10 210 90s-70 150-170 150-190-40-190-120 60-95 150-120z'/%3E%3Cpath d='M490 452c68-22 150 8 158 68s-53 112-128 112-142-30-142-90 45-72 112-90z'/%3E%3Cpath d='M502 486c45-15 100 5 105 45s-35 75-85 75-95-20-95-60 30-48 75-60z'/%3E%3Cpath d='M515 518c22-7 50 3 52 22s-17 37-42 37-47-10-47-30 15-23 37-29z'/%3E%3Cpath d='M-40 470c70-50 170-40 220 10s30 140-40 180-200 20-230-40 0-110 50-150z'/%3E%3Cpath d='M-10 500c50-36 122-28 158 8s22 100-28 128-142 14-164-28 0-80 34-108z'/%3E%3Cpath d='M20 530c30-22 74-17 96 5s13 60-17 77-86 8-99-17 0-48 20-65z'/%3E%3Cpath d='M560 40c60-20 140 10 150 60s-40 100-110 100-130-30-130-80 30-60 90-80z'/%3E%3Cpath d='M572 70c38-12 88 6 94 38s-25 62-69 62-82-19-82-50 19-38 57-50z'/%3E%3Cpath d='M300 600c40-20 100-10 110 25s-25 65-70 65-85-15-85-45 15-30 45-45z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 720px 720px;
}
/* scanlines */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, .12) 2px 3px);
  mix-blend-mode: multiply;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-shadow: var(--glow); }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(82, 255, 143, .3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(82, 255, 143, .18); border: 2px solid transparent; background-clip: padding-box; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(82, 255, 143, .32); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
input[type=checkbox] { accent-color: var(--accent); }

/* ---------- top bar ---------- */
.top { height: 58px; flex: none; display: flex; align-items: center; gap: 18px; padding: 0 18px; position: relative; z-index: 5;
  background: linear-gradient(to bottom, rgba(4, 18, 10, .96), rgba(3, 12, 7, .92));
  border-bottom: 1px solid var(--line2); box-shadow: 0 1px 0 rgba(82, 255, 143, .08), 0 6px 24px rgba(0, 0, 0, .5); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); font-family: var(--display); font-size: 26px;
  letter-spacing: .12em; text-shadow: var(--glow); }
.brand:hover { text-decoration: none; }
.brand::after { content: ""; width: 10px; height: 18px; background: var(--accent); box-shadow: var(--glow); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.logo { border: 1px solid var(--accent); color: var(--accent); border-radius: 3px; padding: 0 6px; font-size: 22px; line-height: 26px;
  letter-spacing: 0; box-shadow: var(--glow-box); }
.builds { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 3px; padding: 2px 9px; white-space: nowrap; color: var(--muted); }
.chip b { color: var(--accent); font-weight: 400; margin-right: 6px; text-shadow: var(--glow); }
.arrow { color: var(--accent); text-shadow: var(--glow); }
.tabs { display: flex; gap: 0; margin-left: 4px; }
.tabs a { color: var(--muted); padding: 4px 11px; font-family: var(--display); font-size: 20px; letter-spacing: .06em; text-transform: uppercase;
  border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--accent); text-decoration: none; text-shadow: var(--glow); }
.tabs a.active { color: var(--accent); border-color: var(--accent); text-shadow: var(--glow); }
.search { margin-left: auto; position: relative; }
.search::before { content: ">"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--accent); text-shadow: var(--glow); }
.search input { width: 300px; background: rgba(1, 8, 4, .8); border: 1px solid var(--line2); border-radius: 3px; padding: 7px 12px 7px 24px;
  outline: none; color: var(--accent); caret-color: var(--accent); }
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--accent); box-shadow: var(--glow-box); }

main { flex: 1; min-height: 0; overflow: auto; position: relative; z-index: 1; }
.page { padding: 26px 30px 70px; max-width: 1500px; margin: 0 auto; }
h1 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.05; margin: 0 0 6px; color: var(--accent);
  letter-spacing: .04em; text-transform: uppercase; text-shadow: var(--glow); }
h2 { font-family: var(--display); font-weight: 400; font-size: 23px; margin: 32px 0 12px; color: var(--accent); letter-spacing: .08em;
  text-transform: uppercase; text-shadow: var(--glow); display: flex; align-items: baseline; gap: 10px; }
h2::before { content: "//"; color: var(--dim); text-shadow: none; }
h2 .dim { font-size: 18px; text-shadow: none; }

/* ---------- status badges ---------- */
.badge { display: inline-block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; padding: 0 6px; border-radius: 2px;
  border: 1px solid currentColor; line-height: 17px; }
.badge.new { color: var(--new); background: rgba(82, 255, 143, .08); text-shadow: 0 0 6px rgba(82, 255, 143, .5); }
.badge.changed { color: var(--changed); background: rgba(255, 182, 65, .08); text-shadow: 0 0 6px rgba(255, 182, 65, .45); }
.badge.removed { color: var(--removed); background: rgba(255, 95, 86, .08); }
.badge.unchanged { color: var(--muted); }
.badge.sig { color: var(--muted); border-color: var(--line2); letter-spacing: .02em; }

/* ---------- overview ---------- */
.boot { border: 1px solid var(--line2); background: var(--panel); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px;
  box-shadow: inset 0 0 40px rgba(82, 255, 143, .04); position: relative; }
.boot .ln { display: flex; gap: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.boot .ln .dots { flex: 1; overflow: hidden; color: var(--dim); }
.boot .ln .dots::before { content: "................................................................................................................................................"; }
.boot .ln .ok { color: var(--accent); text-shadow: var(--glow); }
.boot .ready { color: var(--text); margin-top: 6px; }
.boot .ready b { color: var(--accent); font-weight: 400; text-shadow: var(--glow); }
.boot .ln { animation: typein .5s steps(20) both; }
.boot .ln:nth-child(2) { animation-delay: .15s; } .boot .ln:nth-child(3) { animation-delay: .3s; } .boot .ln:nth-child(4) { animation-delay: .45s; }
@keyframes typein { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 10px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; opacity: .5; }
.stat .n { font-family: var(--display); font-size: 46px; line-height: .95; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px currentColor; }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat .sub { color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.stat { color: var(--text); }
.stat.new { color: var(--new); } .stat.changed { color: var(--changed); } .stat.removed { color: var(--removed); }
.stat.new .l, .stat.changed .l, .stat.removed .l { color: var(--muted); }
.jump { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.jump a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius);
  color: var(--text); transition: border-color .15s, box-shadow .15s; }
.jump a:hover { border-color: var(--accent); box-shadow: var(--glow-box); text-decoration: none; text-shadow: none; }
.jump .jt { font-family: var(--display); font-size: 24px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; text-shadow: var(--glow); }
.jump .jd { color: var(--muted); font-size: 12.5px; }
.jump .jn { font-size: 12px; color: var(--dim); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 7px; transition: border-color .15s, box-shadow .15s; color: var(--text); }
.cat:hover { border-color: var(--accent); box-shadow: var(--glow-box); text-decoration: none; text-shadow: none; }
.cat .t { text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.cat .counts { display: flex; gap: 12px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cat .counts span { display: inline-flex; gap: 5px; align-items: center; }
.cat .bar { display: flex; height: 4px; background: rgba(82, 255, 143, .07); border-radius: 2px; overflow: hidden; gap: 2px; }
.cat .bar i { display: block; height: 100%; }
.cat .bar .bn { background: var(--new); box-shadow: 0 0 6px var(--new); } .cat .bar .bc { background: var(--changed); } .cat .bar .br { background: var(--removed); }
.cat.zero { opacity: .4; }
.dot { width: 7px; height: 7px; border-radius: 1px; display: inline-block; }
.dot.new { background: var(--new); box-shadow: 0 0 6px var(--new); } .dot.changed { background: var(--changed); } .dot.removed { background: var(--removed); }

/* ---------- item cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; transition: transform .12s, border-color .12s, box-shadow .12s; color: var(--text); position: relative; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--glow-box); text-decoration: none; text-shadow: none; }
.viewall { font-family: var(--mono); font-size: 12.5px; text-transform: none; letter-spacing: 0; margin-left: auto; text-shadow: none; }
.card .thumb { height: 150px; display: grid; place-items: center; overflow: hidden; color: var(--dim); font-family: var(--display); font-size: 26px;
  background: radial-gradient(circle at 50% 42%, rgba(82, 255, 143, .13), rgba(4, 16, 9, .4) 62%), linear-gradient(rgba(82, 255, 143, .04) 1px, transparent 1px) 0 0 / 100% 12px;
  border-bottom: 1px solid var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.card .body { padding: 9px 12px 11px; display: flex; flex-direction: column; gap: 4px; }
.card .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 14px; }
.card .ed { color: var(--dim); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- records browser ---------- */
.browser { display: grid; grid-template-columns: 260px 1fr; height: 100%; }
.side { border-right: 1px solid var(--line); overflow: auto; padding: 14px 10px 40px; background: var(--bg2); backdrop-filter: blur(2px); }
.side .grp { color: var(--accent); font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .1em; margin: 16px 8px 4px;
  text-shadow: var(--glow); }
.side a { display: flex; justify-content: space-between; align-items: center; padding: 3px 8px; border-radius: 2px; color: var(--muted); font-size: 13px;
  border-left: 2px solid transparent; }
.side a:hover { background: rgba(82, 255, 143, .06); color: var(--text); text-decoration: none; text-shadow: none; }
.side a.active { background: rgba(82, 255, 143, .1); color: var(--accent); border-left-color: var(--accent); }
.side a .c { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--dim); }
.side a.zero { opacity: .4; }
.list { overflow: auto; padding: 16px 22px 60px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 3px; padding: 2px; background: rgba(1, 8, 4, .6); }
.seg button { background: none; border: 0; padding: 3px 12px; border-radius: 2px; cursor: pointer; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; font-size: 12.5px; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 10px rgba(82, 255, 143, .4); }
.toolbar input[type=search], .swffilter, .mapside input[type=search] { background: rgba(1, 8, 4, .8); border: 1px solid var(--line2); border-radius: 3px;
  padding: 6px 10px; outline: none; color: var(--accent); }
.toolbar input[type=search] { width: 260px; }
.toolbar input[type=search]:focus, .swffilter:focus { border-color: var(--accent); box-shadow: var(--glow-box); }
.toolbar label { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.toolbar .total { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; }
table.rows { width: 100%; border-collapse: collapse; }
table.rows th { text-align: left; font-weight: 400; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  padding: 8px 10px; border-bottom: 1px solid var(--line2); position: sticky; top: -16px; background: rgba(3, 12, 7, .97); z-index: 1; }
table.rows td { padding: 6px 10px; border-bottom: 1px solid rgba(82, 255, 143, .07); vertical-align: middle; }
table.rows tr.r { cursor: pointer; }
table.rows tr.r:hover td { background: rgba(82, 255, 143, .06); }
table.rows tr.sel td { background: rgba(82, 255, 143, .12); }
td.ico { width: 34px; padding: 3px 6px !important; }
td.ico img { width: 28px; height: 28px; object-fit: contain; display: block; }
.old { color: var(--removed); text-decoration: line-through; opacity: .85; }
.more { margin: 16px auto; display: block; background: transparent; border: 1px solid var(--line2); border-radius: 3px; padding: 7px 20px; cursor: pointer;
  color: var(--accent); text-transform: uppercase; letter-spacing: .1em; }
.more:hover { border-color: var(--accent); box-shadow: var(--glow-box); }
.empty { color: var(--muted); padding: 40px; text-align: center; }
.empty::before { content: "> "; color: var(--accent); }

/* ---------- drawer ---------- */
.drawer { position: fixed; top: 58px; right: 0; bottom: 0; width: min(900px, 62vw); background: rgba(3, 12, 7, .97); border-left: 1px solid var(--line2);
  box-shadow: -24px 0 50px rgba(0, 0, 0, .6), -1px 0 0 rgba(82, 255, 143, .1); overflow: auto; z-index: 4; transition: transform .2s ease; }
.drawer.hidden { transform: translateX(105%); }
.drawer-close { position: absolute; top: 14px; right: 16px; background: transparent; border: 1px solid var(--line2); border-radius: 3px;
  width: 32px; height: 32px; cursor: pointer; color: var(--accent); z-index: 2; }
.drawer-close:hover { border-color: var(--accent); box-shadow: var(--glow-box); }
.det { padding: 22px 26px 70px; }
.det-head { display: flex; gap: 16px; align-items: flex-start; padding-right: 40px; }
.det-head .icon { width: 88px; height: 88px; border-radius: var(--radius); border: 1px solid var(--line2); display: grid; place-items: center; flex: none;
  background: radial-gradient(circle, rgba(82, 255, 143, .14), rgba(4, 16, 9, .5) 70%); color: var(--dim); font-family: var(--display); font-size: 20px; }
.det-head .icon img { max-width: 100%; max-height: 100%; }
.det-head h1 { font-size: 34px; }
.det-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.subtabs { display: flex; gap: 2px; margin: 18px 0 14px; border-bottom: 1px solid var(--line2); }
.subtabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 4px 12px; cursor: pointer; color: var(--muted);
  font-family: var(--display); font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
.subtabs button:hover { color: var(--text); }
.subtabs button.active { color: var(--accent); border-color: var(--accent); text-shadow: var(--glow); }
.desc { background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; white-space: pre-wrap; }
table.fields { width: 100%; border-collapse: collapse; font-size: 13px; }
table.fields td { padding: 6px 8px; border-bottom: 1px solid rgba(82, 255, 143, .07); vertical-align: top; }
table.fields td.k { width: 160px; color: var(--muted); white-space: nowrap; }
table.fields td.k .mono { color: var(--dim); font-size: 11px; margin-left: 5px; }
table.fields tr.added td { background: rgba(82, 255, 143, .07); }
table.fields tr.removed td { background: rgba(255, 95, 86, .07); }
table.fields tr.changed td { background: rgba(255, 182, 65, .06); }
td.op { width: 18px; text-align: center; }
tr.added td.op { color: var(--new); } tr.removed td.op { color: var(--removed); } tr.changed td.op { color: var(--changed); }
.val { word-break: break-word; }
.val .hex { font-size: 11.5px; color: var(--dim); word-break: break-all; }
.val .ref { display: inline-flex; gap: 5px; align-items: baseline; margin: 1px 8px 1px 0; }
.val .ref .s { font-size: 10.5px; color: var(--dim); }
.val .num { color: #9ff5ff; }
.val .str { color: #f3e6b3; }
.ref .s { font-size: 10.5px; color: var(--dim); margin-left: 4px; }
.cell { display: inline-block; font-size: 12px; background: rgba(82, 255, 143, .07); border: 1px solid var(--line); border-radius: 2px; padding: 0 5px;
  margin: 1px 3px 1px 0; color: var(--text); }
.ovr { display: grid; grid-template-columns: 1fr; gap: 14px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv .k { color: var(--muted); }

/* ---------- 3D viewer ---------- */
.viewer-wrap { display: grid; grid-template-columns: 1fr 230px; gap: 12px; }
.viewer { position: relative; height: 520px; border-radius: var(--radius); border: 1px solid var(--line2); overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #12301e, #030b06 72%); box-shadow: inset 0 0 60px rgba(0, 0, 0, .6); }
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer .hud { position: absolute; left: 10px; bottom: 8px; font-size: 11.5px; color: var(--muted); pointer-events: none; }
.viewer .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.viewer-opts { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.viewer-opts button { background: rgba(2, 10, 5, .8); border: 1px solid var(--line2); border-radius: 3px; padding: 2px 8px; cursor: pointer; font-size: 12px; color: var(--muted); }
.viewer-opts button.on, .viewer-opts button:hover { color: var(--accent); border-color: var(--accent); }
.models { display: flex; flex-direction: column; gap: 4px; max-height: 520px; overflow: auto; }
.models button { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 7px 9px; cursor: pointer; font-size: 12px; color: var(--text); }
.models button:hover { border-color: var(--line2); }
.models button.active { border-color: var(--accent); box-shadow: var(--glow-box); }
.models button .p { font-size: 11px; color: var(--dim); word-break: break-all; }
.texprev { max-width: 100%; max-height: 70vh; border-radius: 3px; border: 1px solid var(--line2);
  background: repeating-conic-gradient(#0b1a11 0 25%, #11261a 0 50%) 50% / 20px 20px; }
pre.text { background: rgba(1, 8, 4, .85); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow: auto; max-height: 70vh;
  font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; color: var(--text); }
.strrow td.t { white-space: pre-wrap; }
.loadingbar { color: var(--accent); padding: 30px; text-shadow: var(--glow); }
.loadingbar::before { content: "> "; }
.loadingbar::after { content: "_"; animation: blink 1s steps(1) infinite; }

/* ---------- typed fields, stats, charts ---------- */
.tf { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 2px 12px; font-size: 12.5px; }
.tf .tk { color: var(--muted); }
.tf .tf { margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); }
table.mini { border-collapse: collapse; font-size: 12px; margin: 2px 0; }
table.mini th { text-align: left; color: var(--accent); font-weight: 400; padding: 2px 10px 2px 0; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
table.mini td { padding: 2px 10px 2px 0; border-top: 1px solid rgba(82, 255, 143, .07); vertical-align: top; }
h3.sec { font-family: var(--display); font-weight: 400; font-size: 20px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent);
  margin: 10px 0 4px; text-shadow: var(--glow); }
.statblocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.statblock { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.statblock .sb-t { margin-bottom: 6px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.sb-t { color: var(--accent); }
table.changes td.val b { color: var(--accent); font-weight: 400; }
.add { color: var(--new); }
.chart { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); padding: 2px 6px 0; min-width: 0; }
.chart .legend > span { min-width: 0; overflow-wrap: anywhere; }
.chart .legend .readout { margin-left: auto; white-space: nowrap; color: var(--text); }
.chart .legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.tree { font-size: 13px; }
.tree details { margin-left: 14px; }
.tree summary { cursor: pointer; padding: 2px 0; }
.tree summary::marker { color: var(--accent); }
.tree .leaf { margin-left: 14px; padding: 2px 0; }
audio { width: 100%; height: 34px; vertical-align: middle; filter: hue-rotate(80deg) saturate(.6) brightness(.9); }
.jsontree { background: rgba(1, 8, 4, .85); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; max-height: 60vh;
  overflow: auto; font-size: 12px; margin-bottom: 12px; }
.jsontree .tk { color: var(--muted); }
.jsontree > details { margin-left: 0; }

/* ---------- swf ---------- */
#swftab h3 { font-family: var(--display); font-weight: 400; font-size: 19px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 18px 0 6px; }
.swflist { font-size: 12px; background: rgba(1, 8, 4, .85); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px 10px; max-height: 360px; overflow: auto; margin: 4px 0; }
.swflist div { white-space: pre-wrap; word-break: break-word; padding: 1px 0; }
.swflist.add div { color: var(--new); }
.swflist.rem div { color: var(--removed); }
.swfcls { margin: 8px 0; }
.swfcls summary { cursor: pointer; padding: 4px 0; }
.swfimgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.swfimgs figure { margin: 0; background: repeating-conic-gradient(#0b1a11 0 25%, #11261a 0 50%) 50% / 16px 16px; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.swfimgs img { width: 100%; height: 120px; object-fit: contain; display: block; }
.swfimgs figcaption { font-size: 11px; padding: 4px 6px; background: var(--panel-solid); color: var(--muted); word-break: break-all; }
.swfstage { height: 480px; background: #030b06; border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; position: relative; }
.swfstage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.swffilter { width: 260px; margin-bottom: 8px; }

/* ---------- dialogue ---------- */
details.dlg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; margin: 6px 0; }
details.dlg summary { cursor: pointer; }
details.dlg summary::marker { color: var(--accent); }
.dline { border-top: 1px solid rgba(82, 255, 143, .08); padding: 8px 0; }
.dmeta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.dresp { margin: 4px 0 4px 10px; padding-left: 10px; border-left: 2px solid var(--line2); }
.dvoice { display: grid; grid-template-columns: max-content 1fr; gap: 4px 8px; align-items: center; margin-top: 4px; font-size: 11px; }

/* ---------- map ---------- */
.mapwrap { display: grid; grid-template-columns: 250px 1fr; height: 100%; }
.mapside { background: var(--bg2); border-right: 1px solid var(--line); padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.mapside .grp { color: var(--accent); font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .1em; margin: 12px 0 2px; text-shadow: var(--glow); }
.mapside label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); }
.mapside .sigs { display: flex; flex-direction: column; gap: 2px; }
.mapstage { position: relative; overflow: hidden; cursor: grab; }
.mapstage:active { cursor: grabbing; }
.mapstage canvas { display: block; }
.maptip { position: absolute; display: none; pointer-events: none; background: rgba(3, 12, 7, .96); border: 1px solid var(--line2);
  border-radius: 3px; padding: 6px 9px; font-size: 12px; max-width: 260px; z-index: 2; box-shadow: var(--glow-box); }
.maphud { position: absolute; left: 10px; bottom: 8px; font-size: 11.5px; color: var(--muted); background: rgba(2, 8, 4, .8); padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
a.chip { color: var(--muted); text-decoration: none; cursor: pointer; font-size: 12.5px; }
a.chip:hover { color: var(--accent); border-color: var(--accent); text-shadow: none; }
a.chip.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px rgba(82, 255, 143, .4); }
a.chip.on .dim, a.chip.on span { color: var(--accent-ink) !important; opacity: .75; }

/* ---------- emotes ---------- */
.emote-row { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.emotestage { width: 256px; height: 256px; background: #d8d2c0; border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; position: relative;
  box-shadow: var(--glow-box); }
.emotestage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: #555; }

/* ---------- animation player ---------- */
.animpick { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.animpick select, .animbar select { background: rgba(1, 8, 4, .85); border: 1px solid var(--line2); border-radius: 3px; padding: 4px 6px; max-width: 360px; margin-left: 6px; color: var(--text); }
.animbar { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.animbar button { background: transparent; border: 1px solid var(--line2); border-radius: 3px; width: 36px; height: 30px; cursor: pointer; color: var(--accent); }
.animbar button:hover { box-shadow: var(--glow-box); }
.animbar input[type=range] { flex: 1; accent-color: var(--accent); }
.animnotes { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.animnotes button { border: 0; cursor: pointer; color: var(--muted); }

/* ---------- plans ---------- */
.plancards { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.plancard { cursor: default; }
.plancard:hover { transform: none; }
.plancard .thumb { height: 140px; }
.plancard .nm { color: var(--text); }
.plancard a.nm:hover { color: var(--accent); }
.plancard .pl-make { font-size: 12.5px; }
.plancard .pl-row { font-size: 12px; color: var(--muted); }
.plancard .pl-comps { color: var(--text); opacity: .85; }
.plancard .pl-changes { font-size: 12px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }

@media (max-width: 1440px) {
  .search input { width: 220px; }
  .tabs a { padding: 4px 8px; }
}
@media (max-width: 1200px) {
  .drawer { width: calc(100vw - 40px); }
  .viewer-wrap { grid-template-columns: 1fr; }
  .models { max-height: 220px; }
  .builds { display: none; }
  .search input { width: 170px; }
  .tabs a { font-size: 18px; padding: 4px 6px; }
}
@media (max-width: 900px) {
  .builds { display: none; }
  .browser, .mapwrap { grid-template-columns: 1fr; }
  .side, .mapside { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .brand::after, .loadingbar::after { animation: none; }
  .boot .ln { animation: none; }
}

/* sound toggle */
.sndtoggle { margin-left: auto; white-space: nowrap; flex: none; background: transparent; border: 1px solid var(--line2); border-radius: 3px; color: var(--accent); cursor: pointer;
  font-size: 12px; letter-spacing: .08em; padding: 3px 8px; text-shadow: var(--glow); }
.sndtoggle:hover { border-color: var(--accent); box-shadow: var(--glow-box); }
.sndtoggle.off { color: var(--dim); text-shadow: none; }
.sndtoggle + .search { margin-left: 0; }

/* ---------- compact overview ---------- */
.boot { padding: 10px 16px; margin-bottom: 14px; font-size: 13px; }
.hero-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.hero-stats .stat { padding: 7px 12px 6px; cursor: default; }
.hero-stats .stat .n { font-size: 32px; }
.hero-stats .stat .l { font-size: 11px; }
.stat.world { color: var(--text); }
nav.jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; grid-template-columns: none; }
nav.jump a { flex-direction: row; align-items: baseline; gap: 8px; padding: 3px 12px; }
nav.jump .jt { font-size: 20px; }
nav.jump .jn { font-size: 12.5px; color: var(--muted); }
.cats.compact { grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 6px; }
.cats.compact .cat { padding: 6px 10px 7px; gap: 5px; }
.cats.compact .cl { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cats.compact .t { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cats.compact .counts { gap: 8px; font-size: 12px; flex: none; }
.cats.compact .bar { height: 3px; }
.page > h1 { margin-top: 2px; }
@media (max-width: 1100px) { .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
nav.jump { justify-content: center; }

/* published-build disclaimer */
.disclaimer { position: fixed; left: 10px; bottom: 6px; z-index: 6; font-size: 10.5px; color: var(--dim); pointer-events: none;
  background: rgba(2, 8, 5, .7); padding: 1px 6px; border-radius: 3px; }

/* curve tables */
.curvegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; }
.curvecard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.curvecard .chart { padding: 4px; min-width: 0; }
.curvecard { min-width: 0; display: flex; flex-direction: column; }
.curvecard .chart { margin-top: 6px; }
.curvelv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 12px; margin-top: 6px; font-size: 12px; }
.curvelv > div { white-space: nowrap; border-bottom: 1px solid var(--line); padding: 2px 0; }
.curvelv b { color: var(--accent); font-weight: 400; }

/* buff / nerf badges */
.badge.verdict.buff { color: #52ff8f; background: rgba(82, 255, 143, .14); border-color: #52ff8f; }
.badge.verdict.nerf { color: #ff5f56; background: rgba(255, 95, 86, .14); border-color: #ff5f56; }
.badge.verdict.mixed { color: #ffb641; background: rgba(255, 182, 65, .12); border-color: #ffb641; }
table.balance tr.up td.op { color: var(--new); } table.balance tr.down td.op { color: var(--removed); }
table.balance tr.minor { opacity: .65; }
table.balance td.val b { color: var(--text); font-weight: 400; }

/* long editor IDs wrap inside stat/recipe cards instead of spilling into the next card */
.statblock { min-width: 0; overflow: hidden; }
.statblock .sb-t, .tf .tv, .tf .tk { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.statblock .sb-t { text-transform: none; }

/* ================= phones & small tablets ================= */
.side-select { display: none; }
.mapfilters-btn { display: none; }
@media (max-width: 760px) {
  body { font-size: 13.5px; }
  body::after { display: none; } /* scanlines cost battery and blur small text */
  .disclaimer { display: none; }
  /* header: brand + sound + search on row 1, scrollable tabs on row 2 */
  .top { height: auto; flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px 0; }
  .brand { font-size: 22px; }
  .brand::after { width: 8px; height: 15px; }
  .logo { font-size: 18px; line-height: 22px; }
  .sndtoggle { margin-left: auto; padding: 2px 6px; font-size: 11px; }
  .search { order: 2; flex: 1 1 100%; margin: 0; }
  .search input { width: 100% !important; }
  .tabs { order: 3; flex: 1 1 100%; margin: 0 -12px; padding: 0 6px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { font-size: 19px; padding: 6px 10px; white-space: nowrap; }

  .page { padding: 16px 12px 50px; }
  h1 { font-size: 27px; }
  h2 { font-size: 20px; margin: 22px 0 10px; flex-wrap: wrap; }
  .boot { padding: 8px 10px; font-size: 11.5px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .hero-stats .stat .n { font-size: 28px; }
  nav.jump a { padding: 3px 9px; }
  nav.jump .jt { font-size: 17px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .card .thumb { height: 110px; }
  .card .body { padding: 7px 8px 9px; }
  .card .nm { font-size: 13px; }
  .plancards { grid-template-columns: 1fr !important; }

  /* records / files: sidebar becomes a dropdown above the list */
  .browser { display: block; }
  .side { display: none; }
  .side-select { display: block; width: 100%; margin-bottom: 10px; background: rgba(1, 8, 4, .85); color: var(--accent);
    border: 1px solid var(--line2); border-radius: 3px; padding: 8px 10px; font-family: var(--mono); font-size: 14px; }
  .list { padding: 12px 10px 50px; height: 100%; }
  .toolbar { gap: 8px; }
  .toolbar input[type=search] { width: 100%; flex: 1 1 100%; }
  .toolbar .total { margin-left: 0; }
  .seg button { padding: 4px 9px; }
  table.rows th { top: -12px; }
  table.rows td, table.rows th { padding: 6px 6px; }
  /* drop the wide ID columns; the name + type + status are what matter on a phone */
  #rows tr td:nth-child(3), .browser table.rows thead th:nth-child(3), #rows tr td:nth-child(5), .browser table.rows thead th:nth-child(5) { display: none; }
  .assets-table td:nth-child(2), .assets-table th:nth-child(2) { display: none; }
  td.mono, .assets-table td { word-break: break-all; }

  /* record / file drawer: full screen above the header */
  .drawer { top: 0; width: 100vw; z-index: 30; border-left: 0; overflow-x: hidden; }
  .drawer .val, .drawer .ref, .drawer td, .drawer .desc { overflow-wrap: anywhere; word-break: break-word; }
  .drawer-close { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; width: 38px; height: 38px; background: rgba(2, 8, 5, .9); }
  .det { padding: 14px 12px 60px; clear: both; }
  .det-head { gap: 10px; padding-right: 0; }
  .det-head .icon { width: 64px; height: 64px; }
  .det-head h1 { font-size: 25px; }
  .subtabs { overflow-x: auto; scrollbar-width: none; }
  .subtabs button { font-size: 17px; padding: 4px 9px; white-space: nowrap; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv > *, .tf > *, table.fields td { min-width: 0; }
  .val .ref { flex-wrap: wrap; max-width: 100%; }
  .drawer .mono { overflow-wrap: anywhere; }
  .kv .k { margin-top: 6px; }
  table.fields td.k { width: auto; white-space: normal; min-width: 90px; }
  table.fields td { padding: 5px 4px; }
  .tf { grid-template-columns: minmax(90px, max-content) 1fr; }
  .statblocks, .curvegrid { grid-template-columns: 1fr; }
    .viewer { height: 340px; }
  .viewer-wrap { grid-template-columns: 1fr; }
  .models { max-height: 180px; }
  .emote-row { grid-template-columns: 1fr; }
  .swfstage { height: 300px; }
  .dvoice { grid-template-columns: 1fr; }

  /* map: filters slide in over the map */
  .mapwrap { display: block; height: 100%; position: relative; }
  .mapstage { height: 100%; }
  .mapside { display: flex; position: absolute; inset: 0 auto 0 0; width: min(280px, 85vw); z-index: 3; transform: translateX(-105%);
    transition: transform .2s ease; box-shadow: 10px 0 30px rgba(0, 0, 0, .6); }
  .mapwrap.filters-open .mapside { transform: none; }
  .mapfilters-btn { display: block; position: absolute; top: 8px; left: 8px; z-index: 4; background: rgba(2, 8, 5, .9); color: var(--accent);
    border: 1px solid var(--line2); border-radius: 3px; padding: 5px 10px; font-family: var(--mono); letter-spacing: .06em; }
  .maphud { font-size: 10.5px; right: 8px; }
}
