.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:root {
  color-scheme: light;
  --bg: #fff;
  --surface: oklch(98.6% .003 255);
  --ink: oklch(23% .016 255);
  --muted: oklch(48% .022 255);
  --line: oklch(91% .009 255);
  --accent: #0866ed;
  --accent-hover: #0056ce;
  --soft: oklch(96% .019 255);
  --danger: oklch(46% .18 25);
  --danger-soft: oklch(97% .012 25);
  --radius: 10px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input { font: inherit; }
button, a, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: wait; opacity: .55; }
button, input { min-height: 48px; }
button, a, input { transition: background-color 180ms var(--ease), border-color 180ms var(--ease), color 180ms var(--ease); }
button:focus-visible, a:focus-visible, input:focus-visible, canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
a { color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.9px; font-weight: 650; }
h2 { font-size: 19px; line-height: 1.35; letter-spacing: -.35px; font-weight: 600; }
h3 { font-size: 17px; line-height: 1.4; font-weight: 600; }
.muted { color: var(--muted); }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.shell { max-width: 936px; margin: auto; padding: 0 40px max(32px, env(safe-area-inset-bottom)); }
.topbar { height: 100px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { position: relative; display: block; width: 218px; height: 44px; overflow: hidden; flex-shrink: 0; border-radius: 3px; }
.wordmark img { position: absolute; width: 246px; height: auto; left: -15px; top: 50%; transform: translateY(-50%); }
.text-button, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: transparent; color: var(--muted); padding: 10px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 550; text-decoration: none; }
.text-button:hover, .secondary:hover { background: var(--surface); color: var(--ink); }
.icon-button { width: 44px; min-height: 44px; padding: 12px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--surface); color: var(--accent); }
.login { max-width: 360px; margin: 112px auto 80px; }
.login form { margin-top: 32px; }
label { display: block; font-size: 14px; font-weight: 550; margin: 20px 0 8px; }
input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font-size: 16px; }
input:hover { border-color: oklch(78% .014 255); }
input:focus { border-color: var(--accent); }
.primary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--accent); color: var(--bg); padding: 14px 18px; border-radius: var(--radius); min-height: 50px; font-size: 15px; font-weight: 600; }
.primary:hover { background: var(--accent-hover); }
.primary:active { background: #004bb7; }
.login .primary { margin-top: 28px; justify-content: center; }
.error { color: var(--danger); margin-top: 12px; font-size: 14px; }
.error:empty { display: none; }
.notice, .message { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); font-size: 14px; margin: 20px 0; line-height: 1.6; }
.message { position: sticky; bottom: 16px; background: var(--bg); box-shadow: 0 4px 20px oklch(23% .016 255 / .07); }
.message.error { color: var(--danger); background: var(--danger-soft); }
.page-heading { padding: 38px 0 24px; }
.page-heading .eyebrow { margin-bottom: 8px; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 450; }
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.heading-row .icon-button { flex-shrink: 0; }
.date-range { margin-top: 10px; color: var(--muted); font-size: 14px; }
.route-navigation { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.route-navigation button { position: relative; padding: 0 0 12px; min-height: 44px; border-radius: 0; background: transparent; color: var(--muted); font-weight: 550; font-size: 14px; }
.route-navigation button:hover { color: var(--ink); }
.route-navigation button[aria-current="page"] { color: var(--accent); }
.route-navigation button[aria-current="page"]::after { content: ""; position: absolute; height: 2px; inset: auto 0 -1px; background: var(--accent); border-radius: 2px; }
.route-list { display: grid; gap: 16px; }
.route-card { display: block; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px 0; color: var(--ink); }
.route-card:hover { border-color: oklch(73% .065 255); background: oklch(99.4% .003 255); }
.route-card:active { background: var(--surface); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.4; font-weight: 550; padding: 5px 8px; background: var(--surface); border-radius: 6px; color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.active, .badge.submitted { background: var(--soft); color: #095bcf; }
.route-id { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.route-stops { display: grid; grid-template-columns: minmax(0, max-content) minmax(40px, 1fr) minmax(0, max-content); align-items: start; gap: 10px; }

.stop { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stop--start { text-align: left; }
.stop--end { text-align: right; }
.stop strong { display: block; font-size: 19px; font-weight: 550; line-height: 1.2; letter-spacing: -.35px; overflow-wrap: anywhere; color: var(--ink); }
.stop span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.2; }

.connector { display: flex; align-items: center; justify-content: center; color: oklch(73% .02 255); margin-top: 2px; }

.route-path-dots {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  width: 100%;
  height: 32px;
}
.route-path-curve {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.route-path-curve path {
  fill: none;
  stroke: #095bcf;
  stroke-width: 2.4px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.card-bottom { border-top: 1px solid var(--line); margin-top: 24px; padding: 14px 0; font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); }
.document-count { display: inline-flex; align-items: center; gap: 8px; }
.document-count .icon { width: 16px; height: 16px; flex-basis: 16px; }
.document-count.ready { color: #095bcf; }
.card-open { color: var(--muted); display: flex; }
.back { margin: 24px 0 8px -10px; padding-left: 8px; }
.detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0 32px; }
.detail-heading .route-reference { margin-top: 8px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; border-top: 1px solid var(--line); padding-top: 32px; }

.detail-route .stop strong { font-size: 24px; letter-spacing: -.65px; }
.detail-route .stop-marker { margin-top: 12px; }

.detail-route .connector .icon { display: none; }
.detail-route .connector::before { content: ""; width: 1px; height: 30px; background: var(--line); margin-left: 3px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.section-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.document-action { margin-bottom: 24px; }
.documents-empty { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 12px 0; }
.empty { padding: 64px 24px; text-align: center; }
.empty > .icon { width: 32px; height: 32px; color: var(--muted); margin-bottom: 16px; }
.empty p { color: var(--muted); margin: 10px auto 20px; max-width: 34ch; font-size: 14px; }
.file-row { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.file-meta { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.file-meta > .icon { color: var(--muted); margin-top: 2px; }
.file-row strong { overflow-wrap: anywhere; display: block; font-size: 14px; font-weight: 550; }
.file-row small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.file-row .secondary { color: var(--accent); flex-shrink: 0; padding: 10px 8px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.toolbar button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius); padding: 12px; color: var(--ink); font-size: 14px; font-weight: 550; }
.toolbar button:hover { background: var(--surface); border-color: oklch(78% .014 255); }
#picker { margin: -8px 0 24px; }
#picker .toolbar { margin: 0 0 10px; }
.picker-help { color: var(--muted); font-size: 12px; }
#draft-area:has(.draft) { margin-bottom: 24px; }
.draft-status { font-size: 12px; color: var(--muted); margin-top: -6px; }
.draft { padding: 16px 0 20px; }
.draft + .draft { border-top: 1px solid var(--line); }
.draft label { margin-top: 0; }
.draft input { margin-bottom: 12px; }
.pages { display: flex; gap: 12px; overflow-x: auto; padding: 0 0 12px; }
.page-thumb { flex: 0 0 112px; }
.page-thumb img { display: block; width: 112px; height: 144px; object-fit: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.page-thumb button { width: 100%; min-height: 44px; font-size: 12px; }
.page-thumb [data-crop] { display: block; padding: 0; min-height: 144px; }
.page-thumb .remove { color: var(--danger); background: transparent; border-radius: var(--radius); }
.page-thumb .remove:hover { background: var(--danger-soft); }
.draft-actions { display: flex; gap: 0 8px; flex-wrap: wrap; }
.draft-actions .secondary { font-size: 13px; padding: 10px 8px; color: var(--accent); }
.draft-actions [data-remove] { color: var(--muted); }
.upload-status { margin-top: 12px; color: var(--muted); font-size: 14px; }
progress { width: 100%; accent-color: var(--accent); height: 8px; }
#preview-area:not(:empty) { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 24px; }
#preview-area h2 { overflow-wrap: anywhere; }
.scanner-canvas { display: block; width: 100%; height: auto; background: var(--surface); touch-action: none; border-radius: 6px; }
.scanner-help { margin: 12px 0; color: var(--muted); font-size: 14px; max-width: 65ch; }
.scan-camera { display: flex; flex-direction: column; max-width: 540px; height: 70vh; height: min(70dvh, 760px); min-height: 420px; margin: 0 auto; overflow: hidden; border-radius: 14px; background: oklch(18% .02 255); }
.scan-camera-frame { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
/* Video and overlay are letterboxed identically, so the outline matches the preview. */
.scan-camera-frame video, .scan-camera-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.scan-camera-frame canvas { pointer-events: none; }
.scan-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.scan-flash.is-flashing { animation: scan-flash 420ms ease-out; }
@keyframes scan-flash { 0% { opacity: 0; } 15% { opacity: .85; } 100% { opacity: 0; } }
.scan-camera-info { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.scan-camera-info p { max-width: 100%; padding: 6px 12px; border-radius: 10px; background: oklch(18% .02 255 / .72); color: #fff; font-size: 13px; line-height: 1.4; text-align: center; }
.scan-camera-info p:empty { display: none; }
.scan-camera-controls { flex: 0 0 auto; display: flex; justify-content: center; padding: 14px 16px max(18px, env(safe-area-inset-bottom)); }
.scan-shutter { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 0; padding: 4px 16px; border-radius: 14px; background: transparent; color: #fff; font-size: 15px; font-weight: 600; }
.scan-shutter-ring { display: grid; place-items: center; width: 78px; height: 78px; border: 4px solid #fff; border-radius: 50%; }
.scan-shutter-ring::after { content: ""; width: 60px; height: 60px; border-radius: 50%; background: var(--accent); transition: transform 150ms var(--ease), background-color 150ms var(--ease); }
.scan-shutter:hover .scan-shutter-ring::after { background: var(--accent-hover); }
.scan-shutter:active .scan-shutter-ring::after { transform: scale(.86); }
.scan-shutter:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.scan-shutter:disabled { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .scan-flash.is-flashing { animation-duration: 1ms; } }
.scan-mode { width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: inherit; }
.scan-mode:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.page-status { display: block; font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0; }
.page-status.needs-review { color: var(--danger); }
.viewer { width: 100%; height: 65vh; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.image-viewer { width: 100%; max-height: 70vh; object-fit: contain; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preview-actions .secondary { color: var(--accent); }
.skeleton { height: 200px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap; }
@media (max-width: 700px) {
  .shell { padding-left: 24px; padding-right: 24px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 24px; }
  .documents-panel { border-top: 1px solid var(--line); padding-top: 24px; }
  
  
  .connector .icon { display: none; }
  .connector::before { content: ""; width: 1px; height: 22px; background: var(--line); }
  .file-row strong { font-size: 15px; }
  .file-row small { font-size: 13px; }
}
@media (max-width: 480px) {
  .shell { padding-left: 20px; padding-right: 20px; }
  .topbar { height: 84px; }
  .wordmark { width: 195px; height: 44px; }
  .wordmark img { width: 220px; left: -13px; }
  .logout { width: 44px; min-height: 44px; padding: 12px; margin-right: -8px; }
  .logout span { display: none; }
  h1 { font-size: 28px; }
  .login { margin: 72px auto 48px; }
  .login form { margin-top: 28px; }
  .page-heading { padding-top: 30px; }
  .route-card { padding: 18px 18px 0; }
  .card-top { margin-bottom: 20px; }
  .stop strong { font-size: 20px; }
  .card-bottom { margin-top: 20px; font-size: 13px; }
  .detail-heading { padding-bottom: 24px; }
  .detail-route .stop strong { font-size: 23px; }
  .badge, .route-id, .picker-help, .draft-status { font-size: 13px; }
  .page-thumb button, .draft-actions .secondary { font-size: 14px; }
  .back { margin-top: 16px; }
  .file-row { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

.connector.route-path-dots::before { display: none !important; }


