@font-face { font-family: "Atkinson Next"; src: url(fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url(fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+1E00-1EFF; }

:root {
  --ink: #20262b;
  --ink-soft: #55606a;
  --rock: #e7ebe9;
  --rock-deep: #cdd5d1;
  --paper: #ffffff;
  --malachite: #0b6b50;
  --azurite: #1c4a8f;
  --rhodochrosite: #b03259;
  --sulfur: #e8bb1c;
  --hematite: #7a3327;
  --fluorite: #5b3f98;
  --chrysocolla: #0f7c8a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--rock); color: var(--ink); font: 400 17px/1.45 "Atkinson Next", system-ui, sans-serif; font-variant-numeric: tabular-nums; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.75rem; line-height: 1.15; margin: .4em 0 .5em; }
h2 { font-size: 1.2rem; line-height: 1.25; margin: 1.8em 0 .5em; }
h3 { font-size: 1.02rem; margin: 1.3em 0 .3em; }
p { margin: .5em 0; }
a { color: var(--azurite); }
small { color: var(--ink-soft); font-size: .84rem; }
.muted { color: var(--ink-soft); }
.code { letter-spacing: .01em; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--azurite); outline-offset: 2px; }

/* Each station carries a mineral's colour wherever it appears. */
.band-0 { --band: var(--malachite); }
.band-1 { --band: var(--azurite); }
.band-2 { --band: var(--rhodochrosite); }
.band-3 { --band: var(--chrysocolla); }
.band-4 { --band: var(--hematite); }
.band-5 { --band: var(--fluorite); }
.dot { display: inline-block; width: .7em; height: .7em; margin-right: .4em; background: var(--band); border-radius: 2px; }

/* Navigation: a bar under the thumb on phones, a strip across the top on larger screens. */
.nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: flex; background: var(--ink); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; color: #d6dcd9; text-decoration: none; text-align: center; padding: 19px 4px; font-size: .94rem; }
.nav a.on { color: #fff; font-weight: 700; box-shadow: inset 0 3px 0 var(--sulfur); }
.nav .nav-scan { background: var(--malachite); color: #fff; font-weight: 700; }
.nav .nav-scan.on { box-shadow: inset 0 3px 0 var(--sulfur); }
.nav .wide, .nav .nav-brand { display: none; }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav { position: sticky; top: 0; bottom: auto; padding: 0 16px; align-items: stretch; }
  .nav a { flex: 0 0 auto; padding: 13px 14px; }
  .nav a.on { box-shadow: inset 0 -3px 0 var(--sulfur); }
  .nav .nav-scan.on { box-shadow: inset 0 -3px 0 var(--sulfur); }
  .nav .wide { display: block; }
  .nav .nav-brand { display: block; color: #fff; font-weight: 700; padding-left: 0; margin-right: 12px; }
  .nav .narrow { display: none; }
  .nav { flex-wrap: wrap; }
  .nav .nav-account { margin-left: auto; }
  .nav .nav-out { display: flex; align-items: center; }
}
.linklike { background: none; border: 0; color: #d6dcd9; font: inherit; font-size: .94rem; cursor: pointer; padding: 8px; }

/* Controls */
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 10px 11px; background: var(--paper); border: 1px solid #8a9690; border-radius: 4px; min-height: 46px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; flex: none; margin: 0; accent-color: var(--malachite); }
label { display: block; font-weight: 700; font-size: .94rem; }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; font-size: 1.05rem; }
label small { display: block; font-weight: 400; margin-top: 3px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > .btn { align-self: flex-start; }
.pair { display: grid; gap: 12px; }
@media (min-width: 560px) { .pair { grid-template-columns: 1fr 1fr; } }
.short { max-width: 320px; }
.narrow-form { max-width: 460px; }
.inline-form { display: flex; gap: 8px; align-items: stretch; margin: 8px 0; }
.inline-form input, .inline-form select { flex: 1; min-width: 0; }
.btn { display: inline-block; font: inherit; font-weight: 700; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 5px; padding: 10px 16px; min-height: 46px; text-decoration: none; cursor: pointer; text-align: center; }
.btn.primary { background: var(--malachite); border-color: var(--malachite); color: #fff; }
.btn.danger { background: var(--rhodochrosite); border-color: var(--rhodochrosite); color: #fff; }
.btn.big { width: 100%; font-size: 1.15rem; padding: 18px 16px; }
.btn.small { min-height: 38px; padding: 5px 12px; font-size: .92rem; }
.btn:active { transform: translateY(1px); }
.ghost-dark { margin-top: 24px; }

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: .94rem; padding: 0; margin-bottom: 6px; }
.checks { display: grid; gap: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 1rem; padding: 7px 0; }
.check .dot { margin: 0 -2px 0 0; flex: none; }
.specimen-entry { display: flex; flex-direction: column; gap: 12px; background: var(--paper); padding: 14px; border-left: 6px solid var(--ink); }
.specimen-entry legend { float: left; font-size: 1.05rem; margin-bottom: 4px; }
.specimen-entry > legend + * { clear: both; }

/* Messages */
.flash { padding: 11px 14px; margin: 0 0 12px; background: var(--paper); border-left: 6px solid var(--azurite); display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.flash.ok { border-color: var(--malachite); }
.flash.error { border-color: var(--rhodochrosite); display: block; }
.secret { font-size: 1.15rem; font-weight: 700; user-select: all; background: var(--rock); padding: 2px 8px; word-break: break-all; }

/* The working state fills the screen's width in colour, readable from across the bench. */
.work { color: #fff; background: var(--malachite); margin: -16px -16px 18px; padding: 20px 16px 16px; }
.work.paused { background: var(--sulfur); color: var(--ink); }
.work-state { margin: 0; font-size: 1.1rem; font-weight: 700; }
.timer { font-size: clamp(3.6rem, 21vw, 6.5rem); line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
.work-spec { margin: 0 0 14px; font-size: 1.05rem; }
.work-spec a { color: inherit; }
.work-actions { display: grid; gap: 8px; margin-top: 14px; }
.work .btn.pause, .work .btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.work .btn.finish { background: #fff; color: var(--ink); border-color: #fff; }
.work.paused .btn.finish { background: var(--ink); color: #fff; border-color: var(--ink); }
.route-notice { background: var(--ink); color: #fff; margin: -16px -16px 18px; padding: 22px 16px; border-bottom: 8px solid var(--sulfur); }
.route-notice h2 { font-size: 1.6rem; margin: 0 0 4px; }
.route-notice p { margin: 0; color: #d6dcd9; }
main > * + .work { margin-top: 12px; }
main > .route-notice + * { margin-top: 0; }
@media (min-width: 792px) { .work, .route-notice { margin-left: 0; margin-right: 0; margin-top: 0; } }
.scan-cta { display: block; background: var(--malachite); color: #fff; font-size: 1.5rem; font-weight: 700; text-decoration: none; text-align: center; padding: 42px 16px; margin: 0 0 8px; border-radius: 5px; }
.state-block { background: var(--paper); padding: 14px; border-left: 6px solid var(--ink); margin: 12px 0; }
.state-block h2 { margin: 0 0 8px; }

/* Rows */
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; background: var(--paper); color: inherit; text-decoration: none; padding: 11px 13px; margin-bottom: 3px; }
a.row:hover { background: #f6f8f7; }
.row-main small { display: block; }
.row-side { text-align: right; font-size: .88rem; color: var(--ink-soft); }
.row.alert { border-left: 6px solid var(--rhodochrosite); }
.warn { color: var(--rhodochrosite); font-weight: 700; }
.strata { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 2px; height: 13px; margin-top: 4px; }
.strata i { flex: 1; display: block; height: 6px; background: var(--band); }
.strata i.done { height: 6px; }
.strata i.now { height: 13px; }
.strata i.todo { height: 6px; background: repeating-linear-gradient(135deg, var(--band) 0 2px, transparent 2px 5px); opacity: .55; }

/* Route on a specimen: bands stacked like a cut through the rock. */
.route { list-style: none; margin: 0; padding: 0; }
.route li { background: var(--paper); border-left: 10px solid var(--band); padding: 10px 12px; margin-bottom: 2px; }
.route li.pending:not(.now) { border-left-color: transparent; border-image: repeating-linear-gradient(135deg, var(--band) 0 3px, #fff 3px 7px) 10; }
.route li.now { border-left-width: 22px; }
.route li.cancelled { opacity: .55; border-left-color: var(--rock-deep); }
.route li.cancelled strong { text-decoration: line-through; }
.route-line { display: flex; justify-content: space-between; gap: 10px; }
.route-line small { display: block; }
.dur { font-weight: 700; white-space: nowrap; }
.route-more { margin-top: 6px; }
summary { cursor: pointer; color: var(--azurite); padding: 4px 0; }
.route-more > .stack { padding: 10px 0 6px; gap: 18px; }
.pair-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.facts { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.copyline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.known { background: var(--paper); border-left: 6px solid var(--azurite); padding: 10px 13px; margin: 10px 0; }
.known.warning { border-color: var(--rhodochrosite); background: #fbeef2; }
.known p { margin: 3px 0 0; }
.note { background: var(--paper); padding: 9px 13px; margin-bottom: 3px; }
.note p { margin: 0 0 2px; }
.note + form, #notes + p + form { margin-top: 14px; }
.history summary h2 { display: inline; }
.history { margin-top: 1.8em; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 8.5em 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid var(--rock-deep); font-size: .94rem; }
.timeline time { color: var(--ink-soft); }
.spec-head h1 { margin-bottom: .1em; }
.locality { margin: 0 0 12px; color: var(--ink-soft); }
.job-spec { margin-bottom: 14px; }
.board-cols { display: grid; gap: 0 28px; }
@media (min-width: 720px) { .board-cols { grid-template-columns: 1fr 1fr; } }
.board-row { align-items: center; }
.menu a { display: block; background: var(--paper); padding: 14px 13px; margin-bottom: 3px; font-weight: 700; text-decoration: none; color: inherit; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 16px; border-bottom: 2px solid var(--rock-deep); margin-bottom: 10px; }
.tabs a { padding: 8px 0; text-decoration: none; color: var(--ink-soft); }
.tabs a.on { color: var(--ink); font-weight: 700; box-shadow: 0 2px 0 var(--ink); }
.edit-row { background: var(--paper); padding: 9px 13px; margin-bottom: 3px; }
.edit-row summary { color: inherit; }
.edit-row form, .add form { padding: 10px 0; }
.add { margin-top: 16px; }
.add summary { font-weight: 700; }
.scanner { position: relative; aspect-ratio: 1; max-width: 460px; background: var(--ink); overflow: hidden; margin-bottom: 8px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Pages with no navigation */
.solo { padding-bottom: 0; }
.solo main { max-width: 440px; padding-top: 8vh; }
.signin { background: var(--ink); color: #fff; min-height: 100vh; }
.signin a { color: #fff; }
.signin input { color: var(--ink); }
.signin .flash { color: var(--ink); }
.signin h1 { font-size: 2.6rem; margin: 0 0 18px; }
.signin .btn.primary { margin-top: 6px; }
.core { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 22px; }
.core i { background: var(--band); display: block; }
.core i:nth-child(1) { flex: 5; } .core i:nth-child(2) { flex: 2; } .core i:nth-child(3) { flex: 8; }
.core i:nth-child(4) { flex: 1; } .core i:nth-child(5) { flex: 3; } .core i:nth-child(6) { flex: 6; }
.signin main { padding-left: 38px; }

.track { background: var(--paper); }
.track-brand { font-weight: 700; margin: 0; }
.track h1 { font-size: 1.9rem; margin-top: .15em; }
.track-steps { list-style: none; padding: 0; margin: 26px 0; }
.track-steps li { font-size: 1.4rem; padding: 15px 16px; border-left: 12px solid var(--rock-deep); color: var(--ink-soft); }
.track-steps li.past { border-left-color: var(--malachite); color: var(--ink); }
.track-steps li.here { border-left-color: var(--malachite); background: var(--malachite); color: #fff; font-weight: 700; }

/* Labels */
.labels-page { background: var(--paper); padding: 16px; }
.label-tools { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.label-wrap { margin-bottom: 20px; }
.label { display: flex; gap: 3mm; align-items: center; width: 90mm; height: 38mm; padding: 2mm; border: 1px dashed var(--rock-deep); color: #000; overflow: hidden; }
.label img { width: 33mm; height: 33mm; flex: none; }
.label p { margin: 0; font-size: 9pt; line-height: 1.2; }
.label .label-code { font-size: 13pt; font-weight: 700; }
.label .label-min { font-size: 10.5pt; font-weight: 700; margin-bottom: 1mm; }
@media print {
  .no-print { display: none !important; }
  .labels-page { padding: 0; }
  .label { border: 0; break-after: page; }
  .label-wrap { margin: 0; }
  @page { size: 90mm 38mm; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
