/* ============================================================================
   BEPCO Studio — Archive styles (loaded on /archive/ and /archive/* via
   pageCss). Ported in spirit from design/mockups/bepco-archive-index.html and
   bepco-archive-kt.html; every color/spacing/type value references tokens.css.
   All classes are namespaced `av-` to avoid collisions with site.css.
   ============================================================================ */

/* Era accent as a local custom property, so any element can tint itself with
   var(--era). founding→amber · operational→porcelain · contemporary→steel. */
.av-era--founding    { --era: var(--color-era-founding); }
.av-era--operational { --era: var(--color-era-midcentury); }
.av-era--contemporary{ --era: var(--color-era-contemporary); }

/* ── DEPARTMENT MASTHEAD ── */
.av-head {
  padding: 72px 52px 48px;
  border-bottom: 1px solid rgba(26,22,18,0.10);
  display: grid;
  /* Left column sizes to its CONTENT (title/eyebrow/meta; subtitle capped at
     560px), not a fixed 2fr — so the right column, and the info panel in it,
     can actually sit close to the text instead of being pinned at the ⅔ line. */
  grid-template-columns: auto minmax(0, 1fr);
  gap: 64px;
  align-items: end;
}
.av-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(200,134,10,0.7);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* (Eyebrow prefix mark removed — see note in site.css.) */
.av-title {
  font-family: var(--font-serif);
  font-size: var(--fs-fluid-48-84);
  font-weight: var(--weight-regular);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--color-carbon);
  margin-bottom: 16px;
}
.av-subtitle {
  font-family: var(--font-serif);
  font-size: var(--fs-18);
  font-style: italic;
  line-height: 1.6;
  color: rgba(26,22,18,0.55);
  margin-bottom: 24px;
  max-width: 560px;
}
.av-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.45);
}
.av-meta-item strong {
  color: var(--color-amber);
  font-weight: var(--weight-medium);
  margin-right: 4px;
}
/* Hero media: fills the full height of archive.head, flush against its right
   edge, shown at ~4:3 (no crop for canonical-shape plates) with a light sepia
   cast. The left edge dissolves toward the title; header text stacks above.
   Holds one or more .av-head-plate layers (from _data/archiveHero.json) that
   crossfade on a timer (archive.js) — same pattern as the homepage hero. */
.av-head { position: relative; }
.av-head-media {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  aspect-ratio: 2009 / 1531;      /* canonical plate shape → no crop */
  /* Light sepia cast only — strong enough to sit in the palette, light enough
     that the LEGO bricks stay unmistakably LEGO. */
  filter: sepia(0.3) saturate(0.8) contrast(0.95) brightness(1.04);
  opacity: 0.7;
  -webkit-mask-image: linear-gradient(to left, black 62%, transparent 100%);
  mask-image: linear-gradient(to left, black 62%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.av-head-plate {
  position: absolute;
  inset: 0;
  background-position: right center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.av-head-plate.on { opacity: 1; }
.av-head-left { position: relative; z-index: 1; }
.av-head-right { position: relative; z-index: 1; }
/* Pulled left, off the image's busiest zone: capped width, nudged into the
   column gap, right edge released from the page edge. */
.av-info-panel { border-left: 1px solid rgba(26,22,18,0.15); padding-left: 24px; max-width: 320px; margin-left: -40px; margin-right: auto; }
.av-info-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  padding: 8px 0;
  border-bottom: 1px solid rgba(26,22,18,0.06);
  align-items: baseline;
}
.av-info-row:last-child { border-bottom: none; }
.av-info-label { font-family: var(--font-serif); font-style: italic; font-size: var(--fs-11); color: rgba(26,22,18,0.5); }
.av-info-value { font-family: var(--font-mono); font-size: var(--fs-10); letter-spacing: 0.06em; color: rgba(26,22,18,0.75); }
.av-info-value.amber { color: var(--color-amber); }
/* Animate the mobile contrast bump so crossing the breakpoint isn't jarring. */
.av-eyebrow, .av-title, .av-subtitle, .av-meta, .av-info-label, .av-info-value { transition: color 0.35s var(--ease), text-shadow 0.35s var(--ease); }
.av-info-value a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(200,134,10,0.35); transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
.av-info-value a:hover { color: var(--color-amber); border-bottom-color: var(--color-amber); }

/* ── MAIN LAYOUT ── */
.av-main {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
}

/* ── FILTER SIDEBAR ── */
.av-sidebar {
  padding: 44px 32px 48px 52px;
  background: var(--color-vellum);
  border-right: 1px solid rgba(26,22,18,0.10);
  position: sticky;
  top: 96px;
  height: calc(100vh - 96px);
  overflow-y: auto;
}
.av-fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(200,134,10,0.20);
  text-align: left;
  cursor: default;
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-amber);
  margin-bottom: 24px;
  padding: 0 0 12px;
}
/* CSS chevron — hidden on desktop (panel is always open); shown on mobile. */
.av-fs-header-icon {
  display: none;
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-bottom: 4px;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease);
}
.av-fs-body { display: block; }
.av-fs-group { margin-bottom: 28px; }
.av-fs-group-title {
  font-family: var(--font-serif);
  font-size: var(--fs-13);
  font-style: italic;
  color: rgba(26,22,18,0.55);
  margin-bottom: 12px;
}
.av-fs-options { display: flex; flex-direction: column; gap: 4px; }

.av-opt {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  cursor: pointer;
}
.av-opt-input { position: absolute; opacity: 0; width: 0; height: 0; }
.av-opt-box {
  width: 10px; height: 10px;
  border: 1px solid rgba(26,22,18,0.30);
  background: transparent;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.av-opt-input:checked + .av-opt-box { background: var(--color-amber); border-color: var(--color-amber); }
/* Era filter squares carry the era color instead of amber. */
.av-opt-box.av-era--founding,
.av-opt-box.av-era--operational,
.av-opt-box.av-era--contemporary { border-color: var(--era); }
.av-opt-input:checked + .av-opt-box.av-era--founding,
.av-opt-input:checked + .av-opt-box.av-era--operational,
.av-opt-input:checked + .av-opt-box.av-era--contemporary { background: var(--era); border-color: var(--era); }

.av-opt-label {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.08em;
  color: rgba(26,22,18,0.65);
  transition: color 0.2s var(--ease);
}
.av-opt:hover .av-opt-label { color: var(--color-carbon); }
.av-opt-input:checked ~ .av-opt-label { color: var(--color-amber); font-weight: var(--weight-medium); }
.av-opt-count { font-family: var(--font-mono); font-size: var(--fs-11); color: rgba(26,22,18,0.32); font-variant-numeric: tabular-nums; }
.av-opt-input:focus-visible + .av-opt-box { outline: 2px solid var(--color-amber); outline-offset: 2px; }

.av-clear {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.9);
  background: var(--color-amber);
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  margin-top: 16px;
  width: 100%;
  text-align: center;
}
.av-clear:hover { background: var(--color-amber-dk); }

/* ── RESULTS COLUMN ── */
/* scroll-margin clears the sticky masthead (banner + nav) when arriving at
   the #av-results anchor from the nav search. */
.av-results { padding: 44px 52px 96px 48px; min-width: 0; scroll-margin-top: 100px; }

/* Search */
.av-search {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  border: 1px solid rgba(26,22,18,0.18);
  background: rgba(245,240,232,0.6);
  transition: border-color 0.2s var(--ease);
}
.av-search:focus-within { border-color: var(--color-amber); }
.av-search-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.04em;
  color: var(--color-carbon);
  background: transparent;
  border: none;
  outline: none;
  padding: 12px 16px;
}
.av-search-input::placeholder { color: rgba(26,22,18,0.3); }
.av-search-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-9);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.9);
  background: var(--color-amber);
  border: none;
  /* Fill the field's height, inset by an equal 4px on top/bottom/right so
     the amber block floats inside the border instead of touching it. */
  align-self: stretch;
  margin: 4px 4px 4px 0;
  padding: 0 20px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
  flex-shrink: 0;
}
.av-search-btn:hover { background: var(--color-amber-dk); }

/* Active filter chips */
.av-active { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.av-active[hidden] { display: none; }
.av-active-label { font-family: var(--font-mono); font-size: var(--fs-8); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(26,22,18,0.35); }
.av-active-chips { display: contents; }
.av-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-9);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-amber);
  background: rgba(200,134,10,0.08);
  border: 1px solid rgba(200,134,10,0.25);
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.av-chip:hover { background: rgba(200,134,10,0.15); }
.av-chip-x { opacity: 0.6; font-size: var(--fs-11); line-height: 1; }

/* Toolbar */
.av-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(26,22,18,0.10);
}
.av-count { font-family: var(--font-serif); font-style: italic; font-size: var(--fs-15); color: rgba(26,22,18,0.65); }
.av-count strong { font-style: normal; font-family: var(--font-mono); color: var(--color-amber); font-weight: var(--weight-medium); font-size: var(--fs-14); letter-spacing: 0.04em; margin-right: 4px; }
.av-count-suffix[hidden] { display: none; }
.av-count-suffix { font-family: var(--font-mono); font-style: normal; font-size: var(--fs-11); letter-spacing: 0.08em; color: rgba(26,22,18,0.4); }
.av-sort { font-family: var(--font-mono); font-size: var(--fs-10); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(26,22,18,0.45); }

/* Shared 8-column grid for the list header + rows:
   era diamond · reference · type · title · photo strip (flexes) · division · date · status.
   The title column sizes to its content (capped); the STRIP is the elastic
   track — it absorbs all spare width and shrinks to zero as the page narrows. */
.av-list-head,
.av-row {
  display: grid;
  /* Title track is minmax(min-content, 300px), NOT fit-content: each row is
     its own grid, and fit-content sized the column per row's text — leaving
     the strips starting at ragged x positions. minmax maximizes every row's
     title track to the same 300px whenever space allows, so all strips begin
     on one consistent vertical line (compressing only on tight viewports). */
  /* The row thumbnail is NOT a grid track — it's absolutely positioned inside
     the title cell (see .av-rr-strip), so it never competes for width. */
  grid-template-columns: 36px 150px 42px minmax(0, 1fr) 100px 56px 96px;
  gap: 20px;
  /* Center every cell vertically so single-line fields (reference, type, system,
     date, status) sit at the row's middle rather than the title's top baseline. */
  align-items: center;
}
.av-list-head {
  padding: 16px 0 12px;
  border-bottom: 1px solid rgba(26,22,18,0.20);
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.40);
}
.av-list-head span:nth-child(5) { text-align: center; }
.av-list-head span:nth-child(6),
.av-list-head span:nth-child(7) { text-align: right; }

/* Records list + era groups */
.av-list { display: flex; flex-direction: column; }
.av-group { display: flex; flex-direction: column; }
.av-group[hidden] { display: none; }

/* Era / decade separator */
.av-sep { display: flex; align-items: center; gap: 16px; padding: 40px 0 20px; }
.av-sep-line { flex: 1; height: 1px; background: rgba(26,22,18,0.12); }
.av-sep-label { font-family: var(--font-serif); font-style: italic; font-size: var(--fs-14); color: rgba(26,22,18,0.45); }
.av-sep-diamond { width: 8px; height: 8px; background: var(--era, var(--color-amber)); transform: rotate(45deg); opacity: 0.7; }
.av-sep-year { font-family: var(--font-serif); font-size: var(--fs-32); color: var(--color-amber); letter-spacing: -0.02em; line-height: 1; }

/* Record row */
.av-row {
  padding: 18px 0;
  border-bottom: 1px solid rgba(26,22,18,0.08);
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s var(--ease), padding-left 0.3s var(--ease);
}
.av-row::before {
  content: '';
  position: absolute;
  left: -48px; top: 0; bottom: 0;
  width: 0;
  background: var(--color-amber);
  transition: width 0.3s var(--ease);
}
.av-row:hover { background: rgba(200,134,10,0.04); padding-left: 12px; }
.av-row:hover::before { width: 4px; }
.av-row[hidden] { display: none; }

.av-rr-code { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: 0.06em; color: rgba(26,22,18,0.50); }
/* Era cell: color-coded diamond only (name shown via title tooltip). */
.av-rr-era {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}
.av-rr-era::before { content: ''; width: 8px; height: 8px; flex-shrink: 0; transform: rotate(45deg); background: var(--era, var(--color-amber)); }

/* Row thumbnail: a small 4:3 preview sourced from a record's hero *detail*
   image (a close-up reads better than a full model at this size). Contained,
   full-colour for legibility, thin border → amber on row hover. div +
   background (not <img>) per the Safari flex/object-fit lesson. Hidden on
   mobile. NB: the field is still named `strip` for back-compat. */
.av-rr-strip {
  /* Absolutely positioned inside .av-rr-main, right-anchored and behind the
     text (z-index -1 in the cell's stacking context). top/bottom -18px reach
     into the row's padding so it fills the full row height; width follows from
     4:3. The left edge fades out, so as the row narrows the title/subtitle
     slide over it — it never competes for grid width or drives row height. */
  position: absolute;
  right: 0;
  top: -18px;
  bottom: -18px;
  aspect-ratio: 4 / 3;
  /* Never wider than the title cell, so the right-anchored image can't poke out
     past the cell's LEFT edge (to the left of the title) when the row narrows
     or the hover shift squeezes the cell — it just cover-crops instead. */
  max-width: 100%;
  z-index: -2;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(26,22,18,0.14);
  border-radius: 2px;
  /* Heavily washed sepia so the thumbnail reads as a faint archival ghost;
     full colour + amber border on row hover. */
  filter: sepia(0.72) saturate(0.55) hue-rotate(-8deg) brightness(1.05) contrast(0.93);
  /* Snap the sepia->colour change instead of animating `filter` — filter
     interpolation can't hold 60fps here (it re-rasterizes each frame). */
  transition: border-color 0.2s var(--ease);
}
.av-row:hover .av-rr-strip { filter: none; border-color: var(--color-amber); }
/* No image on file: render nothing (the hatch placeholder is retired). */
.av-rr-strip--empty { display: none; }
.av-rr-type {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.45);
  background: rgba(26,22,18,0.05);
  border: 1px solid rgba(26,22,18,0.10);
  padding: 2px 6px;
  justify-self: start;
  align-self: center;
}
.av-rr-main { min-width: 0; position: relative; z-index: 0; }
.av-rr-title { font-family: var(--font-serif); font-size: var(--fs-16); line-height: 1.3; color: var(--color-carbon); display: block; }
.av-rr-sub { font-family: var(--font-serif); font-style: italic; font-size: var(--fs-12); color: rgba(26,22,18,0.50); margin-top: 2px; display: block; }
.av-rr-div { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: 0.06em; color: rgba(26,22,18,0.55); text-align: center; }
.av-rr-date { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: 0.06em; color: rgba(26,22,18,0.50); text-align: right; }
.av-rr-status { font-family: var(--font-mono); font-size: var(--fs-11); letter-spacing: 0.12em; text-transform: uppercase; text-align: right; }
.av-status--active { color: var(--color-era-midcentury); }
.av-status--featured { color: var(--color-amber); }
.av-status--historic { color: rgba(26,22,18,0.45); }
.av-status--coming-soon { color: var(--color-steel); }

/* Empty state */
.av-empty { padding: 56px 0; max-width: 560px; }
.av-empty[hidden] { display: none; }
.av-empty-code { font-family: var(--font-mono); font-size: var(--fs-9); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(200,134,10,0.6); margin-bottom: 14px; }
.av-empty-title { font-family: var(--font-serif); font-size: var(--fs-22); color: var(--color-carbon); margin-bottom: 12px; }
.av-empty-note { font-family: var(--font-serif); font-size: var(--fs-15); line-height: 1.8; font-style: italic; color: rgba(26,22,18,0.55); margin-bottom: 20px; }
.av-empty-clear {
  font-family: var(--font-mono); font-size: var(--fs-10); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-soot); background: transparent; border: 1px solid rgba(200,134,10,0.45);
  padding: 10px 18px; cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.av-empty-clear:hover { background: var(--color-amber); border-color: var(--color-amber); color: var(--color-carbon); }

/* ── Pagination ── */
.av-pagination {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(26,22,18,0.10);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.av-pagination[hidden] { display: none; }
.av-page-numbers { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
.av-page-num {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.06em;
  color: rgba(26,22,18,0.55);
  background: transparent;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.av-page-num:hover { color: var(--color-carbon); border-color: rgba(26,22,18,0.20); }
.av-page-num.current { color: var(--color-amber); border-color: var(--color-amber); background: rgba(200,134,10,0.06); }
.av-page-ellipsis { font-family: var(--font-mono); font-size: var(--fs-11); color: rgba(26,22,18,0.35); padding: 0 4px; }
.av-page-nav {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.55);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.av-page-nav:hover:not(:disabled) { color: var(--color-amber); }
.av-page-nav:disabled { color: rgba(26,22,18,0.22); cursor: default; }

/* ══════════════════════════════════════════════════════════════════════════
   DETAIL PAGES
   ══════════════════════════════════════════════════════════════════════════ */

/* Breadcrumb */
.av-breadcrumb {
  max-width: 1060px; margin: 0 auto;
  padding: 16px 52px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: var(--fs-11); letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(26,22,18,0.35);
  border-bottom: 1px solid rgba(26,22,18,0.07);
}
.av-breadcrumb a { color: rgba(26,22,18,0.35); text-decoration: none; transition: color 0.2s var(--ease); }
.av-breadcrumb a:hover { color: var(--color-amber); }
.av-bc-sep { color: rgba(26,22,18,0.2); }
.av-bc-current { color: var(--color-carbon); }

/* Shared record head bits */
.av-rec-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--fs-11); letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--era, var(--color-amber)); margin-bottom: 16px;
}
.av-rec-badge::before { content: ''; width: 8px; height: 8px; background: var(--era, var(--color-amber)); transform: rotate(45deg); opacity: 0.8; }
.av-rec-title { font-family: var(--font-serif); font-size: var(--fs-fluid-32-48); font-weight: var(--weight-regular); line-height: 1.02; letter-spacing: -0.02em; color: var(--color-carbon); margin-bottom: 8px; }
.av-rec-subtitle { font-family: var(--font-serif); font-size: var(--fs-16); font-style: italic; color: rgba(26,22,18,0.5); margin-bottom: 16px; }
/* Reference code as a mini refcard: just the code, boxed, with an amber spine —
   the same plate language as .av-refcard--x, minus the label + interpretations. */
.av-rec-ref {
  display: inline-block;
  font-family: var(--font-mono); font-size: var(--fs-14); letter-spacing: 0.14em;
  color: var(--color-carbon);
  background: var(--color-vellum);
  border: 1px solid rgba(26,22,18,0.07);
  border-left: 4px solid var(--color-amber);
  padding: 8px 14px; margin-bottom: 16px;
}
/* Code segments, echoing the refcard: institution amber, layer bit in an amber
   box, the rest in carbon ink. */
.av-rec-ref-org { color: var(--color-amber); }
.av-rec-ref-layer { color: var(--color-parchment); background: var(--color-amber); border-radius: 2px; font-weight: var(--weight-bold); padding: 0 5px; }
.av-rec-ref-sep { color: rgba(26,22,18,0.3); }

/* Simple masthead (EV/CM/IF/fallback) */
.av-rec-masthead { max-width: 1060px; margin: 0 auto; padding: 48px 52px 8px; }

/* KT split hero. align-items:start so the image column keeps its own (4:3)
   height instead of being stretched to the taller info column — the info
   column sets the hero height, the image never deforms. */
.av-rec-hero { max-width: 1060px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; min-height: 440px; align-items: start; }
.av-rec-image {
  background: var(--color-soot);
  display: flex; align-items: center; justify-content: center;
  padding: 48px; position: relative; overflow: hidden;
  /* Frame is locked to 4:3 (border-box); supply ~4:3 assets — they fill with
     no crop, off-ratio images center-crop. */
  aspect-ratio: 4 / 3;
  box-sizing: border-box;
  /* Era frame: an even spine-width border on all four sides. */
  border: 3px solid var(--era, var(--color-amber));
}
.av-rec-image::before {
  content: attr(data-glyph);
  position: absolute; right: -10px; bottom: -40px;
  font-family: var(--font-serif); font-size: var(--fs-240); font-weight: var(--weight-bold);
  color: rgba(200,134,10,0.05); line-height: 1; user-select: none; pointer-events: none;
}
/* Real hero (when the asset exists) covers the labeled placeholder behind it. */
/* cover, edge to edge — supply ~4:3 assets; off-ratio images center-crop. */
.av-rec-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--color-soot); z-index: 1; }

/* ── Record gallery (KT): static product-style viewer ──
   The media wrapper is a flex column holding the 4:3 image and the thumb strip
   directly beneath it, occupying grid column 1. Keeping them in one flow (not
   dissolved into the grid) lets the image hold its 4:3 shape while the taller
   info column in column 2 drives the overall hero height. */
.av-rec-media { grid-column: 1; display: flex; flex-direction: column; }
.av-rec-hero .av-rec-info { grid-column: 2; }
.av-gal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-18);
  line-height: 1;
  color: rgba(245,240,232,0.85);
  background: rgba(26,22,18,0.45);
  border: 1px solid rgba(245,240,232,0.25);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.av-gal-nav:hover { background: var(--color-amber); border-color: var(--color-amber); color: var(--color-carbon); }
.av-gal-prev { left: 14px; }
.av-gal-next { right: 14px; }
.av-gal-thumbs {
  display: flex;
  gap: 8px;
  padding: 10px 0 0;
  flex-wrap: wrap;
}
.av-gal-thumb {
  width: 64px; height: 48px;
  padding: 0;
  border: 2px solid rgba(26,22,18,0.15);
  background: var(--color-soot);
  cursor: pointer;
  overflow: hidden;
  opacity: 0.65;
  transition: border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.av-gal-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.av-gal-thumb:hover { opacity: 1; }
.av-gal-thumb.on { border-color: var(--color-amber); opacity: 1; }
.av-rec-info { padding: 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.av-rec-info .av-rec-title { color: var(--color-carbon); margin-bottom: 16px; }
.av-rec-desc { font-family: var(--font-serif); font-size: var(--fs-15); line-height: 1.85; color: rgba(26,22,18,0.65); margin-top: 0; }
.av-rec-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.av-btn {
  font-family: var(--font-mono); font-size: var(--fs-10); letter-spacing: 0.18em; text-transform: uppercase;
  padding: 13px 26px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.av-btn--primary { color: rgba(245,240,232,0.95); background: var(--color-amber); border-color: var(--color-amber); }
.av-btn--primary:hover { background: var(--color-amber-dk); border-color: var(--color-amber-dk); }
.av-btn--secondary { color: var(--color-carbon); background: transparent; border-color: rgba(26,22,18,0.25); }
.av-btn--secondary:hover { border-color: var(--color-amber); color: var(--color-amber); }
.av-btn--disabled { color: rgba(26,22,18,0.4); background: rgba(26,22,18,0.05); border-color: rgba(26,22,18,0.12); cursor: default; }
.av-btn--block { width: 100%; justify-content: center; }

/* Record body layout */
.av-rec-body { max-width: 1060px; margin: 0 auto; padding: 56px 52px; }
.av-rec-body--split { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 56px; align-items: start; }
.av-rec-prose { min-width: 0; }

.av-section-label {
  font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(200,134,10,0.55); margin-bottom: 12px; display: flex; align-items: center; gap: 12px;
}
/* (Eyebrow prefix mark removed — see note in site.css.) */
.av-section-title { font-family: var(--font-serif); font-size: var(--fs-22); font-weight: var(--weight-regular); color: var(--color-carbon); margin-bottom: 18px; }
.av-body { font-family: var(--font-serif); font-size: var(--fs-15); line-height: 1.9; color: rgba(26,22,18,0.65); margin-bottom: 16px; }
.av-body strong { color: var(--color-carbon); font-weight: var(--weight-medium); }
.av-body:last-child { margin-bottom: 0; }
.av-rule { width: 100%; height: 1px; background: rgba(26,22,18,0.08); margin: 40px 0; }

/* Rail: specs / ref / shop / coming-soon / parts */
.av-rec-rail { display: flex; flex-direction: column; gap: 20px; }
.av-specs { background: var(--color-vellum); border: 1px solid rgba(26,22,18,0.07); border-top: 3px solid var(--color-amber); padding: 26px; }
.av-specs-title { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: 0.22em; text-transform: uppercase; color: rgba(200,134,10,0.6); margin-bottom: 18px; }
.av-spec-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(26,22,18,0.07); }
.av-spec-row:last-child { border-bottom: none; }
.av-spec-label { font-family: var(--font-serif); font-size: var(--fs-12); font-style: italic; color: rgba(26,22,18,0.45); }
.av-spec-value { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: 0.02em; color: var(--color-carbon); text-align: right; }
.av-spec-value.amber { color: var(--color-amber); }

/* Anchor target for the hero's "Archive Record ↓" button: lands with the
   Design Process label at the top of the viewport, clear of the masthead. */
#av-archive-record { scroll-margin-top: 100px; }

/* Sample-record stamp: prominent rubber-stamp watermark distinguishing design
   stubs from final content. Fixed to the viewport so it rides the whole page;
   below the masthead (z 100+), above the page content; never intercepts input. */
.av-sample-mark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-22deg);
  font-family: var(--font-mono);
  font-size: clamp(48px, 9vw, 120px);
  font-weight: var(--weight-bold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(192,81,42,0.10);
  border: 5px solid rgba(192,81,42,0.08);
  border-radius: 6px;
  padding: 16px 56px;
  pointer-events: none;
  user-select: none;
  z-index: 40;
}

/* F-layer excerpt: a quoted fragment of the held fictional document —
   the finding-aid tease. Mirrors the About page's pull-quote grammar. */
.av-excerpt { border-left: 2px solid rgba(200,134,10,0.3); padding: 4px 0 4px 20px; margin: 24px 0 20px; }
.av-excerpt p { font-family: var(--font-serif); font-size: var(--fs-16); font-style: italic; line-height: 1.7; color: rgba(26,22,18,0.6); }
.av-excerpt cite {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(200,134,10,0.55);
  margin-top: 10px;
  font-style: normal;
}
/* Provenance line: what the archive holds, finding-aid register. */
.av-provenance {
  font-family: var(--font-mono);
  font-size: var(--fs-11);
  letter-spacing: 0.08em;
  color: rgba(26,22,18,0.5);
  padding: 10px 0 0;
  border-top: 1px solid rgba(26,22,18,0.1);
}

/* Expanded Archive Reference — code-anatomy figure (structure after the
   horizontal figure in design/bepco-archival-coding-system.html §1), restyled
   to the page's light card language: vellum plate, amber spine, carbon ink. */
.av-refcard--x {
  margin: 28px 0;
  background: var(--color-vellum);
  border: 1px solid rgba(26,22,18,0.07);
  border-left: 4px solid var(--color-amber);
  padding: 24px 28px 22px;
}
.av-refx-label { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: 0.2em; text-transform: uppercase; color: rgba(200,134,10,0.65); margin-bottom: 20px; }
.av-refx-string {
  font-family: var(--font-mono);
  font-size: clamp(17px, 2.4vw, 26px);
  font-weight: var(--weight-medium);
  letter-spacing: 0.03em;
  color: var(--color-carbon);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2px;
  justify-content: center;
}
.av-refx-seg { display: inline-flex; flex-direction: column; align-items: center; }
.av-refx-glyph { padding: 0 4px; }
.av-refx--prefix .av-refx-glyph { color: var(--color-amber); }
.av-refx--type .av-refx-glyph { background: rgba(200,134,10,0.14); border-radius: 2px; }
.av-refx--layer .av-refx-glyph { color: var(--color-parchment); background: var(--color-amber); border-radius: 2px; font-weight: var(--weight-bold); }
.av-refx--cap .av-refx-glyph { color: var(--color-amber); }
.av-refx-sep { color: rgba(26,22,18,0.3); padding: 0 2px; }
.av-refx-tick { width: 1px; height: 10px; background: rgba(200,134,10,0.5); margin-top: 6px; }
.av-refx-note {
  font-family: var(--font-mono);
  font-size: var(--fs-8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26,22,18,0.45);
  margin-top: 12px;
  text-align: center;
  max-width: 110px;
  line-height: 1.35;
}

/* ── Schema-document components (RF/AR rich bodies, e.g. BEPCO-R-RF-SCHEMA).
      Ported from bepco-archival-coding-system.html; dark mockup ground
      translated to the page's light card language, colors via tokens. ── */
.av-doc-content { margin-top: 40px; }
.av-sch-section { margin: 48px 0; }
.av-sch-section:first-child { margin-top: 0; }
.av-sch-fig { margin: 24px 0 28px; }

.av-sch-table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); margin: 8px 0 16px; }
.av-sch-table thead th {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  color: rgba(200,134,10,0.65);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(26,22,18,0.18);
}
.av-sch-table tbody td {
  font-family: var(--font-serif);
  padding: 12px 14px;
  border-bottom: 1px solid rgba(26,22,18,0.08);
  vertical-align: top;
  color: rgba(26,22,18,0.75);
  line-height: 1.6;
}
.av-sch-table tbody tr:hover td { background: rgba(200,134,10,0.05); }
.av-td-code { font-family: var(--font-mono); letter-spacing: 0.06em; color: var(--color-amber); font-weight: var(--weight-medium); }
.av-td-cap { font-family: var(--font-mono); color: var(--color-amber-dk); font-weight: var(--weight-bold); }
.av-inline { font-family: var(--font-mono); font-size: 0.85em; background: rgba(26,22,18,0.05); border: 1px solid rgba(26,22,18,0.1); padding: 1px 5px; border-radius: 2px; }

.av-tag-r, .av-tag-f {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-9);
  letter-spacing: 0.12em;
  padding: 1px 6px;
  border-radius: 2px;
  vertical-align: middle;
  font-weight: var(--weight-bold);
}
.av-tag-r { color: var(--color-parchment); background: var(--color-amber); }
.av-tag-f { color: rgba(26,22,18,0.6); border: 1px solid rgba(26,22,18,0.35); }

.av-sch-note {
  background: rgba(200,134,10,0.08);
  border-left: 3px solid var(--color-amber);
  padding: 18px 22px;
  margin: 24px 0;
  font-family: var(--font-serif);
  font-size: var(--fs-13);
  line-height: 1.7;
  color: rgba(26,22,18,0.65);
}
.av-sch-kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-10);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-amber);
  display: block;
  margin-bottom: 8px;
}

.av-sch-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.av-sch-tier { background: var(--color-vellum); border: 1px solid rgba(26,22,18,0.1); border-top: 3px solid var(--color-amber); padding: 22px 20px; }
.av-sch-tier-n { font-family: var(--font-mono); font-size: var(--fs-10); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-amber); margin-bottom: 10px; }
.av-sch-tier-name { font-family: var(--font-cond); font-weight: var(--weight-bold); font-size: var(--fs-17); text-transform: uppercase; color: var(--color-carbon); margin-bottom: 10px; letter-spacing: 0.02em; }
.av-sch-tier-eg { font-family: var(--font-mono); font-size: var(--fs-13); color: var(--color-amber); margin-bottom: 12px; }
.av-sch-tier-desc { font-family: var(--font-serif); font-size: var(--fs-13); color: rgba(26,22,18,0.6); line-height: 1.6; }

.av-sch-kitfam { background: var(--color-vellum); border: 1px solid rgba(200,134,10,0.24); border-left: 4px solid var(--color-amber); padding: 26px 30px; margin: 20px 0; }
.av-sch-kitfam-title { font-family: var(--font-mono); font-size: var(--fs-10); letter-spacing: 0.18em; text-transform: uppercase; color: rgba(200,134,10,0.7); margin-bottom: 16px; }
.av-sch-kf-row { display: flex; align-items: baseline; gap: 18px; padding: 8px 0; border-bottom: 1px solid rgba(26,22,18,0.06); }
.av-sch-kf-row:last-child { border-bottom: none; }
.av-sch-kf-code { font-family: var(--font-mono); font-size: var(--fs-15); color: var(--color-carbon); font-weight: var(--weight-medium); min-width: 220px; letter-spacing: 0.03em; }
.av-kf-r { color: var(--color-amber); }
.av-kf-f { color: rgba(26,22,18,0.45); }
.av-kf-cap { color: var(--color-amber-dk); }
.av-sch-kf-face { font-family: var(--font-serif); font-size: var(--fs-13); color: rgba(26,22,18,0.6); }
.av-sch-kf-face strong { color: var(--color-carbon); }

.av-sch-ex { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.av-sch-ex-card { background: var(--color-vellum); border: 1px solid rgba(26,22,18,0.1); padding: 20px 22px; }
.av-sch-ex-code { font-family: var(--font-mono); font-size: var(--fs-16); font-weight: var(--weight-medium); color: var(--color-amber); letter-spacing: 0.04em; margin-bottom: 12px; }
.av-sch-ex-gloss { font-family: var(--font-serif); font-size: var(--fs-13); color: rgba(26,22,18,0.6); line-height: 1.6; }
.av-sch-ex-gloss strong { color: var(--color-carbon); }

.av-parts { border: 1px solid rgba(26,22,18,0.08); padding: 18px 20px; }
.av-parts-title { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: 0.2em; text-transform: uppercase; color: rgba(200,134,10,0.5); margin-bottom: 8px; }
.av-parts-note { font-family: var(--font-serif); font-size: var(--fs-13); line-height: 1.7; color: rgba(26,22,18,0.55); }

/* Corresponding kit (IF) */
.av-corr { margin-top: 8px; }
.av-corr-label { font-family: var(--font-mono); font-size: var(--fs-8); letter-spacing: 0.2em; text-transform: uppercase; color: rgba(200,134,10,0.5); margin-bottom: 10px; }
.av-corr-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid rgba(26,22,18,0.1); border-left: 2px solid var(--color-amber); text-decoration: none; margin-bottom: 8px; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.av-corr-link:hover { border-color: var(--color-amber); transform: translateX(2px); }
.av-corr-code { font-family: var(--font-mono); font-size: var(--fs-9); letter-spacing: 0.1em; color: rgba(200,134,10,0.6); }
.av-corr-title { font-family: var(--font-serif); font-size: var(--fs-15); color: var(--color-carbon); }

/* Photo placeholder zones */
.av-photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.av-photo-zone {
  background: rgba(26,22,18,0.04); border: 1px dashed rgba(26,22,18,0.18);
  min-height: 200px; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center;
}
.av-photo-zone--wide { grid-column: 1 / -1; min-height: 280px; }
/* Standalone figure in the prose reading flow (blog-post-style sections). */
.av-photo-zone--flow { min-height: 260px; margin: 28px 0; }

/* In-prose photo figures (designPhotos / fieldPhotos arrays): real images
   woven into the reading flow, with an optional mono caption. */
.av-flow-photo { margin: 28px 0; }
.av-flow-photo-img { min-height: 300px; background-color: var(--color-soot); background-size: cover; background-position: center; background-repeat: no-repeat; }
.av-flow-caption { font-family: var(--font-mono); font-size: var(--fs-10); letter-spacing: 0.08em; color: rgba(26,22,18,0.45); margin-top: 8px; }
.av-photo-label { font-family: var(--font-mono); font-size: var(--fs-8); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(26,22,18,0.3); line-height: 1.8; }
.av-rec-image .av-photo-label { color: rgba(245,240,232,0.28); }

/* ── AR institutional document ── */
.av-doc { max-width: 780px; margin: 0 auto; padding: 56px 52px; }
.av-doc-header { border-bottom: 2px solid var(--color-carbon); padding-bottom: 24px; margin-bottom: 28px; }
.av-doc-classification {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: var(--fs-9); letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(26,22,18,0.45); margin-bottom: 20px;
}
.av-doc-code { color: var(--color-amber); }
.av-doc-title { font-family: var(--font-serif); font-size: var(--fs-32); font-weight: var(--weight-regular); line-height: 1.1; color: var(--color-carbon); margin-bottom: 8px; }
.av-doc-subtitle { font-family: var(--font-serif); font-size: var(--fs-15); font-style: italic; color: rgba(26,22,18,0.5); }
.av-doc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; border: 1px solid rgba(26,22,18,0.1); background: var(--color-vellum); padding: 8px 24px; margin-bottom: 32px; }
.av-doc-field { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(26,22,18,0.07); align-items: baseline; }
.av-doc-field-label { font-family: var(--font-serif); font-style: italic; font-size: var(--fs-12); color: rgba(26,22,18,0.45); }
.av-doc-field-value { font-family: var(--font-mono); font-size: var(--fs-11); letter-spacing: 0.04em; color: var(--color-carbon); }
.av-doc-body .av-body { font-size: var(--fs-16); }

/* ── Related Records ── */
.av-related { max-width: 1060px; margin: 0 auto; padding: 0 52px 80px; }
/* 2×2 grid of wider cards: text on the left, thumbnail filling the right. */
.av-related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 24px; }
.av-rcard { background: var(--color-vellum); border: 1px solid rgba(26,22,18,0.07); text-decoration: none; color: inherit; display: flex; align-items: stretch; gap: 16px; overflow: hidden; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.av-rcard:hover { border-color: var(--color-amber); transform: translateY(-2px); }
.av-rc-text { flex: 1; min-width: 0; padding: 20px 0 20px 20px; }
.av-rc-thumb {
  width: 128px;
  flex-shrink: 0;
  background-color: var(--color-soot);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* No image: faint archival hatch, same language as the index strips. */
  background-image: repeating-linear-gradient(-45deg, rgba(245,240,232,0.06) 0 1px, transparent 1px 7px);
  /* Same washed sepia grade as the archive index row strips; hover reveals
     full colour. */
  filter: sepia(0.72) saturate(0.55) hue-rotate(-8deg) brightness(1.05) contrast(0.93);
  transition: filter 0.25s var(--ease);
}
.av-rcard:hover .av-rc-thumb { filter: none; }
.av-rc-code { font-family: var(--font-mono); font-size: var(--fs-11); letter-spacing: 0.14em; text-transform: uppercase; color: var(--era, rgba(200,134,10,0.55)); margin-bottom: 8px; }
.av-rc-title { font-family: var(--font-serif); font-size: var(--fs-18); color: var(--color-carbon); line-height: 1.3; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .av-head { grid-template-columns: 1fr; gap: 36px; }
  /* Single-column head: image sits behind stacked text — fade it back and
     strengthen the dissolve so the title stays legible. */
  .av-head-media { opacity: 0.4; -webkit-mask-image: linear-gradient(to left, black 35%, transparent 85%); mask-image: linear-gradient(to left, black 35%, transparent 85%); }
  .av-info-panel { margin-left: 0; max-width: none; }
  /* Head text sits over the image once stacked — firm up the secondary text
     and lift it off the image with a soft light halo so it never fades. */
  .av-subtitle { color: rgba(26,22,18,0.82); }
  .av-meta { color: rgba(26,22,18,0.72); }
  .av-info-label { color: rgba(26,22,18,0.72); }
  .av-info-value { color: var(--color-carbon); }
  .av-eyebrow, .av-title, .av-subtitle, .av-meta,
  .av-info-label, .av-info-value { text-shadow: 0 0 9px rgba(245,240,232,0.9); }
  .av-main { grid-template-columns: 1fr; }
  .av-sidebar { position: static; height: auto; overflow: visible; border-right: none; border-bottom: 1px solid rgba(26,22,18,0.10); padding: 32px 20px; }
  /* Collapsible filter panel: tap "Refine Records" to expand/collapse so the
     search bar and results aren't buried under the full filter list. */
  .av-fs-header { cursor: pointer; margin-bottom: 0; }
  .av-fs-header-icon { display: block; }
  .av-fs-body { display: none; padding-top: 24px; }
  .av-sidebar.is-open .av-fs-body { display: block; }
  .av-sidebar.is-open .av-fs-header-icon { transform: rotate(225deg); }
  .av-rec-hero { grid-template-columns: 1fr; grid-template-rows: none; }
  .av-rec-hero .av-rec-image, .av-rec-hero .av-gal-thumbs, .av-rec-hero .av-rec-info { grid-column: 1; grid-row: auto; }
  .av-rec-image { min-height: 300px; }
  .av-rec-body--split { grid-template-columns: 1fr; gap: 40px; }
  .av-doc-fields { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .av-head { padding: 44px 20px 32px; }
  .av-results { padding: 32px 20px 64px; }
  .av-breadcrumb, .av-rec-masthead, .av-rec-body, .av-related, .av-doc { padding-left: 20px; padding-right: 20px; }
  .av-rec-info { padding: 32px 20px; }
  .av-list-head { display: none; }
  /* Mobile record card: a robust 4-track grid (era · main · date · status).
     Distinct cells only — no row-spanning and no baseline alignment, which is
     what dropped the System cell and skewed the RHS on iOS WebKit. */
  .av-row {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 6px;
    padding: 16px 0;
  }
  .av-row::before { left: -20px; }
  .av-rr-strip { display: none; }
  .av-rr-era    { grid-column: 1; grid-row: 1; }
  .av-rr-code   { grid-column: 2; grid-row: 1; }
  .av-rr-type   { grid-column: 4; grid-row: 1; justify-self: end; }
  .av-rr-main   { grid-column: 2 / -1; grid-row: 2; }
  .av-rr-div    { grid-column: 2; grid-row: 3; justify-self: start; }
  .av-rr-date   { grid-column: 3; grid-row: 3; justify-self: start; }
  .av-rr-status { grid-column: 4; grid-row: 3; justify-self: end; text-align: right; }
  .av-photo-grid { grid-template-columns: 1fr; }
  .av-related-grid { grid-template-columns: 1fr; }
  .av-sch-tiers, .av-sch-ex { grid-template-columns: 1fr; }
  .av-sch-kf-row { flex-direction: column; gap: 4px; }
  .av-sch-kf-code { min-width: 0; }
}
