:root {
  --ink: #172033;
  --ink-soft: #31415c;
  --muted: #66758b;
  --paper: #f4f5f7;
  --surface: #fff;
  --line: #d6dce5;
  --accent: #df6400;
  --accent-dark: #a94500;
  --accent-soft: #fff0e2;
  --navy: #0e1728;
  --blue-soft: #eaf2fb;
  --green: #26704b;
  --green-soft: #e4f3e9;
  --red: #a82d25;
  --red-soft: #fbeae8;
  --amber: #995300;
  --amber-soft: #fff3d8;
  --radius: 3px;
  --shadow: 0 14px 36px rgba(26, 40, 63, 0.08);
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  line-height: 1.05;
  letter-spacing: 0.005em;
}
h1 { margin-bottom: 10px; font-size: clamp(2.35rem, 5vw, 4.5rem); text-transform: uppercase; max-width: 18ch; }
h2 { margin-bottom: 10px; font-size: clamp(1.45rem, 3vw, 2.2rem); }
h3 { margin-bottom: 6px; font-size: 1.2rem; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid rgba(223, 100, 0, 0.45); outline-offset: 3px; }
.muted, .lede { color: var(--muted); }
.lede { max-width: 62ch; font-size: 1.02rem; }
.mono, .eyebrow, .status, .label-id { font-family: "IBM Plex Mono", Consolas, monospace; }
.eyebrow { margin-bottom: 8px; color: var(--accent-dark); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.text-link { color: var(--ink); font-weight: 700; text-underline-offset: 4px; }

.app-header {
  min-height: 78px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 12px max(20px, calc((100vw - 1440px) / 2));
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--accent); font-size: 1.5rem; font-weight: 900; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 1.55rem; letter-spacing: 0.04em; text-transform: uppercase; }
.brand-copy small { margin-top: 4px; color: #aebad0; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.main-nav { display: flex; justify-content: center; gap: 4px; }
.main-nav a { padding: 12px 10px; border-bottom: 2px solid transparent; color: #bec8d9; font-size: 0.9rem; font-weight: 700; text-decoration: none; transition: color 160ms, border-color 160ms, transform 160ms; }
.main-nav a:hover { color: #fff; transform: translateY(-1px); }
.main-nav a.active { color: #fff; border-color: var(--accent); }
.user-tray { display: flex; gap: 14px; align-items: center; }
.user-tray > span { display: grid; max-width: 180px; text-align: right; line-height: 1.2; }
.user-tray small { color: #aebad0; font-size: 0.7rem; }
.text-button { color: #fff; font-size: 0.82rem; font-weight: 700; text-decoration: none; border: 1px solid #44516b; padding: 8px 10px; }

.app-shell { width: min(1440px, 100%); min-height: calc(100vh - 150px); margin: 0 auto; padding: 44px 28px 72px; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(20px, calc((100vw - 1440px) / 2)); border-top: 1px solid var(--line); color: var(--muted); background: #fff; font-size: 0.76rem; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 28px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin-bottom: 6px; }
.page-heading .lede { margin-bottom: 0; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; border: 1px solid var(--ink); border-radius: var(--radius); color: var(--ink); background: #fff; font-weight: 750; text-decoration: none; transition: transform 140ms, box-shadow 140ms, background 140ms; }
.button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(23, 32, 51, 0.12); }
.button.primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary:hover { background: var(--ink); color: #fff; }
.button.danger { border-color: var(--red); color: #fff; background: var(--red); }
.button.large { min-height: 54px; padding-inline: 22px; font-size: 1rem; }
.button.full { width: 100%; }

.panel { border: 1px solid var(--line); border-top: 3px solid var(--ink); background: var(--surface); padding: 22px; box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.alert { margin-bottom: 20px; padding: 13px 16px; border-left: 4px solid; font-size: 0.9rem; }
.alert.error { color: #6f201a; border-color: var(--red); background: var(--red-soft); }
.alert.success { color: #1b5238; border-color: var(--green); background: var(--green-soft); }
.empty, .quiet-state { padding: 24px 8px; color: var(--muted); text-align: center; }
.helper { margin: 10px 0 0; color: var(--muted); font-size: 0.82rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.metric-card { min-height: 160px; display: grid; align-content: space-between; padding: 18px; border: 1px solid var(--line); border-top: 5px solid var(--ink); background: #fff; }
.metric-card.accent { border-top-color: var(--accent); background: var(--accent-soft); }
.metric-card.warn { border-top-color: var(--amber); background: var(--amber-soft); }
.metric-card span { color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.metric-card strong { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 3.75rem; line-height: 1; }
.metric-card small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 0.75fr); gap: 18px; }
.action-panel p { color: var(--muted); font-size: 0.88rem; }
.queue-list { display: grid; gap: 1px; margin: 18px 0; background: var(--line); }
.queue-list > a { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; padding: 11px; background: #fff; text-decoration: none; transition: background 140ms, padding-left 140ms; }
.queue-list > a:hover { padding-left: 15px; background: var(--accent-soft); }
.queue-list strong { display: block; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 0.78rem; }
.queue-list small { display: block; color: var(--muted); }
.locker, .locker-code { display: inline-grid; min-width: 30px; min-height: 30px; place-items: center; padding: 5px; border: 1px solid var(--ink); color: var(--ink); background: var(--amber-soft); font-family: "IBM Plex Mono", Consolas, monospace; font-weight: 700; }
.queue-title { margin-top: 24px; }
.core-list .locker { border-color: var(--red); background: var(--red-soft); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f8f9fb; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
td small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.72rem; }
.status { display: inline-flex; padding: 3px 7px; border: 1px solid var(--line); color: var(--ink); background: #fff; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.status-created { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.status-stored, .status-on_hold { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.status-pending_billing { border-color: var(--blue-soft); background: var(--blue-soft); color: var(--ink-soft); }
.status-to_discard, .status-not_found { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.status-discarded { color: #5e6878; background: #eceff3; }
.status-returned, .status-return_requested { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.core-mark { color: var(--red); font-weight: 800; }

.workflow-strip { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 14px; margin-top: 22px; padding: 22px; border: 1px solid var(--line); background: #fff; }
.workflow-strip div { display: grid; gap: 2px; }
.workflow-strip span { color: var(--accent); font-family: "IBM Plex Mono", Consolas, monospace; font-size: 0.68rem; font-weight: 700; }
.workflow-strip strong { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 1.25rem; text-transform: uppercase; }
.workflow-strip small { color: var(--muted); }
.workflow-strip i { position: relative; display: block; height: 2px; overflow: hidden; background: var(--line); }
.workflow-strip i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 28%; background: var(--accent); animation: route-progress 2.8s ease-in-out both; }

.tag-station { padding: 0; border-top-color: var(--accent); }
.form-section { margin: 0; padding: 22px; border: 0; border-bottom: 1px solid var(--line); }
.form-section legend { display: flex; align-items: center; gap: 9px; width: 100%; padding: 0 0 16px; font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 1.4rem; font-weight: 800; text-transform: uppercase; }
.form-section legend span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 0.78rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 0.78rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #aeb8c7; border-radius: 2px; color: var(--ink); background: #fff; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
.pay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.choice-card { position: relative; min-height: 78px; display: flex; gap: 10px; align-items: center; padding: 14px; border: 2px solid var(--line); background: #fff; transition: border-color 150ms, background 150ms, transform 150ms; }
.choice-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-card input { width: 18px; min-height: 18px; accent-color: var(--accent); }
.choice-card span { display: grid; }
.choice-card small { color: var(--muted); font-weight: 500; }
.check-field { flex-direction: row; align-items: center; min-height: 46px; }
.check-field input { width: 22px; min-height: 22px; }
.check-field span { display: grid; }
.check-field small { color: var(--muted); font-weight: 500; }
.form-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 22px; background: #f9fafc; }
.form-footer p { margin: 0; }
.print-button { min-width: 250px; }
.filter-panel { margin-bottom: 18px; padding: 15px; }
.filter-form { display: grid; grid-template-columns: minmax(220px, 2fr) 1fr 1fr auto; gap: 12px; align-items: end; }
.close-ro summary { display: flex; justify-content: space-between; align-items: center; list-style: none; }
.close-ro summary span { display: grid; }
.close-ro summary small { color: var(--muted); }
.close-ro summary b { font-size: 2rem; transition: transform 180ms; }
.close-ro[open] summary b { transform: rotate(45deg); }
.close-ro form { margin-top: 20px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr); gap: 18px; }
.detail-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0; }
.detail-list div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 0.75rem; }
.detail-list dd { margin: 0; font-weight: 650; }
.timeline-panel { margin-top: 18px; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 14px; padding-bottom: 22px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; top: 8px; bottom: -8px; left: 7px; width: 2px; background: var(--line); }
.timeline-dot { width: 16px; height: 16px; margin-top: 4px; border: 4px solid var(--accent-soft); border-radius: 50%; background: var(--accent); z-index: 1; }
.timeline li > div { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.timeline time { color: var(--muted); font-family: "IBM Plex Mono", Consolas, monospace; font-size: 0.72rem; text-align: right; }
.timeline p, .timeline small { grid-column: 1 / -1; margin: 0; }
.timeline small { color: var(--muted); }

.print-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.label-sheet { width: min(720px, 100%); margin: 0 auto; padding: 18px; border: 2px solid #000; background: #fffdf5; color: #000; box-shadow: var(--shadow); font-family: "IBM Plex Mono", Consolas, monospace; }
.label-tagline { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid #000; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.label-main { display: grid; grid-template-columns: 1fr 150px; gap: 18px; }
.label-id { margin: 0 0 12px; font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 800; }
.label-main dl { display: grid; margin: 0; }
.label-main dl div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 3px 0; border-bottom: 1px dashed #999; }
.label-main dt { color: #555; font-size: 0.68rem; text-transform: uppercase; }
.label-main dd { margin: 0; font-weight: 700; font-size: 0.82rem; }
.label-qr { display: grid; align-content: center; gap: 6px; text-align: center; }
.label-qr img { width: 150px; height: 150px; }
.label-qr span { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; }
.label-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 14px; padding: 10px; background: #000; color: #fff; }
.label-footer b { padding: 2px 7px; color: #000; background: #fff; }
.print-after { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }

.mode-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 3px solid var(--ink); }
.mode-tabs a { padding: 11px 16px; border: 1px solid var(--line); border-bottom: 0; color: var(--muted); background: #e9edf2; font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 1.15rem; font-weight: 800; text-decoration: none; text-transform: uppercase; }
.mode-tabs a.active { color: #fff; background: var(--ink); border-color: var(--ink); }
.floor-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr); gap: 18px; }
.scan-panel { border-top-color: var(--accent); }
.scan-form { display: grid; gap: 18px; margin-top: 22px; }
.scan-form label span { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 1.18rem; text-transform: uppercase; }
.scan-form input { min-height: 68px; border-width: 2px; font-size: 1.2rem; }
.count { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--accent); font-weight: 800; }
.lookup-result { margin-top: 20px; padding: 16px; border: 1px solid var(--line); background: #f9fafc; }
.lookup-result dl { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 0; }
.lookup-result dl div { display: grid; }
.lookup-result dd { margin: 0; font-weight: 800; }

.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.config-list, .compact-list { display: grid; gap: 1px; background: var(--line); }
.config-list > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; background: #fff; }
.config-list span { display: grid; }
.config-list small { color: var(--muted); }
.compact-list > span { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; background: #fff; }
details.panel, .admin-grid details { margin-top: 12px; }
details summary { color: var(--accent-dark); font-weight: 800; }
.admin-grid details[open] summary { margin-bottom: 16px; }
.form-stack { display: grid; gap: 14px; }

.qr-scan-field {
  position: relative;
  display: block;
  min-width: 0;
}

.qr-scan-field > input {
  padding-right: 58px;
}

.qr-scan-trigger {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #F2690D;
  border-radius: 2px;
  color: #FFFFFF;
  background: #F2690D;
  transform: translateY(-50%);
  transition: background 140ms, transform 140ms, opacity 140ms;
}

.qr-scan-trigger:hover {
  background: #C94D00;
  transform: translateY(-50%) scale(1.04);
}

.qr-scan-trigger svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.qr-scan-trigger[hidden] {
  display: none;
}

.qr-scanner-dialog {
  width: min(520px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  border: 0;
  color: #0B1424;
  background: transparent;
  overflow: visible;
}

.qr-scanner-dialog::backdrop {
  background: rgba(11, 20, 36, 0.82);
  backdrop-filter: blur(4px);
}

.qr-scanner-panel {
  padding: 18px;
  border-top: 5px solid #F2690D;
  background: #FFFFFF;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.qr-scanner-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.qr-scanner-heading h2 {
  margin: 0;
  font-size: 28px;
}

.qr-scanner-close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(11, 20, 36, 0.28);
  color: #0B1424;
  background: #FFFFFF;
  font-size: 28px;
  line-height: 1;
}

.qr-scanner-viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0B1424;
}

.qr-scanner-viewport video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.qr-scanner-reticle {
  position: absolute;
  inset: 14% 10%;
  pointer-events: none;
}

.qr-scanner-reticle i {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: #F2690D;
  border-style: solid;
}

.qr-scanner-reticle i:nth-child(1) {
  inset: 0 auto auto 0;
  border-width: 4px 0 0 4px;
}

.qr-scanner-reticle i:nth-child(2) {
  inset: 0 0 auto auto;
  border-width: 4px 4px 0 0;
}

.qr-scanner-reticle i:nth-child(3) {
  inset: auto auto 0 0;
  border-width: 0 0 4px 4px;
}

.qr-scanner-reticle i:nth-child(4) {
  inset: auto 0 0 auto;
  border-width: 0 4px 4px 0;
}

.qr-scanner-status {
  min-height: 26px;
  margin: 14px 0 0;
  color: #4A5468;
  font-size: 14px;
}

.login-layout { min-height: calc(100vh - 240px); display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(30px, 7vw, 100px); align-items: center; }
.login-story h1 { max-width: 14ch; }
.login-story > p:not(.eyebrow) { max-width: 52ch; color: var(--muted); font-size: 1.1rem; }
.login-card { padding: 30px; border-top-color: var(--accent); }
.route-line { max-width: 560px; display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; gap: 10px; align-items: center; margin-top: 35px; }
.route-line span { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-size: 1.1rem; font-weight: 800; text-transform: uppercase; }
.route-line i { height: 2px; background: var(--accent); transform-origin: left; animation: route-progress 1.4s ease-out both; }
.login-card h2 { font-size: 2rem; }

.reveal { opacity: 0; transform: translateY(14px); animation: reveal 520ms cubic-bezier(.2,.65,.25,1) forwards; }
.reveal:nth-child(2) { animation-delay: 70ms; }
.reveal:nth-child(3) { animation-delay: 140ms; }
.reveal:nth-child(4) { animation-delay: 210ms; }
@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes route-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 1080px) {
  .app-header { grid-template-columns: auto 1fr; }
  .main-nav { grid-column: 1 / -1; order: 3; justify-content: flex-start; overflow-x: auto; }
  .user-tray { justify-self: end; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .pay-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-form { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .detail-grid, .floor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { padding: 28px 14px 48px; }
  .app-header { padding: 10px 14px; }
  .user-tray > span { display: none; }
  .main-nav a { flex: 0 0 auto; padding: 9px 8px; }
  .page-heading, .print-toolbar, .form-footer { align-items: stretch; flex-direction: column; }
  .heading-actions { justify-content: stretch; }
  .heading-actions .button { flex: 1; }
  .metric-grid, .admin-grid, .form-grid, .detail-list { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .pay-grid { grid-template-columns: 1fr; }
  .filter-form { grid-template-columns: 1fr; }
  .workflow-strip { grid-template-columns: 1fr; }
  .workflow-strip i { width: 2px; height: 28px; margin-left: 17px; }
  .workflow-strip i::after { width: 100%; height: 35%; animation-name: vertical-progress; }
  .detail-list div { grid-template-columns: 95px 1fr; }
  .label-main { grid-template-columns: 1fr 110px; }
  .label-main dl div { grid-template-columns: 88px 1fr; }
  .label-qr img { width: 110px; height: 110px; }
  .label-footer { align-items: flex-start; flex-wrap: wrap; }
  .mode-tabs { overflow-x: auto; }
  .mode-tabs a { flex: 1 0 auto; text-align: center; }
  .login-layout { grid-template-columns: 1fr; padding-top: 16px; }
  .login-story h1 { font-size: 2.7rem; }
  .route-line { display: none; }
  .app-footer { flex-direction: column; }
}

@keyframes vertical-progress {
  from { transform: scaleY(0); transform-origin: top; }
  to { transform: scaleY(1); transform-origin: top; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* QanaFlow light-mode media kit */
:root[data-theme="light"] {
  --pearl: #0B1424;
  --navy-kit: #182339;
  --orange-kit: #F2690D;
  --gray-kit: #E6E6E6;
  --ink: #0B1424;
  --ink-soft: #4A5468;
  --muted: #4A5468;
  --paper: #FFFFFF;
  --surface: #F4F5F7;
  --surface-2: #EDEEF1;
  --line: rgba(11, 20, 36, 0.14);
  --line-soft: rgba(11, 20, 36, 0.08);
  --accent: #F2690D;
  --accent-dark: #C94D00;
  --accent-soft: #FFF2E9;
  --navy: #0B1424;
  --radius: 0;
  --shadow: none;
  --inter: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --jakarta: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="light"],
:root[data-theme="light"] body {
  background: #FFFFFF;
  color: #0B1424;
  font-family: var(--jakarta);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

:root[data-theme="light"] h1,
:root[data-theme="light"] h2,
:root[data-theme="light"] h3,
:root[data-theme="light"] .metric-card strong,
:root[data-theme="light"] .workflow-strip strong,
:root[data-theme="light"] .form-section legend,
:root[data-theme="light"] .mode-tabs a,
:root[data-theme="light"] .scan-form label span,
:root[data-theme="light"] .route-line span,
:root[data-theme="light"] .brand-copy strong {
  font-family: var(--inter);
}

:root[data-theme="light"] h1 {
  max-width: 18ch;
  font-size: clamp(34px, 4.4vw, 70px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

:root[data-theme="light"] h2 {
  font-size: clamp(24px, 2.7vw, 40px);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

:root[data-theme="light"] h3 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

:root[data-theme="light"] .lede {
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.6;
}

:root[data-theme="light"] .eyebrow,
:root[data-theme="light"] .button,
:root[data-theme="light"] .status,
:root[data-theme="light"] th,
:root[data-theme="light"] label,
:root[data-theme="light"] .main-nav a,
:root[data-theme="light"] .switch-label {
  font-family: var(--inter);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:root[data-theme="light"] .eyebrow {
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 0.15em;
}

:root[data-theme="light"] .mono,
:root[data-theme="light"] .status,
:root[data-theme="light"] .label-id,
:root[data-theme="light"] .metric-card span,
:root[data-theme="light"] .workflow-strip span,
:root[data-theme="light"] th,
:root[data-theme="light"] .locker,
:root[data-theme="light"] .locker-code,
:root[data-theme="light"] .queue-list strong {
  font-family: var(--mono);
}

:root[data-theme="light"] .app-header {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 240px;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  align-items: stretch;
  padding: 24px 14px 28px;
  overflow-y: auto;
  background: #0B1424;
  color: #E6E6E6;
  border: 0;
  border-right: 2px solid #F2690D;
}

:root[data-theme="light"] .brand {
  display: grid;
  gap: 18px;
  align-items: start;
  padding: 0 10px;
}

:root[data-theme="light"] .brand-logo {
  display: block;
  width: 150px;
  height: auto;
}

:root[data-theme="light"] .brand-copy {
  width: 100%;
  padding-top: 15px;
  border-top: 1px solid rgba(230, 230, 230, 0.13);
}

:root[data-theme="light"] .brand-copy strong {
  color: #E6E6E6;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

:root[data-theme="light"] .brand-copy small {
  color: #9AA4B4;
  font-family: var(--inter);
  font-size: 9.5px;
  letter-spacing: 0.14em;
}

:root[data-theme="light"] .main-nav {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 1px;
  justify-content: flex-start;
}

:root[data-theme="light"] .main-nav a {
  min-height: 39px;
  padding: 10px 12px;
  border: 0;
  border-left: 2px solid transparent;
  color: #9AA4B4;
  font-size: 11.5px;
  letter-spacing: 0.11em;
}

:root[data-theme="light"] .main-nav a:hover {
  color: #E6E6E6;
  background: rgba(230, 230, 230, 0.05);
  transform: none;
}

:root[data-theme="light"] .main-nav a.active {
  color: #E6E6E6;
  border-left-color: #F2690D;
  background: rgba(230, 230, 230, 0.05);
}

:root[data-theme="light"] .user-tray {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid rgba(230, 230, 230, 0.13);
}

:root[data-theme="light"] .user-tray > span {
  max-width: none;
  text-align: left;
}

:root[data-theme="light"] .user-tray small {
  color: #63708A;
}

:root[data-theme="light"] .text-button {
  width: fit-content;
  border-color: rgba(230, 230, 230, 0.2);
  color: #E6E6E6;
  font-family: var(--inter);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:root[data-theme="light"] .app-shell {
  width: calc(100% - 240px);
  max-width: none;
  min-height: calc(100vh - 76px);
  margin: 0 0 0 240px;
  padding: 48px clamp(24px, 4vw, 58px) 72px;
}

:root[data-theme="light"] .app-footer {
  margin-left: 240px;
  padding: 24px clamp(24px, 4vw, 58px);
  border-top-color: var(--line);
  color: #7C8697;
  background: #FFFFFF;
  font-family: var(--inter);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root[data-theme="light"] .page-heading {
  border-bottom: 1px solid var(--line);
  padding-bottom: 30px;
}

:root[data-theme="light"] .button {
  min-height: 40px;
  border-radius: 0;
  font-size: 10.5px;
}

:root[data-theme="light"] .button:hover {
  box-shadow: 3px 3px 0 rgba(11, 20, 36, 0.12);
}

:root[data-theme="light"] .button.primary {
  border-color: #F2690D;
  background: #F2690D;
}

:root[data-theme="light"] .button.primary:hover {
  background: #C94D00;
  border-color: #C94D00;
}

:root[data-theme="light"] .panel,
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .lookup-result {
  border-color: var(--line);
  border-top-color: #0B1424;
  border-radius: 0;
  background: #FFFFFF;
  box-shadow: none;
}

:root[data-theme="light"] .metric-card {
  border-top-width: 1px;
  border-left: 5px solid #0B1424;
  background: #F4F5F7;
}

:root[data-theme="light"] .metric-card.accent {
  border-left-color: #F2690D;
  background: #F4F5F7;
}

:root[data-theme="light"] .metric-card.warn {
  border-left-color: #182339;
  background: #EDEEF1;
}

:root[data-theme="light"] .metric-card span {
  color: #4A5468;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

:root[data-theme="light"] .metric-card strong {
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 900;
}

:root[data-theme="light"] .metric-card small,
:root[data-theme="light"] td small,
:root[data-theme="light"] .helper {
  color: #7C8697;
}

:root[data-theme="light"] th {
  border-bottom-color: var(--line);
  color: #7C8697;
  background: #F4F5F7;
  font-size: 9.5px;
  letter-spacing: 0.12em;
}

:root[data-theme="light"] td {
  border-bottom-color: var(--line-soft);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  border-color: rgba(11, 20, 36, 0.28);
  border-radius: 0;
  background: #FFFFFF;
}

:root[data-theme="light"] .tag-station,
:root[data-theme="light"] .scan-panel,
:root[data-theme="light"] .login-card {
  border-top-color: #F2690D;
}

:root[data-theme="light"] .choice-card:has(input:checked) {
  border-color: #F2690D;
  background: #F4F5F7;
}

:root[data-theme="light"] .form-footer {
  background: #F4F5F7;
}

:root[data-theme="light"] .form-section legend span {
  border-radius: 0;
  background: #0B1424;
}

:root[data-theme="light"] .workflow-strip {
  border-color: var(--line);
  background: #F4F5F7;
}

:root[data-theme="light"] .workflow-strip i::after,
:root[data-theme="light"] .route-line i {
  background: #F2690D;
}

:root[data-theme="light"] .status-created,
:root[data-theme="light"] .status-to_discard,
:root[data-theme="light"] .status-not_found {
  border-color: #F2690D;
  color: #C94D00;
  background: #FFF2E9;
}

:root[data-theme="light"] .status-stored,
:root[data-theme="light"] .status-on_hold {
  border-color: #182339;
  color: #182339;
  background: #F4F5F7;
}

:root[data-theme="light"] .mode-tabs {
  border-bottom-color: #0B1424;
}

:root[data-theme="light"] .mode-tabs a {
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
}

:root[data-theme="light"] .mode-tabs a.active {
  background: #0B1424;
  border-color: #0B1424;
}

:root[data-theme="light"] .login-layout {
  min-height: calc(100vh - 230px);
}

:root[data-theme="light"] .login-story h1 {
  font-size: clamp(38px, 5vw, 70px);
}

:root[data-theme="light"] .login-card h2 {
  font-size: 30px;
}

:root[data-theme="light"] .login-card .button {
  background: #F2690D;
}

:root[data-theme="light"] .label-sheet {
  border-color: #0B1424;
}

:root[data-theme="light"] :focus-visible {
  outline-color: #F2690D;
}

@media (max-width: 860px) {
  :root[data-theme="light"] .app-header {
    position: static;
    width: auto;
    height: auto;
    display: flex;
    padding: 18px 14px;
    border-right: 0;
    border-bottom: 2px solid #F2690D;
  }

  :root[data-theme="light"] .brand {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  :root[data-theme="light"] .brand-copy {
    width: auto;
    padding: 0 0 0 16px;
    border-top: 0;
    border-left: 1px solid rgba(230, 230, 230, 0.13);
  }

  :root[data-theme="light"] .main-nav {
    flex-direction: row;
    flex-wrap: wrap;
    overflow-x: auto;
  }

  :root[data-theme="light"] .main-nav a {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }

  :root[data-theme="light"] .main-nav a.active {
    border-left-color: transparent;
    border-bottom-color: #F2690D;
  }

  :root[data-theme="light"] .user-tray {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-top: 0;
  }

  :root[data-theme="light"] .app-shell {
    width: 100%;
    min-height: calc(100vh - 240px);
    margin-left: 0;
    padding: 34px 20px 56px;
  }

  :root[data-theme="light"] .app-footer {
    margin-left: 0;
    padding: 20px;
  }
}
