:root {
  --shell: #102b2d;
  --shell-light: #193a3c;
  --paper: #eef2ec;
  --white: #ffffff;
  --ink: #203333;
  --muted: #5b6b68;
  --saffron: #f2b33d;
  --petrol: #23615b;
  --line: #d8e1dc;
  --sans: "Avenir Next", Avenir, "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--shell); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
button { color: inherit; }
input, select, button { max-width: 100%; }
::selection { background: var(--saffron); color: var(--shell); }
:focus-visible { outline: 3px solid var(--petrol); outline-offset: 3px; }
:is(.site-header, .wiki-sidebar, .site-footer) :focus-visible { outline-color: var(--saffron); }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--sans); font-weight: 800; line-height: 1.25; letter-spacing: -.025em; }
h1 { font-size: 34px; }
h2 { font-size: 23px; }
h3 { font-size: 18px; }
p:last-child { margin-bottom: 0; }
.wrap { width: min(1380px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 20; padding: 12px 18px; background: var(--saffron); color: var(--shell); }
.skip-link:focus { top: 12px; }

.site-header { background: var(--shell-light); color: #eef4ec; border-bottom: 3px solid var(--saffron); }
.site-header > .wrap { display: flex; align-items: center; gap: 22px; min-height: 82px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--saffron); color: var(--shell); font-size: 22px; font-weight: 900; border-radius: 5px; }
.brand-mark > span { display: none; }
.brand strong { display: block; font-size: 17px; font-weight: 900; letter-spacing: -.025em; line-height: 1.2; }
.brand small { display: block; color: #c0d2ca; font-size: 10px; letter-spacing: .12em; margin-top: 3px; }
.wiki-search { display: flex; flex: 1; min-width: 210px; max-width: 430px; margin-left: auto; }
.wiki-search input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid #87a6a0; border-right: 0; border-radius: 4px 0 0 4px; background: var(--white); color: var(--ink); padding: 9px 12px; font-size: 15px; }
.wiki-search button { min-height: 44px; border: 1px solid var(--saffron); border-radius: 0 4px 4px 0; background: var(--saffron); color: var(--shell); padding: 9px 13px; font-size: 13px; font-weight: 800; }
.wiki-search button:hover { background: #ffca67; }
.play-link { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-height: 44px; border: 1px solid #718f87; border-radius: 4px; padding: 9px 14px; text-decoration: none; font-size: 13px; font-weight: 800; }
.play-link:hover { border-color: var(--saffron); color: var(--saffron); }
.wiki-shell { margin-block: 20px 32px; }
.wiki-main { min-width: 0; background: var(--white); border: 1px solid #385753; border-radius: 6px; padding: 24px 28px 32px; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--petrol); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--saffron); flex-shrink: 0; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.7; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; padding: 10px 17px; border: 1px solid var(--petrol); border-radius: 4px; background: var(--white); color: var(--petrol); font-size: 14px; font-weight: 800; text-decoration: none; line-height: 1.4; }
.button.dark { background: var(--petrol); color: var(--white); }
.button:hover { background: var(--saffron); border-color: #ac791e; color: var(--shell); }

.portal-intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 24px; margin-bottom: 22px; }
.portal-intro h1 { margin-bottom: 9px; }
.portal-intro .lede { max-width: 76ch; margin-bottom: 16px; }
.portal-intro p:not(.eyebrow) { max-width: 76ch; }
.portal-intro .game-photo { margin: 0; }
.portal-intro .game-photo img { aspect-ratio: 1200 / 630; object-fit: contain; }
.home-guide { max-width: 82ch; margin: 30px auto 38px; }
.home-guide > .article-section { margin-top: 36px; }
.home-guide > .updated { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.portal-index { padding-top: 24px; border-top: 2px solid var(--line); }
.wiki-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--line); }
.wiki-stats > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding: 10px 14px; background: var(--paper); }
.wiki-stats dt { font-size: 12px; color: var(--muted); }
.wiki-stats dd { margin: 0; font-size: 21px; font-weight: 900; color: var(--petrol); font-variant-numeric: tabular-nums; }
.portal-featured > h2, .portal-index > h2 { margin-bottom: 12px; font-size: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-card { display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; align-items: start; gap: 11px; min-width: 0; min-height: 84px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 4px; background: #f8faf7; text-decoration: none; }
.card-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; color: var(--petrol); background: #e9f0e7; }
.card-icon svg, .system-icon svg { width: 24px; height: 24px; }
.quick-card h3 { font-size: 16px; margin: 0 0 4px; }
.quick-card p { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 0; }
.card-arrow, .entry-arrow { color: var(--petrol); font-size: 18px; font-weight: 800; }
.quick-card:hover, .guide-card:hover { background: #f0f5eb; border-color: #9abca9; }
.portal-categories { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-block: 18px 24px; }
.portal-categories a { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 48px; padding: 8px; border: 1px solid var(--line); border-bottom: 3px solid var(--saffron); border-radius: 4px; color: var(--petrol); background: #f6f8f3; font-size: 12px; font-weight: 800; line-height: 1.35; text-decoration: none; }
.portal-categories a:hover { background: #f8edd5; border-color: #c69d46; }
.system-icon { display: inline-flex; flex-shrink: 0; color: var(--petrol); }
#guide-result-count { margin: -6px 0 14px; color: var(--muted); font-size: 13px; }
.guide-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.guide-group { min-width: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.group-heading { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #edf3ea; }
.group-heading h2 { margin: 0; font-size: 17px; }
.guide-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; min-height: 64px; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; }
.guide-card:last-child { border-bottom: 0; }
.entry-copy { min-width: 0; }
.guide-card h3 { font-size: 15px; margin-bottom: 4px; }
.guide-card p { font-size: 14px; line-height: 1.5; color: var(--muted); margin-bottom: 0; }
.entry-arrow { flex-shrink: 0; }
.tag { display: inline-block; color: var(--petrol); font-size: 11px; font-weight: 800; line-height: 1.5; letter-spacing: .04em; text-transform: uppercase; }
.read-link { display: inline-block; color: var(--petrol); font-size: 12px; font-weight: 800; text-decoration: underline; }

.article-shell { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 28px; }
.article-shell article { min-width: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 17px; font-size: 12px; color: var(--muted); }
.breadcrumb a { color: var(--petrol); }
.article-header h1 { font-size: 32px; margin-bottom: 12px; overflow-wrap: break-word; }
.article-header .lede { margin-bottom: 10px; }
.updated { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.entry-overview { display: grid; gap: 12px; margin-bottom: 24px; }
.answer-box { background: #edf4e8; border: 1px solid #cfdfc6; border-left: 4px solid var(--petrol); border-radius: 3px; padding: 15px 18px; }
.answer-box > strong { display: block; margin-bottom: 5px; font-size: 13px; color: var(--petrol); }
.answer-box p, .answer-box ul { font-size: 15px; line-height: 1.65; margin-bottom: 0; }
.answer-box h2, .answer-box h3 { font-size: 17px; margin-bottom: 8px; }
.wiki-infobox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--line); }
.wiki-infobox.three-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wiki-infobox > div { min-width: 0; padding: 10px 13px; background: #f6f8f4; }
.wiki-infobox dt { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.wiki-infobox dd { margin: 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.article-aside { position: sticky; top: 24px; max-height: calc(100dvh - 48px); overflow-y: auto; align-self: start; min-width: 0; padding-left: 17px; border-left: 1px solid var(--line); scrollbar-color: #9ab2a6 var(--white); }
.aside-box + .aside-box { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.aside-box h2, .toc > strong { display: block; font-size: 13px; font-weight: 800; margin-bottom: 9px; color: var(--ink); }
.toc-links { display: grid; gap: 2px; }
.toc-links a { display: flex; align-items: start; gap: 8px; min-height: 40px; padding: 9px 5px; border-radius: 3px; color: var(--muted); font-size: 13px; line-height: 1.45; text-decoration: none; }
.toc-links a > span { color: #81958d; font-size: 11px; font-variant-numeric: tabular-nums; }
.toc-links a:hover { background: var(--paper); color: var(--petrol); }
.aside-box > a { display: flex; align-items: center; min-height: 44px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--petrol); font-size: 13px; line-height: 1.5; text-decoration: none; }
.aside-box > a:hover { text-decoration: underline; }
.toc-mobile { display: none; }
.article-section { margin-top: 28px; }
.article-section > h2 { font-size: 23px; padding-bottom: 9px; margin-bottom: 15px; border-bottom: 1px solid var(--line); }
.article-section h3 { font-size: 18px; margin-top: 23px; margin-bottom: 10px; }
.article-section p, .article-section li { line-height: 1.75; }
.article-section p { margin-bottom: 15px; }
.article-section a:not(.button) { color: var(--petrol); }
.article-section ul, .article-section ol { padding-left: 23px; margin-block: 14px 20px; }
.article-section li { padding-left: 3px; margin-bottom: 7px; }
.article-section hr { border: 0; border-top: 1px solid var(--line); margin-block: 24px; }

.game-photo, .guide-video, .guide-figure, .model-photos { margin: 24px 0 28px; }
.game-photo img { width: 100%; border-radius: 5px; border: 1px solid var(--line); background: var(--paper); }
.account-photo img { max-width: 420px; margin-inline: auto; }
.model-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.model-gallery img { width: 100%; border: 1px solid var(--line); border-radius: 5px; }
.single-model .model-gallery { max-width: 360px; margin-inline: auto; grid-template-columns: minmax(0, 1fr); }
figcaption { padding-top: 9px; font-size: 12px; color: var(--muted); line-height: 1.6; }
figcaption a { color: var(--petrol); }
.guide-diagram { width: 100%; height: auto; border-radius: 5px; background: #eff5ef; }
.guide-diagram-scroll { overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: 5px; }
.video-stage { position: relative; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 5px; background: #102b2d; }
.video-stage > img { width: 100%; height: 100%; object-fit: cover; }
.video-load { display: flex; align-items: center; gap: 14px; position: absolute; inset: 0; width: 100%; padding: 24px; border: 0; background: linear-gradient(0deg,#061b20eb,#071b2040 70%); color: white; text-align: left; font-size: 18px; font-weight: 800; }
.video-load > span:last-child { align-self: end; }
.video-load small { display: block; margin-top: 5px; font-size: 12px; font-weight: 500; color: #dceadd; }
.video-play { display: grid; place-items: center; align-self: end; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; background: var(--saffron); color: var(--shell); font-size: 21px; }
.video-load:hover .video-play { background: #ffcd73; transform: scale(1.06); }
.video-load:focus-visible { outline: 3px solid var(--saffron); outline-offset: -6px; }
.video-stage iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-stage.playing { min-height: 200px; }
.article-section details:not(.job-card) { border-bottom: 1px solid var(--line); padding-block: 9px; }
.article-section details > summary { min-height: 44px; padding-block: 10px; font-weight: 700; }
.article-section details > p { margin-top: 10px; }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 4px; margin-block: 18px; scrollbar-color: #819e8e var(--paper); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; line-height: 1.55; font-variant-numeric: tabular-nums; }
th { background: #e9f0e5; color: #304f45; font-size: 12px; font-weight: 800; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f7f9f5; }
tbody tr:hover { background: #edf4e8; }
td:first-child { font-weight: 700; }
caption { padding: 10px 12px; text-align: left; color: var(--muted); font-size: 13px; }
.callout { border: 1px solid #dec892; border-left: 4px solid var(--saffron); border-radius: 3px; background: #fff8e7; padding: 15px 18px; margin-block: 20px; font-size: 15px; }
.steps { list-style: none; counter-reset: step; padding-left: 0 !important; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 16px 40px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.steps > li::before { content: counter(step, decimal-leading-zero); position: absolute; top: 1px; left: 0; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 3px; background: #e9f0e5; color: var(--petrol); font-size: 12px; font-weight: 800; }
.steps h3 { margin-top: 0; }
.expired { border-left: 4px solid var(--saffron); background: #fff8e7; padding: 15px 18px; }

.catalog-search { display: flex; flex-direction: column; gap: 6px; max-width: 480px; margin-block: 17px; font-size: 13px; font-weight: 700; color: var(--muted); }
.catalog-search input, .tool input, .tool select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #95aaa0; border-radius: 4px; background: var(--white); color: var(--ink); padding: 9px 11px; font-size: 16px; }
.tool { background: #f0f4ec; border: 1px solid #cbd8c6; border-radius: 4px; padding: 19px; margin-block: 20px; }
.tool h3 { margin-top: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 16px; }
.field-grid label, .tool > label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.tool input:invalid:not(:placeholder-shown) { border-color: #a34825; }
.tool .button, .tool button { margin-top: 16px; }
.tool input[type="checkbox"], .tool input[type="radio"] { width: 19px; height: 19px; min-height: 19px; margin: 0; accent-color: var(--petrol); flex-shrink: 0; }
.entry-skill-check { margin-top: 12px; }
.entry-skill-check .field-grid { margin-block: 10px 12px; }
.check-label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 700; }
.tool > p, .entry-skill-check > p { font-size: 14px; color: var(--muted); margin-top: 10px; }
#job-count { color: var(--petrol); font-weight: 800; }
.result { border-top: 1px solid #cbd8c6; margin-top: 17px; padding-top: 16px; font-size: 15px; font-variant-numeric: tabular-nums; }
.result strong, .result .number { color: var(--petrol); }
.result .number { font-size: 30px; font-weight: 800; line-height: 1.2; }
.jobs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 18px; }
.job-card { min-width: 0; border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; background: var(--white); }
.job-card:hover, .job-card[open] { border-color: #96bda5; }
.job-card > summary { display: block; min-height: 44px; padding: 0 !important; list-style: none; }
.job-card > summary::-webkit-details-marker { display: none; }
.job-card h3 { font-size: 17px; margin: 4px 0 7px; }
.job-card p { font-size: 14px; line-height: 1.55; margin-bottom: 8px; }
.job-card .tag { font-size: 10px; }
.job-card .entry-status { color: var(--muted); }
.job-card[open] .read-link { color: var(--muted); }
.job-details { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 13px; }
.job-details h4 { font-size: 15px; line-height: 1.5; margin-block: 15px 8px; }
.job-details .table-scroll { margin-block: 12px; }
.job-details table { min-width: 340px; font-size: 13px; }
.job-details th, .job-details td { padding: 8px 10px; }
.source-list { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.source-list li { margin-bottom: 10px; }
.source-list p { margin-top: 5px; }

.site-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 30px; border-top: 1px solid #3c5952; color: #d0e0d4; padding-block: 20px 24px; }
.site-footer .brand-mark { width: 30px; height: 30px; font-size: 17px; }
.site-footer .brand strong { font-size: 13px; }
.site-footer .brand small { font-size: 9px; }
.site-footer p { color: #b8d0c2; font-size: 12px; margin-bottom: 0; max-width: 66ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-left: auto; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; text-decoration: none; }
.site-footer nav a:hover { color: var(--saffron); text-decoration: underline; }
.footer-note { flex-basis: 100%; }
.not-found { padding-block: 12px 28px; }
.not-found h1 { font-size: 32px; margin-bottom: 13px; }
.not-found p { color: var(--muted); }

@media (max-width: 1200px) {
  .site-header > .wrap { gap: 16px; }
  .wiki-search { min-width: 190px; }
  .wiki-main { padding-inline: 22px; }
  .article-shell { gap: 22px; grid-template-columns: minmax(0, 1fr) 190px; }
  .portal-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .wiki-shell { grid-template-columns: minmax(0, 1fr); }
  .wiki-search { max-width: none; }
  .portal-categories { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .wrap { width: calc(100% - 32px); }
  .site-header > .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px 13px; padding-block: 12px; }
  .wiki-search { grid-column: 1 / -1; grid-row: 2; min-width: 0; width: 100%; margin: 0; }
  .wiki-shell { margin-top: 18px; }
  .wiki-main { padding: 20px; }
  .portal-intro { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .portal-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .article-shell { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .article-aside { position: static; max-height: none; overflow: visible; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .article-aside .toc-box { display: none; }
  .article-aside .aside-box + .aside-box { border-top: 0; padding-top: 0; margin-top: 0; }
  .toc-mobile { display: block; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 4px; background: #f6f8f3; padding-inline: 14px; }
  .toc-mobile > summary { display: flex; align-items: center; min-height: 44px; gap: 10px; padding-block: 10px; color: var(--petrol); font-size: 14px; font-weight: 800; }
  .toc-mobile > summary::after { content: "+"; margin-left: auto; font-size: 19px; }
  .toc-mobile[open] > summary::after { content: "−"; }
  .toc-mobile .toc-links { padding-bottom: 9px; }
  .toc-links a { min-height: 44px; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .site-header > .wrap { gap: 9px; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; font-size: 20px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 9px; }
  .play-link { font-size: 12px; padding-inline: 9px; }
  .wiki-search input { font-size: 16px; }
  .wiki-main { padding: 18px 16px 24px; }
  h1, .article-header h1, .not-found h1 { font-size: 28px; }
  .portal-intro .lede { font-size: 15px; }
  .guide-diagram { min-width: 640px; }
  .model-gallery { grid-template-columns: minmax(0, 1fr); max-width: 360px; margin-inline: auto; }
  .guide-figure figcaption::before { content: "Swipe to see the full diagram. "; font-weight: 700; }
  .video-load { gap: 10px; padding: 16px; font-size: 16px; }
  .video-play { flex-basis: 42px; width: 42px; height: 42px; font-size: 18px; }
  .wiki-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
  .wiki-stats > div { padding: 9px 11px; }
  .wiki-stats dt { font-size: 11px; }
  .wiki-stats dd { font-size: 20px; }
  .quick-grid, .guide-groups { grid-template-columns: minmax(0, 1fr); }
  .quick-card { min-height: 78px; padding: 12px; }
  .quick-card p, .guide-card p { font-size: 14px; }
  .portal-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-block: 16px 22px; }
  .portal-categories a { min-height: 48px; justify-content: flex-start; padding-inline: 11px; font-size: 13px; }
  .guide-groups { gap: 15px; }
  .guide-card { padding: 12px; }
  .group-heading { padding-inline: 12px; }
  .entry-overview { margin-bottom: 20px; }
  .answer-box { padding: 13px 14px; }
  .wiki-infobox > div { padding: 9px 10px; }
  .wiki-infobox dd { font-size: 14px; }
  .article-section > h2 { font-size: 21px; }
  .article-section h3 { font-size: 17px; }
  table { min-width: 480px; font-size: 14px; }
  th, td { padding: 10px 11px; }
  .callout { padding: 13px 15px; }
  .steps > li { padding-left: 37px; }
  .tool { padding: 15px; }
  .field-grid, .jobs-grid { grid-template-columns: minmax(0, 1fr); }
  .job-card { padding: 12px; }
  .site-footer { gap: 10px 20px; }
  .site-footer nav { margin-left: 0; }
}

@media (max-width: 480px) {
  .site-header .play-link { display: none; }
  .site-header > .wrap { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (pointer: coarse) {
  .wiki-home, .nav-group > a, .nav-group .nav-label, .toc-links a { min-height: 44px; }
}

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

@media print {
  body { background: white; color: black; }
  .site-header, .wiki-sidebar, .article-aside, .site-footer, .toc-mobile { display: none; }
  .wrap { width: 100%; }
  .wiki-shell, .article-shell { display: block; margin: 0; }
  .wiki-main { padding: 0; border: 0; }
  .table-scroll { overflow: visible; }
  table, .job-details table { min-width: 0; }
  a { text-decoration: underline; }
}

/* ==========================================================================
   Lagos Life Wiki — Vibrant City-Game Append-Only Overrides
   ========================================================================== */
:root {
  --shell: #eff5f1;
  --shell-light: #ffffff;
  --paper: #f4f8f5;
  --white: #ffffff;
  --ink: #142825;
  --muted: #536b64;
  --saffron: #f59e0b;
  --coral: #ea580c;
  --petrol: #0b6e4f;
  --petrol-tint: #e6f4ee;
  --line: #d8e5df;
}

body { background: var(--shell); color: var(--ink); }
.wiki-shell { display: block; margin-block: 20px 32px; }
.wiki-sidebar, .main-nav, .mobile-menu { display: none !important; }
.wiki-main { border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 16px rgba(20,40,37,.05); }

/* --- Site Header & Top Nav (Row 1 & Row 2) --- */
.site-header { background: #ffffff; color: var(--ink); border-bottom: 2px solid var(--line); box-shadow: 0 2px 10px rgba(20,40,37,.04); }
.site-header > .wrap:first-child { min-height: 64px; padding-block: 10px; }
.brand strong { color: var(--ink); }
.brand small { color: var(--muted); font-weight: 700; }
.brand-mark { border-radius: 6px; box-shadow: 0 2px 6px rgba(245,158,11,.3); }
.wiki-search input { border: 2px solid var(--line); border-radius: 6px 0 0 6px; background: #ffffff; color: var(--ink); }
.wiki-search input:focus { border-color: var(--petrol); }
.wiki-search button { border-radius: 0 6px 6px 0; background: var(--saffron); color: #142825; font-weight: 800; }
.wiki-search button:hover { background: #fbbf24; }
.play-link { background: #eaf6ef; border: 1.5px solid var(--petrol); color: var(--petrol); border-radius: 6px; }
.play-link:hover { background: var(--petrol); color: #ffffff; }

.site-header > .top-nav { display: flex; min-height: 0; gap: 8px; padding: 0 0 12px; }
.top-category { position: relative; flex: 1; }
.top-category > summary {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); font-size: 13px; font-weight: 800; list-style: none; user-select: none;
}
.top-category > summary::-webkit-details-marker { display: none; }
.top-category > summary::after { content: "▾"; font-size: 10px; color: var(--muted); margin-left: 2px; }
.top-category:hover > summary, .top-category[open] > summary {
  background: #ffffff; border-color: var(--petrol); color: var(--petrol);
  box-shadow: 0 2px 8px rgba(11,110,79,.12);
}
.category-menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
  min-width: max(100%, 200px); padding: 6px;
  background: #ffffff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 10px 24px rgba(20,40,37,.1); display: grid; gap: 2px;
}
.category-menu a {
  display: flex; align-items: center; min-height: 44px; padding: 7px 11px;
  border-radius: 4px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none;
}
.category-menu a:hover, .category-menu a[aria-current="page"] {
  background: var(--paper); color: var(--petrol);
}

/* --- Category Accents --- */
.top-category:nth-child(1) .system-icon, .portal-categories a:nth-child(1) .system-icon { color: #0b6e4f; }
.top-category:nth-child(2) .system-icon, .portal-categories a:nth-child(2) .system-icon { color: #d97706; }
.top-category:nth-child(3) .system-icon, .portal-categories a:nth-child(3) .system-icon { color: #ea580c; }
.top-category:nth-child(4) .system-icon, .portal-categories a:nth-child(4) .system-icon { color: #0284c7; }
.top-category:nth-child(5) .system-icon, .portal-categories a:nth-child(5) .system-icon { color: #059669; }
.top-category:nth-child(6) .system-icon, .portal-categories a:nth-child(6) .system-icon { color: #4b6b66; }
.portal-categories a:nth-child(1) { border-bottom-color: #0b6e4f; }
.portal-categories a:nth-child(2) { border-bottom-color: #d97706; }
.portal-categories a:nth-child(3) { border-bottom-color: #ea580c; }
.portal-categories a:nth-child(4) { border-bottom-color: #0284c7; }
.portal-categories a:nth-child(5) { border-bottom-color: #059669; }
.portal-categories a:nth-child(6) { border-bottom-color: #4b6b66; }

/* --- Cards, Categories & Panels --- */
.portal-categories a { background: #ffffff; color: var(--ink); border-color: var(--line); border-radius: 6px; box-shadow: 0 2px 6px rgba(20,40,37,.03); }
.portal-categories a:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(20,40,37,.08); color: var(--petrol); }
.quick-card { background: #ffffff; border-radius: 6px; box-shadow: 0 2px 6px rgba(20,40,37,.03); }
.quick-card:hover { border-color: var(--petrol); background: #f8fbf9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(11,110,79,.08); }
.card-icon { background: var(--petrol-tint); color: var(--petrol); border-radius: 6px; }
.guide-group { background: #ffffff; border-radius: 6px; box-shadow: 0 2px 8px rgba(20,40,37,.03); }
.group-heading { background: #edf6f1; border-bottom: 2px solid var(--line); color: var(--ink); }
.guide-card:hover { background: #f8fbf9; }
.wiki-stats, .wiki-infobox { border-color: var(--line); border-radius: 6px; box-shadow: 0 2px 8px rgba(20,40,37,.03); }
.wiki-stats > div, .wiki-infobox > div { background: #ffffff; }
.answer-box { background: #f3faf6; border: 1px solid #cce5d9; border-left: 4px solid var(--petrol); border-radius: 6px; }
.callout { background: #fffbeb; border: 1px solid #fed7aa; border-left: 4px solid var(--saffron); border-radius: 6px; }

/* --- Media, Focus & Interactions --- */
.video-stage { background: #0c201d; border-radius: 6px; }
.video-load { background: linear-gradient(0deg, rgba(8,26,23,.92), rgba(8,26,23,.3) 70%); }
.video-play { background: var(--saffron); color: #142825; box-shadow: 0 4px 12px rgba(245,158,11,.4); }
:focus-visible { outline: 3px solid var(--petrol); outline-offset: 2px; }
:is(.wiki-search input, .play-link, .top-category > summary):focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* --- Article Editorial, Tables, Tools & Footer --- */
.article-section > h2 { color: var(--ink); border-bottom: 2px solid var(--line); position: relative; }
.article-section > h2::after { content: ""; display: block; width: 36px; height: 3px; background: var(--petrol); margin-top: 8px; border-radius: 2px; }
.steps > li::before { background: var(--petrol-tint); color: var(--petrol); border: 1px solid #bce1d0; border-radius: 4px; }
th { background: #e6f3ec; color: #0f4435; }
tbody tr:nth-child(even) { background: #f9fcf9; }
tbody tr:hover { background: #eef7f1; }
.tool { background: #f4faf6; border: 1px solid #c9e0d4; border-radius: 6px; }
.job-card { border-radius: 6px; box-shadow: 0 2px 6px rgba(20,40,37,.03); }
.job-card:hover, .job-card[open] { border-color: var(--petrol); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); background: transparent; }
.site-footer p { color: var(--muted); }
.site-footer nav a { color: var(--petrol); font-weight: 700; }
.site-footer nav a:hover { color: #b84322; }

/* --- Responsive, Accessibility & Print --- */
@media (max-width: 850px) {
  .site-header > .top-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-bottom: 12px; }
  .category-menu { position: static; min-width: 0; box-shadow: none; border-top: 1px dashed var(--line); margin-top: 4px; }
}
@media (max-width: 600px) {
  .site-header > .top-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; transform: none !important; }
}
@media print {
  body { background: #ffffff; }
  .site-header > .top-nav { display: none !important; }
}

/* Integrate AGY's top-only city palette with the existing header. */
.site-header .header-main { display: flex; align-items: center; gap: 24px; }
.site-header .wiki-search { max-width: 600px; margin-left: auto; }
.site-header .category-menu { min-width: 220px; }
.top-category:last-child .category-menu { left: auto; right: 0; }
.top-category:nth-child(1) { --category: #0b6e4f; --category-bg: #e6f7eb; }
.top-category:nth-child(2) { --category: #925c00; --category-bg: #fff3cd; }
.top-category:nth-child(3) { --category: #b84322; --category-bg: #ffede4; }
.top-category:nth-child(4) { --category: #1966a3; --category-bg: #e8f3ff; }
.top-category:nth-child(5) { --category: #08795b; --category-bg: #e4faf3; }
.top-category:nth-child(6) { --category: #495c78; --category-bg: #edf0f8; }
.top-category > summary { background: var(--category-bg); border-bottom: 3px solid var(--category); }
.top-category.active > summary { box-shadow: inset 0 0 0 1px var(--category); }
.top-category .system-icon { color: var(--category) !important; }
.site-header :is(a,input,button,summary):focus-visible { outline-color: var(--petrol); }
.portal-intro { background: #f5fff8; border: 1px solid #d2e9da; padding: 24px; border-radius: 12px; }
.portal-intro .guide-video { margin: 0; }
.quick-card:nth-child(1) { background: #eaf8ef; }
.quick-card:nth-child(2) { background: #fff7df; }
.quick-card:nth-child(3) { background: #fff0e7; }
.quick-card:nth-child(4) { background: #edf5ff; }
.quick-card, .top-category > summary, .play-link { transition: background-color .16s, border-color .16s, box-shadow .16s; }
.entry-media { margin: 0 0 24px; }
.entry-media > figure { margin: 0; }
.entry-media > .guide-video, .entry-media > .guide-figure { max-width: 850px; }
.recipe-overview { display: grid; grid-template-columns: minmax(0,360px) minmax(0,1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.recipe-overview .entry-media { margin: 0; }
.guide-figure[data-diagram="needs"] { max-width: 360px; }
.entry-media > .guide-figure[data-diagram="needs"] { max-width: 360px; }
.guide-figure[data-diagram="needs"] .guide-diagram { min-width: 0; }
.guide-figure[data-diagram="needs"] figcaption::before { content: none; }
.article-section > p { max-width: 84ch; }
.article-section .button.dark { color: white; }
@media (max-width: 850px) {
  .recipe-overview { grid-template-columns: minmax(0,1fr); }
  .site-header .header-main { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; }
  .site-header .wiki-search { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; margin: 0; }
  .site-header > .top-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .site-header .category-menu { min-width: 0; }
  .top-category:last-child .category-menu { left: auto; right: auto; }
  .portal-intro > div { display: contents; }
  .portal-intro .eyebrow { grid-row: 1; margin-bottom: 0; }
  .portal-intro h1 { grid-row: 2; margin-bottom: 0; }
  .portal-intro .lede { grid-row: 3; margin-bottom: 0; }
  .portal-intro > .guide-video { grid-row: 4; }
  .portal-intro > div > p:last-child { grid-row: 5; }
}
@media (max-width: 600px) {
  .site-header > .top-nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .top-category > summary { padding: 7px 6px; gap: 4px; font-size: 11px; }
  .top-category .system-icon { display: none; }
  .top-category[open] { grid-column: 1 / -1; }
  .site-header .play-link { display: inline-flex; }
  .portal-intro { padding: 16px; }
}
@media print {
  .wiki-main, .portal-intro { border: 0; box-shadow: none; background: white; }
  .guide-diagram { min-width: 0; }
}
