/* G2 styles. The look is the Skin Check demo (pitch deck): paper, black ink, 3px edges and one
   hi-vis orange. Dark mode uses the YardDog shop-board palette.
   Crew screens: large targets for gloves, high contrast for sun, one job per screen.
   Contrast (WCAG): see the notes on each token. Hi-vis orange is a fill only, never text. */

:root {
  --bg: #fafaf7;
  --panel: #ffffff;
  --panel2: #f1f0eb;
  --ink: #121212;            /* 17.9:1 on --bg */
  --muted: #55554f;          /* 7.2:1 on --bg */
  --inv-muted: #d6d6d0;      /* muted text on an --ink fill: 12.8:1 */
  --line: #d9d8d2;           /* dividers only: too faint for the edge of a control */
  --edge: #121212;           /* 3px edges of cards and controls */
  --accent: #f25c05;         /* hi-vis orange fill; --accent-ink on it is 5.6:1 */
  --accent-ink: #121212;
  --miss: #c2410c;           /* short: 5.2:1 on --panel */
  --wrong: #1d4ed8;          /* wrong bin or extra: 6.7:1 */
  --dmg: #a55300;
  --ok: #18703f;             /* 5.3:1 on --okbg */
  --okbg: #e2f3e9;
  --mark: #ffc72c;           /* the yellow patch; --mark-ink on it is 12:1 */
  --mark-ink: #121212;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --display: var(--font);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --tap: 64px;
  --radius: 8px;
  --border: 3px;
  color-scheme: light;
}
/* Dark: the YardDog board (asphalt, steel, seam, zinc, dust, safety orange). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101214; --panel: #1a1e22; --panel2: #22272d;
    --ink: #e8e5de; --muted: #9b958b; --inv-muted: #4a4740;
    --line: #30363d; --edge: #9b958b;
    --accent: #ff7a1a; --accent-ink: #151007;
    --miss: #ff4438; --wrong: #6ea8ff; --dmg: #ffb020;
    --ok: #46c877; --okbg: #163024;
    --mark: #ffb020; --mark-ink: #101214;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101214; --panel: #1a1e22; --panel2: #22272d;
  --ink: #e8e5de; --muted: #9b958b; --inv-muted: #4a4740;
  --line: #30363d; --edge: #9b958b;
  --accent: #ff7a1a; --accent-ink: #151007;
  --miss: #ff4438; --wrong: #6ea8ff; --dmg: #ffb020;
  --ok: #46c877; --okbg: #163024;
  --mark: #ffb020; --mark-ink: #101214;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.4 var(--font);
}
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
a { color: var(--ink); }
:focus-visible { outline: 4px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.error { color: var(--miss); font-weight: 700; }

/* Top bar: a hi-vis stripe, the name, the server state. */
header.top {
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px;
  min-height: 64px; padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg); color: var(--ink);
  border-top: 6px solid var(--accent);
  border-bottom: var(--border) solid var(--edge);
}
.title { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 26px; }
.brand {
  display: inline-flex; align-items: center; min-height: var(--tap);
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 26px;
}
.module { font-weight: 700; font-size: 22px; }
a.module { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--ink); text-decoration: none; }
.spacer { flex: 1; }
.health { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--muted); }
.health::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted);
}
.health.ok { color: var(--ink); }
.health.ok::before { background: var(--ok); }
.health.bad { color: var(--miss); }
.health.bad::before { background: var(--miss); }
/* Who is signed in, and Switch user. On a phone they take their own row. */
.who { display: flex; align-items: center; gap: 12px; }
.who-name { font-weight: 800; font-size: 18px; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .who { flex: 1 1 100%; justify-content: space-between; padding: 2px 0 10px; }
}
/* The shop of the person (migration 006), in the who area. A native select: phones and the
   MC51 open their full-screen list, which works with gloves. */
.who-shop { display: flex; align-items: center; gap: 8px; }
.who-shop label { display: flex; align-items: center; gap: 8px; }
.shop-label { font-weight: 700; }
.who-shop select {
  min-height: var(--tap); max-width: 14em; padding: 8px 12px;
  border: var(--border) solid var(--edge); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); font: 700 18px var(--font);
}
.shop-note { color: var(--miss); font-weight: 700; }
.shop-note:empty { display: none; }
.who { flex-wrap: wrap; }
.who-shop { flex-wrap: wrap; }
/* On a phone the who area is its own row: the name and Switch user stay on one line, and the
   shop takes the full width under them (a bigger target), with its note under it. */
@media (max-width: 560px) {
  .who-shop { order: 3; flex: 1 1 100%; }
  .who-shop label { flex: 1 1 auto; }
  .who-shop select { flex: 1 1 auto; max-width: none; }
  .shop-note { flex: 1 1 100%; }
}

/* Page */
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px; }

/* Buttons and inputs. Crew targets are at least --tap high, for gloves (CLAUDE.md rule 12). */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 16px;
  border: var(--border) solid var(--edge); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
  font: 700 18px/1.15 var(--font);
  cursor: pointer; touch-action: manipulation;
}
.button { text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:focus-visible { outline-color: var(--ink); }
button:disabled { cursor: not-allowed; }
.search input {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border: var(--border) solid var(--edge); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); font: 18px var(--font);
}
.search input::placeholder { color: var(--muted); opacity: 1; }

/* Home: the bin list (left) and the panel (right), as in the demo. */
.split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.side { display: grid; gap: 12px; min-width: 0; }
.hint { margin: 2px 0 0; color: var(--muted); }
.bin-nav h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 24px; margin: 12px 0 8px; }
.bin-nav h2 small { margin-left: auto; padding-left: 10px; font-size: 15px; font-weight: 700; color: var(--muted); }
.off-mark {
  margin-left: 10px; padding: 1px 8px; border: 2px solid var(--muted); border-radius: 999px;
  font-size: 14px; font-weight: 800; color: var(--muted);
}
/* A system color: a round dot next to the name. */
.swatch {
  display: inline-block; flex: none; width: .9em; height: .9em; margin-right: 8px;
  border: 2px solid var(--edge); border-radius: 50%; background: var(--panel2); vertical-align: -.08em;
}
.bin-nav h2:focus { outline: none; }
.bins { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bin {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 12px 16px;
  background: var(--panel); color: var(--ink); text-decoration: none;
  border: var(--border) solid var(--edge); border-radius: var(--radius);
  font-weight: 800; font-size: 19px;
  -webkit-tap-highlight-color: transparent;
}
.bin .label { min-width: 0; overflow-wrap: anywhere; }
.bin small { flex: none; font-size: 15px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.bin:hover { background: var(--panel2); }
.bin[aria-current="page"] { background: var(--ink); color: var(--bg); }
.bin[aria-current="page"] small { color: var(--inv-muted); }

/* Wide: the panel stays in view while the list scrolls, and scrolls inside itself when it is
   taller than the screen. Its minimum height is never more than its maximum: on a short
   screen (a phone turned sideways), min-height would win and push the end out of view. */
.panel {
  min-width: 0; padding: 18px 20px;
  min-height: min(420px, calc(100vh - 24px)); min-height: min(420px, calc(100dvh - 24px));
  background: var(--panel); border: var(--border) solid var(--edge); border-radius: var(--radius);
  position: sticky; top: 12px;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto;
}
.panel h2 { font-size: 28px; margin: 0 0 4px; overflow-wrap: anywhere; }
#panel-title:focus { outline: none; }
.panel h3 { font-size: 19px; margin: 18px 0 2px; }
.sub { margin: 0 0 8px; color: var(--muted); }
.big { margin: 4px 0 6px; font-size: 44px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.long { overflow-wrap: anywhere; }
.note { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 2.4em minmax(0, 1fr); gap: 10px; align-items: center;
  min-height: 52px; padding: 8px 0; border-top: 2px solid var(--line);
}
.row .qty { font-size: 24px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.row .what { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.row .name { min-width: 0; overflow-wrap: anywhere; }
/* The yellow patch with the black stencil text, as on the skin. */
.patch {
  flex: none; padding: 4px 8px; border: 2px solid #121212; border-radius: 4px;
  background: var(--mark); color: var(--mark-ink);
  font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.back { display: none; align-items: center; gap: 6px; min-height: var(--tap); margin: -8px 0 4px; font-weight: 700; text-decoration: none; }
.back span { font-size: 28px; line-height: 1; }

/* Sign-in screens: one job each, large targets. */
.screen { max-width: 520px; margin: 8px auto 0; display: grid; gap: 14px; }
.screen > p { margin: 0; }
.screen h1, .screen h2 { font-size: 28px; overflow-wrap: anywhere; }
.screen h1:focus, .screen h2:focus { outline: none; }
.screen-form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; font-weight: 700; }
.field input {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border: var(--border) solid var(--edge); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); font: 700 22px var(--font);
}
.problem { display: grid; gap: 10px; }
.problem .error { margin: 0; }
button.back-step { justify-self: start; border: none; background: none; padding: 0 8px 0 0; }
button.back-step span { font-size: 28px; line-height: 1; }
button.quiet { justify-self: start; font-size: 16px; }
.quiet-link { display: inline-flex; align-items: center; justify-self: start; min-height: var(--tap); font-weight: 700; }

/* The PIN pad: keys on the screen, no text field (no phone keyboard, no reader input). */
.pin { display: grid; gap: 16px; justify-items: center; width: 100%; }
.pin:focus { outline: none; }
.pin-dots { display: flex; gap: 14px; }
.pin-dots .dot { width: 22px; height: 22px; border: 3px solid var(--edge); border-radius: 50%; }
.pin-dots .dot.on { background: var(--ink); border-color: var(--ink); }
.pinpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 360px; }
.pinpad .key { min-height: 72px; font-size: 30px; font-weight: 800; -webkit-user-select: none; user-select: none; }
.pinpad .key.small { font-size: 18px; }

/* Phones and the C71: one column. The list and each bin are separate screens. */
@media (max-width: 760px) {
  .wrap { padding: 12px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.show-panel > .side { display: none; }
  .split:not(.show-panel) > .panel { display: none; }
  .panel { position: static; min-height: 0; max-height: none; overflow: visible; padding: 14px 16px; }
  .back { display: inline-flex; }
}

/* Maintenance: dense is fine (CLAUDE.md rule 12) */
.maint { font-size: 16px; }
.maint-nav { display: flex; flex-wrap: wrap; gap: 6px; max-width: 1100px; margin: 0 auto; padding: 12px 16px 0; }
.maint-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px;
  border: 2px solid var(--edge); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); font-weight: 700; text-decoration: none;
}
.maint-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.maint .screen { margin-top: 16px; }
.maint h2 { font-size: 20px; margin: 22px 0 6px; }
.maint input:not([type="checkbox"]):not([type="color"]):not(.field input) {
  min-height: 44px; padding: 6px 10px; font: 16px var(--font);
  border: var(--border) solid var(--edge); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
}
.maint input[type="color"] {
  width: 56px; min-height: 44px; padding: 2px;
  border: var(--border) solid var(--edge); border-radius: var(--radius); background: var(--panel);
}
.maint .system { margin: 18px 0 28px; }
.maint .system h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 22px; margin: 0 0 2px; }
.maint .system .table-wrap { margin: 10px 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.inline-form label { display: grid; gap: 4px; font-weight: 700; }
.mono { font-family: var(--mono); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
.check input { width: 20px; height: 20px; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data td { overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions .question { font-weight: 700; }
.chip { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; border: 2px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 700; }
.chip.off { color: var(--muted); }
.chip.locked { color: var(--miss); border-color: var(--miss); }
.chip.start { color: var(--dmg); border-color: var(--dmg); }
.result-box { margin: 16px 0; padding: 12px 16px; border: var(--border) solid var(--ok); border-radius: var(--radius); background: var(--okbg); }
.result-box h2 { margin-top: 0; }
.result-box h2:focus { outline: none; }
.big-code { font: 800 32px var(--mono); letter-spacing: .08em; }
table.logs td.nowrap { white-space: nowrap; }
table.logs button.event { padding: 2px 8px; border-width: 2px; font: 700 14px var(--mono); text-align: left; }
table.logs tr.details td { background: var(--panel2); }
table.logs pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.level { font-weight: 800; font-size: 13px; }
.level.error, .level.critical { color: var(--miss); }
.level.warning { color: var(--dmg); }
.level.info { color: var(--muted); }
.maint h1 { font-size: 28px; margin-bottom: 4px; }
.maint button, .maint .button { min-height: 44px; font-size: 17px; padding: 6px 14px; }
.maint select {
  min-height: 44px; padding: 6px 10px; font: 16px var(--font);
  border: var(--border) solid var(--edge); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
}
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.stat {
  min-width: 120px; padding: 8px 14px;
  background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius);
}
.stat b { display: block; font: 800 28px/1.1 var(--font); font-variant-numeric: tabular-nums; }
.stat.warn b { color: var(--dmg); }
.desc { margin: 4px 0 0; color: var(--muted); }
table.reads { width: 100%; border-collapse: collapse; background: var(--panel); font-variant-numeric: tabular-nums; }
table.reads th, table.reads td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.reads td.id { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
table.reads td.num, table.reads th.num { text-align: right; }
table.reads td { transition: background-color .6s; }
table.reads tr.new td { background: var(--okbg); }
.table-wrap { overflow-x: auto; border: 2px solid var(--edge); border-radius: var(--radius); }
.status-chip { padding: 2px 10px; border-radius: 999px; background: var(--panel2); border: 2px solid var(--line); }
.status-chip.listening { background: var(--okbg); color: var(--ok); border-color: var(--ok); }
.result { min-height: 1.4em; margin: 8px 0 12px; }
.result.pass { color: var(--ok); font-weight: 700; }
.result.fail { color: var(--miss); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  table.reads td { transition: none; }
}

/* Admin page (A1): the laptop test bar, Home cards, Readers steps */
.test-bar {
  max-width: 1100px; margin: 10px auto 0; padding: 8px 16px;
  background: var(--mark); color: var(--mark-ink); border-radius: var(--radius);
  font-weight: 800; letter-spacing: .02em;
}
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.page-head .muted { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.card {
  margin: 12px 0; padding: 10px 16px 12px;
  background: var(--panel); border: 2px solid var(--edge); border-radius: var(--radius);
}
.cards .card { margin: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.maint .card h2 { margin: 4px 0; font-size: 19px; }
.card .table-wrap { margin-top: 6px; }
.todo { list-style: none; margin: 6px 0 0; padding: 0; }
.todo li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  margin: 0 0 6px; padding: 6px 6px 6px 12px;
  border-left: 6px solid var(--dmg); background: var(--panel2); font-weight: 700;
}
.facts { margin: 6px 0 0; padding-left: 20px; }
.facts li { margin: 2px 0; }
.system-line { list-style: none; margin-left: -20px; }
.system-line .swatch { margin-right: 6px; vertical-align: -2px; }
.system-line .chip { margin-left: 6px; }
.state.ok { color: var(--ok); font-weight: 800; }
.steps { margin: 6px 0 0; padding-left: 24px; }
.steps li { margin: 6px 0 10px; }
.steps .inline-form { margin-top: 6px; }
dl.setup { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; align-items: baseline; margin: 8px 0; }
dl.setup dt { font-weight: 700; }
dl.setup dd { margin: 0; overflow-wrap: anywhere; }

/* Test tools (A2, laptop only) */
.device-list { display: grid; gap: 4px; margin: 6px 0; }
.check.device { font-weight: 400; }
.check.device b { font-weight: 800; }
.card .toolbar, .card .inline-form { margin: 8px 0; }

/* The hub (g2hub.org/): one big tile for each module. The main module is hi-vis. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
a.tile {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  min-height: 128px; padding: 16px 20px;
  border: var(--border) solid var(--edge); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); text-decoration: none;
}
a.tile.main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
a.tile.main:focus-visible { outline-color: var(--ink); }
.tile-name { font-size: 32px; font-weight: 800; line-height: 1.1; }
a.tile small { font-size: 17px; font-weight: 700; }
