/* Nivalis Nights Companion: design system "Neon night market" (direction A). Tokens, components and layout rules: conventions/style.md.
   One file for the website and the desktop app. Dark only (the game is a night city). */
:root {
  color-scheme: dark;
  /* surfaces: warm black, one gray family */
  --bg: #140e0f; --bg-deep: #0f0a0b; --panel: #1d1416; --panel2: #261b1d; --raised: #2e2123;
  --line: #3a2a2a; --line-soft: #2b1f20;
  --text: #f3e7df; --dim: #b39e94;
  /* accent: neon red-orange; second warm; sign pink only for rare highlights */
  --accent: #ff6a3d; --accent2: #ffb35c; --sign: #ff4f8b; --onaccent: #1a0b07;
  --glow: 0 0 22px -4px var(--accent);
  /* semantic (never the accent): scores and status */
  --good: #4cc38a; --mid: #e8c35a; --bad: #e5484d;
  --goodtx: #8fdcb4; --warntx: #f2c879; --badtx: #ff9d96;
  --goodline: #2f6b4c; --warnline: #7a5a26; --badline: #7d3434; --badbg: #4a1d1f;
  --input: #170f11; --hover: #241a1c; --explain: #1a1213; --focus: #ffb35c;
  /* shape: one scale */
  --r-sm: 4px; --r: 6px; --radius: var(--r); --radius-sm: var(--r-sm);
  /* type */
  --display: "Chakra Petch", "Bahnschrift", "Arial Narrow", system-ui, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, Consolas, "SFMono-Regular", Menlo, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", monospace;
  --font: 14px/1.55 var(--body);
  /* layout: one container; header, subnav, main and footer share the same content edge */
  --wrap: 1240px; --gut: 20px;
  --edge: max(var(--gut), calc((100% - var(--wrap)) / 2 + var(--gut)));
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font: var(--font);
  overflow-wrap: break-word; -webkit-font-smoothing: antialiased; overflow-x: clip;
}
/* page width by layout (<main data-layout>, set from registerPage({layout})): wide = data and tool pages, home = landing.
   --edge is recomputed on body so header, subnav, main and footer keep one content edge whatever the width. */
body { --edge: max(var(--gut), calc((100% - var(--wrap)) / 2 + var(--gut))); }
body:has(#main[data-layout="wide"]) { --wrap: 1600px; }
body:has(#main[data-layout="home"]) { --wrap: 1400px; }
/* atmosphere: two warm radial glows, fixed behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(1100px 520px at 88% -12%, #3a1712 0%, transparent 62%), radial-gradient(860px 520px at -12% 38%, #2a0f1c 0%, transparent 60%), var(--bg);
}
a { color: var(--text); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--accent) 75%, transparent); }
a:hover { color: var(--accent2); text-decoration-color: var(--accent2); }
img { max-width: 100%; }
code { font: 12.5px var(--mono); }
b, strong { font-weight: 600; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
table, .kpi, .s, .num, .bar .val, .count, .tnum { font-variant-numeric: tabular-nums; }

/* ---------- focus, skip link, visually hidden ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
label.filebtn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 30; background: var(--accent); color: var(--onaccent); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- shell: header, nav, language, subnav, footer ---------- */
#top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header { display: flex; align-items: center; gap: 6px 22px; min-height: 60px; padding: 8px var(--edge); flex-wrap: wrap; }
#brand { order: 0; margin: 0; font: 700 18px/1 var(--display); letter-spacing: .02em; white-space: nowrap; display: flex; align-items: center; }
#brand > a, #brand > .brand-t { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; }
#brand > a::before, #brand > .brand-t::before { content: ""; width: 12px; height: 12px; margin-right: 10px; border: 2px solid var(--accent); box-shadow: 0 0 10px var(--accent), inset 0 0 5px var(--accent); flex: none; }
#brand .dim { margin-left: 6px; font: 500 12px var(--body); letter-spacing: 0; }
nav#nav { order: 1; display: flex; gap: 2px; flex-wrap: wrap; }
nav#nav a, nav#nav button { position: relative; background: none; border: 0; color: var(--dim); padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font: 500 14px/1.2 var(--body); text-decoration: none; }
nav#nav a:hover, nav#nav button:hover { color: var(--text); }
nav#nav a.on, nav#nav button.on { color: var(--text); }
nav#nav a.on::after, nav#nav button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 1px; height: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
header .status { order: 2; margin-left: auto; display: flex; gap: 4px 14px; flex-wrap: wrap; align-items: center; color: var(--dim); font-size: 13px; }
header .status b { color: var(--text); font-family: var(--mono); font-weight: 600; font-size: 12.5px; }
header .status > a { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 10px; text-decoration: none; color: var(--dim); white-space: nowrap; }
header .status > a.warn { color: var(--accent2); }
header .status > a:hover { border-color: var(--accent2); color: var(--text); }
.lang { order: 3; display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.lang:empty { display: none; }
.lang button, .lang a { background: none; border: none; color: var(--dim); padding: 5px 10px; cursor: pointer; font: 600 12px/1.2 var(--body); text-decoration: none; }
.lang > * + * { border-left: 1px solid var(--line); }
.lang button.on, .lang a.on { background: var(--panel2); color: var(--accent2); }
.lang a:hover, .lang button:hover { color: var(--text); }
#subnav { display: none; gap: 4px; padding: 0 var(--edge); border-top: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: thin; }
#subnav button, #subnav a { background: none; border: none; border-bottom: 2px solid transparent; color: var(--dim); padding: 9px 10px 8px; cursor: pointer; font: 500 13.5px/1.2 var(--body); white-space: nowrap; text-decoration: none; }
#subnav button:hover, #subnav a:hover { color: var(--text); }
#subnav button.on, #subnav a.on { color: var(--text); border-bottom-color: var(--accent); }
main { display: block; max-width: var(--wrap); margin: 0 auto; padding: 20px var(--gut) 40px; min-height: 60vh; }
main:focus { outline: none; }
footer#foot { max-width: var(--wrap); margin: 32px auto 0; padding: 22px var(--gut) 36px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
footer#foot > a { color: var(--dim); }
footer#foot > a:hover { color: var(--accent2); }
footer#foot .foot-note { flex: 1 1 320px; }
footer#foot .foot-link { background: none; border: 0; padding: 0; font: inherit; color: var(--dim); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--accent) 75%, transparent); }
footer#foot .foot-link:hover { color: var(--accent2); text-decoration-color: var(--accent2); }
/* support popup (website footer): native <dialog>, opened with showModal() */
.support-dlg { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--text); font-size: 14px; box-shadow: 0 18px 50px color-mix(in srgb, var(--bg-deep) 85%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
.support-dlg::backdrop { background: color-mix(in srgb, var(--bg-deep, #0f0a0b) 75%, transparent); }
.support-in { padding: 18px 20px 20px; }
.support-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.support-head h2 { font: 600 18px/1.25 var(--display); margin: 0; flex: 1; }
.support-in > p { margin: 0 0 14px; line-height: 1.55; color: var(--dim); }
.support-in > p.support-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.support-links .b { flex: 1 1 140px; }

/* ---------- cards and layout ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; min-width: 0; box-shadow: inset 0 1px 0 #ffffff07; }
.card h2 { font: 600 18px/1.25 var(--display); letter-spacing: .01em; margin: 0 0 12px; color: var(--text); display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.card h2 .dim, .card h2 .small { font-family: var(--body); font-weight: 400; letter-spacing: 0; }
.card h3 { font: 600 15px/1.3 var(--display); letter-spacing: .01em; margin: 18px 0 8px; }
/* page title: the first card of a page (or the one right after the breadcrumb) */
main > .card:first-child > h2:first-child, .crumbs + .card > h2:first-child, h2.hero-t, .page-h { font: 700 26px/1.15 var(--display); letter-spacing: 0; margin-bottom: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.row.center { justify-content: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.grid > * { min-width: 0; }
.grid > .card { margin-bottom: 0; }
.sub { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.lead { color: var(--dim); font-size: 16px; line-height: 1.6; max-width: 68ch; margin: 0 0 18px; }
.prose { max-width: 860px; }
.prose p, .prose li, .prose dd { line-height: 1.65; }

/* ---------- buttons ---------- */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; font: 500 13.5px/1.3 var(--body); text-decoration: none; white-space: nowrap; transition: border-color .15s, box-shadow .2s, background-color .15s, transform .1s; }
.b:hover { border-color: var(--accent2); color: var(--text); }
.b:active { transform: translateY(1px); }
.b.p { background: var(--accent); border-color: var(--accent); color: var(--onaccent); font-weight: 600; }
.b.p:hover { background: #ff7a50; border-color: #ff7a50; color: var(--onaccent); box-shadow: var(--glow); }
.b.lg { padding: 12px 20px; font-size: 15px; }
.b.ghost { background: transparent; }
button.d, .b.d { border-color: var(--badline); color: var(--badtx); }
button.d:hover, .b.d:hover { background: var(--badbg); border-color: var(--bad); }
.b.xs, button.b.xs { padding: 2px 8px; font-size: 12px; }
.b:disabled, .b[aria-disabled="true"] { opacity: .5; cursor: default; transform: none; }
.b.on, .b[aria-pressed="true"], .sub button.on { border-color: var(--accent); color: var(--accent2); background: color-mix(in srgb, var(--accent) 10%, var(--panel2)); }
label.filebtn { position: relative; }

/* ---------- forms ---------- */
input, select, textarea { background: var(--input); border: 1px solid var(--line); color: var(--text); padding: 7px 10px; border-radius: var(--r-sm); font: inherit; max-width: 100%; transition: border-color .15s; }
input:hover, select:hover { border-color: #4a3636; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent2); outline: 2px solid color-mix(in srgb, var(--focus) 60%, transparent); outline-offset: 0; }
input::placeholder { color: #8f7b72; }
input[type=number] { width: 90px; font-family: var(--mono); font-size: 13px; }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--accent); }
/* sliders: no text-field box (padding narrowed the track, so the thumb did not line up with the ends) */
input[type=range] { padding: 0; border: 0; background: none; vertical-align: middle; min-width: 120px; }
/* inline validation message next to a field (readNum / fieldMsg in lib/html.js) */
input[aria-invalid="true"] { border-color: var(--bad); }
.field-err { color: var(--badtx); font-size: 12.5px; margin-left: 6px; }
input[type=checkbox] { vertical-align: middle; }
input.search { margin-left: auto; min-width: 220px; flex: 0 1 300px; }
input.search.big { display: block; width: 100%; max-width: 680px; margin: 0; font-size: 16px; padding: 12px 14px 12px 40px; flex: none; background: var(--input) no-repeat 14px 50% / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b39e94' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
input.w52 { width: 52px; } input.w70 { width: 70px; }
select { max-width: 100%; }
.row > label { min-width: 0; max-width: 100%; }
label.nw, .nw { white-space: nowrap; }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
th { color: var(--dim); font: 600 12px/1.3 var(--body); letter-spacing: .02em; position: sticky; top: 0; background: var(--panel); z-index: 1; border-bottom-color: var(--line); }
tr:hover td { background: var(--hover); }
td.nw { white-space: nowrap; }
.scroll { max-height: 640px; overflow: auto; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ---------- small data components ---------- */
.dim { color: var(--dim); } .small { font-size: 12.5px; }
.good { color: var(--goodtx); } .bad { color: var(--badtx); } .warn { color: var(--warntx); }
.tag { display: inline-block; padding: 0 6px; margin: 1px 2px; border-radius: 3px; font-size: 11.5px; line-height: 18px; border: 1px solid; white-space: nowrap; }
.pref { outline: 2px solid var(--accent2); outline-offset: 1px; }
.s { display: inline-block; min-width: 34px; text-align: center; padding: 1px 5px; border-radius: 3px; font: 700 12px/16px var(--mono); color: #140e0f; }
.s.good { background: var(--good); } .s.mid { background: var(--mid); } .s.bad { background: var(--bad); }
.s.off { opacity: .35; }
.pill { display: inline-block; padding: 2px 8px; border-radius: var(--r-sm); background: var(--panel2); border: 1px solid var(--line); margin: 2px; font-size: 12px; line-height: 1.45; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.pill.warn { color: var(--warntx); border-color: var(--warnline); }
.pill.bad { color: var(--badtx); border-color: var(--badline); }
.pill.good { color: var(--goodtx); border-color: var(--goodline); }
.pill.dim { opacity: .75; }
.pill.lk { text-decoration: none; }
.pill a { text-decoration: none; }
.pill a:hover { text-decoration: underline; }
.kpi { display: inline-block; padding: 8px 12px; margin: 0 8px 8px 0; background: var(--panel2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); color: var(--dim); font-size: 13px; line-height: 1.5; vertical-align: top; }
.kpi b { color: var(--text); font: 600 16px/1.3 var(--mono); }
.kpi > .dim:first-child { display: block; font-size: 12px; }
.row > .kpi { margin: 0; }
.explain { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 75%), var(--explain); border-left: 2px solid var(--accent); padding: 10px 14px; margin: 10px 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 13px; line-height: 1.6; color: var(--dim); }
.explain b { color: var(--text); }
.note { background: var(--explain); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px 16px; }
.note h3 { margin: 0 0 6px; font: 600 15px var(--display); color: var(--text); }
.note p { margin: 4px 0; }
.lk { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; color: inherit; }
.lk:hover { color: var(--accent2); }
.focus { outline: 2px solid var(--accent); box-shadow: var(--glow); }
.meter { background: #2a1d1d; height: 8px; border-radius: 2px; width: 120px; max-width: 100%; overflow: hidden; }
.meter > div { height: 8px; border-radius: 2px; max-width: 100%; }
.meter.sm { height: 7px; width: 90px; } .meter.sm > div { height: 7px; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 60px; margin-bottom: 22px; }
.bars div { background: linear-gradient(0deg, var(--accent), var(--accent2)); width: 22px; border-radius: 2px 2px 0 0; position: relative; }
.bars span { position: absolute; bottom: -18px; left: -6px; right: -6px; text-align: center; font: 11px var(--mono); color: var(--dim); }
.relrow { display: flex; align-items: center; gap: 6px; }
.relrow .rl { min-width: 72px; }
.h2-right { margin-left: auto; font: 400 13px var(--body); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
pre.log { background: var(--input); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; max-height: 220px; overflow: auto; font: 12px/1.5 var(--mono); white-space: pre-wrap; }
details > summary { cursor: pointer; }
details > summary::marker { color: var(--accent); }
dl.defs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dl.defs dt { font-weight: 600; white-space: nowrap; }
dl.defs dd { margin: 0; color: var(--dim); }
ul.plain { list-style: none; margin: 4px 0; padding: 0; }
ul.plain li { margin: 6px 0; }
ol.todo { margin: 4px 0; padding-left: 20px; }
ol.todo li { margin: 4px 0; }

/* ---------- empty / loading (skeleton) / error ---------- */
.offline { padding: 44px 16px; text-align: center; color: var(--dim); }
.offline h2 { color: var(--text); font: 600 20px var(--display); margin: 0 0 8px; }
.offline p { max-width: 560px; margin: 8px auto; }
.offline.err h2, .offline h2.warn { color: var(--warntx); }
.offline.loading { padding: 8px 0 24px; text-align: left; font-size: 12.5px; }
.offline.loading::before {
  content: ""; display: block; height: 128px; margin-bottom: 10px; border-radius: var(--r);
  background:
    linear-gradient(100deg, transparent 20%, #ffffff0c 50%, transparent 80%) -150% 0 / 60% 100% no-repeat,
    linear-gradient(var(--panel2) 0 0) 0 0 / 34% 22px no-repeat,
    linear-gradient(var(--panel2) 0 0) 0 40px / 92% 12px no-repeat,
    linear-gradient(var(--panel2) 0 0) 0 62px / 80% 12px no-repeat,
    linear-gradient(var(--panel2) 0 0) 0 84px / 86% 12px no-repeat,
    linear-gradient(var(--panel2) 0 0) 0 112px / 44% 12px no-repeat;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { background-position: 250% 0, 0 0, 0 40px, 0 62px, 0 84px, 0 112px; } }
.card.errcard { border-color: var(--badline); }
#toast { position: fixed; right: 18px; bottom: 18px; background: var(--raised); border: 1px solid var(--accent); white-space: pre-line; padding: 10px 14px; border-radius: var(--r); display: none; max-width: 420px; z-index: 25; box-shadow: 0 10px 30px -10px #000, var(--glow); }
#toast.err { border-color: var(--bad); box-shadow: 0 10px 30px -10px #000; }

/* ---------- game images ---------- */
img.ic { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
img.ic.sm { width: 20px; height: 20px; margin-right: 3px; }
img.portrait { width: 40px; height: 40px; object-fit: cover; object-position: top; border-radius: var(--r-sm); vertical-align: middle; margin-right: 8px; background: var(--panel2); }
/* source icons are 128 px wide: never shown wider than 1.5x */
img.banner { width: 192px; max-width: 40vw; height: auto; border-radius: var(--r-sm); object-fit: cover; vertical-align: middle; }
img.banner.sm { width: 96px; height: 48px; max-width: 30vw; }
td > img.banner { width: 128px; margin: 0 0 6px; display: block; }
.name { display: flex; align-items: center; min-width: 150px; }
/* art(): high-res art when available, otherwise a framed icon (≤1.5x) or a gradient */
.art { position: relative; display: block; overflow: hidden; border-radius: var(--r); background: radial-gradient(120% 90% at 80% 0%, #4a1b12 0%, transparent 60%), radial-gradient(100% 100% at 0% 100%, #3a1226 0%, transparent 60%), var(--panel2); }
.art > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art.px > img { image-rendering: pixelated; object-fit: none; }
.art.px.sized { max-width: 100%; aspect-ratio: auto; }
.art.px.sized > img { object-fit: fill; width: 100%; height: auto; }
.art.icon { display: grid; place-items: center; }
.art.icon > img { width: auto; height: auto; max-width: min(100%, 192px); max-height: min(100%, 192px); object-fit: contain; filter: drop-shadow(0 8px 18px #0009); }
.art.fallback::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 22px, #ffffff05 22px 23px); }
.art-banner { width: 100%; max-width: 640px; aspect-ratio: 2 / 1; margin: 6px 0 12px; }
.card h2 img.banner { width: 128px; }
.art-banner.icon > img { max-height: 128px; }

/* ---------- breadcrumb ---------- */
.crumbs { font-size: 12.5px; margin: 0 0 10px; color: var(--dim); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line); }
.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--accent2); }
.crumbs li[aria-current] { color: var(--text); }

/* ---------- home (marketing) ---------- */
.mk { --sec: 64px; }
.mk-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding: 28px 0 48px; min-height: min(560px, calc(100dvh - 140px)); }
.mk-hero h1 { font: 700 clamp(36px, 5vw, 60px)/1.04 var(--display); letter-spacing: -.01em; margin: 0 0 18px; max-width: 15ch; }
.mk-hero h1 em { font-style: normal; color: var(--accent); text-shadow: 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); }
.mk-hero .mk-sub { font-size: 17px; line-height: 1.6; color: var(--dim); max-width: 44ch; margin: 0 0 26px; }
.mk-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.collage { position: relative; aspect-ratio: 1 / .86; width: 100%; }
.collage .art { position: absolute; border: 1px solid #ffffff1a; box-shadow: 0 30px 60px -22px #000, 0 0 0 1px #0004; }
.collage .c1 { width: 60%; aspect-ratio: 4 / 3; left: 0; top: 7%; transform: rotate(-3deg); }
.collage .c2 { width: 52%; aspect-ratio: 4 / 3; right: 0; top: 0; transform: rotate(2.5deg); }
.collage .c3 { width: 50%; aspect-ratio: 4 / 3; left: 25%; bottom: 0; transform: rotate(-1deg); box-shadow: 0 30px 60px -22px #000, 0 0 40px -12px var(--accent); }
.collage .art.fallback.c1 { background: radial-gradient(90% 80% at 75% 20%, #ff6a3d55, transparent 60%), radial-gradient(70% 70% at 10% 90%, #ff4f8b33, transparent 60%), #241619; }
.collage .art.fallback.c2 { background: radial-gradient(80% 90% at 30% 30%, #ffb35c44, transparent 60%), #1f1517; }
.collage .art.fallback.c3 { background: linear-gradient(160deg, #ff6a3d40, transparent 55%), radial-gradient(80% 60% at 80% 100%, #ff4f8b40, transparent 60%), #261719; }
.mk-sec { padding: 52px 0; border-top: 1px solid var(--line); }
.mk-sec > h2 { font: 700 30px/1.12 var(--display); margin: 0 0 8px; }
.mk-sec > .mk-lede { color: var(--dim); margin: 0 0 26px; max-width: 62ch; font-size: 15.5px; line-height: 1.6; }
.mk-find { padding: 0 0 44px; }
.mk-find .mk-counts { margin: 10px 0 0; color: var(--dim); font-size: 13.5px; }
.mk-find .mk-counts b { color: var(--text); font-family: var(--mono); }
.tool { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.panel h3 { font: 600 19px/1.2 var(--display); margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.panel .sub2 { font-size: 13px; color: var(--dim); margin-bottom: 16px; }
.tool .pick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tool .pick label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--dim); flex: 1 1 180px; min-width: 0; }
.bar { display: grid; grid-template-columns: minmax(70px, 120px) 1fr 44px; gap: 10px; align-items: center; font-size: 13.5px; margin-block: 9px; }
.bar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { position: relative; height: 10px; background: #2a1d1d; border-radius: 2px; }
.bar .track::after { content: ""; position: absolute; left: var(--floor, -10px); top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); opacity: .55; }
.bar .fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 12px -2px var(--accent); }
.bar.out .fill { background: #5a4542; box-shadow: none; }
.bar.out { color: var(--dim); }
.bar .val { font: 600 13.5px var(--mono); text-align: right; }
.panel .legend { margin: 14px 0 0; }
.panel .more { margin: 16px 0 0; }
.kv { display: flex; gap: 10px 26px; flex-wrap: wrap; margin-top: 16px; font-size: 12.5px; color: var(--dim); }
.kv b { display: block; font: 600 19px/1.3 var(--mono); color: var(--text); }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 12px; font-size: 14px; line-height: 1.5; }
ol.steps li::before { content: counter(s); font: 700 13px/26px var(--mono); text-align: center; border: 1px solid var(--accent); color: var(--accent); border-radius: 3px; height: 28px; }
ol.steps .d { color: var(--dim); font-size: 13px; }
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 168px; gap: 14px; }
.tile { position: relative; overflow: hidden; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; text-decoration: none; color: var(--text); min-width: 0; transition: border-color .2s, box-shadow .2s; }
.tile:hover { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); box-shadow: 0 0 30px -14px var(--accent); color: var(--text); }
.tile h3 { font: 700 20px/1.1 var(--display); margin: 0 0 6px; position: relative; display: flex; align-items: baseline; gap: 8px; }
.tile h3 .n { font: 600 14px var(--mono); color: var(--accent2); }
.tile p { margin: 0; font-size: 13.5px; color: var(--dim); position: relative; line-height: 1.5; max-width: 52ch; }
.tile > .art { position: absolute; inset: 0; border-radius: 0; opacity: .55; }
.tile > .art.icon { opacity: .9; place-items: start end; padding: 14px; }
.tile > .art.icon > img { max-width: 96px; max-height: 96px; }
.tile.img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 15%, #140e0ff2 85%); pointer-events: none; }
.tile > *:not(.art) { position: relative; z-index: 1; }
.tile .strip { display: flex; gap: 6px; margin-bottom: auto; flex-wrap: wrap; }
.tile .strip img { width: 40px; height: 40px; object-fit: contain; margin: 0; }
.tile .strip img.portrait { width: 40px; height: 40px; margin: 0; }
.tile .count { font: 700 42px/1 var(--mono); color: var(--sign); text-shadow: 0 0 18px color-mix(in srgb, var(--sign) 55%, transparent); margin-bottom: auto; }
.tile.warm { background: linear-gradient(120deg, #2a1015, var(--panel) 70%); }
.tile.ember { background: linear-gradient(200deg, #2c160d, var(--panel) 65%); }
.t-a { grid-column: span 4; grid-row: span 2; }
.t-b { grid-column: span 2; grid-row: span 2; }
.t-c { grid-column: span 3; }
.t-d { grid-column: span 3; }
.t-e { grid-column: span 2; }
.desk { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 28px; margin-top: 8px; border: 1px solid var(--accent); border-radius: var(--r); background: linear-gradient(90deg, #2a120c, var(--panel)); box-shadow: 0 0 40px -18px var(--accent); }
.desk h2 { font: 700 24px/1.15 var(--display); margin: 0 0 6px; }
.desk p { margin: 0; color: var(--dim); max-width: 60ch; }

/* ---------- search ---------- */
.hsearch { margin: 4px 0 8px; }
ul.results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 2px 24px; }
ul.results li { padding: 5px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.results a { text-decoration: none; color: var(--text); }
ul.results a:hover b { color: var(--accent2); }

/* ---------- wiki hub ---------- */
.hub-head { display: grid; gap: 6px; margin: 4px 0 22px; }
.hub-head h1 { font: 700 34px/1.1 var(--display); margin: 0; }
.hub-head p { margin: 0 0 12px; color: var(--dim); font-size: 15.5px; max-width: 66ch; }
.hub-sec { margin-top: 32px; }
.hub-sec > h2 { font: 600 20px/1.2 var(--display); margin: 0 0 12px; }
.useful { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.useful a { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--panel); text-decoration: none; color: var(--text); min-width: 0; }
.useful a:hover { border-color: var(--accent2); }
.useful a > img, .useful a > .ph { grid-row: span 2; width: 36px; height: 36px; object-fit: contain; margin: 0; }
.useful a > .ph { border-radius: var(--r-sm); background: var(--panel2); }
.useful .k { font-size: 12px; color: var(--dim); }
.useful .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.useful .v { font-family: var(--mono); color: var(--accent2); font-size: 12.5px; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; }
.recent a { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 10px; font-size: 13px; text-decoration: none; color: var(--text); background: var(--panel); }
.recent a:hover { border-color: var(--accent2); }
.recent a span { color: var(--dim); font-size: 12px; margin-left: 6px; }

/* ---------- guides ---------- */
.glist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; counter-reset: g; }
.glist li { counter-increment: g; border-top: 1px solid var(--line); }
.glist a { display: grid; grid-template-columns: 36px 1fr; gap: 2px 12px; padding: 16px 0; text-decoration: none; color: var(--text); }
.glist a::before { content: counter(g, decimal-leading-zero); grid-row: span 2; font: 600 14px/1.6 var(--mono); color: var(--accent); }
.glist a b { font: 600 17px/1.3 var(--display); }
.glist a span { color: var(--dim); font-size: 13.5px; line-height: 1.55; }
.glist a:hover b { color: var(--accent2); }
article.guide { max-width: 760px; padding: 28px 32px; font-size: 15.5px; line-height: 1.7; }
.guide h2:not(.hero-t) { font: 600 22px/1.25 var(--display); margin: 30px 0 10px; display: block; }
.guide h3 { font: 600 17px/1.3 var(--display); margin: 24px 0 8px; }
.guide p { margin: 0 0 14px; }
.guide ul, .guide ol { padding-left: 22px; margin: 0 0 14px; }
.guide li { margin: 4px 0; }
.guide li::marker { color: var(--accent); }
.guide table { width: auto; max-width: 100%; margin: 12px 0 18px; display: block; overflow-x: auto; font-size: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.guide th { position: static; background: var(--panel2); }
.guide blockquote { margin: 16px 0; padding: 10px 16px; border-left: 2px solid var(--accent); background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 80%); color: var(--text); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.guide blockquote p:last-child { margin-bottom: 0; }
.guide code { background: var(--input); border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.guide pre { background: var(--input); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px 14px; overflow-x: auto; font: 13px/1.5 var(--mono); }
.guide pre code { border: 0; padding: 0; background: none; }
.guide-next { display: flex; justify-content: space-between; gap: 12px; max-width: 760px; margin-top: 4px; }
.guide-next a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); text-decoration: none; font: 600 15px/1.3 var(--display); max-width: 48%; }
.guide-next a:hover { border-color: var(--accent2); color: var(--text); }
.guide-next a:last-child:not(:first-child) { text-align: right; }
.guide-next .small { font: 500 12px var(--body); }

/* ---------- 404 ---------- */
.nf { padding: 48px 0 24px; }
.nf-code { font: 700 clamp(64px, 12vw, 120px)/1 var(--mono); color: var(--sign); text-shadow: 0 0 28px color-mix(in srgb, var(--sign) 55%, transparent); margin: 0 0 12px; }
.nf h1 { font: 700 32px/1.15 var(--display); margin: 0 0 10px; }

/* ---------- my save ---------- */
.dropzone { border: 1px dashed #5a4040; border-radius: var(--r); padding: 26px 16px; text-align: center; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent), var(--input); transition: border-color .2s, box-shadow .2s; }
.dropzone.big { padding: 36px 16px; margin-bottom: 16px; }
.dropzone p { margin: 6px 0; }
.dz-ic { color: var(--accent); display: block; margin: 0 auto 6px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 60%, transparent)); }
body.dragging .dropzone, body.dragging main { outline: 2px dashed var(--accent); outline-offset: -6px; }
body.dragging .dropzone { border-color: var(--accent); box-shadow: var(--glow); }
.path { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.path code { background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 8px; word-break: break-all; flex: 1 1 220px; color: var(--text); }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 0 28px; }
.feat { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.feat b { color: var(--text); font-family: var(--display); font-size: 15px; }
.feat.go { cursor: pointer; transition: border-color .15s; }
.feat.go:hover b { color: var(--accent2); }
.feat.go b::after { content: " \2192"; color: var(--accent); }

/* ---------- dashboard ---------- */
.home-vh { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.home-vh:hover h2 { color: var(--accent2); }
.home-q { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.home-q:last-child { border-bottom: none; }
.home-q:hover { background: var(--hover); }

/* ---------- quests: conditions, rewards, fails ---------- */
code.qv { font: 11px var(--mono); color: var(--dim); background: var(--input); padding: 0 4px; border-radius: 3px; word-break: break-all; }
.qc { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 3px 0; }
.qa { font-size: 12.5px; }
.qa.ok { color: var(--goodtx); } .qa.no { color: var(--badtx); } .qa.unk { color: var(--dim); }
.qlab { font-size: 11px; color: var(--dim); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; margin-right: 4px; white-space: nowrap; }
.qlab.bad { color: var(--badtx); border-color: var(--badline); }
.qlab.warn { color: var(--warntx); border-color: var(--warnline); }
.qbox { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; }
.qstep { margin: 3px 0; }
.qhint { margin: 2px 0 4px 12px; padding-left: 10px; border-left: 2px solid var(--line); }
.qw { padding: 1px 0; }
.qstuck details > summary { margin-top: 2px; }
.pill.qr { white-space: normal; }
.pill.qr img.ic.sm { width: 16px; height: 16px; }
.qsum { color: var(--text); font: 600 17px var(--display); }
.pill.qfailed { background: var(--badbg); color: #ffc2bd; border-color: #a8433e; font-weight: 600; font-size: 12.5px; }
.pill.qx { color: var(--accent2); border-color: var(--warnline); background: color-mix(in srgb, var(--accent2) 10%, transparent); }
.qfail b.bad { color: var(--badtx); }
.qfrow { margin: 4px 0 4px 12px; padding-left: 10px; border-left: 2px solid var(--badline); }
.card.qfate { border-color: var(--badline); }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "+"; display: inline-block; width: 20px; font: 600 16px var(--mono); color: var(--accent); }
details.card[open] > summary::before { content: "\2212"; }
details.spoiler { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin: 8px 0; background: var(--input); }
details.spoiler > summary { color: var(--text); list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.spoiler > summary::-webkit-details-marker { display: none; }
details.spoiler > summary::before { content: "+"; font: 600 15px/1 var(--mono); color: var(--accent); width: 14px; }
details.spoiler[open] > summary::before { content: "\2212"; }
details.spoiler > summary .dim { border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; font-size: 11.5px; }
details.spoiler[open] > summary { margin-bottom: 8px; }
details.spoiler:hover { border-color: #4a3636; }
details.spoiler.qfail { border-color: var(--badline); }
details.inline { display: inline; }
details.inline > summary { display: inline; font-size: 12px; }
ol.qsteps { margin: 4px 0; padding-left: 22px; }
ol.qsteps li { margin: 6px 0; }
ol.qsteps li::marker { color: var(--accent); font-family: var(--mono); font-size: 12px; }
.qfilters { margin: 12px 0 0; }
.qfilters select { max-width: 220px; }
.card.qguide h3 { margin: 16px 0 6px; }

/* ---------- staff timeline, planner ---------- */
table.timeline { table-layout: fixed; min-width: 560px; }
table.timeline th, table.timeline td { padding: 2px; text-align: center; border-bottom-color: transparent; font-family: var(--mono); }
table.timeline td:first-child { text-align: left; font-family: var(--body); }
.dbar { background: linear-gradient(0deg, var(--accent), var(--accent2)); border-radius: 2px; }
.pl-sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 8px 22px; margin: 10px 0; }
.pl-sl { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(90px, 2fr) 48px; gap: 10px; align-items: center; font-size: 13px; }
.pl-sl input[type=range] { width: 100%; }
.pl-sl b { text-align: right; font-family: var(--mono); }
.pl-types { gap: 6px 14px; }
.pl-types > label { display: inline-flex; align-items: center; gap: 5px; }
.pl-types > .dim { flex-basis: 100%; }
.pl-recipes { margin: 8px 0; line-height: 2; }
.pl-recipes label { margin-right: 10px; }
tr.pl-cur td { background: var(--hover); }
.pl-linked p { margin: 0; }
.pl-linked .row { margin-bottom: 0; }

/* ---------- wide screens ---------- */
/* text keeps a reading measure on wide pages */
#main[data-layout="wide"] .card > p, #main[data-layout="wide"] .explain, #main[data-layout="wide"] .note p, #main[data-layout="wide"] .lead { max-width: 100ch; }
/* article table of contents (built from h2/h3), shown beside the text from 1440px */
.toc { display: none; }
.toc-h { margin: 0 0 8px; font: 600 12px/1.3 var(--body); color: var(--dim); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 4px 0 4px 12px; border-left: 2px solid transparent; color: var(--dim); text-decoration: none; font-size: 13px; line-height: 1.4; }
.toc li.h3 a { padding-left: 24px; font-size: 12.5px; }
.toc a:hover { color: var(--text); border-left-color: var(--accent2); }
/* home: the atmosphere glows scale with the window, so they reach both edges on large monitors
   (a fixed layer like body::before: nothing wider than the page, no horizontal scroll) */
body:has(#main[data-layout="home"])::before {
  background: radial-gradient(62vw 62vh at 86% -10%, #3a1712 0%, transparent 64%), radial-gradient(52vw 70vh at -8% 42%, #2a0f1c 0%, transparent 62%),
    radial-gradient(46vw 40vh at 55% 105%, #24100e 0%, transparent 70%), var(--bg);
}
@media (min-width: 1440px) {
  #main[data-layout="article"] .with-toc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
  .toc { display: block; position: sticky; top: 112px; max-height: calc(100vh - 128px); overflow: auto; scrollbar-width: thin; }
  /* wiki lists: filters and search in a sidebar */
  .wl { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
  .wl-side { position: sticky; top: 112px; }
  .wl-side input.search { margin-left: 0; min-width: 0; flex: 1 1 100%; width: 100%; }
  .wl-main .scroll { max-height: calc(100vh - 170px); }
  /* planner: scenario and tabs on the left, results on the right */
  .pl-layout { display: grid; grid-template-columns: minmax(360px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
  .pl-side { position: sticky; top: 112px; max-height: calc(100vh - 124px); overflow: auto; scrollbar-width: thin; border-radius: var(--r); }
  .pl-side > .card { margin-bottom: 0; }
  .pl-side .row > label:not(.nw) { display: flex; flex-direction: column; gap: 4px; flex: 1 1 100%; }
  .pl-side .h2-right { margin-left: 0; width: 100%; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  #brand > a::before, #brand > .brand-t::before { animation: flick 7s infinite; }
  @keyframes flick { 0%, 92%, 100% { opacity: 1 } 93% { opacity: .45 } 95% { opacity: 1 } 96% { opacity: .6 } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- narrow ---------- */
@media (max-width: 1080px) and (min-width: 701px) {
  .lang { margin-left: auto; }
  header .status { order: 4; width: 100%; margin-left: 0; }
  header .status:empty { display: none; }
}
@media (max-width: 900px) {
  .mk-hero, .tool { grid-template-columns: 1fr; }
  .mk-hero { min-height: 0; padding-top: 12px; gap: 28px; }
  .collage { max-width: 560px; }
  .bento { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; }
  .t-a, .t-b { grid-column: span 2; grid-row: span 1; }
  .t-c, .t-d, .t-e { grid-column: span 1; }
  .bento > .tile:last-child:nth-child(odd) { grid-column: span 2; }
  .desk { grid-template-columns: 1fr; }
  .glist { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  :root { --gut: 16px; }
  #top { position: static; }
  header { padding: 8px var(--gut); gap: 6px 10px; min-height: 0; }
  nav#nav { order: 3; width: 100%; margin: 0 -10px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  nav#nav a, nav#nav button { padding: 8px 10px; white-space: nowrap; }
  header .status { order: 4; width: 100%; margin-left: 0; font-size: 12px; }
  .lang { order: 2; margin-left: auto; }
  #subnav { padding: 0 var(--gut); }
  main { padding: 14px var(--gut) 28px; }
  footer#foot { padding: 18px var(--gut) 28px; }
  .card { padding: 14px; }
  main > .card:first-child > h2:first-child, .crumbs + .card > h2:first-child, h2.hero-t, .page-h { font-size: 22px; }
  .grid { grid-template-columns: 1fr; }
  img.banner { width: 128px; }
  input.search { margin-left: 0; min-width: 0; flex: 1 1 100%; }
  .h2-right { margin-left: 0; }
  #toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  dl.defs { grid-template-columns: 1fr; }
  dl.defs dd { margin-bottom: 6px; }
  .kpi { margin: 0 6px 6px 0; }
  .mk-sec { padding: 40px 0; }
  .mk-sec > h2 { font-size: 25px; }
  .hub-head h1 { font-size: 28px; }
  article.guide { padding: 20px 16px; font-size: 15px; }
  .qfilters label { flex: 1 1 100%; }
  .qfilters select { max-width: 100%; }
  .desk { padding: 20px; }
}
@media (max-width: 480px) {
  .bento { grid-template-columns: 1fr; }
  .t-a, .t-b, .t-c, .t-d, .t-e, .bento > .tile:last-child:nth-child(odd) { grid-column: span 1; }
  .b.lg { flex: 1 1 auto; }
  .bar { grid-template-columns: 96px 1fr 36px; gap: 8px; font-size: 13px; }
}
