/* Container Scan — read outdoors, in daylight, with gloves on.
   Paper-pale ground so the screen survives sunlight, ink-black text,
   and one signal yellow reserved for the action that matters. */
@font-face { font-family: "Barlow Condensed"; src: url("/font/barlow-condensed-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/font/barlow-condensed-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --paper: #e4e2dc;
  --plate: #f6f5f1;
  --ink: #15171a;
  --steel: #b4b1a9;
  --signal: #f3b700;
  --oxide: #9e3b22;
  --moss: #3e6b35;
  --stencil: "Barlow Condensed", "Haettenschweiler", "Arial Narrow", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px 12px;
  border-bottom: 2px solid var(--ink);
}
header .title { font-family: var(--stencil); font-weight: 700; font-size: 27px; letter-spacing: .04em; white-space: nowrap; }
header .yard { font-size: 13px; color: #5d6168; }
.icon { width: auto; min-height: 44px; background: none; border: 0; color: var(--ink); padding: 10px; margin: 0 -10px 0 0; flex: none; }
.icon svg { width: 24px; height: 24px; display: block; }

main { padding: 20px; max-width: 560px; margin: 0 auto; }
section { display: none; }
body[data-view="loading"] #loading, body[data-view="login"] #login, body[data-view="scan"] #scan,
body[data-view="confirm"] #confirm, body[data-view="done"] #done, body[data-view="settings"] #settings { display: block; }
body[data-view="login"] #navSettings, body[data-view="loading"] #navSettings { visibility: hidden; }

h1 { font-family: var(--stencil); font-weight: 700; font-size: 30px; letter-spacing: .02em; margin: 0 0 18px; }
h2 { font-family: var(--stencil); font-weight: 700; font-size: 20px; margin: 34px 0 10px; letter-spacing: .02em; }
p { margin: 0 0 14px; }
.muted { color: #5d6168; font-size: 14px; }

/* Photo slots: each one has a job, printed on the slot. */
.slots { display: grid; gap: 12px; margin-bottom: 22px; }
.slot {
  position: relative; display: flex; align-items: center; gap: 14px;
  min-height: 86px; padding: 14px 16px;
  background: var(--plate) center/cover no-repeat;
  border: 2px solid var(--steel);
}
.slot:not(.filled) {
  background-image: repeating-linear-gradient(90deg, rgba(21,23,26,.045) 0 2px, transparent 2px 17px);
}
.slot .n { font-family: var(--stencil); font-weight: 700; font-size: 38px; line-height: 1; width: 32px; color: #8d8a82; flex: none; }
.slot .what { font-weight: 600; font-size: 17px; }
.slot .hint { font-size: 13px; color: #5d6168; }
.slot.filled { border-color: var(--ink); }
.slot.filled .n, .slot.filled .text { background: rgba(246,245,241,.86); padding: 4px 8px; }
.slot input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; }

/* The number, painted on a plate. */
.plate {
  background: var(--plate); border: 3px solid var(--ink);
  padding: 18px 16px 14px; margin: 0 0 14px; text-align: center;
}
.plate input {
  font-family: var(--stencil); font-weight: 700; font-size: clamp(38px, 13vw, 54px);
  letter-spacing: .08em; text-align: center; width: 100%;
  background: none; border: 0; color: var(--ink); padding: 0; margin: 0;
  font-variant-numeric: tabular-nums;
}
.plate input:focus { outline: none; }
.plate.good { border-color: var(--moss); }
.plate.bad { border-color: var(--oxide); }
.plate.good { animation: stamp .18s ease-out; }
@keyframes stamp { from { transform: scale(1.035); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .plate.good { animation: none; } }

input, select { width: 100%; padding: 14px; background: var(--plate); border: 2px solid var(--steel); color: var(--ink); font-size: 16px; font-family: inherit; margin: 6px 0 16px; }
input:focus { outline: 2px solid var(--ink); outline-offset: -2px; border-color: var(--ink); }

button { width: 100%; min-height: 58px; font-size: 17px; font-weight: 600; font-family: inherit; border: 2px solid var(--ink); background: var(--plate); color: var(--ink); margin-bottom: 12px; }
button.primary { background: var(--signal); border-color: var(--ink); }
button.primary:disabled { background: var(--plate); color: #8b8f96; border-color: var(--steel); }
button.quiet { border: 0; background: none; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; font-weight: 500; }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.readings { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 14px; }
.readings th { text-align: left; font-weight: 600; color: #5d6168; padding: 7px 0; border-bottom: 1px solid var(--steel); }
.readings td { padding: 7px 0; border-bottom: 1px solid var(--steel); }
.readings td.code { font-family: var(--stencil); font-weight: 700; font-size: 19px; letter-spacing: .04em; text-align: right; }
.readings td.missing { text-align: right; color: #8b8f96; }

.msg { font-size: 14px; min-height: 22px; margin: 2px 0 10px; }
.msg.err { color: var(--oxide); font-weight: 600; }
.msg.ok { color: var(--moss); }

.field { display: block; font-size: 14px; font-weight: 600; margin-top: 4px; }
.switch { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--steel); font-size: 16px; }
.switch input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--ink); }

.log { list-style: none; padding: 0; margin: 0 0 20px; }
.log li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--steel); }
.log .code { font-family: var(--stencil); font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.log .when { display: block; font-size: 12px; color: #5d6168; font-family: var(--body); font-weight: 400; letter-spacing: 0; }
.log .failed { color: var(--oxide); font-weight: 600; }

#done .plate { margin-bottom: 20px; }
#done .plate .shot { font-family: var(--stencil); font-weight: 700; font-size: clamp(38px, 13vw, 54px); letter-spacing: .08em; }

.standby { font-size: 14px; color: #5d6168; text-align: center; margin: -4px 0 18px; }
