/* 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;
}

/* Levels. Everything here is worth reading, so nothing shouts; but "six of
   eight photographs went up" must not look like "posted". */
.messages li.warning, .messages li.error {
  border-color: var(--ink-soft);
  border-left-width: 3px;
  background: color-mix(in srgb, var(--ink-soft) 6%, transparent);
}

.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; } }

/* --- importing photographs --------------------------------------------- */

.dropzone {
  border: 2px dashed var(--rule);
  border-radius: 8px;
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--paper);
}
.dropzone:hover, .dropzone:focus, .dropzone.over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  outline: none;
}
.dropzone-main { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.25rem; }
.dropzone-sub { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

.progress { height: 3px; background: var(--rule); border-radius: 2px; margin: 0.75rem 0 0.5rem; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s linear; }
.working .dropzone { opacity: 0.5; pointer-events: none; }

.proposal-head { display: flex; gap: 0.6rem; align-items: baseline; font-weight: 400; }
.proposal-head input { margin: 0; }
.frames { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.85rem; }
.frames li { padding: 0.2rem 0; border-top: 1px solid var(--rule); }
.frames code { font-family: ui-monospace, Menlo, monospace; }

/* A group the site already knows about. Marked, unticked, still visible --
   hiding it would leave you wondering where it went. */
.proposal-known { opacity: 0.75; border-left: 4px solid var(--rule); }
.notice {
  font-size: 0.85rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
}

/* A block of numbers meant to be copied whole. */
.numbers {
  width: 100%;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.9rem;
  padding: 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1.25rem; }

/* Present, findable, and not competing with anything. */
.signin-link { font-size: 0.8rem; margin: 1rem 0 0; }
.signin-link a { color: var(--ink-soft); text-decoration: none; }
.signin-link a:hover { color: var(--accent-dark); text-decoration: underline; }

/* Two short fields side by side, stacking on a phone. */
.pair { display: flex; gap: 1rem; flex-wrap: wrap; }
.pair .field { flex: 1 1 12rem; }

/* The merge control: quiet, and clearly attached to the group above it. */
.merge {
  display: flex; gap: 0.5rem; align-items: baseline;
  font-size: 0.85rem; color: var(--ink-soft);
  margin: 0.5rem 0; padding-left: 1.5rem;
}
.merge input { margin: 0; }

/* The label caption when the label *is* the field -- the pattern the import
   review and the posting screen both use. Matches `.field label`, which only
   catches a label nested inside one. */
label.field > span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }

/* Choosing photographs to post. Deliberately not a drop zone: the import
   screen takes a whole walk at once, this one takes the few frames that make
   one observation, and they should not look like the same act. */
.panel input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px dashed var(--rule);
  border-radius: 5px;
  background: var(--paper);
  font: inherit;
  font-size: 0.9rem;
}
.panel input[type="file"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The last look before an observation becomes real. Deliberately plain: it is
   there to be read, not to alarm. */
.confirm { border-left: 4px solid var(--accent); }
.confirm h2 { margin-top: 0; }
.checks { list-style: none; margin: 0 0 1rem; padding: 0; font-size: 0.9rem; }
.check { padding: 0.3rem 0; border-bottom: 1px solid var(--rule); }
.check:last-child { border-bottom: 0; }
.check-warn { color: var(--ink); font-weight: 600; }

/* Decisions on a worklist row: three small presses, not a form. */
.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0; }
.row-actions .btn { font-size: 0.8rem; padding: 0.3rem 0.55rem; }

/* A folder of records, folded when it is large. The hoard should read as a
   handful of folders rather than four thousand decisions. */
.folder { border: 1px solid var(--rule); border-radius: 6px; margin: 0 0 0.75rem; padding: 0.6rem 0.8rem; }
.folder > summary { cursor: pointer; display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }
.folder-name { font-weight: 600; }
.folder-actions { margin: 0.6rem 0; }
.folder .records { margin-top: 0.5rem; }

/* Choosing individual photographs, and where they should go. */
.frame-pick { display: flex; gap: 0.4rem; align-items: baseline; }
.move-to { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-soft); margin: 0.5rem 0; }
.move-to select { font: inherit; font-size: 0.85rem; padding: 0.2rem 0.3rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); color: var(--ink); max-width: 22rem; }

/* A button that reads as a link: an action that changes nothing on the server. */
.linkish {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: var(--accent-dark); cursor: pointer;
  text-decoration: underline;
}
.linkish:hover { background: none; color: var(--accent); }
.frame-tools { margin: 0.4rem 0 0.2rem; }
.from-here { font-size: 0.8rem; margin-left: 0.4rem; opacity: 0.75; }

/* Photographs shown beside their names, drawn from the local disk by the
   browser. Nothing is uploaded and nothing is stored: these are object URLs
   that live as long as the page does. See static/js/review.js. */
.pictures { border: 1px dashed var(--rule); border-radius: 6px; padding: 0.7rem 0.9rem; margin: 0 0 1rem; }
.pictures .btn { margin-right: 0.3rem; }
.frames li { display: flex; gap: 0.6rem; align-items: flex-start; }
.frames li > .frame-pick { flex: 1; }
.thumb {
  width: 72px; height: 72px; object-fit: cover;
  border: 1px solid var(--rule); border-radius: 4px;
  cursor: zoom-in; background: var(--paper); flex: none;
}
.thumb-large { width: 320px; height: auto; object-fit: contain; cursor: zoom-out; }
