:root {
  color-scheme: dark;
  --base: #202733;
  --deep: #171c24;
  --recess: #242b34;
  --plane-top: #444b54;
  --plane-low: #2a313b;
  --surface: #4b5562;
  --surface-low: #343d48;
  --blue-top: #496484;
  --blue-low: #2c4058;
  --line: #6e7479;
  --rim: #8290a0;
  --divider: #ffffff26;
  --text: #faf8f2;
  --muted: #d2d5d9;
  --accent: #f5d59a;
  --accent-light: #fff0cc;
  --danger: #ffd1c7;
  --grain: url("./grain.png");
  --fine-grain: url("./fine-grain.png");
  --panel: var(--fine-grain), linear-gradient(144deg, var(--plane-top), var(--plane-low));
  --control: var(--fine-grain), linear-gradient(145deg, var(--surface), var(--surface-low));
  --selected: var(--fine-grain), linear-gradient(173deg, var(--blue-top), var(--blue-low));
  --raised: inset 0 1px 0 #ffffff2e, inset 0 -2px 2px #0004, 0 3px 6px #0005;
  --well: inset 0 2px 5px #0007, inset 0 -1px 0 #ffffff18;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--base);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--grain), linear-gradient(145deg, var(--base), var(--deep));
}
button, input, select { font: inherit; color: inherit; }
button, select, .photo-picker { cursor: pointer; }
button, input:not([type="checkbox"], [type="radio"]), select, .photo-picker {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
button, .photo-picker {
  min-width: 48px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  line-height: 1.25;
  background: var(--control);
  box-shadow: var(--raised);
}
button:hover, .photo-picker:hover { border-color: var(--rim); }
button:active:not(:disabled) { box-shadow: var(--well); }
button:disabled { color: var(--muted); background: var(--recess); box-shadow: none; cursor: wait; }
button.primary {
  min-height: 52px;
  border-color: var(--accent);
  border-radius: 12px;
  color: var(--text);
  background: var(--selected);
  font-size: 1.125rem;
  font-weight: 670;
  letter-spacing: -.02em;
  text-shadow: 0 1px 2px #0006;
  box-shadow: inset 0 2px 2px #ffffff54, inset 0 -3px 3px #0004, 0 0 0 2px #0003, 0 1px 8px #fcd08140, 0 5px 7px #0006;
}
button.primary:hover { border-color: var(--accent-light); }
.primary svg { color: var(--accent); }
:focus-visible, .photo-picker:focus-within, .select-tool:focus-within {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
}
input:not([type="checkbox"], [type="radio"]), select {
  background: var(--recess);
  box-shadow: var(--well);
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 38px;
  background: var(--recess) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23d2d5d9' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E") right 12px center / 18px no-repeat;
}
.site-select { display: flex; position: relative; align-items: center; }
.site-select > svg { position: absolute; left: 12px; width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.site-select select { padding-inline-start: 39px; }
@media (forced-colors: active) {
  select { appearance: auto; background-image: none; }
}
input::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent);
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
}
button svg, .search svg, .empty svg, .tool-icon svg, .directory-icon svg, .notice-icon svg {
  width: 22px;
  height: 22px;
  flex: none;
}
h1, h2, h3, p, fieldset { margin: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(2.05rem, 3.5vw, 3.25rem); }
h2 { font-size: 1.62rem; }
h3 { font-size: 1.3rem; }
strong, b { font-weight: 660; }
p { margin-block: 10px; }
small, .muted, .serial, dt { color: var(--muted); }
small { display: block; font-size: 1rem; }
.serial, .group-count, .metric b { font-variant-numeric: tabular-nums; }
.serial, .group-count { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
aside {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  background: var(--fine-grain), linear-gradient(135deg, var(--plane-low), var(--deep) 85%);
  border-right: 1px solid var(--divider);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.65rem; font-weight: 730; letter-spacing: -.045em; }
.mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  gap: 2px;
  background: var(--accent);
  border-radius: 3px;
  transform: skewX(-7deg);
  box-shadow: inset 0 1px 0 #fff7, 0 2px 4px #0005;
}
.mark i { width: 4px; height: 16px; background: #263240; }
.mark i:nth-child(2) { height: 10px; }
nav { display: grid; gap: 4px; margin-top: 42px; }
nav button {
  justify-content: flex-start;
  gap: 12px;
  color: var(--muted);
  font-weight: 550;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
nav button:hover { border-color: var(--divider); background: var(--plane-low); }
nav button[aria-current="page"] { color: var(--accent); border-color: var(--divider); background: var(--control); box-shadow: var(--raised); }
.account { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--divider); }
.account-copy { min-width: 0; overflow-wrap: anywhere; }
.account strong { display: block; font-size: 1.125rem; line-height: 1.2; }
.account .network { display: none; }
.iconbtn { width: 48px; height: 48px; flex: none; gap: 0; padding: 0; border-radius: 50%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.directory-icon, .tool-icon {
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px;
  color: var(--muted); border: 1px solid #ffffff39; border-radius: 8px;
  background: linear-gradient(145deg, var(--surface), var(--recess));
  box-shadow: inset 0 1px 0 #ffffff20, 0 2px 3px #0004;
}
.notice-icon {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px;
  border-radius: 50%; background: #ffffff58; box-shadow: inset 0 1px 1px #fffd, 0 2px 3px #0004;
}
.notice-text { flex: 1 1 180px; }
.account .iconbtn { color: var(--accent); }
main { min-width: 0; padding: 24px clamp(22px, 4vw, 72px) 56px; }
.topline, .heading, .actions, .filters, .printbar, dialog header { display: flex; align-items: center; gap: 12px; }
.topline, .heading, .printbar, dialog header { justify-content: space-between; }
.topline { border-bottom: 1px solid var(--divider); color: var(--muted); padding-bottom: 16px; }
.network { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.network::before, .badge::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor;
}
.network::before { color: #b6d8ae; }
.network.off::before { color: var(--accent); }
.heading { margin: 28px 0 20px; gap: 10px; flex-wrap: wrap; }
.actions, .filters, .printbar { flex-wrap: wrap; }
.metrics, .panel, .table, .list, dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: var(--raised);
}
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { flex-direction: column; gap: 3px; align-items: start; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 16px 22px; }
.metric + .metric { border-left: 1px solid var(--divider); }
.metric:first-child { border-radius: 12px 0 0 12px; }
.metric:last-child { border-radius: 0 12px 12px 0; }
.metric[aria-pressed="true"] { background: var(--selected); box-shadow: inset 0 2px var(--accent); }
.metric span { color: var(--muted); }
.metric[aria-pressed="true"] span { color: var(--text); }
.metric b { font-size: 2.1rem; line-height: 1.12; letter-spacing: -.035em; }
.filters { margin: 20px 0 10px; gap: 9px; }
.filters select { max-width: 100%; }
.search { display: flex; flex: 1; align-items: center; min-width: min(200px, 100%); gap: 10px; padding-inline: 13px; background: var(--recess); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--well); color: var(--muted); }
.search input:not([type="checkbox"], [type="radio"]) { padding: 0; width: 100%; background: transparent; box-shadow: none; border: 0; border-radius: 0; color: var(--text); }
.search:focus-within { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.search input:focus-visible { outline: 0; }
.printbar { margin: 10px 0; color: var(--muted); }
.printbar label, .select-tool { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 48px; min-height: 48px; cursor: pointer; }
.printbar label { justify-content: flex-start; }
.table { padding-inline: 14px; }
.thead, .tr {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  overflow-wrap: anywhere;
}
.thead { color: var(--muted); font-weight: 600; }
.tr { border-top: 1px solid var(--divider); }
.identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.link { display: block; text-align: left; padding: 4px 2px; border: 0; box-shadow: none; background: transparent; overflow-wrap: anywhere; }
.link:hover strong { color: var(--accent-light); }
.link small { font-family: ui-monospace, Consolas, monospace; }
.tool-caption { display: none; }
.badge, .late {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 7px;
  border: 1px solid #ffffff29; border-radius: 6px; line-height: 1.25; background: var(--recess); color: var(--muted);
}
.badge.warehouse { color: #d0e6cd; background: #20342c; }
.badge.foreman { color: var(--accent-light); }
.badge.worker { color: #e2edfa; background: #283a4c; }
.badge.repair { color: var(--accent); background: #3c3428; }
.badge.lost, .late { color: var(--danger); background: #462e30; }
.late { margin-block: 2px; }
.overdue { border-inline-start: 3px solid var(--danger); padding-inline-start: 8px; }
.list { padding-inline: 16px; }
.list article { display: flex; align-items: center; gap: 12px; padding-block: 14px; overflow-wrap: anywhere; }
.list article + article { border-top: 1px solid var(--divider); }
.list article > div { flex: 1; min-width: min(150px, 100%); }
.list article button { margin-left: auto; }
.empty { display: flex; gap: 12px; align-items: center; padding: 17px; background: var(--recess); border: 1px solid var(--divider); border-radius: 10px; color: var(--muted); box-shadow: var(--well); }
.panel { max-width: 760px; padding: clamp(16px, 2vw, 26px); margin: 16px 0; overflow-wrap: anywhere; }
.panel h2 { margin-bottom: 14px; }
.panel form { max-width: 480px; }
.panel small { margin-top: 4px; }
hr { border: 0; border-top: 1px solid var(--divider); margin-block: 20px; }
.field { display: grid; gap: 7px; margin: 16px 0; min-width: 0; font-weight: 620; }
.field input, .field select, #photo-name { font-weight: 400; }
.field select, .field input:not([type="file"]) { width: 100%; }
.photo-picker { position: relative; justify-self: start; overflow: hidden; }
.photo-picker input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.photo { width: 50px; height: 50px; flex: none; object-fit: cover; border-radius: 50%; border: 1px solid #ffffff65; box-shadow: 0 2px 4px #0007; }
.error { color: var(--danger); }
.error:empty, #print, .scan-dock { display: none; }
.setup ol { margin: 0; padding-inline-start: 1.75rem; }
.setup li { padding: 8px 0 8px 4px; }
.setup li::marker { color: var(--accent); font-weight: 650; }
.setup li + li { border-top: 1px solid var(--divider); }
.setup li button { margin: 2px; }
dialog {
  color: var(--text);
  width: min(530px, calc(100% - 28px));
  max-height: calc(100dvh - 32px);
  padding: 22px;
  border-color: var(--rim);
  box-shadow: inset 0 1px 1px #ffffff47, 0 12px 32px #000a;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
}
dialog::backdrop { background: #080c119e; }
dialog header { margin-bottom: 12px; }
dialog header .iconbtn { background: transparent; border: 0; box-shadow: none; }
dialog header .iconbtn svg { width: 30px; height: 30px; padding: 5px; border: 1px solid var(--line); border-radius: 50%; background: var(--control); box-shadow: var(--raised); }
dialog form > .primary { width: 100%; margin-top: 8px; }
dialog form + button { margin-top: 12px; }
dl { margin: 14px 0; }
dl:empty { display: none; }
dl div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--divider); }
dd { margin: 0; text-align: right; }
.event .photo { width: min(100%, 320px); height: auto; border-radius: 8px; }
fieldset { min-width: 0; border: 1px solid var(--divider); border-radius: 10px; }
.camera { color: var(--text); background: var(--deep); text-align: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.camera video { display: block; width: 100%; max-height: 37vh; }
.camera span { display: block; padding: 12px; }
form[data-form="scan"] input { min-height: 56px; font-size: 1.25rem; }
#number-hint { margin: -5px 0 14px; }
.login { min-height: 100dvh; padding: clamp(16px, 4vw, 52px); display: grid; grid-template-rows: auto 1fr; background: var(--grain), radial-gradient(ellipse at 65% 10%, #303b49, var(--deep) 78%); }
.loginbrand { padding-bottom: 16px; border-bottom: 1px solid var(--divider); }
.login main { width: min(470px, 100%); align-self: center; justify-self: center; padding: clamp(22px, 4vw, 38px); margin-block: 32px; background: var(--panel); border: 1px solid var(--rim); border-radius: 16px; box-shadow: var(--raised), 0 12px 32px #0005; }
.login h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
.login .muted { margin: 10px 0 24px; }
.login .primary { width: 100%; margin-top: 8px; }
.rule { width: 40px; height: 4px; background: var(--accent); margin-bottom: 20px; border-radius: 2px; }
#notice:not(:empty) {
  display: flex; position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 20; align-items: center; gap: 10px; flex-wrap: wrap;
  width: max-content; max-width: min(calc(100% - 28px), 560px);
  padding: 12px 16px; border: 1px solid var(--accent-light); border-radius: 12px;
  color: #262a25; background: var(--fine-grain), linear-gradient(155deg, #ece3c9, #d4c9a9);
  box-shadow: inset 0 1px 1px #fffc, 0 2px 12px #fcd08133, 0 8px 17px #0008; overflow-wrap: anywhere;
}
#notice button { color: var(--text); }
.queue-strip { width: 100%; justify-content: flex-start; text-align: start; border-color: #85755b; background: linear-gradient(110deg, #393a3b, var(--deep)); color: var(--accent-light); box-shadow: inset 0 1px 0 #ffffff12; }
.tool-group { margin-top: 22px; }
.tool-group h2 { font-size: 1.32rem; }
.group-heading {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 8px;
}
.group-count {
  display: inline-grid; place-items: center; min-width: 26px; padding: 0 5px;
  border: 1px solid var(--divider); border-radius: 7px; color: var(--muted); background: var(--recess);
}
.queue-strip { min-height: 50px; font-weight: 500; }
.queue-strip svg { width: 20px; }
.queue-action { margin-left: auto; font-weight: 650; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.tool-face, .row-meta { display: flex; align-items: center; gap: 10px; }
.tool-copy { min-width: 0; }
.row-meta { flex-wrap: wrap; margin-top: 3px; gap: 4px 8px; font-weight: 400; }
.compact-status { display: none; }
.tool-icon svg { width: 26px; height: 26px; }
.dialog-title { display: flex; align-items: center; gap: 8px; }
.dialog-title > svg { width: 20px; height: 20px; flex: none; }
dialog:has(.specimen) .dialog-title { color: var(--muted); }
dialog:has(.specimen) .dialog-title h2 { font-size: 1rem; letter-spacing: normal; font-weight: 500; }
.specimen {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px; min-height: 120px; border: 1px solid var(--rim); border-radius: 12px;
  background: var(--fine-grain), radial-gradient(ellipse at 85% 38%, #43576b, #222d3a 84%);
  box-shadow: inset 0 1px 1px #ffffff3d, inset 0 -2px 2px #0005, 0 0 0 2px #65717b77, 0 4px 7px #0006;
}
.specimen::before, .specimen::after {
  content: ""; position: absolute; width: 11px; height: 11px; pointer-events: none; border: solid #b89762;
}
.specimen::before { inset: 7px auto auto 7px; border-width: 1px 0 0 1px; border-top-left-radius: 3px; }
.specimen::after { inset: auto 7px 7px auto; border-width: 0 1px 1px 0; border-bottom-right-radius: 3px; }
.specimen h2 { margin: 4px 0 8px; }
.specimen .tool-icon { width: 58px; height: 58px; color: var(--accent); }
.specimen .tool-icon svg { width: 34px; height: 34px; }
.card-actions { display: grid; gap: 11px; margin-top: 13px; }
.action-list {
  padding: 0 11px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--fine-grain), linear-gradient(140deg, var(--surface-low), var(--plane-low)); box-shadow: var(--raised);
}
.action-row { display: flex; align-items: center; position: relative; }
.action-row > svg { position: absolute; left: 2px; width: 22px; height: 22px; pointer-events: none; }
.action-row + .action-row { border-top: 1px solid var(--divider); }
.action-row button {
  width: 100%; min-height: 49px; padding: 10px 3px 10px 36px; text-align: left; justify-content: space-between;
  background: transparent; border: 0; border-radius: 6px; box-shadow: none; color: inherit;
}
.action-row button:hover { background: #ffffff09; }
.action-row.loss { color: var(--danger); }
.action-row button::after, .tool-face::after {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 4px;
  border: solid var(--muted); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg);
}
.tool-face::after { display: none; }
.history { margin-top: 20px; }
.history h3 { margin-bottom: 12px; }
.event { position: relative; padding: 0 0 14px 22px; margin: 0; }
.event:last-child { padding-bottom: 0; }
.event:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 14px; bottom: -6px; width: 1px; background: var(--rim); }
.event::before {
  content: ""; position: absolute; left: 2px; top: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--recess);
}
.event.pending::before { background: var(--recess); border: 1px solid var(--accent); }
.event p { margin: 3px 0; color: var(--muted); }
.event .photo { margin-top: 5px; }
.move-summary { display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin: 4px 0 18px; border-radius: 10px; background: var(--recess); border: 1px solid var(--divider); box-shadow: var(--well); }
.move-summary .serial { display: block; }
.move-summary .tool-icon { color: var(--accent); }
.worker-tiles { padding: 0; border: 0; }
.worker-tiles legend { font-size: 1.125rem; font-weight: 650; padding: 0; margin-bottom: 8px; }
.worker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.worker-tile {
  display: flex; position: relative; align-items: flex-start; flex-direction: column; gap: 9px;
  padding: 12px; min-height: 132px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--control); box-shadow: var(--raised); cursor: pointer; overflow-wrap: anywhere;
}
.worker-tile strong { font-size: 1.125rem; line-height: 1.2; }
.worker-tile input[type="radio"] {
  position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.worker-tile:has(:checked) { border-color: var(--accent); background: var(--selected); box-shadow: inset 0 1px 0 #ffffff3d, 0 0 0 2px #fcd08144, 0 3px 8px #0006; }
.worker-tile:focus-within { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.tile-check {
  display: grid; place-items: center; position: absolute; right: 10px; top: 11px; pointer-events: none;
  width: 21px; height: 21px; border-radius: 50%; border: 1px solid #abb5c0; background: var(--recess); box-shadow: var(--well);
}
.tile-check svg { width: 15px; height: 15px; stroke-width: 2.6; visibility: hidden; }
.worker-tile input:checked ~ .tile-check { background: var(--accent); color: #30291b; border-color: var(--accent-light); box-shadow: 0 1px 3px #0005; }
.worker-tile input:checked ~ .tile-check svg { visibility: visible; }
.portrait-fallback { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--rim); border-radius: 50%; background: var(--recess); color: var(--muted); }
.portrait-fallback svg { width: 25px; height: 25px; }
@media (min-width: 651px) and (max-width: 960px) {
  .layout { grid-template-columns: 186px minmax(0, 1fr); }
  aside { padding-inline: 12px; }
  main { padding-inline: 18px; }
  .thead, .tr { gap: 8px; }
}
@media (max-width: 650px), (pointer: coarse) and (max-width: 1024px) and (max-height: 520px) {
  :root { --tabs-height: 68px; --bottom: env(safe-area-inset-bottom, 0px); }
  .layout { display: block; }
  aside {
    position: static; height: auto; display: flex; flex-direction: row; align-items: center;
    gap: 12px; margin-inline: 16px; padding: max(8px, env(safe-area-inset-top)) 2px 8px;
    border: 0; border-bottom: 1px solid var(--divider); background: none;
  }
  aside .brand-name { display: none; }
  .account { flex: 1; min-width: 0; padding: 0; margin: 0; border: 0; }
  .account small { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
  .account .network { display: inline-flex; }
  .topline { display: none; }
  nav {
    position: fixed; inset: auto 0 0; z-index: 5;
    grid-template-columns: repeat(4, auto); align-content: start;
    margin: 0; padding: 4px 6px calc(4px + var(--bottom)); gap: 2px;
    height: calc(var(--tabs-height) + var(--bottom)); background: var(--grain), linear-gradient(var(--plane-low), var(--deep));
    border-top: 1px solid var(--divider);
  }
  nav button { min-width: 48px; min-height: 58px; flex-direction: column; justify-content: center; gap: 3px; font-size: 1rem; line-height: 1.15; padding: 3px 1px; letter-spacing: -.025em; }
  nav button[aria-current="page"] { background: linear-gradient(150deg, var(--surface-low), var(--recess)); }
  main { padding: 0 16px calc(var(--tabs-height) + var(--bottom) + 20px); }
  .heading { margin: 14px 0 10px; }
  .actions { gap: 8px; }
  .filters { margin: 10px 0; }
  .filters .search { flex-basis: 100%; }
  .filters select { flex: 1; }
  .metrics .metric { padding: 12px 8px; }
  .metric b { font-size: 1.65rem; }
  .metric span { text-align: left; }
  .list article { flex-wrap: wrap; }
  .thead { display: none; }
  .tr { position: relative; display: block; }
  .tr:first-of-type, .thead + .tr { border-top: 0; }
  .tr .link::after { content: ""; position: absolute; inset: 0; }
  .select-tool { position: relative; z-index: 1; }
  .row-site, .row-holder { display: none; }
  nav button:focus-visible { outline-offset: -3px; }
  .queue-strip { gap: 7px; padding-inline: 10px; }
  .table .link { flex: 1; min-width: 0; padding: 0; }
  .tool-copy { flex: 1; }
  .tool-copy strong { display: block; font-size: 1.125rem; line-height: 1.18; }
  .tool-face { min-height: 49px; }
  .tool-face::after { display: block; }
  .compact-status { display: inline-flex; flex-wrap: wrap; gap: 4px; }
  .desktop-status { display: none; }
  .assigned-row .tool-caption { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--divider); color: var(--muted); font-weight: 400; line-height: 1.28; }
  .tool-group .table { padding: 0 11px; }
  .tool-group:has(.assigned-row) .table { display: grid; gap: 9px; border: 0; background: none; box-shadow: none; padding: 0; }
  .tool-group .assigned-row { padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: var(--raised); }
  .tool-group .assigned-row.overdue { border-inline-start: 3px solid var(--danger); }
  .row-status > small { margin-top: 5px; color: var(--accent-light); }
  dialog:has(.specimen) header { margin-bottom: 6px; }
  .foreman-layout .catalog-scan { display: none; }
  .foreman-layout main { padding-bottom: calc(var(--tabs-height) + var(--bottom) + 90px); }
  .scan-dock {
    display: block; position: fixed; z-index: 4; inset: auto 0 calc(var(--tabs-height) + var(--bottom));
    padding: 8px 16px 12px; background: var(--grain), var(--deep);
  }
  .scan-dock button { width: 100%; min-height: 54px; }
  #notice:not(:empty) { bottom: calc(var(--tabs-height) + var(--bottom) + 8px); }
  body:has(.scan-dock) #notice:not(:empty) { bottom: calc(var(--tabs-height) + var(--bottom) + 76px); }
  dialog {
    position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; max-height: calc(100dvh - 12px);
    border-radius: 16px 16px 0 0; padding: 9px 16px max(16px, var(--bottom));
  }
  dialog::before { content: ""; display: block; width: 44px; height: 4px; margin: 0 auto 5px; border-radius: 4px; background: #b3b8bf; box-shadow: 0 1px 1px #0008; }
  dialog form > button[type="submit"] { position: sticky; bottom: 0; z-index: 1; }
}
@page {
  size: A4 portrait;
  margin: 8mm;
}
@media print {
  :root, body, #print {
    color-scheme: light;
    margin: 0;
    background: white;
    color: #000;
  }
  body > *:not(#print) {
    display: none !important;
  }
  #print {
    display: block;
  }
  .sheet {
    width: 194mm;
    height: 280mm;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(8, 35mm);
    break-after: page;
    page-break-after: always;
  }
  .sheet:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .label {
    padding: 1mm;
    display: flex;
    align-items: center;
    border: 0.15mm dashed #999;
    gap: 1mm;
    min-width: 0;
    overflow: hidden;
  }
  .label svg {
    fill: #000;
    width: 27mm;
    height: 27mm;
    flex: none;
  }
  .label div {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .label small,
  .label strong,
  .label span {
    display: block;
    color: #000;
  }
  .label small {
    font-size: 7pt;
  }
  .label strong {
    font-size: 8pt;
    line-height: 1.13;
    max-height: 12mm;
    overflow: hidden;
  }
  .label span {
    font: 7pt/1.1 monospace;
    margin-top: 1mm;
  }
}
