/* Phone first, gloves on: big targets (at least 56 px), high contrast for daylight. */
:root {
  --bg: #f4f5f6;
  --ink: #15191d;
  --muted: #5b6670;
  --bar: #1d2329;
  --accent: #f2b705;
  --ok: #1f7a3a;
  --bad: #b3261e;
  --card: #ffffff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
}
* { box-sizing: border-box; }
/* `hidden` must win over any display set by a class (.stack is display: grid). */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.bar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bar); color: #fff; padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
}
.brand { font-weight: 700; letter-spacing: .02em; }
.brand::before { content: ""; display: inline-block; width: 12px; height: 12px; background: var(--accent); margin-right: 8px; }
main { padding: 16px; max-width: 560px; margin: 0 auto; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.1rem; margin: 0 0 6px; }
.muted { color: var(--muted); }
.error { color: var(--bad); font-weight: 600; min-height: 1.4em; }
.stack { display: grid; gap: 12px; }
button { font: inherit; cursor: pointer; }
.big {
  min-height: 64px; width: 100%; border: 0; border-radius: 12px;
  background: var(--bar); color: #fff; font-size: 1.2rem; font-weight: 600;
}
.big:active { transform: scale(.98); }
.link { background: none; border: 0; color: inherit; text-decoration: underline; min-height: 48px; padding: 0 8px; }
main .link { color: var(--muted); display: block; margin: 16px auto 0; }
.dots { display: flex; justify-content: center; gap: 14px; margin: 8px 0; min-height: 22px; }
.dots span { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pad button {
  min-height: 72px; border: 2px solid #cfd5da; border-radius: 12px; background: var(--card);
  font-size: 1.6rem; font-weight: 600; color: var(--ink);
}
.pad button.go { background: var(--accent); border-color: var(--accent); }
.card { background: var(--card); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; border-left: 6px solid #cfd5da; }
.card .none { color: var(--muted); margin: 0; }
.brand { color: #fff; text-decoration: none; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; }
.small { font-size: .85rem; }
a.as-button { display: flex; align-items: center; justify-content: center; text-decoration: none; margin-top: 12px; }
.big.go, button.go { background: var(--accent); color: var(--ink); }
.field { display: grid; gap: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  font: inherit; min-height: 56px; padding: 10px 12px; border: 2px solid #cfd5da; border-radius: 10px; background: #fff; width: 100%;
}
.field textarea { min-height: 72px; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 56px;
  padding: 8px 0; border-top: 1px solid #e3e7ea; color: var(--ink); text-decoration: none;
}
.tag { font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #e3e7ea; white-space: nowrap; }
.tag.ok { background: var(--ok); color: #fff; }
.big-tag { display: block; text-align: center; padding: 18px; font-size: 1.1rem; border-radius: 12px; }
.check-row { border-top: 1px solid #e3e7ea; padding: 6px 0; }
.check {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; text-align: left;
  background: none; border: 0; padding: 4px 0; color: var(--ink);
}
.check .box {
  flex: 0 0 36px; height: 36px; border: 3px solid var(--ink); border-radius: 8px;
  display: grid; place-items: center; font-weight: 800; font-size: 1.3rem;
}
.check.on .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.check:disabled { opacity: .85; }
.note { margin: 0 0 4px 48px; font-style: italic; }
.check-row .link.small { margin: 0 0 0 40px; display: inline-block; min-height: 40px; }
.card.warn { border-left-color: var(--accent); }
.tag.bad { background: var(--bad); color: #fff; }
.test-row { border-top: 1px solid #e3e7ea; padding: 8px 0; }
.test-row.failed { border-left: 6px solid var(--bad); padding-left: 10px; margin-left: -16px; }
.row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.test-row p { margin: 4px 0; }
.fails { margin: 4px 0 0; padding-left: 20px; color: var(--bad); font-weight: 600; }
.fail-head { color: var(--bad); font-weight: 800; margin: 0; }
.live { min-height: 8px; }
.field.bad input { border-color: var(--bad); background: #fdecea; }
.field.bad span { color: var(--bad); }
.tick { display: flex; align-items: center; gap: 12px; min-height: 56px; font-weight: 600; }
.tick input { width: 28px; height: 28px; }
.note-edit { margin: 6px 0 8px; }
.note-edit textarea { font: inherit; min-height: 72px; padding: 10px 12px; border: 2px solid #cfd5da; border-radius: 10px; width: 100%; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big.light { background: #e3e7ea; color: var(--ink); }
.error ul { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }
.offline { margin: 0; padding: 10px 16px; background: #fff3cd; color: #7a4d00; font-weight: 700; border-bottom: 2px solid #d69e2e; }
.outbox { display: block; margin: 0; padding: 10px 16px; background: #e6f0fa; color: #1d4f7a; font-weight: 700; border-bottom: 2px solid #4a86b8; text-decoration: none; }
.outbox[hidden] { display: none; }
.outbox.bad { background: #fde8e8; color: var(--bad); border-bottom-color: var(--bad); }
.search { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 8px 0 12px; }
.search input { font: inherit; min-height: 56px; padding: 10px 12px; border: 2px solid #cfd5da; border-radius: 10px; }
.chart { width: 100%; height: auto; }
.key { font-weight: 700; margin-right: 10px; }
.key.c0 { color: #2b6cb0; } .key.c1 { color: #d69e2e; } .key.c2 { color: #2f855a; } .key.c3 { color: #6b46c1; } .key.fc { color: #b42318; }
.report p { margin: 3px 0; }
@media print {
  .bar, .no-print, .link { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
/* Piece labels: 2 × 4 in., two across and five down a letter page (the Avery 5163 / 5523 layout). */
.sheet, .label-page { display: grid; gap: 12px; }
.sheet { margin-top: 12px; }
.label { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; background: #fff;
  border: 1px dashed #b8c0c6; border-radius: 8px; padding: 8px; aspect-ratio: 2 / 1; max-width: 400px; overflow: hidden; }
.label .qr { height: 100%; max-height: 170px; aspect-ratio: 1; display: block; }
.label-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; line-height: 1.25; color: #000; }
.label-text span, .label-text strong { overflow-wrap: anywhere; }
.label-co { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; }
.label-no { font-size: 22px; line-height: 1.1; }
.label-tag { align-self: start; border: 1.5px solid #000; border-radius: 4px; padding: 0 4px; font-weight: 700; font-size: 11px; }
.label-hint { font-size: 9px; color: #444; }
@page labels { size: letter; margin: 0; }
@media print {
  main:has(.sheet) { padding: 0; max-width: none; margin: 0; }
  .sheet { page: labels; display: block; margin: 0; }
  .label-page { width: 8.5in; height: 11in; box-sizing: border-box; padding: 0.5in 0 0 0.15625in; display: grid;
    grid-template-columns: 4in 4in; grid-template-rows: repeat(5, 2in); column-gap: 0.1875in; row-gap: 0;
    break-after: page; overflow: hidden; }
  .label-page:last-child { break-after: auto; }
  .label { width: 4in; height: 2in; box-sizing: border-box; max-width: none; aspect-ratio: auto; border: none; border-radius: 0;
    padding: 0.14in 0.16in; gap: 0.14in; }
  .label .qr { height: 1.72in; max-height: none; }
}
.plain { list-style: none; padding: 0; margin: 6px 0; }
.plain li { padding: 3px 0; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.photos a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #e3e7ea; }
