/* Prison Bus Wiki: colours and details taken from the game's own artwork. See DESIGN.md. */

@font-face {
  font-family: 'Fredoka';
  src: url('/assets/fredoka.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito Sans';
  src: url('/assets/nunito-sans.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --storm: #29313c;          /* night-rain sky */
  --cab: #1c2431;            /* dashboard and bus body */
  --cab-text: #c9d1dc;
  --jumpsuit: #ff8624;       /* prisoner jumpsuit */
  --jumpsuit-dark: #c95f0f;
  --jumpsuit-ink: #a8490b;   /* jumpsuit orange that passes contrast as text on paper */
  --lamp: #ffc94a;           /* amber roof lamp, yellow centre line */
  --lamp-bg: #fff4d6;
  --lamp-line: #f0cc6a;
  --decline: #c41a08;
  --mist: #e4e7ea;
  --paper: #f8f8f6;
  --ink: #1c2431;
  --muted: #5a6472;
  --line: #cdd3d9;
  --link: #2a4d80;
  --header: 64px;
  --stripe: 12px;
  --display: 'Fredoka', 'Nunito Sans', system-ui, sans-serif;
  --body: 'Nunito Sans', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
  font-family: var(--body);
  font-size: 16px;
  color: var(--ink);
  background: var(--mist);
}

/* Base */
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--mist); }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { color: var(--ink); font-family: var(--display); font-weight: 600; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; height: auto; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
kbd { font: 700 12px var(--body); border: 1px solid currentColor; border-radius: 4px; padding: 0 6px; opacity: .7; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.topbar :focus-visible, .hero :focus-visible, .not-found :focus-visible { outline-color: var(--lamp); }
::selection { background: var(--lamp); color: var(--ink); }

.skip { position: fixed; top: -80px; left: 16px; z-index: 100; background: var(--paper); color: var(--ink); padding: 12px 16px; border: 2px solid var(--ink); }
.skip:focus { top: 12px; }

/* Buttons: chunky and rounded like the game's own prompts */
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 20px 11px; border-radius: 10px; font-family: var(--display); font-size: 17px; font-weight: 600; text-decoration: none; }
.button.primary { background: var(--jumpsuit); color: var(--cab); box-shadow: inset 0 -4px 0 var(--jumpsuit-dark); }
.button.primary:hover { background: #ff9640; }
.button.secondary { color: #fff; box-shadow: inset 0 0 0 2px #ffffff66; }
.button.secondary:hover { box-shadow: inset 0 0 0 2px #fff; }

/* Header, with the checkered stripe from the bus livery */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--cab); color: #fff; }
.topbar::after { content: ''; display: block; height: var(--stripe); background: repeating-conic-gradient(#0f131a 0 25%, #eef0f2 0 50%) 0 0 / var(--stripe) var(--stripe); }
.masthead { max-width: 1320px; height: var(--header); margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 40px; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-family: var(--display); font-size: 23px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; }
.brand-mark img { display: block; width: 100%; height: 100%; }
.top-nav { display: flex; align-self: stretch; gap: 28px; }
.top-nav a { display: flex; align-items: center; padding-top: 3px; border-bottom: 3px solid transparent; color: var(--cab-text); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.top-nav a:hover, .top-nav a[aria-current] { color: #fff; border-bottom-color: var(--jumpsuit); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search-trigger { display: flex; align-items: center; gap: 10px; width: 190px; height: 40px; padding: 0 12px; border-radius: 8px; background: #ffffff14; border: 1px solid #ffffff33; color: var(--cab-text); font-size: 15px; }
.search-trigger:hover { background: #ffffff24; color: #fff; }
.search-trigger kbd { margin-left: auto; }
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid #ffffff33; color: #fff; font-size: 20px; }

/* Page frame */
.layout { flex: 1; width: 100%; display: flex; align-items: stretch; }
.article-page .layout { max-width: 1320px; margin: 0 auto; background: var(--paper); border-inline: 1px solid var(--line); }
.main-shell { flex: 1; min-width: 0; }
.overview-page .sidebar { display: none; }

/* Sidebar */
.sidebar { width: 232px; flex-shrink: 0; padding: 32px 22px 40px; background: var(--mist); border-right: 1px solid var(--line); }
/* The nav and the Roblox link stick together; a tall list scrolls inside the sidebar instead of overlapping */
.sidebar-inner { position: sticky; top: calc(var(--header) + var(--stripe) + 28px); max-height: calc(100vh - var(--header) - var(--stripe) - 56px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.nav-group { margin-bottom: 26px; }
.nav-group h2 { margin-bottom: 6px; color: var(--muted); font-family: var(--body); font-size: 13px; font-weight: 800; }
.nav-group a { display: block; margin-left: -10px; padding: 6px 10px; border-radius: 8px; color: var(--ink); font-size: 15px; line-height: 1.4; text-decoration: none; }
.nav-group a:hover { background: #d5dade; }
.nav-group a[aria-current] { background: var(--jumpsuit); color: var(--cab); font-weight: 800; }
.sidebar-play { display: block; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 700; }

/* Home hero: the stormy road from the artwork */
.hero { background: var(--storm); color: #fff; padding: 52px 32px 0; }
.hero-inner { max-width: 1256px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(48px, 6vw, 82px); font-weight: 700; line-height: .98; letter-spacing: -.01em; }
.hero-lead { margin-top: 18px; max-width: 40ch; color: var(--cab-text); font-size: 18px; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.game-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.game-cover figcaption { margin-top: 10px; color: #9aa5b3; font-size: 13px; }
.artwork-button { display: block; width: 100%; padding: 0; cursor: zoom-in; }

/* The four objectives, joined by the road's yellow double centre line. This is a real sequence. */
.run { max-width: 1256px; margin: 44px auto 0; padding: 26px 0 38px; border-top: 1px solid #ffffff1f; }
.run h2 { color: var(--cab-text); font-size: 18px; font-weight: 500; }
.run-route { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: run; }
.run-route::before { content: ''; position: absolute; left: 0; right: 0; top: 13px; height: 9px; background: linear-gradient(var(--lamp) 0 3px, transparent 3px 6px, var(--lamp) 6px 9px); opacity: .85; }
.run-route li { position: relative; counter-increment: run; }
.run-route a { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; color: #fff; font-family: var(--display); font-size: 20px; font-weight: 500; text-decoration: none; }
.run-route a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.run-stop { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--jumpsuit); color: var(--cab); box-shadow: 0 0 0 5px var(--storm); font-family: var(--display); font-size: 17px; font-weight: 700; }
.run-stop::before { content: counter(run); }

/* Home content */
.home-content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 32px 64px; }
.home-search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 30px 0 0; }
.home-search { display: flex; align-items: center; gap: 12px; width: min(540px, 100%); height: 54px; padding: 0 16px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; color: var(--muted); font-size: 16px; text-align: left; }
.home-search svg { color: var(--ink); width: 22px; height: 22px; }
.home-search kbd { margin-left: auto; }
.home-search:hover { border-color: var(--jumpsuit-dark); }
.unofficial-note { color: var(--muted); font-size: 14px; line-height: 1.5; }
.unofficial-note a { font-weight: 700; white-space: nowrap; }

.wiki-columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; margin-top: 44px; }
.wiki-main { min-width: 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 3px solid var(--ink); }
.section-heading h2 { font-size: 28px; }
.section-heading > a { font-size: 15px; font-weight: 700; white-space: nowrap; }
.directory-row { display: block; padding: 18px 0 17px; border-bottom: 1px solid var(--line); text-decoration: none; }
.directory-row h3 { color: var(--link); font-size: 21px; font-weight: 500; }
.directory-row:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.directory-row p { margin-top: 3px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.reference { margin-top: 48px; }
.reference-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
.home-modes { margin-top: 48px; }

.anomaly-summary { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 44px; padding-top: 32px; border-top: 1px solid var(--line); }
.anomaly-image img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.anomaly-summary h2 { font-size: 28px; }
.anomaly-summary h2 a { color: var(--ink); text-decoration: none; }
.anomaly-summary h2 a:hover { text-decoration: underline; }
.anomaly-summary p { margin: 8px 0 12px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.read-link { font-size: 15px; font-weight: 800; }

.wiki-notes > :not(:first-child) { margin-top: 32px; }
.update-note { padding: 22px 22px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.update-note h2 { font-size: 27px; }
.update-note h2 a { color: var(--ink); text-decoration: none; }
.update-note p { margin: 10px 0 14px; font-size: 16px; line-height: 1.55; }
.game-facts h2, .wiki-note h2 { font-size: 20px; }
.game-facts dl { margin: 10px 0 14px; font-size: 15px; }
.game-facts dl > div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 9px 0 8px; border-bottom: 1px solid var(--line); }
.game-facts dt { color: var(--muted); }
.game-facts > a, .wiki-note > a { font-size: 15px; font-weight: 700; }
.wiki-note p { margin: 8px 0 12px; color: var(--muted); font-size: 15px; line-height: 1.55; }

/* Ad slots: fixed reserved height, quiet label, centred */
.ad-slot { display: none; flex-direction: column; align-items: center; gap: 6px; margin: 28px auto; max-width: 100%; overflow: hidden; }
.ad-slot.on { display: flex; }
.ad-label { color: var(--muted); font-size: 12px; }
/* Side rails: centred in the empty space either side of the 1320px page, fixed while scrolling */
.ad-rail { display: none; position: fixed; z-index: 5; top: calc(var(--header) + var(--stripe) + 24px); width: 160px; flex-direction: column; align-items: center; gap: 6px; }
.ad-rail.on { display: flex; }
.ad-rail .ad-label { color: #9aa5b3; }
.ad-rail-left { left: calc((100vw - 1320px) / 4 - 80px); }
.ad-rail-right { right: calc((100vw - 1320px) / 4 - 80px); }
.ad-rectangle { min-height: 274px; }
.wiki-notes .ad-rectangle { margin-bottom: 0; }
.ad-banner { min-height: 74px; }

/* Tables */
.table-wrap { max-width: 100%; overflow-x: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.5; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--mist); font-size: 14px; font-weight: 800; }
tbody th { font-weight: 800; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
/* Store tables: icon beside the name, price on one line */
.item-icon { float: left; width: 44px; height: 44px; margin: -2px 12px -2px 0; border-radius: 9px; }
.prose td:has(> .item-icon) { min-width: 200px; }
.prose td:has(> .item-icon) strong { display: flex; align-items: center; min-height: 40px; overflow: hidden; line-height: 1.3; }
.prose tr:has(.item-icon) td:last-child { white-space: nowrap; }

/* Caution: an amber lamp for unverified or version-limited information, nothing else */
.caution { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; margin: 16px 0 24px; padding: 13px 16px 12px; background: var(--lamp-bg); border: 1px solid var(--lamp-line); border-radius: 10px; }
.caution p, .prose .caution p { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.55; }
.caution-lamp { width: 24px; height: 24px; stroke: var(--ink); stroke-width: 2.2; }
.caution-lamp circle { fill: var(--lamp); stroke: #d49b12; }

/* Articles */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 24px 48px 0; color: var(--muted); font-size: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 700; }
.article-layout { display: grid; grid-template-columns: minmax(0, 700px) 200px; justify-content: center; gap: 56px; padding: 26px 48px 72px; }
.article { min-width: 0; }
.article-header { padding-bottom: 24px; margin-bottom: 30px; border-bottom: 3px solid var(--ink); }
.article h1 { font-size: 48px; font-weight: 700; line-height: 1.05; }
.article-deck { margin-top: 14px; max-width: 58ch; color: var(--muted); font-size: 19px; line-height: 1.5; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 16px; color: var(--muted); font-size: 14px; }

.prose { font-size: 17px; line-height: 1.7; color: var(--ink); overflow-wrap: break-word; }
.prose > * { max-width: 66ch; }
.prose > .table-wrap, .prose > .caution { max-width: none; }
.prose h2 { margin: 46px 0 10px; font-size: 29px; line-height: 1.2; scroll-margin-top: calc(var(--header) + var(--stripe) + 24px); }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { margin: 30px 0 6px; font-size: 22px; font-weight: 500; line-height: 1.3; scroll-margin-top: calc(var(--header) + var(--stripe) + 24px); }
.prose p { margin: 0 0 18px; }
.prose ul { margin: 0 0 22px; padding-left: 22px; }
.prose li { margin: 8px 0; padding-left: 4px; }
.prose li::marker { color: var(--jumpsuit-ink); }
.prose strong { font-weight: 800; }

.article-figure { margin-bottom: 32px; }
.article-figure img { border-radius: 10px; }
.article-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.source-box { margin-top: 44px; padding: 20px 22px; background: var(--mist); border-radius: 10px; font-size: 15px; line-height: 1.55; }
.source-box h2 { font-size: 20px; }
.source-box ul { list-style: none; margin: 8px 0 0; padding: 0; }
.source-box > p { margin-top: 10px; color: var(--muted); font-size: 14px; }
.source-box h2 + p { margin-top: 8px; }
.article-next { display: inline-flex; align-items: center; min-height: 48px; margin-top: 28px; padding: 10px 20px 11px; border-radius: 10px; background: var(--jumpsuit); color: var(--cab); box-shadow: inset 0 -4px 0 var(--jumpsuit-dark); font-family: var(--display); font-size: 17px; font-weight: 600; text-decoration: none; }
.article-next:hover { background: #ff9640; }

.article-aside { position: sticky; top: calc(var(--header) + var(--stripe) + 28px); align-self: start; }
.article-aside h2 { margin-bottom: 10px; color: var(--muted); font-family: var(--body); font-size: 13px; font-weight: 800; }
.article-aside nav { display: flex; flex-direction: column; border-left: 2px solid var(--line); }
.article-aside a { margin-left: -2px; padding: 6px 0 5px 14px; border-left: 3px solid transparent; color: var(--muted); font-size: 14px; line-height: 1.4; text-decoration: none; }
.article-aside a:hover { color: var(--ink); }
.article-aside a.current { border-left-color: var(--jumpsuit); color: var(--ink); font-weight: 800; }
.mobile-toc { display: none; }

/* 404 */
.not-found { background: var(--storm); color: #fff; padding: 72px 32px 80px; }
.not-found > * { max-width: 760px; margin-inline: auto; }
.not-found h1 { color: #fff; font-size: clamp(40px, 6vw, 64px); font-weight: 700; line-height: 1; }
.not-found p { margin-top: 16px; color: var(--cab-text); font-size: 18px; line-height: 1.55; }
.not-found .hero-actions { margin-top: 28px; }

/* Footer */
.footer { background: var(--paper); border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { max-width: 1320px; margin: 0 auto; padding: 34px 32px 40px; display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; }
.footer-name { color: var(--ink); font-family: var(--display); font-size: 20px; font-weight: 600; text-decoration: none; }
.footer p { max-width: 60ch; margin-top: 8px; font-size: 14px; line-height: 1.55; }
.footer nav { display: flex; gap: 24px; white-space: nowrap; }
.footer nav a { font-size: 15px; font-weight: 700; }

/* Dialogs */
body.modal-open { overflow: hidden; }
dialog { max-width: calc(100vw - 24px); padding: 24px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px #0e131a59; }
dialog::backdrop { background: #1c2431b3; }
#search-dialog { width: 660px; max-height: 78dvh; margin: 0 auto; top: 10vh; }
.search-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.search-top h2 { font-size: 25px; }
.search-top button, #image-dialog > button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; font-weight: 700; }
.search-input-wrap { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 0 14px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; }
.search-input-wrap input { width: 100%; min-width: 0; height: 50px; border: 0; outline: none; background: none; font-size: 17px; }
.search-input-wrap:focus-within { outline: 3px solid var(--jumpsuit); outline-offset: 1px; }
.search-status { margin: 16px 0 8px; color: var(--muted); font-size: 14px; }
.search-result { display: block; padding: 14px 12px 12px; border-top: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.search-result:hover, .search-result:focus-visible { background: var(--mist); }
.search-result small { color: var(--muted); font-size: 13px; }
.search-result h3 { margin: 2px 0 4px; color: var(--link); font-size: 20px; font-weight: 500; }
.search-result p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.search-help { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; }
.search-empty { padding: 16px 4px; font-size: 16px; line-height: 1.7; }
.search-empty p { margin-bottom: 8px; }
.search-retry { padding: 9px 16px; background: var(--jumpsuit); color: var(--cab); border-radius: 8px; font-weight: 800; }
#image-dialog { width: min(1100px, 95vw); padding: 14px; }
#image-dialog > button { float: right; margin-bottom: 12px; }
#image-dialog img { clear: both; max-height: 74vh; margin: auto; object-fit: contain; }
#image-dialog p { margin-top: 12px; color: var(--muted); font-size: 14px; }

/* Responsive */
@media (max-width: 1200px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 180px; gap: 36px; padding-inline: 36px; }
  .breadcrumb { padding-inline: 36px; }
  .wiki-columns { grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; }
}

@media (max-width: 1024px) {
  .masthead { padding: 0 24px; gap: 24px; }
  .top-nav { gap: 20px; }
  .search-trigger { width: 120px; }
  .menu-toggle { display: block; }
  .layout { display: block; }
  .sidebar, .overview-page .sidebar { display: none; position: fixed; z-index: 19; top: calc(var(--header) + var(--stripe)); bottom: 0; left: 0; width: 280px; padding: 24px; background: var(--paper); overflow-y: auto; box-shadow: 16px 0 40px #1c243140; }
  .sidebar.open, .overview-page .sidebar.open { display: block; }
  .sidebar-inner { position: static; max-height: none; overflow: visible; }
  .nav-group a { padding-block: 9px; }
  .hero { padding-inline: 24px; }
  .hero-inner { gap: 32px; }
  .wiki-columns { grid-template-columns: 1fr; }
  .wiki-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 32px; border-top: 1px solid var(--line); }
  .wiki-notes > :not(:first-child) { margin-top: 0; }
  .wiki-note { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .top-nav { display: none; }
  .search-trigger { width: 150px; }
  .hero { padding-top: 36px; }
  .hero-inner { grid-template-columns: 1fr; }
  .run-route { grid-template-columns: 1fr; gap: 18px; }
  .run-route::before { top: 0; bottom: 0; left: 12px; right: auto; width: 9px; height: auto; background: linear-gradient(90deg, var(--lamp) 0 3px, transparent 3px 6px, var(--lamp) 6px 9px); }
  .run-route a { flex-direction: row; align-items: center; gap: 16px; }
  .article-layout { display: block; padding: 22px 28px 56px; }
  .breadcrumb { padding-inline: 28px; }
  .article-aside { display: none; }
  .mobile-toc { display: block; margin-bottom: 28px; padding: 12px 16px; background: var(--mist); border-radius: 10px; font-size: 16px; }
  .mobile-toc summary { cursor: pointer; font-weight: 800; }
  .mobile-toc nav { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
  .article h1 { font-size: 42px; }
  .footer-inner { flex-direction: column; gap: 20px; }
}

@media (max-width: 560px) {
  :root { --header: 58px; --stripe: 10px; }
  .masthead { padding: 0 16px; gap: 12px; }
  .brand { font-size: 20px; gap: 10px; }
  .brand-mark { width: 32px; height: 32px; }
  .search-trigger { width: 40px; justify-content: center; padding: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .hero { padding: 28px 16px 0; }
  .hero-lead { font-size: 17px; }
  .hero-actions .button { flex: 1 1 100%; justify-content: center; }
  .run { margin-top: 32px; padding-bottom: 30px; }
  .run-route a { font-size: 19px; }
  .home-content { padding: 0 16px 48px; }
  .home-search-row { padding-top: 22px; }
  .home-search kbd { display: none; }
  .wiki-columns { margin-top: 36px; }
  .section-heading h2, .anomaly-summary h2 { font-size: 25px; }
  .anomaly-summary { grid-template-columns: 1fr; gap: 16px; }
  .reference-grid { grid-template-columns: 1fr; }
  /* Store tables become stacked rows: name and price on top, description below */
  .table-wrap:has(.item-icon) table { min-width: 0; }
  .table-wrap:has(.item-icon) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .prose tr:has(.item-icon) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .prose tr:has(.item-icon):last-child { border-bottom: 0; }
  .prose tr:has(.item-icon) td { display: block; padding: 0; border: 0; min-width: 0; }
  .prose tr:has(.item-icon) td:last-child { grid-column: 2; grid-row: 1; align-self: center; font-weight: 800; }
  .prose tr:has(.item-icon) td:nth-child(2) { grid-column: 1 / -1; margin-top: 8px; color: var(--muted); }
  .wiki-notes { grid-template-columns: 1fr; }
  .wiki-note { grid-column: auto; }
  .breadcrumb { padding: 18px 16px 0; font-size: 13px; }
  .article-layout { padding: 18px 16px 48px; }
  .article h1 { font-size: 36px; }
  .article-deck { font-size: 17px; }
  .prose h2 { font-size: 26px; margin-top: 38px; }
  .not-found { padding: 48px 16px 56px; }
  .footer-inner { padding: 28px 16px 32px; }
  .footer nav { flex-wrap: wrap; gap: 12px 20px; }
  #search-dialog { top: 4vh; max-height: 90dvh; padding: 18px; }
  .search-help { flex-direction: column; gap: 6px; }
}

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