/* Landing layout backup (pre center-column redesign): public/_landing-backup/ — see BACKUP.md */
:root {
  color-scheme: dark light;
  --bg: #0c111c;
  --panel: #141b2b;
  --panel-2: #1a2234;
  --text: #eef2ff;
  --muted: #8b97b0;
  --border: #27324a;
  --accent: #6ea8fe;
  --accent-soft: rgba(110, 168, 254, 0.14);
  --good: #7ee787;
  --shadow: rgba(0, 0, 0, 0.22);
  --promo-rail-w: clamp(120px, 10vw, 160px);
  --promo-sky-h: clamp(360px, 72vh, 600px);
  --page-inline: clamp(12px, 2vw, 28px);
  --page-gap: clamp(12px, 1.6vw, 24px);
  --content-max: 1180px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --panel-2: #f7f9fc;
    --text: #142033;
    --muted: #5e6b85;
    --border: #d7deea;
    --accent: #2563eb;
    --accent-soft: rgba(37, 99, 235, 0.1);
    --good: #0f9d58;
    --shadow: rgba(16, 32, 58, 0.06);
  }
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 45%, var(--border)) var(--panel-2);
}

/* Unified scrollbars — thin, accent-tinted, no arrow buttons */
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--panel-2);
}

*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 999px;
  border: 2px solid var(--panel-2);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 55%, var(--border));
  border: 2px solid var(--panel-2);
  background-clip: padding-box;
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-corner {
  background: var(--panel-2);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
    var(--bg);
  position: relative;
}

.page-frame {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0;
  /* When side rails are on, body --rail-pad (ads.js) keeps content clear of fixed ads */
  padding-inline: max(var(--page-inline), var(--rail-pad, 0px));
  min-height: 100vh;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.page-frame > .shell {
  flex: 0 1 var(--content-max);
  width: min(100%, var(--content-max));
  max-width: var(--content-max);
  min-width: 0;
}

.shell {
  max-width: none;
  margin: 0;
  padding: 48px 0 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Landing: lock to viewport on tall desktops (no document scroll); content stacks inside.
   Short / narrow viewports unlock scroll via media queries below.
   Legal/craft pages use .legal-body and must not inherit this lock. */
body:not(.is-browse):not(.legal-body) {
  /* Clip top10 overhang instead of forcing a horizontal scrollbar */
  overflow-x: hidden;
  overflow-y: hidden;
  /* Match the ?edit=layout shell the composition was authored in */
  --content-max: min(1100px, 100%);
}

html:has(body:not(.is-browse):not(.legal-body)) {
  overflow-x: hidden;
}

body:not(.is-browse):not(.legal-body) .page-frame {
  height: 100vh;
  max-height: 100vh;
  overflow-x: hidden;
  overflow-y: visible;
  align-items: flex-start;
  padding-top: 16px;
}

body:not(.is-browse):not(.legal-body) .shell {
  /* Viewport-fill flex column — stage grows, footer pins to bottom */
  height: calc(100vh - 16px);
  max-height: calc(100vh - 16px);
  min-height: 0;
  padding: 12px 0 16px;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

/* Keep About/Legal above the fixed cookie bar while it is visible */
body:not(.is-browse):not(.legal-body):has(.cookie-notice) .shell {
  padding-bottom: 88px;
}

body:not(.is-browse):not(.legal-body).promo-leaderboard-on .shell {
  padding-bottom: 16px;
}

body:not(.is-browse):not(.legal-body).promo-leaderboard-on:has(.cookie-notice) .shell {
  padding-bottom: 88px;
}

/* Browse: normal document scroll — detail column is page center */
body.is-browse {
  background: var(--bg);
  --browse-sidebar: 250px;
  --browse-detail: 780px;
  --browse-gap: 14px;
  /* Fill the frame between rails; detail centers via 1fr | detail | 1fr */
  --content-max: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}

body.is-browse .page-frame {
  height: auto;
  max-height: none;
  min-height: 100vh;
  overflow: visible;
  align-items: flex-start;
  padding-top: 0;
}

body.is-browse .shell {
  height: auto;
  max-height: none;
  min-height: auto;
  overflow: visible;
  padding-top: 24px;
  padding-bottom: 40px;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  align-self: stretch;
}

/* =============================================================================
   Landing composition (desktop) — hardcoded from ?edit=layout export
   Editor playground lives on branch tooling/layout-editor
   ============================================================================= */

.landing-stage {
  display: contents;
}

body:not(.is-browse) .landing-stage {
  display: block;
  position: relative;
  /* Fill space above the footer — same origin the editor measured against */
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: visible;
  padding: 0;
  margin: 0;
}

body.is-browse .landing-stage {
  display: block;
  flex-shrink: 0;
  width: 100%;
}

.hero {
  text-align: center;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

body:not(.is-browse) .landing-hero {
  display: contents;
}

body:not(.is-browse) .hero-title {
  position: absolute;
  left: 183px;
  top: 69px;
  width: 735px;
  height: 73px;
  margin: 0;
  max-width: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-size: clamp(36px, 4.8vw, 52px);
  text-align: center;
  z-index: 1;
}

body:not(.is-browse) .hero-sub {
  position: absolute;
  left: 263px;
  top: 171px;
  width: 576px;
  height: 44px;
  margin: 0;
  max-width: none;
  text-align: center;
  z-index: 1;
}

body:not(.is-browse) .hero-spiffo {
  position: absolute;
  left: 467px;
  top: 245px;
  width: 168px;
  height: 209px;
  margin: 0;
  object-fit: contain;
  opacity: 0.78;
  z-index: 1;
}

/* Shared landing middle column — map, search, crafting, browse by must match */
body:not(.is-browse) .landing-stage {
  --landing-mid-w: 720px;
  --landing-mid-left: 203px; /* center with title/spiffo column (~563) */
}

body:not(.is-browse) .hero-map-row {
  position: absolute;
  left: var(--landing-mid-left);
  top: 500px;
  width: var(--landing-mid-w);
  height: auto;
  margin: 0;
  max-width: none;
  display: flex;
  justify-content: center;
  z-index: 2;
}

body:not(.is-browse) .hero-search {
  position: absolute;
  left: var(--landing-mid-left);
  top: 546px;
  width: var(--landing-mid-w);
  height: 49px;
  margin: 0;
  max-width: none;
  z-index: 1;
}

body:not(.is-browse) .hero-search input {
  height: 100%;
}

body:not(.is-browse) .browse-by {
  position: absolute;
  left: var(--landing-mid-left);
  top: 636px;
  width: var(--landing-mid-w);
  height: auto;
  min-height: 143px;
  margin: 0;
  max-width: none;
  gap: 14px;
  align-items: stretch;
  /* Above Top Searches so Crafting "More" isn't clipped under the panel radius */
  z-index: 3;
  overflow: visible;
}

body:not(.is-browse) .browse-by .label-row {
  width: 100%;
  align-items: stretch;
}

/* Crafting + Browse by share identical layout (same .label-row / .quick-labels rules) */
body:not(.is-browse) .browse-by .labels-heading {
  width: 100%;
  text-align: center;
}

body:not(.is-browse) .browse-by .quick-labels {
  width: 100%;
  justify-content: center;
  align-content: center;
}

body.is-browse .hero {
  text-align: left;
  margin-bottom: 16px;
  max-width: none;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(0, var(--browse-detail)) 1fr;
  align-items: center;
  gap: 0;
}

.browse-bar {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  width: var(--browse-sidebar, 250px);
  grid-column: 1;
  justify-self: end;
  margin-right: var(--browse-gap, 14px);
}

body.is-browse .hero-search {
  grid-column: 2;
  justify-self: center;
  max-width: min(560px, 100%);
  width: min(560px, 100%);
  margin: 0;
}

/* Shared back control (browse homeBtn + crafting/about/legal) */
.home-link,
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel-2) 82%, var(--accent) 18%);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 6%, transparent);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.home-link-icon,
.legal-back-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.home-link:hover,
.legal-back:hover {
  text-decoration: none;
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--panel-2) 70%, var(--accent) 30%);
}

.home-link:hover .home-link-icon,
.legal-back:hover .legal-back-icon {
  transform: translateX(-2px);
}

.home-link:focus-visible,
.legal-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.home-link:active,
.legal-back:active {
  transform: translateY(1px);
}

.landing-logo-bg,
.landing-bg,
.hero-logo-browse,
.landing-logo,
.hero-logo {
  display: none !important;
}

.browse-bg {
  display: none !important;
}

.hero-brand {
  margin: 0 0 6px;
  font-family: "Oswald", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 10px;
  max-width: 640px;
  font-family: "Oswald", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.12;
  color: var(--text);
  text-align: inherit;
  text-shadow: 0 2px 24px color-mix(in srgb, var(--accent) 22%, transparent);
}

.hero-sub {
  margin: 0 0 8px;
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(13px, 1.6vw, 15px);
  line-height: 1.45;
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 14px;
}

.hero-nav a {
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}

.hero-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hero-title::after {
  content: "";
  display: block;
  width: min(140px, 40%);
  height: 3px;
  margin: 12px 0 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 80%, white),
    transparent
  );
}

body:not(.is-browse) .hero-title::after {
  margin-left: auto;
  margin-right: auto;
}

body.is-browse .hero-title,
body.is-browse .hero-brand,
body.is-browse .hero-sub,
body.is-browse .hero-nav {
  display: none;
}

.hero-spiffo {
  display: block;
  width: min(150px, 36vw);
  height: auto;
  margin: 2px 0 10px;
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
}

body.is-browse .hero-spiffo {
  display: none;
}

.hero-map-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

body.is-browse .hero-map-row {
  display: none;
}

.hero-search {
  position: relative;
  display: block;
  max-width: 460px;
  width: 100%;
  margin: 0;
}

body.is-browse .browse {
  width: 100%;
}

body.is-browse .layout {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(0, var(--browse-detail, 780px)) 1fr;
  gap: 0;
  align-items: start;
}

body.is-browse .layout > aside.panel {
  grid-column: 1;
  justify-self: end;
  width: var(--browse-sidebar, 250px);
  margin-right: var(--browse-gap, 14px);
}

body.is-browse .layout > .detail-panel {
  grid-column: 2;
  width: 100%;
  max-width: none;
}

.hero-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: flex;
  pointer-events: none;
  z-index: 1;
}

.hero-search input {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
  color: var(--text);
  border-radius: 16px;
  padding: 16px 18px 16px 46px;
  font-size: 16px;
  box-shadow: 0 12px 32px var(--shadow);
}

.hero-search input::-webkit-search-decoration,
.hero-search input::-webkit-search-cancel-button,
.hero-search input::-webkit-search-results-button,
.hero-search input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

body.is-browse .hero-search input {
  padding: 14px 16px 14px 44px;
  font-size: 15px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 94%, var(--accent) 6%);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 8px 22px var(--shadow);
}

.hero-search input:focus,
.hero-search input:focus-visible {
  outline: none;
  border-color: var(--accent);
  /* Single ring only — no stacked outline + border */
  box-shadow: 0 12px 32px var(--shadow);
}

body.is-browse .hero-search input:focus,
body.is-browse .hero-search input:focus-visible {
  box-shadow: 0 8px 22px var(--shadow);
}

.hero-search input::placeholder {
  color: color-mix(in srgb, var(--muted) 88%, transparent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.landing {
  max-width: 420px;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  justify-self: start;
}

body:not(.is-browse) .landing-top10 {
  position: absolute;
  /*
   * Authored at left:994 / width:296 in a 1100px shell (overhangs shell).
   * Clamp against the viewport so typical laptop widths don't get an h-scrollbar;
   * wide desktops keep the authored 994px.
   */
  --landing-top10-w: 296px;
  left: min(
    994px,
    calc(
      (100vw - 2 * max(var(--page-inline), var(--rail-pad, 0px)) + 100%) / 2
      - var(--landing-top10-w)
    )
  );
  /* Stay at authored top — shifting up covered the title on short windows */
  top: 142px;
  width: var(--landing-top10-w);
  height: auto;
  min-height: 0;
  /* Cap to remaining viewport under the panel; scroll inside .top10 */
  max-height: calc(100vh - 142px - 24px);
  max-width: none;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: none;
  /* Below chips so Crafting "More" isn't covered when columns overlap */
  z-index: 1;
}

body:not(.is-browse) .landing-top10 .top10 {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: 4px;
}

.top10-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
  text-align: left;
}

.browse-by {
  margin-top: 10px;
  width: 100%;
  max-width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body:not(.is-browse) .labels-heading {
  text-align: center;
}

body:not(.is-browse) .quick-labels,
body:not(.is-browse) #mapLabels,
body:not(.is-browse) #craftLabels,
body:not(.is-browse) #quickLabels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  width: 100%;
  margin-inline: auto;
}

body.is-browse .browse-by {
  display: none;
}

.label-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

body:not(.is-browse) .label-row {
  align-items: stretch;
  width: 100%;
}

.labels-heading {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
  text-align: left;
}

.quick-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.quick-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  border-radius: 999px;
  padding: 6px 11px 6px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  min-height: 36px;
  max-width: 100%;
}

.quick-label:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.quick-label-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.quick-label-text {
  white-space: nowrap;
}

.label-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 13px;
  color: var(--muted);
}

.label-filter-clear {
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.label-filter-clear:hover {
  border-color: var(--accent);
}

.top10 {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  overflow: visible;
  flex: 0 1 auto;
}

.top10 li + li {
  border-top: 1px solid var(--border);
}

.top10-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

a.top10-item {
  text-decoration: none;
  box-sizing: border-box;
}

.top10-item:hover {
  background: var(--accent-soft);
}

.top10-rank {
  width: 22px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.top10-name {
  font-size: 15px;
  font-weight: 550;
}

.top10-icon,
.result-icon,
.detail-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
  flex-shrink: 0;
  image-rendering: pixelated;
  /* Avoid mix-blend-mode: lighten — it can make icons look empty on dark panels */
  mix-blend-mode: normal;
}

.detail-icon {
  width: 56px;
  height: 56px;
}

.icon-fallback {
  display: inline-block;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--border) 70%, transparent), transparent),
    color-mix(in srgb, var(--panel-2) 70%, transparent);
  mix-blend-mode: normal;
}

.browse {
  flex: 1;
}

.filters-disclosure {
  margin: 12px 0 0;
  max-width: 460px;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

/* Filters live on the landing/main page only (under search) */
body.is-browse .filters-disclosure {
  display: none;
}

.filters-disclosure:not([open]) {
  max-width: fit-content;
  min-width: 0;
}

.filters-disclosure:not([open]) summary {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: none;
}

.filters-disclosure[open] {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 0 12px 2px;
}

.filters-disclosure summary {
  cursor: pointer;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
  width: fit-content;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filters-disclosure[open] summary {
  padding: 10px 4px;
  width: 100%;
}

.filters-disclosure summary::-webkit-details-marker {
  display: none;
}

/* Closed: chevron points down (expands below). Open: points up (collapse). */
.filters-disclosure summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  border-bottom: 0;
  flex-shrink: 0;
}

.filters-disclosure[open] summary::before {
  border-top: 0;
  border-bottom: 6px solid var(--muted);
  transform: none;
}

.filters-row {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  padding: 0 4px 14px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.field span,
.check span,
.panel-header .muted {
  color: var(--muted);
  font-size: 13px;
}

select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: none;
}

.layout {
  display: grid;
  grid-template-columns: var(--browse-sidebar, 250px) minmax(0, var(--browse-detail, 780px));
  gap: var(--browse-gap, 14px);
  align-items: start;
  width: 100%;
}

.layout > aside.panel {
  height: fit-content;
  max-height: min(70vh, 720px);
  align-self: start;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  box-shadow: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
}

.results {
  max-height: min(62vh, 640px);
  overflow: auto;
}

.result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.result:last-child {
  border-bottom: none;
}

.result:hover,
.result.active {
  background: var(--accent-soft);
}

.result-body {
  min-width: 0;
}

.result h3 {
  margin: 0 0 2px;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.result .sub {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-panel {
  padding: 18px;
  background: var(--panel);
  box-shadow: none;
  align-self: start;
  width: 100%;
  max-width: var(--browse-detail, 780px);
  box-sizing: border-box;
}

.chance-note {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  justify-content: center;
  align-items: center;
}

.detail-tab {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  max-width: 100%;
}

.detail-tab:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.detail-tab.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.detail-tab-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  opacity: 0.75;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 999px;
  padding: 1px 7px;
}

.detail-summary {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}


.worth-checking {
  margin: 0 0 16px;
}

.worth-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.16), rgba(110, 168, 254, 0.06));
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.worth-toggle:not(.is-open) {
  border-color: #8a7048;
  animation: worth-border-glow 2.2s ease-in-out infinite;
}

.worth-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.26), rgba(110, 168, 254, 0.1));
  color: #fff;
}

.worth-toggle:not(.is-open):hover {
  border-color: #d4b88a;
  animation-play-state: paused;
  box-shadow:
    0 0 0 1px rgba(196, 165, 116, 0.4),
    0 0 14px rgba(196, 165, 116, 0.28);
}

.worth-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.worth-toggle.is-open {
  animation: none;
  box-shadow: none;
}

@keyframes worth-border-glow {
  0%,
  100% {
    border-color: #5c4a32;
    box-shadow:
      0 0 0 1px rgba(196, 165, 116, 0.12),
      0 0 8px rgba(196, 165, 116, 0.08);
  }
  50% {
    border-color: #c4a574;
    box-shadow:
      0 0 0 1px rgba(196, 165, 116, 0.5),
      0 0 16px rgba(196, 165, 116, 0.38);
  }
}

@media (prefers-reduced-motion: reduce) {
  .worth-toggle:not(.is-open) {
    animation: none;
    border-color: #c4a574;
    box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.35);
  }
}

.worth-toggle-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  translate: 0 -1px;
  transition: transform 0.15s ease;
}

.worth-toggle.is-open .worth-toggle-chevron {
  transform: rotate(225deg);
  translate: 0 1px;
}

.worth-panel {
  margin-top: 10px;
  padding: 14px 16px 12px;
  border: 1px solid color-mix(in srgb, #3d3429 65%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(165deg, rgba(196, 165, 116, 0.1) 0%, transparent 48%),
    color-mix(in srgb, var(--panel) 68%, #1a1814);
}

.worth-heading {
  margin: 0 0 4px;
  font-family: "Oswald", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.15;
  color: #e8dfd0;
}

.worth-sub {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #9a8f7c;
}

.worth-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.worth-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.worth-rank {
  flex: 0 0 1.5rem;
  font-family: "Oswald", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #c4a574;
  line-height: 1.3;
}

.worth-body {
  min-width: 0;
  flex: 1;
}

.worth-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 2px;
}

.worth-title {
  font-size: 14px;
  font-weight: 650;
  color: #f0ebe3;
}

.worth-meta {
  font-size: 11px;
  color: #9a9286;
}

.worth-reason {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #b0a594;
}



.spawn-section {
  margin-bottom: 14px;
}

.spawn-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 650;
}

.spawn-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
}

.spawn-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  /* stretch/100%: fill detail panel — max-content was shrinking cards to ~276px */
  width: stretch;
  width: -webkit-fill-available;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-2) 90%, var(--accent) 10%);
  box-shadow: none;
}

.spawn-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.spawn-card-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 5.5rem);
}

.spawn-headline {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
  min-width: 0;
}

.spawn-chance {
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
  font-size: 16px;
  font-weight: 700;
  color: var(--good);
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--good) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--good) 14%, var(--panel));
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  box-sizing: border-box;
}

.spawn-chance-longshot {
  color: #b89a6a;
  border-color: color-mix(in srgb, #b89a6a 45%, transparent);
  background: color-mix(in srgb, #b89a6a 12%, var(--panel));
}

.spawn-longshot-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.spawn-card-longshot {
  opacity: 0.88;
}

.spawn-card-orphan-vehicle {
  opacity: 0.72;
  border-style: dashed;
}

.spawn-chance-orphan {
  color: #9a9286;
}

.spawn-orphan-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c4a574;
  vertical-align: middle;
}

.spawn-chance-note {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 12px;
}

.spawn-fields {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 7px;
  align-items: baseline;
  width: 100%;
}

.spawn-field {
  display: contents;
  font-size: 13px;
  line-height: 1.35;
}

.spawn-field-label {
  color: var(--muted);
  font-weight: 500;
}

.spawn-field-value {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.spawn-context,
.spawn-chips,
.spawn-chip,
.spawn-ingame,
.spawn-ingame-label,
.spawn-ingame-id {
  display: none;
}

.spawn-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 12px;
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  padding-top: 2px;
  margin-top: 0;
  border-top: 0;
}

.spawn-map-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.spawn-map-link:hover {
  text-decoration: underline;
}

.detail-map-link,
.detail-craft-link,
.craft-wiki-detail-loot {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--border));
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.2), rgba(110, 168, 254, 0.07));
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.detail-map-link {
  align-self: start;
  margin: 0 0 0 auto;
}

.detail-craft-link,
.craft-wiki-detail-loot {
  margin: 0;
}

.detail-map-link:hover,
.detail-craft-link:hover,
.craft-wiki-detail-loot:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.3), rgba(110, 168, 254, 0.12));
  color: #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

.detail-map-link-icon,
.detail-craft-link-icon {
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
  opacity: 0.95;
  color: var(--accent);
  flex-shrink: 0;
}

.detail-map-link:hover .detail-map-link-icon,
.detail-craft-link:hover .detail-craft-link-icon,
.craft-wiki-detail-loot:hover .detail-craft-link-icon {
  color: #fff;
}

.detail-map-link-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-10%, -10%) rotate(45deg);
  transform-origin: left center;
  border-radius: 1px;
}

/* Craft / loot cross-links: arrow instead of map pin */
.detail-craft-link-icon {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.detail-craft-link-icon::before,
.detail-craft-link-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.detail-craft-link-icon::before {
  left: 0;
  top: 50%;
  width: 100%;
  height: 1.5px;
  transform: translateY(-50%);
  border-radius: 1px;
}

.detail-craft-link-icon::after {
  right: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  background: transparent;
  transform: translateY(-50%) rotate(45deg);
}

.spawn-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 0 0 12px;
}

.spawn-list + .spawn-pager {
  margin: 12px 0 0;
}

.spawn-pager-range {
  font-size: 12px;
  color: var(--muted);
}

.spawn-pager-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.spawn-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.spawn-page-btn:hover:not(:disabled):not(.active) {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.spawn-page-btn.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.spawn-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.spawn-page-nav {
  font-size: 16px;
  line-height: 1;
}

.spawn-page-ellipsis {
  min-width: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.spawn-more {
  padding: 4px 2px 0;
  font-size: 12px;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  list-style: none;
}

.spawn-more:hover {
  box-shadow: none;
  transform: none;
}

.region-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.region-chip {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.empty-state,
.loading-block,
.error-block {
  display: grid;
  place-items: center;
  min-height: 36vh;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 24px;
  text-align: center;
}

.loading-block,
.error-block {
  min-height: 140px;
}

.error-block {
  color: #ff8f8f;
  border-color: color-mix(in srgb, #ff8f8f 40%, var(--border));
}

.detail h2 {
  margin: 0;
  font-size: 24px;
}

.detail-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.detail-head-text {
  flex: 1;
  min-width: 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 1 auto;
  max-width: 100%;
}

.detail-actions .detail-map-link,
.detail-actions .detail-craft-link {
  margin: 0;
  align-self: center;
}

.detail-sub {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--border);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

.pill-accent {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.stat.span-all {
  grid-column: 1 / -1;
}

.stat .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat .value {
  font-size: 18px;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 11px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

tr:hover td {
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
}

.vehicle-row td {
  background: color-mix(in srgb, var(--accent-soft) 28%, transparent);
}

.muted {
  color: var(--muted);
}

.good {
  color: var(--good);
}

.small {
  font-size: 12px;
}

.site-footer {
  margin-top: 12px;
  padding-top: 8px;
  text-align: center;
  flex-shrink: 0;
}

/* Landing: legal links + cache clear on one row */
body:not(.is-browse) .site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  /* Pin to bottom of the viewport shell — matches the saved ?edit=layout screenshots */
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 6px;
  padding-bottom: 4px;
  flex-shrink: 0;
}

body:not(.is-browse) .site-footer .meta {
  flex: 1 0 100%;
  margin: 0;
}

body:not(.is-browse) .footer-legal {
  margin: 0;
}

body:not(.is-browse) .cache-clear-btn {
  margin-top: 0;
}

body.is-browse .site-footer {
  margin-top: 28px;
  padding-top: 12px;
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

.footer-disclaimer {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  opacity: 0.9;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 8px;
}

.footer-legal a {
  color: var(--muted);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-legal a:hover {
  color: var(--text);
}

/* --- Promo placements: rails fixed via ads.js; leaderboard in-flow at top of shell --- */
.promo-rail {
  display: none;
  box-sizing: border-box;
}

.promo-slot[hidden] {
  display: none !important;
}

.promo-slot--skyscraper {
  width: 160px;
  height: 600px;
  min-width: 160px;
  min-height: 600px;
}

.promo-slot--leaderboard {
  display: none;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: min(728px, 100%);
  height: 90px;
  max-height: 90px;
  margin: 0 auto 16px;
  flex-shrink: 0;
  padding: 8px;
  background: #1a1814;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.promo-slot--leaderboard.promo-slot--native {
  background: #12110e;
}

body.promo-leaderboard-on .promo-slot--leaderboard:not([hidden]) {
  display: block;
}

.promo-slot--native {
  height: auto !important;
  max-height: none !important;
  min-height: 120px;
  overflow: visible;
  background: #12110e;
}

.promo-slot--native > div {
  width: 100%;
  margin-inline: auto;
}

/* Sticky phone / narrow banner — fixed to top when rails don't fit */
body.promo-mobile-banner {
  padding-top: var(--mobile-banner-h, 66px);
}

body.promo-mobile-banner .promo-slot--leaderboard:not([hidden]) {
  display: block !important;
  box-shadow: 0 4px 18px var(--shadow);
}

.promo-slot--outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-height: 100%;
  border: 1px dashed color-mix(in srgb, var(--border) 85%, var(--muted));
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--muted);
  box-sizing: border-box;
  /* Temporarily invisible while AdSense review is pending */
  opacity: 0;
  pointer-events: none;
}

.promo-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  user-select: none;
  text-align: center;
  padding: 8px;
}

.promo-mark-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.promo-mark-size {
  font-size: 12px;
  opacity: 0.65;
}

.cache-clear-btn {
  appearance: none;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.cache-clear-btn:hover {
  color: var(--text);
}

.bar-cache-btn {
  margin-top: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}

.bar-cache-btn:hover {
  color: var(--text);
}

@media (max-width: 900px) {
  .promo-slot--leaderboard {
    height: 100px;
    max-height: 100px;
    width: min(320px, calc(100vw - 24px));
  }

  body:not(.is-browse).promo-leaderboard-on .shell {
    padding-bottom: 16px;
  }
}

@media (max-width: 640px) {
  .promo-slot--leaderboard {
    height: 50px;
    max-height: 50px;
  }

  body:not(.is-browse).promo-leaderboard-on .shell {
    padding-bottom: 12px;
  }
}

@media (max-width: 760px) {
  body.is-browse {
    --content-max: 100%;
  }

  body.is-browse .layout {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 12px;
  }

  body.is-browse .layout > aside.panel,
  body.is-browse .layout > .detail-panel {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    margin-right: 0;
    max-width: none;
  }

  .panel {
    min-height: auto;
  }

  .results {
    max-height: 40vh;
  }

  body.is-browse .hero {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  body.is-browse .browse-bar {
    justify-self: start;
    width: auto;
    margin-right: 0;
  }

  body.is-browse .hero-search {
    grid-column: 1;
    justify-self: stretch;
    max-width: none;
    width: 100%;
  }

  /* Spawn cards: don't crush the value column beside the chance pill */
  .spawn-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }

  .spawn-card-main {
    max-width: 100%;
    width: 100%;
  }

  .spawn-chance {
    align-self: flex-start;
    margin-left: 0;
  }

  .spawn-fields {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: 2px;
  }

  .spawn-field-label {
    margin-top: 6px;
  }

  .spawn-field-label:first-child,
  .spawn-field:first-child .spawn-field-label {
    margin-top: 0;
  }

  .spawn-field-value {
    overflow-wrap: break-word;
    word-break: normal;
  }
}

/*
 * Short desktop (wide enough for absolute composition, but not tall enough):
 * Absolute chips sit at top:636 + height 143 ≈ bottom 779. With overflow-y:hidden
 * + fixed 100vh they collide with the footer and clip. Unlock page scroll and
 * give the stage in-flow height so the footer clears the absolute kids.
 */
@media (min-width: 1500px) and (max-height: 980px) {
  body:not(.is-browse):not(.legal-body) {
    overflow-x: hidden;
    overflow-y: auto;
  }

  html:has(body:not(.is-browse):not(.legal-body)) {
    overflow-x: hidden;
  }

  body:not(.is-browse):not(.legal-body) .page-frame {
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  body:not(.is-browse):not(.legal-body) .shell {
    height: auto;
    max-height: none;
    min-height: calc(100vh - 16px);
    overflow: visible;
  }

  body:not(.is-browse) .landing-stage {
    /* chips bottom ~779; top10 bottom ~742 — keep footer below absolute layer */
    flex: 0 0 auto;
    min-height: 800px;
  }
}

/* Stack Top Searches under hero before absolute side layout overlaps the title.
 * Authored top10 left:994 needs ~1500px viewport once clamp + 296px panel are included
 * (at vw≈1107 logs showed titleAsideOverlapX≈160). Prefer early stack over late overlap. */
@media (max-width: 1499px) {
  body:not(.is-browse):not(.legal-body) {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body:not(.is-browse):not(.legal-body) .page-frame {
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  body:not(.is-browse):not(.legal-body) .shell {
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow: visible;
    padding: 16px 0 20px;
  }

  body:not(.is-browse) .landing-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-content: start;
    justify-content: flex-start;
    gap: 16px;
    flex: 0 0 auto;
    overflow: visible;
    min-height: 0;
  }

  body:not(.is-browse) .landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: none;
    width: 100%;
    position: relative;
  }

  body:not(.is-browse) .hero-title,
  body:not(.is-browse) .hero-sub,
  body:not(.is-browse) .hero-spiffo,
  body:not(.is-browse) .hero-map-row,
  body:not(.is-browse) .browse-by,
  body:not(.is-browse) .landing-top10 {
    position: static;
    left: auto;
    top: auto;
    right: auto;
    transform: none;
    width: auto;
    height: auto;
    max-width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
  }

  /* Keep relative so the magnifier stays inside the search field (not the stage).
     Lock height to 49px so stacked layout matches desktop (avoid auto-padding jump). */
  body:not(.is-browse) .hero-search {
    position: relative;
    left: auto;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    height: 49px;
    max-width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
  }

  body:not(.is-browse) .hero-search input {
    height: 100%;
  }

  body:not(.is-browse) .hero-title {
    white-space: normal;
    font-size: clamp(28px, 7.5vw, 40px);
    max-width: min(720px, 100%);
  }

  body:not(.is-browse) .hero-spiffo {
    width: min(150px, 42vw);
    margin-bottom: 14px;
    opacity: 0.78;
  }

  body:not(.is-browse) .hero-map-row {
    width: 100%;
    max-width: min(720px, 100%);
    margin-bottom: 10px;
    justify-content: center;
  }

  body:not(.is-browse) .hero-search {
    width: 100%;
    height: 49px;
    max-width: min(720px, 100%);
  }

  body:not(.is-browse) .browse-by {
    width: 100%;
    max-width: min(720px, 100%);
    margin-top: 12px;
    margin-left: auto;
    margin-right: auto;
    align-items: stretch;
  }

  body:not(.is-browse) .browse-by .label-row {
    width: 100%;
    align-items: stretch;
  }

  body:not(.is-browse) .labels-heading {
    text-align: center;
  }

  body:not(.is-browse) .quick-labels,
  body:not(.is-browse) #mapLabels,
  body:not(.is-browse) #craftLabels,
  body:not(.is-browse) #quickLabels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    width: 100%;
  }

  body:not(.is-browse) .hero-title::after {
    margin-left: auto;
    margin-right: auto;
  }

  .landing,
  body:not(.is-browse) .landing-top10 {
    max-width: min(420px, 100%);
    width: 100%;
    margin-inline: auto;
    overflow: visible;
    flex: 0 0 auto;
    z-index: auto;
  }

  .top10 {
    overflow: hidden;
  }

  .top10-heading {
    text-align: center;
  }

  .promo-slot--leaderboard {
    aspect-ratio: 320 / 100;
    max-height: 100px;
    width: min(320px, 100%);
  }
}

/* Phone */
@media (max-width: 640px) {
  :root {
    --page-inline: 12px;
    --content-max: 100%;
  }

  body:not(.is-browse):not(.legal-body) .shell {
    padding: 12px 0 16px;
    min-height: 100dvh;
  }

  body:not(.is-browse) .landing-stage {
    gap: 12px;
  }

  body:not(.is-browse) .hero-title {
    font-size: clamp(24px, 7.5vw, 32px);
    margin-bottom: 6px;
  }

  body:not(.is-browse) .hero-title::after {
    margin-top: 8px;
    width: min(100px, 36%);
  }

  body:not(.is-browse) .hero-spiffo {
    width: min(120px, 36vw);
    margin: 2px auto 10px;
    opacity: 0.8;
  }

  body:not(.is-browse) .hero-map-row {
    margin-bottom: 8px;
    width: 100%;
    max-width: min(720px, 100%);
    justify-content: center;
  }

  body:not(.is-browse) .hero-search {
    width: 100%;
    height: 49px;
    max-width: min(720px, 100%);
  }

  body:not(.is-browse) .browse-by {
    margin-top: 10px;
    width: 100%;
    max-width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
    gap: 12px;
    align-items: stretch;
  }

  body:not(.is-browse) .browse-by .label-row {
    width: 100%;
    align-items: stretch;
  }

  body:not(.is-browse) .labels-heading {
    text-align: center;
  }

  body:not(.is-browse) .quick-labels,
  body:not(.is-browse) #mapLabels,
  body:not(.is-browse) #craftLabels,
  body:not(.is-browse) #quickLabels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    width: 100%;
  }

  .quick-labels {
    gap: 6px;
  }

  .quick-label {
    font-size: 12px;
    padding: 5px 10px 5px 5px;
    min-height: 34px;
    gap: 6px;
  }

  .quick-label-icon {
    width: 20px;
    height: 20px;
  }

  .hero-search input {
    padding: 14px 16px 14px 44px;
    font-size: 16px; /* avoid iOS zoom */
    border-radius: 14px;
  }

  .top10-heading {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .top10 {
    border-radius: 14px;
  }

  .top10-item {
    gap: 10px;
    padding: 9px 12px;
  }

  .top10-name {
    font-size: 14px;
  }

  .detail-tab {
    padding: 8px 12px;
    font-size: 12px;
  }

  .top10-icon,
  .icon-fallback {
    width: 32px;
    height: 32px;
  }

  .top10-icon,
  .result-icon,
  .detail-icon {
    mix-blend-mode: normal;
  }

  /* Compact bottom unit; hide if space is very tight via shorter aspect */
  .promo-slot--leaderboard {
    aspect-ratio: 320 / 50;
    max-height: 50px;
    width: 100%;
    margin: 4px auto 2px;
  }

  .site-footer {
    margin-top: 8px;
    padding-top: 6px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .meta {
    font-size: 11px;
  }

  body.is-browse .shell {
    padding: 12px 0 20px;
  }

  body.is-browse .layout {
    gap: 12px;
  }

  .results {
    max-height: none;
  }

  .panel.card {
    border-radius: 14px;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-head {
    flex-wrap: wrap;
  }

  .detail-actions {
    margin-left: 0;
    order: 3;
    width: 100%;
    justify-content: stretch;
  }

  .detail-actions .detail-map-link,
  .detail-actions .detail-craft-link {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 640px) and (max-height: 720px) {
  /* Short phones: drop Spiffo to keep search + list usable */
  body:not(.is-browse) .hero-spiffo {
    display: none;
  }

  body:not(.is-browse) .hero-sub,
  body:not(.is-browse) .hero-nav {
    display: none;
  }

  .promo-slot--leaderboard {
    max-height: 40px;
  }
}

@media (max-width: 380px) {
  body:not(.is-browse) .hero-title {
    font-size: 22px;
  }

  .top10-item {
    padding: 8px 10px;
  }
}

/* —— Legal pages —— */
/* Do not inherit landing's overflow:hidden / 100vh lock */
body.legal-body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}

body.legal-body .page-frame {
  height: auto;
  max-height: none;
  min-height: 100vh;
  overflow: visible;
  align-items: flex-start;
  padding-top: 0;
}

body.legal-body .shell,
body.legal-body .shell.legal-shell {
  height: auto;
  max-height: none;
  min-height: auto;
  overflow: visible;
  max-width: 720px;
  width: min(100%, 720px);
  margin-inline: auto;
  padding-top: 32px;
  padding-bottom: 48px;
  padding-inline: clamp(14px, 4vw, 24px);
  box-sizing: border-box;
  align-self: center;
}

/* Craft wiki: slightly wider than browse, not full ultrawide */
body.craft-wiki-page {
  --content-max: min(1280px, calc(100vw - 48px));
  --craft-sidebar: 320px;
  --craft-detail: 1fr;
}

body.craft-wiki-page .page-frame {
  justify-content: center;
  align-items: stretch;
}

body.craft-wiki-page .shell.legal-shell,
body.craft-wiki-page .shell.craft-wiki-shell {
  max-width: min(1280px, calc(100vw - 48px));
  width: min(1280px, calc(100vw - 48px));
  flex: 0 1 auto;
  overflow-x: visible;
}

body.craft-wiki-page.legal-body {
  overflow-x: clip;
}

body.craft-wiki-page .craft-wiki-header .legal-lead {
  max-width: 62ch;
}

.legal-header {
  margin-bottom: 8px;
}

.legal-back {
  margin: 0 0 18px;
}

.legal-title {
  margin: 0 0 8px;
  font-weight: 650;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.02em;
}

.legal-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.legal-toc a {
  color: var(--accent);
  font-size: 13px;
  text-decoration: none;
}

.legal-toc a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-doc {
  padding: 8px 0 24px;
}

.legal-updated {
  color: var(--muted);
  font-size: 12px;
  margin: 16px 0 0;
}

.legal-section {
  margin-top: 28px;
  scroll-margin-top: 24px;
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 650;
}

.legal-section h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 650;
}

.legal-section p,
.legal-section li {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-size: 14px;
  line-height: 1.55;
}

.legal-section p {
  margin: 0 0 10px;
}

.legal-section ul {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.legal-section ol.about-steps {
  margin: 0 0 12px;
  padding-left: 1.25rem;
}

.legal-section ol.about-steps li {
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
  font-size: 14px;
  line-height: 1.55;
}

.legal-section ol.about-steps li + li {
  margin-top: 6px;
}

.legal-section li + li {
  margin-top: 6px;
}

.legal-section a {
  color: var(--accent);
}

.legal-section code {
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.legal-callout {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--text) 90%, var(--muted));
  font-size: 14px;
  line-height: 1.5;
}

.legal-callout a {
  color: var(--accent);
}

.legal-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  clear: both;
}

body.craft-wiki-page .legal-footer {
  margin-top: 24px;
}

.footer-disclaimer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-disclaimer a:hover {
  color: var(--text);
}

/* —— Cookie notice —— */
.cookie-notice {
  position: fixed;
  z-index: 1000;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  max-width: 640px;
  margin-inline: auto;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 12px 40px var(--shadow);
  backdrop-filter: blur(10px);
}

.cookie-notice-text {
  flex: 1 1 220px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.cookie-notice-text a {
  color: var(--accent);
}

.cookie-notice-btn {
  appearance: none;
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cookie-notice-btn:hover {
  border-color: var(--accent);
}

/* Crafting recipes on item detail */
.craft-pill {
  padding: 2px 8px;
  font-size: 11px;
}

.craft-section {
  margin: 16px 0 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
}

.craft-heading {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.craft-intro,
.craft-browse-link {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.craft-browse-link {
  margin: 14px 0 0;
}

.craft-browse-link a {
  color: var(--accent);
}

.evolved-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.evolved-row {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.evolved-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.evolved-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.evolved-name {
  font-weight: 650;
  font-size: 15px;
}

.evolved-hunger {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted);
  min-width: 2ch;
  text-align: right;
}

.evolved-row-meta {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.evolved-flag {
  padding: 1px 7px;
  font-size: 10px;
}

.craft-recipe {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.craft-recipe:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.craft-recipe + .craft-recipe {
  margin-top: 4px;
}

.craft-recipe-title {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.3;
}

.craft-recipe-meta {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.craft-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px 20px;
  align-items: start;
}

.craft-col {
  min-width: 0;
}

.craft-col-label {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.craft-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.craft-list-outputs {
  gap: 8px;
}

.craft-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.craft-input-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  font-size: 13px;
  line-height: 1.35;
}

.craft-count {
  font-weight: 700;
  color: var(--accent);
}

.craft-input-label {
  color: var(--muted);
}

.craft-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.craft-output {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.craft-item-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-2) 70%, var(--panel));
  color: inherit;
  border-radius: 8px;
  padding: 4px 9px 4px 4px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  max-width: 100%;
}

.craft-item-link span {
  overflow-wrap: anywhere;
}

.craft-item-link:hover {
  border-color: var(--accent);
}

.craft-item-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.craft-tag {
  color: var(--text);
  font-weight: 600;
}

.craft-mode {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.craft-empty {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .craft-cols,
  .craft-wiki-detail .craft-cols {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .craft-section {
    margin: 12px 0 16px;
    padding: 12px;
    border-radius: 12px;
  }

  .craft-recipe {
    padding: 14px 0;
  }

  .craft-recipe-title {
    font-size: 14px;
  }

  .craft-input {
    padding: 9px;
    gap: 7px;
  }

  .craft-input-head {
    font-size: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .craft-mode {
    margin-left: 0;
    width: auto;
  }

  .craft-pills {
    width: 100%;
  }

  .craft-item-link {
    font-size: 12px;
    padding: 5px 8px 5px 4px;
    max-width: 100%;
  }

  .craft-wiki-detail-head {
    flex-direction: column;
    gap: 10px;
  }

  .craft-wiki-detail-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .craft-wiki-detail-loot {
    white-space: normal;
    width: 100%;
    justify-content: center;
  }
}

/* Crafting wiki page */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.craft-wiki-page .craft-wiki {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 8px 0 40px;
}

.craft-wiki-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
}

.craft-wiki-search {
  flex: 1 1 220px;
  min-width: 0;
}

.craft-wiki-search input,
.craft-wiki-filter select {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  box-sizing: border-box;
}

.craft-wiki-filter {
  flex: 0 1 200px;
  min-width: 0;
}

.craft-wiki-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
}

.craft-wiki-nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.craft-wiki-nav-link:hover {
  color: var(--text);
}

.craft-wiki-nav-link.is-active {
  color: var(--text);
  border-bottom-color: var(--accent, #c45c26);
}

.craft-wiki-layout {
  display: grid;
  grid-template-columns: var(--craft-sidebar) minmax(0, var(--craft-detail));
  gap: 14px;
  align-items: start;
  width: 100%;
  margin-bottom: 8px;
}

.craft-wiki-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: auto;
  max-height: min(72vh, 760px);
  overflow: hidden;
  align-self: start;
}

.craft-wiki-list-panel .panel-header {
  padding: 12px 14px 10px;
}

.craft-wiki-results {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.craft-wiki-result {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.craft-wiki-result-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  overflow: hidden;
}

.craft-wiki-result-meta {
  align-items: center;
}

.craft-wiki-skills,
.craft-wiki-surfaces {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.craft-wiki-skill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}

.craft-wiki-surface {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--panel-2) 80%, #000);
  border: 1px solid var(--border);
}

.craft-wiki-surface .craft-wiki-icon {
  width: 14px;
  height: 14px;
}

.craft-wiki-surface .craft-wiki-icon-fallback {
  width: 14px;
  height: 14px;
}

.craft-wiki-detail-surfaces {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.craft-wiki-detail-surfaces-label {
  font-size: 12px;
  color: var(--muted);
}

.craft-wiki-detail-surfaces .craft-wiki-surface {
  width: 24px;
  height: 24px;
}

.craft-wiki-detail-surfaces .craft-wiki-surface .craft-wiki-icon,
.craft-wiki-detail-surfaces .craft-wiki-surface .craft-wiki-icon-fallback {
  width: 18px;
  height: 18px;
}

.craft-wiki-learn {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.craft-wiki-learn-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.craft-wiki-learn-label,
.craft-learn-label {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  padding-top: 4px;
}

.craft-wiki-learn-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.craft-wiki-learn-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-size: 10px;
  font-weight: 650;
  color: var(--text);
  padding: 1px 6px 1px 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-2) 85%, #000);
}

.craft-wiki-learn-compact .craft-wiki-icon,
.craft-wiki-learn-compact .craft-wiki-icon-fallback {
  width: 14px;
  height: 14px;
}

.craft-wiki-learn-compact span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.craft-wiki-learn-fallback,
.craft-learn-fallback {
  font-size: 12px;
  color: var(--muted);
}

.craft-learn-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.craft-wiki-icon {
  width: 28px;
  height: 28px;
  display: block;
  image-rendering: pixelated;
}

.craft-wiki-icon-fallback {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  box-sizing: border-box;
}

.craft-wiki-pager-slot {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  border-bottom: 0;
  flex-shrink: 0;
}

.craft-wiki-pager-slot:empty {
  display: none;
}

.craft-wiki-pager-slot .craft-wiki-pager {
  margin: 0;
  gap: 8px;
}

.craft-wiki-pager-slot .spawn-pager-range {
  font-size: 11px;
}

.craft-wiki-detail-panel {
  min-height: 0;
  height: fit-content;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  align-self: start;
}

.craft-wiki-detail {
  width: 100%;
}

.craft-wiki-detail .craft-cols {
  margin-top: 4px;
  gap: 14px 20px;
  width: 100%;
  align-items: start;
  grid-template-columns: 1fr;
}

@media (min-width: 901px) {
  .craft-wiki-detail .craft-cols {
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.75fr);
  }
}

.craft-wiki-detail .craft-list {
  gap: 8px;
}

.craft-wiki-detail .craft-input {
  padding: 8px 10px;
  gap: 6px;
}

.craft-wiki-detail.hidden,
.craft-wiki-detail-panel .empty-state.hidden {
  display: none;
}

.craft-wiki-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.craft-wiki-detail-head-text {
  min-width: 0;
}

.craft-wiki-detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin-bottom: 6px;
}

.craft-wiki-detail-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.craft-wiki-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.craft-wiki-detail-icons {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  overflow: hidden;
}

.craft-wiki-detail-icons .craft-wiki-icon,
.craft-wiki-detail-icons .craft-wiki-icon-fallback {
  width: 48px;
  height: 48px;
}

.craft-wiki-detail-meta .craft-wiki-skill {
  font-size: 11px;
  padding: 2px 8px;
}

.craft-wiki-detail .craft-col-label {
  font-size: 12px;
}

.craft-wiki-item-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px 4px 4px;
  text-decoration: none;
  font-size: 12px;
  max-width: 100%;
}

.craft-wiki-item-link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent);
}

.craft-wiki-item-link .craft-wiki-icon,
.craft-wiki-item-link .craft-wiki-icon-fallback {
  width: 24px;
  height: 24px;
}

.craft-wiki-more {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  body.craft-wiki-page {
    --content-max: 100%;
  }

  body.craft-wiki-page .shell.legal-shell,
  body.craft-wiki-page .shell.craft-wiki-shell {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }

  .craft-wiki-layout {
    grid-template-columns: 1fr;
  }

  .craft-wiki-list-panel {
    max-height: none;
  }

  .craft-wiki-results {
    max-height: min(42vh, 420px);
  }
}

@media (max-width: 640px) {
  body.craft-wiki-page .shell.legal-shell,
  body.craft-wiki-page .shell.craft-wiki-shell {
    padding-top: 20px;
    padding-bottom: 32px;
    padding-inline: 14px;
  }

  .craft-wiki-page .legal-title {
    font-size: clamp(24px, 7vw, 30px);
  }

  .craft-wiki-controls {
    flex-direction: column;
    gap: 8px;
  }

  .craft-wiki-search,
  .craft-wiki-filter {
    flex: 1 1 auto;
    width: 100%;
  }

  .craft-wiki-pager-slot .spawn-pager {
    flex-direction: column;
    align-items: stretch;
  }

  .craft-wiki-pager-slot .spawn-pager-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .craft-wiki-detail-title {
    font-size: 18px;
  }
}

/* Crawlable item-page summary (hidden once the SPA boots). */
.seo-item-summary {
  max-width: 42rem;
  margin: 0 auto 1rem;
  padding: 1rem 1.25rem;
  color: var(--text, #e8e4dc);
}
.seo-item-summary h1 {
  font-family: Oswald, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.35rem;
}
.seo-item-summary .seo-item-id {
  margin: 0 0 0.75rem;
  opacity: 0.75;
  font-size: 0.9rem;
}
.seo-item-summary.is-booted,
body.is-browse .seo-item-summary {
  display: none;
}

/* —— 404 / not found —— */
body.not-found-body .shell.not-found-shell {
  max-width: 520px;
  width: min(100%, 520px);
  text-align: center;
  padding-top: clamp(48px, 12vh, 96px);
  padding-bottom: 64px;
}

.not-found-code {
  margin: 0 0 8px;
  font-size: clamp(56px, 14vw, 88px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 55%, var(--muted));
  opacity: 0.9;
}

.not-found-spiffo {
  display: block;
  width: 140px;
  height: 140px;
  margin: 4px auto 18px;
  object-fit: contain;
  image-rendering: auto;
}

.not-found-title {
  margin: 0 0 10px;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.2;
}

.not-found-lead {
  margin: 0 auto 22px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}

.not-found-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.not-found-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  color: var(--accent);
}

.not-found-btn-primary {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel-2));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  color: var(--text);
}

.not-found-btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 26%, var(--panel-2));
  color: var(--accent);
}

.not-found-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.not-found-hint a {
  color: var(--accent);
  text-decoration: none;
}

.not-found-hint a:hover {
  text-decoration: underline;
}

.not-found-hint code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}