:root {
  color-scheme: dark;
  --bg: #151515;
  --panel: #1d1c1a;
  --text: #e4dfd5;
  --muted: #b5afa5;
  --gold: #e0b36b;
  --line: #393630;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 8rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: #ffe1a8; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.2rem, 4vw, 3.5rem); line-height: 1.15; letter-spacing: -.035em; margin-bottom: 1.25rem; }
h2 { margin-top: 2.8rem; margin-bottom: .8rem; font-size: 1.25rem; letter-spacing: -.02em; }
p { max-width: 76ch; }
code { color: #e9c68f; font-size: .92em; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 2rem; min-height: 92px; padding: .6rem clamp(1rem, 3vw, 3rem); border-bottom: 1px solid var(--line); background: #171615; }
.brand { flex-shrink: 0; display: flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--text); }
.brand img { width: 156px; height: auto; }
.brand span { font-size: .8rem; letter-spacing: .2em; border-left: 1px solid var(--line); padding-left: 1rem; }
.site-link { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; min-height: 44px; padding: .5rem .75rem; font-size: 1.05rem; font-weight: 600; white-space: nowrap; }
.mobile-navigation { display: none; }
.search-box { position: relative; flex: 1; max-width: 480px; margin-left: auto; }
.search-box label, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
input, select, button { color: var(--text); background: #23211e; border: 1px solid #696052; border-radius: 5px; padding: .7rem .85rem; font: inherit; }
input, select { width: 100%; min-width: 0; }
input::placeholder { color: #b9b2a7; }
.search-box input { padding-right: 3rem; }
.search-box kbd { position: absolute; right: .9rem; top: .7rem; border: 1px solid #6b6255; border-radius: 3px; padding: 0 .4rem; color: var(--muted); font-size: .85rem; }
button { cursor: pointer; }
button:hover { border-color: var(--gold); background: #302a20; }
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 160px; gap: clamp(1.5rem, 3vw, 3rem); max-width: 1540px; margin: auto; padding: 2.7rem clamp(1rem, 3vw, 3rem) 4rem; }
.eyebrow { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 1rem; }
.sidebar, .on-this-page { align-self: start; position: sticky; top: 120px; font-size: .87rem; }
.sidebar nav, .on-this-page nav { display: grid; gap: .3rem; }
.sidebar nav { gap: .1rem; }
.sidebar nav a, .mobile-navigation-panel a { padding: .25rem .6rem; min-height: 28px; line-height: 1.4; color: #d4cfc5; text-decoration: none; border-left: 2px solid transparent; }
.sidebar nav a:hover, .mobile-navigation-panel a:hover { background: #24221e; }
.sidebar nav a[aria-current="page"], .mobile-navigation-panel a[aria-current="page"] { color: #f1ce95; background: #292419; border-left-color: var(--gold); }
.upcoming { margin-top: 2.5rem; }
.upcoming ul { list-style: none; margin: 0; padding: 0; color: var(--muted); }
.upcoming li { margin: .75rem 0; }
.on-this-page { border-left: 1px solid var(--line); padding-left: 1.2rem; }
.on-this-page a { padding: .25rem 0; color: var(--muted); text-decoration: none; }
.on-this-page a:hover { color: var(--gold); }
main { min-width: 0; }
.lead { color: #c9c1b4; font-size: 1.1rem; line-height: 1.8; margin-bottom: 2rem; }
.article-index h1 { font: 650 1.5rem/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; margin-bottom: 1.25rem; }
.article-directory { columns: 3 13rem; column-gap: 1.5rem; }
.article-directory > section { break-inside: avoid; margin-bottom: 1.2rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.article-directory h2 { margin: 0 0 .45rem; color: var(--muted); font-size: .78rem; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; }
.article-directory ul { list-style: none; padding: 0; margin: 0; }
.article-directory a { display: block; min-height: 28px; padding: .2rem 0; font-size: .9rem; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
.article-directory a:hover { text-decoration: underline; }
.equipment-directory { columns: 2 13rem; }
.equipment-directory h2 { font-size: 1.05rem; text-transform: none; letter-spacing: 0; }
.item-index { margin-top: 2rem; }
.item-index > summary { cursor: pointer; color: var(--gold); }
.item-index ul { columns: 3 13rem; list-style: none; padding-left: 0; }
.item-index li { break-inside: avoid; }
.item-index a { display: block; padding: .2rem 0; }
.equipment-group { margin: 1rem 0 2rem; }
.source-note { padding: 1.3rem 1.5rem; border-left: 3px solid #a8864d; border-radius: 0 5px 5px 0; background: var(--panel); margin-top: 1.5rem; color: #c7c0b4; font-size: .92rem; }
.source-note strong { color: var(--text); }
.source-note p { margin: .55rem 0 0; }
.article-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.table-tools { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; margin-top: 1.5rem; }
.table-tools label { display: grid; gap: .4rem; flex: 1 1 150px; color: #c8c0b3; font-size: .8rem; }
.table-tools label:first-child { flex-grow: 2; }
.table-tools input, .table-tools select, .table-tools button { font-size: .9rem; min-height: 44px; }
.table-tools button { flex: 0 0 auto; min-height: 44px; }
.result-count { color: var(--muted); font-size: .82rem; margin: 1rem 0 .6rem; }
.table-wrap { width: fit-content; max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: auto; text-align: left; font-size: .86rem; }
thead { background: #29251f; }
th, td { padding: .2rem .6rem; border-bottom: 1px solid #343029; vertical-align: top; }
thead th { font-size: .77rem; color: #dfcba9; min-width: 6rem; }
tbody th { font-weight: 500; min-width: 195px; }
tbody td { color: #c9c1b4; }
tbody tr:nth-child(even) { background: #1b1a17; }
tbody tr:hover { background: #27231b; }
tbody tr:target { background: #3b3020; outline: 2px solid #bb985b; outline-offset: -2px; }
tbody th a { color: var(--text); text-decoration: none; }
tbody th a:hover { color: var(--gold); text-decoration: underline; }
tbody tr:last-child > * { border-bottom: 0; }
tbody details { max-width: 38ch; font-size: .8rem; }
tbody details[open] { min-width: 18rem; }
tbody summary { cursor: pointer; color: var(--text); font-size: .86rem; }
tbody summary:hover { color: var(--gold); text-decoration: underline; }
.item-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .4rem .8rem; margin: .8rem 0; }
.item-facts dt { color: var(--muted); }
.item-facts dd { margin: 0; overflow-wrap: anywhere; }
.variant-label { margin: 1rem 0 .25rem; color: var(--muted); }
.variant-links { margin: 0; padding-left: 1.2rem; }
.not-applicable { color: var(--muted); }
.equipment-notes { font-size: .85rem; color: var(--muted); border-left: 2px solid var(--line); padding-left: 1rem; }
.equipment-notes p { margin-bottom: .7rem; }
.equipment-notes summary { cursor: pointer; color: var(--gold); margin-bottom: .7rem; }
.wiki-article { overflow-wrap: anywhere; }
.wiki-article h3 { margin-top: 2rem; }
.wiki-article pre { overflow-x: auto; padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 5px; }
.wiki-article blockquote { margin-left: 0; padding-left: 1rem; border-left: 3px solid var(--gold); color: var(--muted); }
.wiki-article img { display: block; max-width: 100%; height: auto; margin: 1rem 0; }
.item-sprite, .wiki-article img.item-sprite { display: inline-block; width: 32px; height: 32px; max-width: none; margin: 0 .4rem 0 0; object-fit: contain; image-rendering: pixelated; vertical-align: middle; }
.item-table .item-sprite, .wiki-article .item-table img.item-sprite { width: 40px; height: 40px; }
/* Keep illustrated recipes readable; the existing table region scrolls on phones. */
.wiki-article td:has(.item-sprite) { min-width: 10rem; }
.wiki-article td:not(:first-child):has(.item-sprite) { min-width: 20rem; }
.wiki-article .table-wrap { margin: 1rem 0; }
.wiki-article math[display="block"] { overflow-x: auto; padding: .5rem 0; margin: 1rem 0; }
.wiki-article .article-align-left { text-align: left; }
.wiki-article .article-align-center { text-align: center; }
.wiki-article .article-align-right { text-align: right; }
.search-results { border: 1px solid #655238; border-radius: 6px; padding: 1.4rem; margin-bottom: 2rem; background: #201d18; }
.search-results h2 { margin: 0 0 .5rem; }
.search-results ul { list-style: none; padding: 0; margin: 0; }
.search-results li + li { border-top: 1px solid var(--line); }
.search-results li a { display: block; padding: .7rem 0; text-decoration: none; }
.search-results li span { display: block; font-size: .8rem; color: var(--muted); }
#search-status { color: var(--muted); font-size: .82rem; }
.skip-link { position: fixed; left: 1rem; top: -8rem; z-index: 10; padding: 1rem; background: #201d18; }
.skip-link:focus { top: 1rem; }
.noscript { padding: 1rem; margin: 0 auto; color: var(--muted); }
@media (max-width: 1150px) {
  .layout { grid-template-columns: 175px minmax(0, 1fr); }
  .on-this-page { display: none; }
  .topbar { gap: 1rem; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: calc(var(--wiki-header-height, 9rem) + 1rem); }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: .65rem 1rem; gap: .5rem .75rem; }
  .brand img { width: clamp(90px, 30vw, 118px); }
  .brand { gap: .65rem; }
  .brand span { padding-left: .65rem; font-size: .7rem; }
  .site-link { grid-column: 2; grid-row: 1; justify-self: end; padding: .4rem .25rem; font-size: .85rem; }
  .search-box { grid-column: 1; grid-row: 2; min-width: 0; width: 100%; max-width: none; margin: 0; }
  .search-box input { min-height: 44px; padding: .5rem .75rem; }
  .search-box kbd { display: none; }
  .mobile-navigation { display: block; grid-column: 2; grid-row: 2; font-size: .9rem; }
  .mobile-navigation > summary { display: flex; align-items: center; justify-content: center; gap: .75rem; min-height: 44px; padding: .5rem .75rem; border: 1px solid #696052; border-radius: 5px; background: #23211e; color: var(--text); cursor: pointer; list-style: none; }
  .mobile-navigation > summary::-webkit-details-marker { display: none; }
  .mobile-navigation > summary::after { content: ""; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
  .mobile-navigation[open] > summary { border-color: var(--gold); background: #302a20; color: var(--gold); }
  .mobile-navigation[open] > summary::after { transform: translateY(2px) rotate(225deg); }
  /* The native disclosure works without scripts; only its panel scrolls. */
  .mobile-navigation-panel { position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - var(--wiki-header-height, 10rem) - .5rem); max-height: calc(100dvh - var(--wiki-header-height, 10rem) - .5rem); overflow-y: auto; overscroll-behavior: contain; padding: 1rem; background: #1d1c1a; border-bottom: 1px solid #655238; box-shadow: 0 .75rem 1.5rem #0008; }
  .mobile-navigation-panel a { display: flex; align-items: center; min-height: 44px; padding: .6rem .75rem; overflow-wrap: anywhere; }
  .mobile-nav-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
  .mobile-nav-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.25rem; margin-top: 1rem; }
  .mobile-nav-groups h2 { margin: 0 0 .35rem; padding: 0 .75rem; color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
  .layout { display: block; padding-top: 1.2rem; }
  .sidebar, .upcoming { display: none; }
  .article-directory a { padding: .4rem 0; min-height: 36px; }
  .table-tools button { width: 100%; }
}
@media print {
  :root { color-scheme: light; }
  body, tbody tr:nth-child(even) { background: white; color: black; }
  .topbar, .sidebar, .on-this-page, .table-tools, .search-results { display: none; }
  .layout { display: block; padding: 0; }
  .table-wrap { overflow: visible; }
  tbody td, tbody th a, tbody summary, thead th { color: black; }
}
