:root {
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
  background: #f5f2eb;
  color: #20231f;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #244f3a; }
a:hover { text-decoration-thickness: 0.15em; }

.site-header,
main,
footer {
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding-block: 1.2rem;
  border-bottom: 1px solid #a9aa9f;
}
.site-header nav { display: flex; gap: 1rem; }
.site-title { font-weight: 700; text-decoration: none; }
main { padding-block: 2rem 4rem; }
footer { border-top: 1px solid #a9aa9f; padding-block: 1rem 3rem; }

.hero { max-width: 55rem; margin-bottom: 2rem; }
h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.05; margin-block: 0.25rem 1rem; }
h2 { margin-top: 2.5rem; }
h3 { margin-bottom: 0.4rem; }
.eyebrow,
.source-label,
.technical-note {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
}
.eyebrow,
.source-label { text-transform: uppercase; letter-spacing: 0.08em; }
.technical-note { color: #555c55; }
.scientific,
.species-scientific { font-style: italic; }
.species-scientific { font-size: 1.35rem; }

input[type="search"] {
  display: block;
  width: min(42rem, 100%);
  margin-top: 0.4rem;
  padding: 0.8rem;
  font: inherit;
}
.search-results { min-height: 2rem; }
.letter-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.letter-list a { min-width: 2.2rem; padding: 0.35rem; text-align: center; border: 1px solid #7c8079; }
.species-list { padding-left: 1.25rem; }
.species-list li { margin-block: 0.35rem; }
.species-list .scientific { margin-left: 0.4rem; color: #4f554f; }

.source-layer,
.media-card,
.taxonomy-card,
.review-card {
  border: 1px solid #b7b8ad;
  padding: 1rem;
  margin-block: 1rem;
  background: #fffef8;
}
.source-layer.recovered { border-left: 0.4rem solid #526f55; }
.source-layer.inferred { border-left: 0.4rem solid #8a6b37; }
.source-layer.reviewed { border-left: 0.4rem solid #685482; }
.source-layer.archival { border-left: 0.4rem solid #8a6b26; }
.archival-note { background: #fff9e9; border: 1px solid #d8c58f; padding: 0.8rem 1rem; }
.conflict { border-left: 0.35rem solid #a33b28; }
.conflict-badge { background: #a33b28; color: white; border-radius: 0.25rem; font-size: 0.78em; margin-left: 0.5rem; padding: 0.12rem 0.35rem; }
.legacy-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.taxonomy-grid,
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.taxonomy-card { margin: 0; }
.media-card img,
.media-card video { display: block; max-width: 100%; height: auto; }
.media-card audio { width: min(100%, 42rem); }
.media-relationship-item { padding-block: 0.6rem; border-top: 1px solid #e3e1d6; }
.media-relationship-item:first-of-type { border-top: none; }
.media-relationship-item img,
.media-relationship-item video { display: block; max-width: 100%; height: auto; }
.media-relationship-item audio { width: min(100%, 42rem); }
.warning { font-family: system-ui, sans-serif; font-weight: 700; }
.metadata { display: grid; grid-template-columns: minmax(10rem, 15rem) 1fr; gap: 0.4rem 1rem; }
.metadata dt { font-weight: 700; }
.metadata dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 42rem) {
  .site-header { display: block; }
  .site-header nav { margin-top: 0.75rem; }
  .metadata { display: block; }
  .metadata dd { margin-bottom: 0.7rem; }
}

/*
 * Modern review-deployment annotation, revision r3.
 * Presentation-only changes:
 * 1. Images are displayed immediately after the species heading.
 * 2. English and scientific names have separate alphabetical indexes.
 * 3. Secondary names are displayed clearly beneath primary names.
 * Historical content, spelling, taxonomy, accounts, and media are unchanged.
 */
main > article:has(> section[aria-labelledby="images"]) {
  display: flex;
  flex-direction: column;
}

main > article:has(> section[aria-labelledby="images"]) > section {
  order: 20;
}

main > article:has(> section[aria-labelledby="images"])
  > section[aria-labelledby="images"] {
  order: 10;
}

.index-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.index-switcher a {
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border: 1px solid #7c8079;
  text-decoration: none;
}

.index-switcher a[aria-current="page"] {
  font-weight: 700;
  border-width: 2px;
}

.index-description {
  margin-top: 0.25rem;
  color: #4f554f;
}

.species-list .scientific,
.species-list .common-name {
  display: block;
  margin-left: 0;
  margin-top: 0.15rem;
}

.species-list .scientific {
  font-style: italic;
  color: #4f554f;
}

.species-list.scientific-index .scientific {
  font-size: 1.05rem;
  color: inherit;
}

.species-list.scientific-index .common-name {
  color: #4f554f;
}

/*
 * Review-site data/view-model layer additions (Workstream 1/3/4).
 * Evidentiary-status badges, provenance panels, and missing-content
 * notices used by the localities and historical-maps sections. These are
 * modern interface additions; they never alter the historical text they
 * label.
 */
.status-badge {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 0.2rem;
  border: 1px solid transparent;
  white-space: nowrap;
}
.status-badge--recovered_historical { background: #eaf1e8; border-color: #526f55; color: #2e4a30; }
.status-badge--deterministic_derived { background: #eaeef4; border-color: #3f5c85; color: #24374f; }
.status-badge--owner_or_review_decision { background: #efe9f6; border-color: #685482; color: #453564; }
.status-badge--tentative_candidate { background: #fbf1de; border-color: #8a6b37; color: #6b4f18; }
.status-badge--conflicting,
.status-badge--unresolved { background: #f8e6e1; border-color: #a33b28; color: #7c2a1a; }
.status-badge--missing_or_partial_recovery { background: #f4ecd6; border-color: #8a6b26; color: #6b4f18; }
.status-badge--modern_addition { background: #eceae3; border-color: #7c8079; color: #40433d; }

.provenance-panel {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: #4f554f;
  background: #f1efe6;
  border: 1px solid #cfcdc0;
  padding: 0.6rem 0.8rem;
  margin-block: 0.6rem;
}
.provenance-panel dt { font-weight: 700; }
.provenance-panel dl { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 0.25rem 1rem; margin: 0; }

.missing-notice {
  font-family: system-ui, sans-serif;
  background: #f4ecd6;
  border: 1px solid #8a6b26;
  border-left-width: 0.35rem;
  padding: 0.6rem 0.9rem;
  margin-block: 0.6rem;
}

.unresolved-notice {
  font-family: system-ui, sans-serif;
  background: #f8e6e1;
  border: 1px solid #a33b28;
  border-left-width: 0.35rem;
  padding: 0.6rem 0.9rem;
  margin-block: 0.6rem;
}

.record-list { padding-left: 0; list-style: none; display: grid; gap: 0.75rem; }
.record-list li {
  border: 1px solid #b7b8ad;
  background: #fffef8;
  padding: 0.8rem 1rem;
}
.record-list h3 { margin: 0 0 0.3rem; }
.record-list .status-badge { margin-left: 0.4rem; }

.relationship-list { padding-left: 1.1rem; }
.relationship-list li { margin-block: 0.5rem; }

.table-scroll { overflow-x: auto; margin-block: 0.6rem; }
.member-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.member-table th, .member-table td {
  border: 1px solid #cfcdc0;
  padding: 0.3rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.member-table th { background: #f1efe6; }

details { margin-block: 0.6rem; }
details summary { cursor: pointer; font-weight: 700; }

/* v0.1.11 reader-language revision: collapsed technical detail blocks used to
   hold source paths, record locators, checkpoint names, and other technical
   recovery information out of the default reader-visible view. */
details.technical-details {
  border: 1px solid #d8d6c8;
  background: #f7f6ef;
  padding: 0.5rem 0.75rem;
  font-size: 0.92em;
}
details.technical-details summary {
  color: #555c55;
  font-weight: 600;
}
details.technical-details[open] {
  padding-bottom: 0.75rem;
}

.map-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
}
.map-gallery figure { margin: 0; border: 1px solid #b7b8ad; background: #fffef8; padding: 0.9rem; }
.map-gallery img { display: block; max-width: 100%; height: auto; border: 1px solid #a9aa9f; }
.map-artifact img { display: block; max-width: 100%; height: auto; border: 1px solid #a9aa9f; }

.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;
}
.search-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-block: 0.6rem;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
}
.search-category-filter label { display: flex; align-items: center; gap: 0.3rem; }
.search-result-list .search-result-category { margin: 0 0 0.3rem; display: inline-block; }

/* Workstream 7: review labels and Heinz feedback affordances. */
.review-affordance {
  margin-top: 2.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid #7c8079;
  border-top: 0.35rem solid #685482;
  background: #f7f6f0;
}
.review-affordance h2 { margin-top: 0; }
.stable-reference {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.25rem 1rem;
  margin: 0 0 0.8rem;
}
.stable-reference dt { font-weight: 700; }
.stable-reference dd { margin: 0; overflow-wrap: anywhere; }
.review-note-block { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.6rem; }
.review-note-block label { font-weight: 700; }
.review-note {
  width: 100%;
  max-width: 42rem;
  font: inherit;
  padding: 0.5rem;
  border: 1px solid #7c8079;
  background: #fffef8;
  box-sizing: border-box;
}
.review-note--compact { max-width: 100%; }
.review-note-explainer { max-width: 42rem; }
.print-button {
  align-self: flex-start;
  font: inherit;
  padding: 0.4rem 0.9rem;
  border: 1px solid #40433d;
  background: #eceae3;
  cursor: pointer;
}
.review-item { border-top: 1px solid #e3e1d6; padding-block: 0.7rem; }
.review-item:first-of-type { border-top: none; }

@media print {
  .no-print { display: none !important; }
  .review-affordance { border: 1px solid #000; background: none; }
  .review-note { border: 1px solid #000; background: none; min-height: 3.5em; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.75em; }
  .status-badge { border: 1px solid #000 !important; background: none !important; color: #000 !important; }
}

/*
 * Release layer (v0.1.18): three-release historical evidence.
 * Presentation-only; release-specific historical values are labeled,
 * never merged. Follows the existing source-layer color language.
 */
.source-layer.release-layer { border-left: 0.4rem solid #3d6472; }

.release-chips {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.release-chip {
  border: 1px solid #7c8079;
  padding: 0.35rem 0.6rem;
  font-size: 0.92rem;
}
.release-chip.is-present { border-left: 0.35rem solid #526f55; }
.release-chip.is-absent { border-left: 0.35rem solid #9b5a4a; color: #4f554f; }
.release-chip strong { margin-right: 0.35rem; }

.release-tag {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  border: 1px solid #3d6472;
  color: #2c4a54;
  padding: 0.05rem 0.4rem;
  margin-left: 0.35rem;
  vertical-align: middle;
  white-space: nowrap;
}
.release-tag--new { max-width: max-content; }

.release-names ul { list-style: none; padding: 0; }
.release-names li { margin-bottom: 0.35rem; }

.release-state-note { font-weight: 600; }
.truncation-note { margin-top: 0.35rem; }
.earlier-release-text { margin: 0.5rem 0 0.75rem; }
.earlier-release-text summary { cursor: pointer; font-family: system-ui, sans-serif; }

.cd01-account-section { margin-bottom: 1rem; }
.release-recording-layer { margin-bottom: 1.25rem; }
.release-media-card { margin-bottom: 0.9rem; }
.no-account-note { margin: 0.5rem 0; }
.checklist-participation-row { margin-bottom: 0.75rem; }

/* --- Public unresolved-evidence register (v0.1.23) -------------------- */
.unresolved-group { margin: 2.5rem 0; }
.unresolved-group-media { margin: 0.75rem 0 1.25rem; }
.unresolved-group-media audio { width: 100%; max-width: 34rem; }
.unresolved-item { margin-bottom: 1.75rem; }
.unresolved-item-title { margin: 0 0 0.35rem; font-size: 1.05rem; }
