:root {
  color-scheme: light;
  --paper: oklch(95.5% 0.012 85);
  --ink: oklch(21% 0.012 60);
  --signal: oklch(86% 0.165 92);
  --red: oklch(56% 0.19 28);
  --green: oklch(50% 0.11 155);
  --soft-red: #fae9e4;
  --soft-green: #e7efe5;
  --soft-yellow: #fff1c4;
  --muted: #62594d;
  --line: #d8d0c3;
  --surface: #fffcf5;
  --radius: 9px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, label:has(input[type="checkbox"]) { cursor: pointer; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.masthead { background: var(--ink); color: var(--paper); border-bottom: 3px solid var(--signal); }
.mast-inner {
  width: min(100% - 36px, 1184px);
  min-height: 60px; margin: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.identity { display: flex; align-items: center; gap: 12px; }
.brand { font-size: 19px; font-weight: 800; white-space: nowrap; }
.demo {
  border: 1px solid #827666; padding: 3px 7px; color: #f5e8d4;
  border-radius: 3px; font-size: 12px; font-weight: 650; white-space: nowrap;
}
#language {
  min-height: 44px; padding: 0 3px 0 8px; border: 0; background: transparent;
  color: var(--signal); font-size: 13px; font-weight: 750; white-space: nowrap;
}
#language:focus-visible { outline-color: var(--signal); }
#navigation {
  position: fixed; z-index: 3; inset: auto 0 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 4px 8px max(6px, env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -3px 14px #1d18120b;
}
#navigation a {
  display: flex; justify-content: center; align-items: center; min-height: 48px;
  padding: 4px; border-radius: 5px; text-decoration: none;
  font-size: 14px; font-weight: 750; color: var(--muted); text-align: center;
}
#navigation a[aria-current] { background: var(--signal); color: var(--ink); }
html { scroll-padding-bottom: 75px; }
main { width: min(100% - 36px, 1184px); margin: 0 auto; padding: 24px 0 92px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: clamp(29px, 4vw, 39px); letter-spacing: -.035em; line-height: 1.15; }
.page-head p { color: var(--muted); margin: 7px 0 0; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px; min-width: 0;
}
.panel + .panel { margin-top: 12px; }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel-title h2, .panel h3 { margin: 0; letter-spacing: -.015em; font-size: 17px; }
.panel-title > span { font-size: 12px; color: var(--muted); text-align: right; }
.station-form { border-top: 3px solid var(--ink); }
label, .field-label { display: block; margin-bottom: 5px; font-weight: 750; font-size: 14px; }
input:not([type="checkbox"]), select, textarea {
  display: block; width: 100%; min-width: 0; min-height: 46px; padding: 8px 10px;
  border: 1px solid #a69b8a; border-radius: 5px; background: #fff;
  font-size: 16px;
}
textarea { resize: vertical; min-height: 76px; }
.scan-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  padding: 8px 13px; border: 1px solid transparent; border-radius: 5px;
  background: var(--signal); font-weight: 800; text-decoration: none;
}
.btn:hover { filter: brightness(.97); }
.btn.light { border-color: #a69b8a; background: var(--surface); }
.btn.danger { border-color: var(--red); color: var(--red); background: var(--surface); }
.wide { width: 100%; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.status { padding: 8px 10px; margin: 9px 0 0; border-left: 3px solid currentColor; font-size: 14px; }
.status:empty { display: none; }
.status.good { background: var(--soft-green); color: var(--green); }
.status.bad { background: var(--soft-red); color: var(--red); }
.status.warn { background: var(--soft-yellow); color: #604602; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; background: var(--paper); border-radius: 6px; margin-bottom: 12px; }
.mode button {
  min-height: 44px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; font-weight: 750; color: var(--muted);
}
.mode button[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); }
.fifo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.row strong { display: block; overflow-wrap: anywhere; }
.row small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.row .right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.chip {
  display: inline-block; padding: 2px 6px; border-radius: 3px;
  background: var(--paper); color: var(--muted); font-size: 12px; font-weight: 800;
}
.chip.good { background: var(--soft-green); color: var(--green); }
.chip.bad { background: var(--soft-red); color: var(--red); }
.chip.warn { background: var(--soft-yellow); color: #604602; }
.check-missed strong { color: var(--red); }
.clock-bar { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.clock-bar .clock { font-size: 18px; font-weight: 800; margin-left: 5px; }
.clock-bar button { font-size: 12px; padding-inline: 8px; }
.check-form { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 12px; }
.check-form textarea { margin-bottom: 9px; }
.check-label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 3px 0; }
.check-label input { width: 21px; height: 21px; margin: 0; accent-color: var(--green); flex: none; }
.dashboard-grid { display: grid; gap: 12px; }
.dashboard-grid .panel { margin: 0; }
.output {
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  border-top: 4px solid var(--signal); padding: 15px;
}
.output .panel-title > span { color: #e3d8c5; }
.output-data { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; margin: 6px 0 10px; }
.output-data > div + div { border-left: 1px solid #6e6354; padding-left: 11px; }
.output-data strong { display: block; font-size: clamp(35px, 8.5vw, 64px); line-height: 1.08; letter-spacing: -.045em; }
.output-data small { color: #e3d8c5; font-size: 12px; }
progress { display: block; width: 100%; height: 9px; border: 0; border-radius: 2px; appearance: none; background: #615649; }
progress::-webkit-progress-bar { background: #615649; border-radius: 2px; }
progress::-webkit-progress-value { background: var(--signal); border-radius: 2px; }
progress::-moz-progress-bar { background: var(--signal); border-radius: 2px; }
.issue-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.codes-bar { margin-bottom: 12px; }
.code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 15px; }
.code-heading { font-size: 16px; margin: 0 0 8px; }
.code-card {
  display: grid; justify-items: center; align-content: start; text-align: center; min-width: 0;
  margin: 0; padding: 10px 6px; background: white; border: 1px solid var(--line); border-radius: 5px;
}
.qr { width: 96px; height: 96px; image-rendering: pixelated; }
.code-card figcaption { font-size: 13px; font-weight: 750; }
.code-card code { display: block; font-size: 12px; color: var(--muted); }
@media (min-width: 750px) {
  html { scroll-padding-bottom: 0; }
  #navigation {
    position: static; grid-template-columns: repeat(6, auto); justify-content: start; gap: 5px;
    padding: 5px max(18px, calc((100% - 1184px) / 2)); box-shadow: none; border-top: 0; border-bottom: 1px solid var(--line);
  }
  #navigation a { padding-inline: 20px; min-height: 44px; }
  main { padding-bottom: 24px; }
  .operations-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 14px; }
  .code-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .output-data strong { font-size: clamp(42px, 5vw, 67px); }
}
@media (min-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1.16fr 1fr; gap: 14px; }
  .dashboard-grid .panel { padding: 16px 19px; }
  .dashboard-grid .panel-title h2 { font-size: 19px; }
  .dashboard-grid .row { padding-block: 8px; }
  .dashboard-grid .row small { font-size: 13px; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { color: #000; background: white; font-size: 12pt; }
  .masthead { background: white; color: #000; border-bottom: 1px solid #000; }
  .mast-inner, main { width: 100%; }
  .demo { color: #000; border-color: #000; }
  #navigation, #language, .codes-bar { display: none; }
  main { padding: 12px 0 0; }
  .page-head h1 { font-size: 26px; }
  .code-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .code-card { break-inside: avoid; border-color: #777; }
  .qr { width: 112px; height: 112px; }
}
.check-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.check-head .btn { font-size: 13px; }
@media (max-width: 749px) {
  .operations-grid { display: grid; gap: 12px; }
}
.dashboard-column { display: contents; }
.stock-summary { order: 1; }
.patrol-summary { order: 2; }
.issue-summary { order: 3; }
@media (min-width: 750px) {
  .dashboard-column { display: grid; gap: 12px; align-content: start; }
}
@media (min-width: 1100px) {
  .dashboard-column { gap: 14px; }
  main:has(.dashboard-grid) { padding-top: 17px; }
  main:has(.dashboard-grid) .page-head { display: flex; align-items: baseline; justify-content: space-between; }
  .dashboard-grid .row strong { font-size: 16px; }
}
.patrol-summary .row > div:first-child {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px;
}
@media (min-width: 1100px) {
  main:has(.dashboard-grid) { padding-bottom: 14px; }
  .dashboard-grid .panel { padding-block: 13px; }
}

/* Full-page evidence keeps the navigation below the captured content. */
html.full-capture body { display: flex; flex-direction: column; }
html.full-capture #navigation { position: static; order: 1; box-shadow: none; }
html.full-capture main { padding-bottom: 24px; }
@media (max-width: 749px) {
  html[lang="en"] #navigation { grid-template-columns: 1.18fr 1fr .75fr 1.14fr 1fr .93fr; }
  html[lang="en"] #navigation a { font-size: clamp(10px, 2.95vw, 13px); padding-inline: 2px; line-height: 1.15; }
}
@media (max-width: 350px) {
  .mast-inner { width: calc(100% - 24px); }
  .identity { gap: 6px; }
  .brand { font-size: 17px; }
  .demo { font-size: 11px; }
}

.photo-controls {
  border-top: 1px solid var(--line); margin: 12px 0; padding-top: 12px;
}
.photo-controls h4 {
  font-size: 14px; margin: 0 0 7px;
}
.photo-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-buttons .btn { font-size: 13px; }
.camera-box { margin: 10px 0; }
.camera-box video { display: block; width: 100%; max-height: 220px; margin-bottom: 8px; background: var(--ink); }
.patrol-photo {
  margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden;
}
.patrol-photo img { display: block; width: 100%; }
.patrol-photo figcaption { padding: 6px 8px; font-size: 12px; color: var(--muted); }
.saved-photo { margin-top: 8px; border-top: 1px solid var(--line); }
.saved-photo summary { min-height: 44px; padding: 10px 1px; cursor: pointer; font-weight: 750; }
.qc-summary .panel-title { align-items: center; flex-wrap: wrap; gap: 5px 9px; }
.qc-summary .panel-title .qc-label {
  color: var(--ink); background: var(--soft-yellow); border-radius: 3px; padding: 4px 7px;
  font-size: 13px; font-weight: 800; text-align: left;
}
.qc-summary dl { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 10px 0; }
.qc-summary dl > div { padding: 0 6px; text-align: center; }
.qc-summary dl > div + div { border-left: 1px solid var(--line); }
.qc-summary dt { font-size: 12px; color: var(--muted); }
.qc-summary dd { font-size: 25px; font-weight: 800; margin: 0; }
.qc-queue { display: grid; gap: 12px; margin-top: 12px; }
.qc-queue .panel { margin: 0; }
.qc-card img {
  display: block; width: 100%; border-radius: 4px; border: 1px solid var(--line);
}
.qc-card .qc-batch { color: var(--muted); font-size: 13px; margin: 6px 0 8px; }
.qc-review { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
@media (min-width: 750px) {
  .qc-queue { grid-template-columns: repeat(2, minmax(0,1fr)); align-items: start; }
}

.shot-mode [data-demo-control] { display: none !important; }
@media (max-width: 749px) and (min-height: 500px) {
  .shot-mode:not(.full-capture) .masthead { position: sticky; top: 0; z-index: 2; }
}
.clock-bar > div { color: var(--muted); font-size: 13px; }
.clock-bar .clock { color: var(--ink); font-size: 15px; font-weight: 750; }
.photo-image { position: relative; }
.shot-mode .legacy-file::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 65%; aspect-ratio: 416 / 34;
  background: #211b15;
}
.record-link { margin-top: 10px; }
.record-bar { margin-bottom: 13px; }
.record-bar .btn { font-size: 13px; }
.record-heading {
  margin: 0 0 16px; font-size: clamp(29px, 4vw, 39px); line-height: 1.15; letter-spacing: -.035em;
}
.record-heading:focus { outline: none; }
.qc-detail, .patrol-record { max-width: 640px; }
.record-status { margin: 0 0 12px; }
.record-items { margin-top: 15px; }
.record-items .row { padding-block: 12px; }
.record-items .row small:empty { display: none; }
.qc-card-main {
  display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; align-items: start;
}
.qc-card h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.qc-card img { aspect-ratio: 3 / 2; object-fit: cover; }
.qc-card .qc-batch { margin: 4px 0; }
.qc-card .btn { min-height: 44px; margin-top: 5px; padding: 3px 8px; font-size: 13px; }
.qc-card .chip { margin-right: 5px; }
.qc-detail .qc-label {
  display: inline-block; margin: 0 0 12px; padding: 4px 7px; border-radius: 3px;
  background: var(--soft-yellow); font-size: 13px; font-weight: 800;
}
.qc-detail img {
  display: block; width: 100%; aspect-ratio: 1.65; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--line);
}
.record-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 15px 0; }
.record-facts dt { font-size: 12px; color: var(--muted); }
.record-facts dd { font-weight: 750; margin: 2px 0 0; }

.shot-mode main.scrolled-capture { padding-bottom: 430px; }

@media (max-width: 749px) {
  .shot-mode:not(.full-capture) main:has(#warehouse-form) { padding-top: 18px; }
  .shot-mode:not(.full-capture) main:has(#warehouse-form) .row { padding-block: 6px; }
  .shot-mode:not(.full-capture) main:has(#warehouse-form) .page-head { margin-bottom: 12px; }
  .shot-mode .scrolled-capture .dashboard-grid .row { padding-block: 19px; }
}
@media (max-width: 749px) {
  .shot-mode:not(.full-capture) .qc-card { padding-block: 11px; }
}

@media (max-width: 749px) {
  .output-focus .panel { padding: 22px 18px; }
  .output-focus .output-data { margin-block: 23px; }
  .output-focus .output-data strong { font-size: 47px; }
  .output-focus .panel-title { margin-bottom: 13px; }
  .output-focus .panel-title h2 { font-size: 20px; }
  .output-focus .station-output .row { padding-block: 24px; }
}
