/* Collection and map layouts share the same heading and spacing. */
.workspace .workspace-main:has(:is(#map-page, #stock-page):not([hidden])) {
 padding-top: clamp(12px, 2.8vw, 34px);
}
.workspace :is(#map-page, #stock-page) > .back-link { margin-bottom: 8px; }

.interior-hero {
 min-width: 0;
 border-radius: 17px;
 padding: clamp(17px, 2.6vw, 30px);
 color: #fffdf4;
 background-size: cover;
}
.interior-hero h1 { margin: 0; font-size: clamp(29px, 3.2vw, 42px); line-height: 1.14; }
.interior-time {
 display: flex;
 flex-wrap: wrap;
 gap: 2px 16px;
 margin: 6px 0 0;
 color: #f0f4e9;
 font-size: 13px;
 font-variant-numeric: tabular-nums;
}

.map-hero {
 display: grid;
 grid-template-columns: minmax(0, 1fr) auto;
 align-items: center;
 gap: clamp(12px, 4vw, 56px);
 margin-bottom: 14px;
 padding-block: clamp(16px, 2.2vw, 23px);
 background: linear-gradient(90deg, #173a30 2%, #173a30e8 42%, #163c3280 100%),
  url('/maps/6.webp') center 48% / cover;
}
.map-overview-copy { min-width: 0; }
.map-metrics {
 display: grid;
 grid-template-columns: repeat(4, minmax(0, 1fr));
 gap: 8px;
 margin: 12px 0 0;
 padding-top: 10px;
 border-top: 1px solid #ffffff48;
}
.map-metrics dt { font-size: 12px; color: #e4eee2; }
.map-metrics dd {
 margin: 1px 0 0;
 font-size: clamp(20px, 2.3vw, 30px);
 line-height: 1.12;
 font-weight: 720;
 font-variant-numeric: tabular-nums;
}
.workspace .map-hero #tracks {
 width: fit-content;
 max-width: min(34vw, 310px);
 min-width: 0;
 margin: 0;
 padding: 10px 13px 12px;
 background: #102c26eb;
 border-color: #ffffff46;
 border-radius: 12px;
 box-shadow: none;
}
.map-hero #tracks h2 {
 color: #cde0d5;
 font-size: 12px;
 font-weight: 670;
}
.map-hero #tracks p, .map-hero #tracks .track-item small { color: #d2e1d7; }
.map-hero #tracks .track-list { flex-direction: column; gap: 8px; margin-top: 7px; }
.map-hero #tracks .track-item {
 min-width: 0; gap: 11px; padding: 0; background: none;
 color: #fffdf4; overflow-wrap: anywhere;
}
.map-hero #tracks .track-cover { width: 58px; height: 58px; }
.map-hero #tracks .track-item strong { font-size: 14px; }

.workspace #map-page #map-filters {
 display: grid;
 grid-template-columns: auto minmax(0, 1fr);
 align-items: start;
 gap: 8px;
 padding: 9px;
 border-radius: 13px;
}
.workspace #map-page #map-filters .map-toggles { margin: 0; }
#map-page .material-picker:not([open]) summary {
 min-height: 38px;
 padding-block: 8px;
}
#map-page .material-picker[open] { grid-column: 1 / -1; }
#map-page .material-picker[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.map-navigation {
 display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
 gap: 6px 16px; margin-top: 8px;
}
#map-areas { display: flex; flex-wrap: wrap; gap: 5px; }
#map-areas button {
 min-height: 36px; padding: 4px 11px; background: #f1f6ef;
 color: var(--green); font-size: 13px; font-weight: 620;
}
#map-areas button:hover { background: #e1eddf; }
#map-page .map-key { margin: 0; }
#maps [data-map-area] { scroll-margin-top: 16px; }
#map-page .maps { margin-top: 10px; }
#map-page .map-heading { padding: 10px 12px; }
#map-page .map-heading h3 { font-size: clamp(16px, 1.6vw, 20px); }
#map-page .map-card { background: var(--surface); }
#map-page .expand-map {
 color: var(--green);
 border-color: #cbdccd;
 background: #eff5ed;
 font-weight: 640;
}
#map-page .expand-map:hover { background: #e0eddf; }

.stock-hero {
 margin-bottom: 16px;
 background: linear-gradient(90deg,#223323 0%,#223323d9 40%,#22332335 100%),
  url('/assets/stock-cover.webp') right 52% / cover;
}
.stock-layout {
 display: grid;
 grid-template-columns: clamp(158px, 18vw, 214px) minmax(0, 1fr);
 align-items: start;
 gap: clamp(12px, 2vw, 22px);
}
.stock-layout nav {
 position: sticky;
 top: 12px;
 padding: 13px;
 border: 1px solid var(--line);
 border-radius: 15px;
 background: var(--surface);
 box-shadow: var(--shadow);
}
.stock-nav-group { display: grid; gap: 4px; }
.stock-nav-group + .stock-nav-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.stock-nav-group p { margin: 0 0 4px; padding: 0 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.stock-nav-group button {
 position: relative;
 display: block;
 width: 100%;
 min-width: 0;
 min-height: 42px;
 padding: 8px 11px;
 border: 1px solid transparent;
 border-radius: 9px;
 background: transparent;
 color: var(--ink);
 text-align: left;
 font-size: 14px;
 font-weight: 640;
}
.stock-nav-group button:hover { background: #f3f7f1; }
.stock-nav-group button[aria-pressed="true"] {
 background: #e6f0e6;
 color: #1c523e;
 border-color: #bdd3c1;
 font-weight: 730;
}
.stock-nav-group button[aria-pressed="true"]::before {
 content: '';
 position: absolute;
 inset: 8px auto 8px 0;
 width: 3px;
 border-radius: 4px;
 background: #4f886c;
}
.stock-content { min-width: 0; }
.stock-content .collection-panel > h2 {
 margin: 0 0 14px;
 padding-bottom: 12px;
 border-bottom: 1px solid var(--line);
 letter-spacing: -.02em;
}
.stock-content .collection-panel > h2 + p { margin-top: -2px; }
#stock-page > .local-import { margin-bottom: 12px; }
#stock-page > .feedback { margin-bottom: 12px; }
#resources-panel .progress-filters {
 display: flex;
 align-items: end;
 flex-wrap: wrap;
 gap: 8px 12px;
 margin-block: 0 16px;
}
#resources-panel .progress-filters label:first-child { flex: 1 1 220px; }
#resources-panel .progress-filters .check-line {
 justify-content: center;
 padding-inline: 10px;
 border: 1px solid var(--line);
 border-radius: 8px;
 background: #f5f8f3;
 font-size: 13px;
}
#resource-results .progress-item[data-state="owned"] { background: #fbfdf9; }
#resource-results .progress-item small:first-of-type {
 width: fit-content;
 margin-top: 3px;
 padding: 1px 6px;
 border-radius: 5px;
 background: #edf4eb;
 color: #285845;
 font-weight: 650;
 font-variant-numeric: tabular-nums;
}
#resource-results .progress-item img { background: #f0f5ef; }

@media (max-width: 760px) {
 .stock-layout { grid-template-columns: minmax(0, 1fr); }
 .stock-layout nav {
  position: static;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px;
 }
 .stock-nav-group { flex: 1 1 200px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
 .stock-nav-group + .stock-nav-group {
  flex-basis: 280px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 0;
 }
 .stock-nav-group p { grid-column: 1 / -1; margin: 0; }
 .stock-nav-group button { padding-inline: 4px; text-align: center; font-size: 13px; }
}
@media (max-width: 620px) {
 .map-hero { grid-template-columns: minmax(0, 1fr); gap: 11px; }
 .workspace .map-hero #tracks {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: 6px 11px; width: 100%; max-width: none; padding: 7px 9px;
 }
 .map-hero #tracks :is(.track-list, p) { margin: 0; }
 .map-hero #tracks .track-cover { width: 44px; height: 44px; }
 .map-hero #tracks .track-item strong { font-size: 13px; }
 .map-hero #tracks .track-item { gap: 8px; }
 .workspace #map-page #map-filters { grid-template-columns: minmax(0, 1fr); }
 #map-areas button { min-height: 38px; }
}
@media (max-width: 440px) {
 .interior-time { font-size: 12px; }
 .map-metrics { margin-top: 12px; padding-top: 9px; }
 .map-metrics dt { font-size: 11px; }
 .stock-nav-group button { padding-inline: 2px; }
 #resources-panel .progress-filters label:first-child { flex-basis: 110px; }
}
