:root {
  --navy: #112747; --amber: #fbb03b; --ink: #15202e; --muted: #5d6a7c; --line: #dfe4ec; --bg: #f4f6f9; --card: #fff;
  --good: #1f8a4c; --bad: #c8372d; --warn: #9a6512;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
header.bar { background: var(--navy); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
header.bar b { font-size: 18px; } header.bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
header.bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 14px; }
main { max-width: 1000px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.card h2 .n { background: var(--navy); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: inline-grid; place-items: center; font-size: 13px; flex: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
button { font: inherit; border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer; background: var(--navy); color: #fff; font-weight: 600; }
button.alt { background: #e8ecf2; color: var(--ink); } button.amber { background: var(--amber); color: var(--navy); }
button.big { padding: 15px 20px; font-size: 17px; width: 100%; }
button:disabled { opacity: .45; cursor: default; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; } .seg button { background: #e8ecf2; color: var(--ink); font-weight: 500; padding: 8px 12px; }
.seg button.on { background: var(--good); color: #fff; } .seg button.on.no { background: var(--bad); }
.muted { color: var(--muted); font-size: 14px; } .small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fact { background: var(--bg); border-radius: 10px; padding: 8px 10px; } .fact span { display: block; font-size: 12px; color: var(--muted); }
.fact b { font-variant-numeric: tabular-nums; word-break: break-all; }
.list { display: grid; gap: 6px; } .item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg); border-radius: 8px; flex-wrap: wrap; }
.pill { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: #e8ecf2; color: var(--muted); white-space: nowrap; }
.pill.pass { background: #dff3e7; color: var(--good); } .pill.fail { background: #fbe3e1; color: var(--bad); } .pill.warn { background: #fdf0d9; color: var(--warn); }
.qrbox { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; } @media (max-width: 600px) { .qrbox { grid-template-columns: 1fr; } }
#qr { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); width: max-content; max-width: 100%; } #qr img, #qr svg { display: block; width: 220px; height: 220px; }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; } @media (max-width: 600px) { .photos { grid-template-columns: repeat(2, 1fr); } }
.slot { border: 2px dashed var(--line); border-radius: 12px; aspect-ratio: 3/4; display: grid; place-items: center; text-align: center; cursor: pointer; position: relative; overflow: hidden; color: var(--muted); font-size: 14px; padding: 6px; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } .slot.done { border-style: solid; border-color: var(--good); }
.slot .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(17,39,71,.8); color: #fff; font-size: 12px; padding: 3px; z-index: 1; }
.slot input { display: none; }
.grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.grade { text-align: left; background: #fff; color: var(--ink); border: 2px solid var(--line); font-weight: 500; display: grid; gap: 2px; position: relative; }
.grade b { font-size: 15px; } .grade .p { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.grade.on { border-color: var(--navy); background: #eef2f8; } .grade .ai { position: absolute; top: 6px; right: 8px; font-size: 11px; background: var(--amber); color: var(--navy); border-radius: 6px; padding: 1px 6px; font-weight: 800; }
.offer { background: var(--navy); color: #fff; border-radius: 14px; padding: 16px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.offer .amt { font-size: 34px; font-weight: 800; color: var(--amber); font-variant-numeric: tabular-nums; } .offer ul { margin: 0; padding-left: 18px; font-size: 14px; }
.err { color: var(--bad); font-size: 14px; } .ok { color: var(--good); font-weight: 600; }
table.recent { width: 100%; border-collapse: collapse; font-size: 14px; } table.recent td, table.recent th { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
/* label: DYMO 99014, 101 x 54 mm */
#labelSheet { display: none; }
.label { width: 101mm; height: 54mm; padding: 3mm 4mm; background: #fff; color: #000; font: 8.5pt/1.25 Arial, sans-serif; display: grid; grid-template-rows: auto auto auto 1fr; gap: .8mm; }
.label .t { font-size: 12pt; font-weight: 800; } .label .k { display: flex; justify-content: space-between; gap: 2mm; } .label .price { font-size: 13pt; font-weight: 800; }
.label svg { width: 100%; height: 14mm; }
@media print {
  @page { size: 101mm 54mm; margin: 0; }
  body { background: #fff; } body > *:not(#labelSheet) { display: none !important; }
  #labelSheet { display: block !important; }
}
/* customer page */
.cust main { max-width: 560px; }
.step { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cust h1 { font-size: 24px; margin: 4px 0 8px; } .cust ol { padding-left: 20px; margin: 8px 0; } .cust li { margin: 4px 0; }
.full { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.full .hint { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-weight: 600; padding: 0 16px; }
.touchgrid { position: fixed; inset: 0; z-index: 50; display: grid; background: #fff; touch-action: none; }
.touchgrid div { border: 1px solid #e3e7ee; } .touchgrid div.hit { background: #2fae63; }
video.cam { width: 100%; border-radius: 12px; background: #000; max-height: 50vh; object-fit: cover; }
.shotprev { max-width: 120px; border-radius: 8px; border: 1px solid var(--line); }
