:root {
  color-scheme: light;
  --ink: #2b211d;
  --muted: #74665f;
  --paper: #f4ede3;
  --panel: #fffdf9;
  --line: #d9cabb;
  --brown: #6f3826;
  --brown-deep: #291b16;
  --oxblood: #6b2527;
  --moss: #53614d;
  --champagne: #f1d5a3;
  --gold: #b98345;
  --blush: #f2ddd5;
  --shadow: 0 12px 34px rgb(54 35 24 / 8%);
  --header-height: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.scroll-restoring { scroll-behavior: auto !important; }
body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html.dialog-open,
body.welcome-mode,
body.dialog-open { overflow: hidden; }
body.dialog-open {
  position: fixed;
  top: var(--dialog-scroll-offset, 0);
  right: 0;
  left: 0;
  width: 100%;
}
a { color: var(--oxblood); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="-1"]:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, h4, p, dd, td { overflow-wrap: anywhere; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
img { max-width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 12px;
  min-height: 44px;
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  color: white;
  background: var(--oxblood);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.welcome-mode .app-shell { display: none !important; }
body.welcome-mode.welcome-transitioning .app-header { display: flex !important; }
body.welcome-mode.welcome-transitioning #main-content { display: block !important; }
body.welcome-mode.welcome-transitioning .app-footer { display: block !important; }
.app-mode .welcome-screen { display: none; }

/* Welcome */
.welcome-screen {
  position: fixed;
  z-index: 50;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vw, 52px);
  color: #fff9f0;
  background:
    radial-gradient(circle at 76% 18%, rgb(202 143 79 / 28%), transparent 31%),
    radial-gradient(circle at 12% 88%, rgb(134 57 48 / 30%), transparent 33%),
    linear-gradient(135deg, #211712 0%, #6b3425 48%, #2a1c17 100%);
  isolation: isolate;
  transform: translateX(0);
  will-change: transform;
}
.welcome-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
  pointer-events: none;
}
.welcome-lockup {
  position: absolute;
  z-index: 4;
  top: clamp(20px, 4vw, 46px);
  left: clamp(20px, 4vw, 52px);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--champagne);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tag-logo { width: 52px; height: 38px; overflow: visible; }
.tag-logo path { fill: var(--brown); stroke: currentColor; stroke-width: 2; }
.tag-logo circle { fill: var(--brown-deep); stroke: currentColor; stroke-width: 1.5; }
.tag-logo text { fill: currentColor; font-family: Arial, sans-serif; font-size: 13px; font-weight: 900; letter-spacing: 1px; }
.tag-logo text:last-child { font-size: 10px; }
.tag-logo-large { width: 64px; height: 46px; }
.welcome-silhouettes { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.silhouette { position: absolute; width: clamp(190px, 28vw, 440px); opacity: .1; }
.silhouette path { fill: none; stroke: var(--champagne); stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.silhouette-tote { top: -5%; left: 2%; animation: silhouette-drift 10s ease-in-out infinite alternate; }
.silhouette-handle { right: 4%; bottom: -7%; animation: silhouette-drift 12s 1s ease-in-out infinite alternate-reverse; }
.silhouette-shoulder { top: 8%; right: 22%; width: clamp(150px, 20vw, 310px); animation: silhouette-drift 11s .4s ease-in-out infinite alternate; }
@keyframes silhouette-drift { to { transform: translate3d(2vw, -1.5vh, 0) rotate(2deg); } }
.welcome-voices { position: absolute; inset: 0; pointer-events: none; }
.welcome-voice {
  --voice-place-x: var(--voice-x);
  --voice-place-y: var(--voice-y);
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: min(390px, 76vw);
  padding: 13px 15px;
  margin: 0;
  opacity: .62;
  background: rgb(44 25 19 / 24%);
  border: 1px solid rgb(241 213 163 / 14%);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgb(0 0 0 / 8%);
  backdrop-filter: blur(5px);
  transform: translate(calc(-50% + var(--voice-place-x)), calc(-50% + var(--voice-place-y)));
  transition: left .62s cubic-bezier(.2,.75,.2,1), top .62s cubic-bezier(.2,.75,.2,1), width .62s cubic-bezier(.2,.75,.2,1), opacity .28s ease, transform .62s cubic-bezier(.2,.75,.2,1), background .3s ease;
  will-change: left, top, width, opacity, transform;
}
.welcome-screen:not(.welcome-ready) .welcome-voice { opacity: 0; }
.welcome-ready:not(.welcome-exiting) .welcome-voice { animation: voice-bubble-in .82s cubic-bezier(.16,.8,.22,1) calc(var(--voice-index) * .28s) both; }
.welcome-voice p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: rgb(255 249 240 / 92%);
  font-family: Georgia, serif;
  font-size: clamp(14px, 1.5vw, 19px);
  font-style: italic;
  line-height: 1.45;
  text-shadow: 0 2px 16px rgb(0 0 0 / 45%);
}
.welcome-voice figcaption { margin-top: 7px; color: var(--champagne); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
@keyframes voice-bubble-in {
  0% { opacity: 0; transform: translate(calc(-50% + var(--voice-place-x)), calc(-50% + var(--voice-place-y) + 10vh)) scale(.88); }
  62% { opacity: .82; }
  100% { opacity: .62; transform: translate(calc(-50% + var(--voice-place-x)), calc(-50% + var(--voice-place-y))); }
}
.welcome-final {
  position: relative;
  z-index: 3;
  max-width: 900px;
  opacity: 0;
  text-align: center;
}
.welcome-ready .welcome-final { animation: final-reveal .7s 2.35s ease-out forwards; }
@keyframes final-reveal { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.welcome-kicker { margin: 0 0 14px; color: #dec7a7; font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.welcome-final h1 {
  max-width: 820px;
  margin: 0;
  color: var(--champagne);
  font-size: clamp(52px, 9vw, 116px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: .9;
  text-wrap: balance;
}
.welcome-cta {
  min-height: 50px;
  margin-top: clamp(28px, 5vh, 48px);
  padding: 13px 20px;
  color: var(--brown-deep);
  background: var(--champagne);
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: 0 12px 38px rgb(0 0 0 / 24%);
  font-weight: 850;
}
.welcome-cta:hover { background: #fff1d4; transform: translateY(-1px); }
.welcome-cta:disabled { cursor: default; }
.welcome-exiting {
  animation: welcome-curtain-out .56s .72s cubic-bezier(.72,0,.2,1) forwards;
  box-shadow: 24px 0 58px rgb(33 23 18 / 34%);
}
.welcome-exiting .welcome-voice {
  top: var(--voice-line-y);
  left: clamp(22px, 4vw, 58px);
  width: min(440px, 38vw);
  opacity: .82;
  background: rgb(34 22 17 / 48%);
  animation: none;
  transform: none;
  transition-delay: var(--voice-exit-delay);
}
.welcome-exiting .welcome-voice p {
  -webkit-line-clamp: 1;
  font-size: clamp(11px, 1vw, 14px);
  line-height: 1.25;
}
.welcome-exiting .welcome-voice figcaption { margin-top: 4px; font-size: 8px; }
.welcome-exiting .welcome-final { opacity: 0; animation: none; transform: translateX(12vw) scale(.96); transition: opacity .24s ease, transform .42s ease; }
.welcome-exiting .welcome-silhouettes { opacity: 0; transition: opacity .35s ease; }
@keyframes welcome-curtain-out { to { transform: translateX(-102%); } }

/* Shared app shell */
.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-width: 0;
  min-height: var(--header-height);
  padding: 9px clamp(14px, 4vw, 54px);
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--ink);
  background: rgb(255 253 249 / 94%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand-lockup {
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--brown);
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .04em;
}
.brand-lockup .tag-logo { width: 47px; height: 34px; }
.app-nav { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 720;
}
.app-nav a:hover { color: var(--oxblood); background: var(--blush); }
.app-nav a.active { color: white; background: var(--oxblood); }
.app-nav .repository-link { margin-left: 5px; color: var(--brown); border: 1px solid var(--line); }

main { width: min(100%, 1360px); min-height: calc(100svh - var(--header-height)); margin: auto; padding: clamp(42px, 6vw, 76px) clamp(18px, 4vw, 58px) 90px; }
.view { display: none; }
.view.active { display: block; view-transition-name: catalog-view; }
::view-transition-old(catalog-view), ::view-transition-new(catalog-view) { animation-duration: .22s; }
.section-heading, .subsection-heading {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
}
.section-heading { margin-bottom: 24px; }
.section-heading h1, .section-heading h2 { margin: 5px 0 0; font-size: clamp(38px, 5vw, 62px); letter-spacing: -.035em; }
.subsection-heading { margin-bottom: 15px; }
.subsection-heading h2, .subsection-heading h3 { margin: 3px 0 0; font-size: clamp(26px, 3vw, 36px); }
.subsection-heading > p, .scope-note { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.eyebrow { margin: 0; color: var(--gold); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.snapshot-strip { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 12px; }
.stat { min-width: 0; padding: 12px 14px; display: flex; align-items: baseline; gap: 7px; background: var(--panel); }
.stat strong { color: var(--brown); font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.stat span { color: var(--muted); font-size: 11px; }
.notice-row { margin-bottom: 18px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 18px; background: #f1e2d8; border-left: 3px solid var(--brown); border-radius: 9px; }
.notice { max-width: 820px; margin: 0; color: #5b3c32; font-size: 12px; line-height: 1.5; }
.text-link, .back-link { font-weight: 780; }
.text-link,
.scope-note a { min-height: 44px; display: inline-flex; align-items: center; }
.back-link { min-height: 44px; margin-bottom: 18px; display: inline-flex; align-items: center; }
button.text-link { padding: 0; color: var(--oxblood); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; }

.consent-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  justify-content: center;
  padding: 14px;
}
.consent-banner:not([hidden]) { display: flex; }
.consent-banner-panel {
  max-width: 720px;
  width: 100%;
  padding: 16px 18px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.consent-banner-panel p { margin: 0 0 10px; font-size: 13px; line-height: 1.5; }
.consent-banner-panel p:last-of-type { margin-bottom: 0; }
.consent-banner-actions { margin-top: 12px; display: flex; justify-content: flex-end; gap: 10px; }
.consent-banner-actions button { min-height: 44px; padding: 9px 18px; border-radius: 999px; font-weight: 800; }
.consent-decline { color: var(--ink); background: #f1e8dc; border: 1px solid var(--line); }
.consent-decline:hover { background: #e7dccb; }
.consent-accept { color: #fff; background: var(--oxblood); border: 1px solid transparent; }
.consent-accept:hover { background: #58201f; }

.controls {
  margin-bottom: 20px;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(190px, 1.8fr) repeat(6, minmax(106px, 1fr));
  gap: 9px;
  background: #e8ded2;
  border-radius: 13px;
}
.controls label { min-width: 0; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.controls input, .controls select { width: 100%; min-width: 0; height: 44px; margin-top: 5px; padding: 0 10px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; letter-spacing: normal; text-transform: none; }
.evidence-controls { grid-template-columns: minmax(230px, 2fr) repeat(4, minmax(130px, 1fr)); }
.filter-clear {
  min-height: 44px;
  align-self: end;
  padding: 9px 14px;
  color: white;
  background: var(--brown);
  border: 1px solid var(--brown);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 820;
}
.filter-clear:hover { background: var(--oxblood); border-color: var(--oxblood); }
.context-chip {
  width: fit-content;
  min-height: 44px;
  margin: 0 0 14px;
  padding: 5px 5px 5px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  background: var(--brown);
  border-radius: 999px;
  font-size: 12px;
}
.context-chip[hidden] { display: none; }
.context-chip button { min-height: 44px; padding: 6px 13px; color: var(--brown-deep); background: var(--champagne); border: 0; border-radius: 999px; font-weight: 800; }

/* Cards and grids */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.card, .compact-card, .support-card, .research-section, .contribution-section { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.family-card { overflow: hidden; display: flex; flex-direction: column; }
.card-body { min-width: 0; flex: 1; padding: 17px; display: flex; flex-direction: column; }
.family-card h3 { margin: 11px 0 7px; font-size: 27px; line-height: 1.06; }
.family-card h3 a { min-height: 44px; display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.family-summary { margin: 0; color: #574a44; font-size: 13px; line-height: 1.5; }
.hero-stack { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #efe4d6; }
.hero-stack > .generic-fallback, .hero-stack > .bag-tile { position: absolute; inset: 0; }
.generic-hero { display: block; color: var(--brown); background: #efe4d6; }
.generic-hero img { width: 100%; height: 100%; display: block; object-fit: cover; }
.generic-hero .bag-tile-source { color: var(--brown-deep); text-shadow: none; }
.generic-hero[aria-hidden="true"] { visibility: hidden; }
.bag-tile { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; color: white; background: #33251f; text-decoration: none; }
.bag-tile::after { content: ""; position: absolute; inset: 42% 0 0; background: linear-gradient(transparent, rgb(20 12 8 / 82%)); pointer-events: none; }
.bag-tile img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .2s ease; }
.bag-tile:hover img { transform: scale(1.025); }
.generic-hero:hover img { transform: none; }
.bag-tile.media-unavailable { display: none; }
.bag-tile-source { position: absolute; z-index: 1; right: 11px; bottom: 9px; left: 11px; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-shadow: 0 1px 8px rgb(0 0 0 / 60%); }
.family-tile-empty { min-height: 190px; padding: 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; color: var(--muted); background: linear-gradient(135deg, #f2dfd8, #eee6da); text-align: center; }
.family-tile-empty strong { color: var(--brown); font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.family-tile-empty span:last-child { max-width: 300px; font-size: 11px; line-height: 1.45; }
.tile-kicker { color: var(--oxblood); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.tags, .source-line, .badge-row, .metadata, .dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.tag, .badge { display: inline-flex; padding: 4px 7px; color: var(--muted); background: #faf5ed; border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.badge { color: var(--oxblood); background: #f7e8e2; border-color: #e9c8bf; letter-spacing: 0; text-transform: none; }
.accent-tag { color: #6e3d3d; background: var(--blush); }
.badge-row { margin-top: 12px; }
.metadata, .fineprint, .empty { color: var(--muted); font-size: 11px; }
.metadata { margin-top: 12px; line-height: 1.45; }
.clamped-text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.card-spacer { flex: 1; min-height: 4px; }
.card-action {
  width: fit-content;
  min-height: 44px;
  margin-top: 12px;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--oxblood);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-weight: 820;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.card-action.secondary { color: var(--muted); }
.compact-card { padding: 17px; display: flex; flex-direction: column; }
.compact-card h3 { margin: 9px 0 6px; font-size: 23px; line-height: 1.12; }
.compact-card > p:not(.eyebrow, .metadata) { margin: 6px 0; color: #584a44; font-size: 13px; line-height: 1.5; }
.empty { grid-column: 1 / -1; padding: 32px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.compact-empty { margin: 0; padding: 20px; }

.directory-section { margin-top: 34px; }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.receipt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.receipt-card h3 { font-size: 22px; }

/* Collection details */
.family-hero { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 48px); align-items: center; }
.detail-tile { border-radius: 14px; }
.family-hero h1 { margin: 5px 0 9px; font-size: clamp(42px, 6vw, 72px); letter-spacing: -.045em; line-height: .94; }
.detail-summary { max-width: 670px; margin: 0; color: #574a44; font-size: 16px; line-height: 1.55; }
.family-section { margin-top: 42px; }
.family-section > .subsection-heading { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.family-section > .subsection-heading .card-action { margin: 0; }
.variant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.variant-card { min-width: 0; overflow: hidden; display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.2fr); background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.variant-thumb { min-height: 190px; background: #e8ded2; }
.variant-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.variant-thumb-empty { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.variant-card-copy { min-width: 0; padding: 16px; display: flex; flex-direction: column; }
.variant-card h3 { margin: 6px 0 12px; font-size: 22px; line-height: 1.1; }
.variant-card dl { margin: 0; display: grid; gap: 7px; }
.variant-card dl div { display: grid; grid-template-columns: 70px 1fr; gap: 7px; }
.variant-card dt { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.variant-card dd { margin: 0; font-size: 12px; }
.receipt-count { width: fit-content; min-height: 44px; margin-top: auto; padding-top: 12px; display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; }
.receipt-count.zero { color: var(--muted); }
.support-grid { margin-top: 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.support-card { padding: 20px; box-shadow: none; }
.support-card h2 { margin: 5px 0 15px; font-size: 29px; }
.at-a-glance { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.at-a-glance > div { min-width: 0; padding: 11px; background: #f5ede3; border-radius: 8px; }
.at-a-glance dt { color: var(--brown); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.at-a-glance dd { margin: 5px 0 0; color: #574a44; font-size: 12px; line-height: 1.45; }
.research-note-preview, .dialog-note-list { margin: 0; padding-left: 20px; }
.research-note-preview li, .dialog-note-list li { margin-bottom: 8px; line-height: 1.5; }
.signal-status { margin: 14px 0 0; padding: 11px; color: var(--muted); background: #f3eadf; border-radius: 8px; font-size: 11px; line-height: 1.45; }

/* Research */
.research-section, .contribution-section { margin-top: 15px; padding: 20px; box-shadow: none; }
.research-section:first-child { margin-top: 0; }
.auto-grid, .glossary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.research-card { box-shadow: none; }
.glossary-grid { margin: 0; }
.glossary-grid > div { min-width: 0; padding: 13px; background: #f5ede3; border-radius: 9px; }
.glossary-grid dt { color: var(--brown); font-weight: 850; }
.glossary-grid dd { margin: 5px 0 0; color: #574a44; font-size: 12px; line-height: 1.45; }
.queue-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.queue-table { width: 100%; min-width: 660px; border-collapse: collapse; background: var(--panel); }
.queue-table th, .queue-table td { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.queue-table th { color: var(--muted); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
.queue-table td { font-size: 12px; line-height: 1.45; }
.contribution-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.catalog-contribution { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .55fr); gap: 24px; align-items: center; }
.catalog-contribution h2, .bag-contribution h2 { margin: 5px 0 9px; font-size: clamp(27px, 4vw, 38px); }
.catalog-contribution p, .bag-contribution > p { max-width: 650px; color: var(--muted); line-height: 1.5; }
.contribution-grid-single { grid-template-columns: minmax(0, 360px); justify-content: end; }
.contribution-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contribution-card { min-width: 0; min-height: 112px; padding: 15px; display: flex; flex-direction: column; gap: 7px; color: var(--ink); background: #f5ede3; border: 0; border-radius: 9px; text-decoration: none; text-align: left; width: 100%; }
.contribution-card strong { color: var(--oxblood); }
.contribution-card span { color: var(--muted); font-size: 12px; line-height: 1.45; }

/* Dialog */
.content-dialog {
  width: min(780px, calc(100% - 34px));
  max-height: min(88vh, 900px);
  max-height: min(88svh, 900px);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgb(25 14 10 / 40%);
}
.content-dialog::backdrop { background: rgb(25 15 11 / 62%); backdrop-filter: blur(3px); }
.dialog-panel { max-height: inherit; display: flex; flex-direction: column; background: var(--panel); }
.dialog-header { flex: 0 0 auto; padding: 18px 18px 15px 22px; display: flex; justify-content: space-between; align-items: start; gap: 20px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 5px 0 0; font-size: clamp(27px, 4vw, 40px); line-height: 1.05; }
.dialog-close { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); background: #f1e8dc; border: 0; border-radius: 50%; font-size: 27px; line-height: 1; }
.dialog-close:hover { color: white; background: var(--oxblood); }
.dialog-body { min-height: 0; padding: 22px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-body > p:first-child { margin-top: 0; }
.dialog-body p, .dialog-body li { line-height: 1.58; }
.dialog-section { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.dialog-section h3 { margin: 0 0 9px; font-size: 22px; }
.receipt-paraphrase { font-family: Georgia, serif; font-size: 19px; }
.observations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.observations section { min-width: 0; padding: 14px; background: #f5ede3; border-radius: 9px; }
.observations h3 { margin: 0 0 8px; font-size: 19px; }
.observations ul { margin: 0; padding-left: 18px; }
.evidence-media { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.evidence-media figure { min-width: 0; margin: 0; }
.evidence-media img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #e8ded2; border-radius: 9px; }
.evidence-media figcaption { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.media-fallback { padding: 11px 12px; color: var(--muted); background: #f3eadf; border-left: 3px solid var(--gold); font-size: 11px; line-height: 1.45; }
.media-unavailable::before { content: "Media unavailable"; color: var(--muted); background: #e8ded2; text-align: center; }
.bag-tile.media-unavailable::before { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; padding: 18px; color: white; background: #4b3932; }
.variant-thumb.media-unavailable::before, .evidence-media figure.media-unavailable::before { min-height: 150px; display: grid; place-items: center; padding: 14px; border-radius: 9px; }
.contact-link { font-weight: 750; }
.contact-source { color: var(--muted); font-size: 11px; }
.dialog-back {
  min-height: 44px;
  margin: -8px 0 12px;
  padding: 8px 0;
  color: var(--oxblood);
  background: transparent;
  border: 0;
  font-weight: 820;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.receipt-update-context {
  margin-bottom: 18px;
  padding: 13px 15px;
  display: grid;
  gap: 3px;
  color: var(--muted);
  background: #f3eadf;
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  font-size: 11px;
}
.receipt-update-context strong { color: var(--brown); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.receipt-update-form { display: grid; gap: 16px; }
.receipt-update-form .form-intro { margin: 0; color: #574a44; }
.receipt-update-form > label,
.form-grid label { min-width: 0; display: grid; gap: 6px; color: var(--brown); font-size: 11px; font-weight: 820; }
.receipt-update-form label > span { color: var(--muted); font-weight: 500; }
.receipt-update-form select,
.receipt-update-form textarea,
.receipt-update-form input:not([type="checkbox"]):not([type="hidden"]) {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 450;
}
.receipt-update-form textarea { resize: vertical; line-height: 1.45; }
.field-help { color: var(--muted) !important; font-size: 10px; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.receipt-update-form .form-confirm { display: flex; align-items: start; gap: 9px; color: #574a44; line-height: 1.45; }
.form-confirm input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; }
.form-honeypot { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-host { min-height: 65px; }
.form-status { min-height: 20px; margin: 0; color: var(--moss); font-size: 12px; font-weight: 750; }
.form-status.error { color: var(--oxblood); }
.form-submit {
  width: fit-content;
  min-height: 48px;
  padding: 11px 17px;
  color: white;
  background: var(--oxblood);
  border: 0;
  border-radius: 999px;
  font-weight: 850;
}
.form-submit:disabled { cursor: wait; opacity: .65; }
.form-success { padding: 10px 0; }

.app-footer { padding: 28px clamp(18px, 5vw, 68px); display: flex; justify-content: space-between; gap: 28px; color: #cdbfb5; background: #241a16; font-size: 11px; }
.app-footer p { max-width: 570px; margin: 0; line-height: 1.5; }

@media (max-width: 1120px) {
  .controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .controls label:first-child { grid-column: 1 / -1; }
  .evidence-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .evidence-controls label:first-child { grid-column: 1 / -1; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --header-height: 62px; }
  .app-header { gap: 10px; padding-block: 6px; }
  .brand-lockup > span { display: none; }
  .app-nav a { padding-inline: 11px; font-size: 12px; }
  .app-nav .repository-link { display: none; }
  .family-hero { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); }
  .variant-card { grid-template-columns: 1fr; }
  .variant-thumb { min-height: 150px; aspect-ratio: 16 / 9; }
  .catalog-contribution { grid-template-columns: 1fr; gap: 12px; }
  .contribution-grid, .contribution-grid-single, .contribution-grid-two { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .section-heading, .subsection-heading { display: block; }
  .scope-note, .subsection-heading > p, .subsection-heading > .scope-note { margin-top: 10px; }
  .snapshot-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notice-row { display: block; }
  .notice-row .text-link { min-height: 44px; margin-top: 6px; display: inline-flex; align-items: center; }
  .family-hero, .variant-grid, .support-grid { grid-template-columns: 1fr; }
  .family-hero .detail-tile { max-height: 360px; }
  .family-section > .subsection-heading .card-action { margin-top: 8px; }
  .variant-card { grid-template-columns: minmax(105px, .7fr) minmax(0, 1.3fr); }
  .variant-thumb { min-height: 190px; aspect-ratio: auto; }
}

@media (max-width: 600px) {
  .welcome-lockup { top: 16px; left: 16px; }
  .welcome-lockup span { font-size: 11px; }
  .welcome-voice {
    --voice-place-x: var(--voice-mobile-x);
    --voice-place-y: var(--voice-mobile-y);
    width: min(250px, 62vw);
    padding: 10px 11px;
    border-radius: 14px;
  }
  .welcome-voice p { font-size: 12px; line-height: 1.3; }
  .welcome-voice figcaption { margin-top: 5px; font-size: 8px; }
  .welcome-exiting .welcome-voice { left: 16px; width: min(310px, 82vw); }
  .welcome-exiting .welcome-voice p { font-size: 10px; }
  .welcome-final h1 { font-size: clamp(49px, 18vw, 78px); }
  .welcome-kicker { max-width: 240px; margin-inline: auto; line-height: 1.5; }
  .silhouette { opacity: .075; }
  .app-header { padding-inline: 8px; }
  .brand-lockup { padding-inline: 4px; }
  .brand-lockup .tag-logo { width: 43px; }
  .app-nav { gap: 1px; }
  .app-nav a { padding-inline: 9px; font-size: 11px; }
  main { padding-top: 34px; padding-bottom: 65px; }
  .controls, .evidence-controls { grid-template-columns: 1fr; }
  .controls label:first-child, .evidence-controls label:first-child { grid-column: auto; }
  .card-grid, .directory-grid, .receipt-grid { grid-template-columns: 1fr; }
  .family-card h3 { font-size: 25px; }
  .at-a-glance { grid-template-columns: 1fr; }
  .observations { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .app-footer { display: block; }
  .app-footer p + p { margin-top: 13px; }
  .content-dialog {
    width: 100%;
    max-width: none;
    height: calc(100svh - 8px);
    max-height: calc(100svh - 8px);
    margin: 8px 0 0;
    border-radius: 20px 20px 0 0;
  }
  .dialog-panel { height: 100%; }
  .dialog-header { padding: 15px 12px 13px 17px; }
  .dialog-body { padding: 17px; }
}

@media (max-width: 430px) {
  .app-nav a { font-size: 10px; }
  .variant-card { grid-template-columns: 1fr; }
  .variant-thumb { min-height: 0; aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .welcome-voice { display: none; }
  .welcome-final { opacity: 1; transform: none; animation: none; }
  .welcome-ready .welcome-voice, .welcome-ready .welcome-final { animation: none; }
  .welcome-exiting { animation: none; }
  .silhouette { animation: none; }
}
