/* mrdbid — one small stylesheet, no build step, no CDN.
   Readable at any width; the content is text and links. */

:root {
  --ink: #1c1a17;
  --ink-soft: #5c574f;
  --paper: #fbfaf7;
  --rule: #ddd8cf;
  --accent: #5a6b3b;
  --accent-dark: #3e4a29;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece8e1;
    --ink-soft: #a7a096;
    --paper: #171614;
    --rule: #34312c;
    --accent: #9db36e;
    --accent-dark: #b6c98c;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.25rem;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 ui-serif, Georgia, "Times New Roman", serif;
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; font-weight: 600; }
h1 { font-size: 1.9rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }

/* --- chrome ------------------------------------------------------------- */

.site-header,
main,
.site-footer { max-width: var(--measure); margin: 0 auto; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
}

.site-header nav a { margin-left: 1.25rem; }

main { padding: 1.5rem 0 3rem; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1rem 0 3rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* --- home --------------------------------------------------------------- */

.intro p { color: var(--ink-soft); }

.counts dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.counts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.counts dd { margin: 0.15rem 0 0; font-size: 1.75rem; font-variant-numeric: tabular-nums; }

/* --- forms -------------------------------------------------------------- */

form[role="search"], .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.5rem 0;
}
.filters label, form[role="search"] label { font-size: 0.85rem; color: var(--ink-soft); }
input[type="search"], select {
  flex: 1 1 12rem;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
button {
  padding: 0.45rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--accent-dark);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
button:hover { background: var(--accent); }
.clear { font-size: 0.85rem; }

/* --- specimen lists ----------------------------------------------------- */

.specimen-list { list-style: none; margin: 0; padding: 0; }

.specimen-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.specimen-summary .name { font-weight: 600; }
.specimen-summary .meta { color: var(--ink-soft); font-size: 0.85rem; }
.catalog {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.result-count { color: var(--ink-soft); font-size: 0.85rem; }
.empty { color: var(--ink-soft); font-style: italic; }

/* --- confidence --------------------------------------------------------- */

.confidence {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.confidence--dna_confirmed { border-color: var(--accent); color: var(--accent-dark); }
.confidence--needs_id { font-style: italic; }

/* --- specimen page ------------------------------------------------------ */

.subhead { display: flex; gap: 0.75rem; align-items: center; margin: 0 0 1.5rem; }

.field-data dl {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) 1fr;
  gap: 0.4rem 1.25rem;
  margin: 0;
}
.field-data dt { color: var(--ink-soft); font-size: 0.85rem; padding-top: 0.15rem; }
.field-data dd { margin: 0; }
.field-data .note { display: block; color: var(--ink-soft); font-size: 0.8rem; }

.timeline ol { list-style: none; margin: 0; padding: 0; }
.event {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  padding: 0.6rem 0 0.6rem 1.1rem;
  border-left: 2px solid var(--rule);
  position: relative;
}
.event::before {
  content: "";
  position: absolute;
  left: -0.3rem;
  top: 1rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  border-radius: 50%;
}
.event .stage { font-weight: 600; }
.event .when, .event .detail { color: var(--ink-soft); font-size: 0.85rem; }
.event .out { font-size: 0.85rem; }

.links ul { padding-left: 1.1rem; }

/* --- prose -------------------------------------------------------------- */

.prose h2 { margin-top: 1.8rem; }
.prose p { max-width: var(--measure); }

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.pagination a:only-child:last-child { margin-left: auto; }

/* --- entry area --------------------------------------------------------
   Not the public site. A records screen: wider than the reading measure,
   sans-serif because it is a form and not prose, and the two halves of the
   data model kept visibly apart. */

.entry { max-width: 52rem; margin: 0 auto; font-family: ui-sans-serif, system-ui, sans-serif; }
.entry-narrow { max-width: 26rem; }
.entry h1 { font-family: ui-serif, Georgia, serif; margin-top: 1rem; }

.record-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  position: sticky;               /* the buttons stay reachable down a long form */
  top: 0;
  background: var(--paper);
  z-index: 2;
}
.record-nav .buttons { display: flex; gap: 0.35rem; align-items: center; }
.record-nav .position { font-size: 0.9rem; color: var(--ink-soft); padding: 0 0.5rem; }

.btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.4;
}
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-primary { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-quiet { border-color: transparent; color: var(--ink-soft); }
/* Off, not hidden: the row of buttons keeps its shape at the ends of the list. */
.btn-off { opacity: 0.35; pointer-events: none; }
.btn[disabled] { opacity: 0.35; cursor: default; }

.record-id { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 1.25rem; }

.panel { border: 1px solid var(--rule); border-radius: 6px; padding: 1rem 1.25rem 1.25rem; margin: 0 0 1.25rem; }
.panel h2 { margin-top: 0.25rem; font-family: ui-serif, Georgia, serif; }
.panel-note { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 1rem; }
/* The authored half is marked. A screen where typed values and regenerated
   ones look alike is what caused the 2026-08-16 loss. */
.panel-authored { border-left: 4px solid var(--accent); }
.panel-derived { border-left: 4px solid var(--rule); }

.field { margin: 0 0 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
.field input[type="text"], .field input[type="number"], .field input[type="date"],
.field input[type="password"], .field input[type="url"], .field textarea, .field select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.field-check { display: flex; align-items: flex-start; gap: 0.5rem; }
.field-check label { font-weight: 400; margin: 0; }

.field-radio { border: 0; padding: 0; margin: 0 0 1rem; }
.field-radio legend { font-size: 0.85rem; font-weight: 600; padding: 0; margin-bottom: 0.35rem; }
.field-radio .radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 1rem 0.25rem 0;
  font-weight: 400;
  font-size: 0.95rem;
}
.field-radio .radio input { margin: 0; }

.help { font-size: 0.8rem; color: var(--ink-soft); margin: 0.3rem 0 0; }
.error { color: #a4402f; font-size: 0.85rem; margin: 0.3rem 0 0; }
@media (prefers-color-scheme: dark) { .error { color: #e0907f; } }

.form-actions { display: flex; gap: 0.5rem; align-items: center; margin: 0 0 2rem; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li {
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  border: 1px solid var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.records { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.records th, .records td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--rule); }
.records th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
.records .num { color: var(--ink-soft); }
.was { color: var(--ink-soft); }

.changes { margin: 0 0 3rem; font-size: 0.85rem; }
.changes summary { cursor: pointer; color: var(--ink-soft); }
.changes table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.changes th, .changes td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--rule); }

/* The record buttons are a row of targets; keep them thumb-sized on a phone. */
@media (max-width: 30rem) {
  .btn { padding: 0.5rem 0.7rem; }
  .record-nav { position: static; }
}

/* Sign out is a POST, because a link that logs you out can be triggered by
   anything that prefetches it. Styled to sit in the nav like the other links. */
.signout { display: inline; }
.signout button {
  border: 0; background: none; padding: 0; font: inherit;
  color: var(--accent-dark); cursor: pointer; text-decoration: underline;
}

/* --- breadcrumbs -------------------------------------------------------
   Discreet by instruction: small, muted, no rule, no background. Present
   when wanted and easy to ignore when not. */

.crumbs { max-width: var(--measure); margin: 0 auto; padding: 0.6rem 0 0; }
.entry ~ .crumbs, .crumbs.wide { max-width: 52rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; }
.crumbs li { font-size: 0.8rem; color: var(--ink-soft); }
.crumbs li + li::before { content: "›"; padding-right: 0.35rem; color: var(--rule); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent-dark); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); }

/* --- the signed-in workbench -------------------------------------------
   Sits above the public page rather than replacing it: seeing what visitors
   see is one of the things you come here to do. */

.workbench { font-family: ui-sans-serif, system-ui, sans-serif; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); margin-bottom: 2rem; }
.workbench h1 { font-family: ui-serif, Georgia, serif; margin-top: 1.5rem; }
.workbench h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin: 1.75rem 0 0.75rem; }

.tally { display: flex; flex-wrap: wrap; gap: 1.75rem; margin: 0; }
.tally div { margin: 0; }
.tally dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.tally dd { margin: 0.1rem 0 0; font-size: 1.5rem; font-weight: 600; }

.actions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.action + .action { border-top: 1px solid var(--rule); }
.action a, .action > .action-label { display: block; padding: 0.75rem 1rem; text-decoration: none; color: var(--ink); }
.action a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.action-label { display: block; font-weight: 600; font-size: 0.95rem; }
.action a::after { content: " →"; color: var(--accent-dark); }
.action-note { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.1rem; }

/* Shown, never clickable. A dead link reads as a fault; this reads as a plan. */
.action-unbuilt { color: var(--ink-soft); }
.action-unbuilt .action-label { padding: 0.75rem 1rem 0; font-weight: 600; color: var(--ink-soft); }
.action-unbuilt .action-note { padding: 0 1rem 0.75rem; margin-top: 0.1rem; }
.tag {
  font-size: 0.7rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.1rem 0.5rem;
  margin-left: 0.4rem; vertical-align: 0.1em; white-space: nowrap;
}
.workbench-help { font-size: 0.9rem; margin: 1.25rem 0 0; }

/* Help page: numbered steps and the little key caps for the record buttons. */
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: 0.35rem; }
.key {
  display: inline-block; border: 1px solid var(--rule); border-radius: 4px;
  padding: 0 0.35rem; font-size: 0.85rem; line-height: 1.5;
}

/* Demoted to <h2> when the workbench is above it, but it is still the opening
   line of the public page and should not shrink to a subheading. */
.intro-heading { font-size: 1.9rem; margin: 0 0 0.5rem; font-family: ui-serif, Georgia, serif; }

/* --- account pages ------------------------------------------------------ */

/* The QR is inline SVG, never a file on disk. Bounded so a large one cannot
   push the instructions off the screen on a phone. */
.qr { margin: 1.25rem 0; max-width: 15rem; }
.qr svg { width: 100%; height: auto; background: #fff; padding: 0.5rem; border-radius: 6px; }

.secret, .codes code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.secret { font-size: 1rem; letter-spacing: 0.08em; word-break: break-all; }

.codes { columns: 2; gap: 1.5rem; padding-left: 1.4rem; margin: 0; }
.codes li { margin-bottom: 0.3rem; }
.codes code { font-size: 0.95rem; }
@media (max-width: 26rem) { .codes { columns: 1; } }
