:root {
  color-scheme: light;
  --brand: #1f6f5c;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  --radius-sm: 10px;
  --pill: 999px;
  --accent: var(--brand);
  --accent-text: color-mix(in srgb, var(--brand) 72%, black);
  --accent-soft: color-mix(in srgb, var(--brand) 12%, white);
  --bg: #f6f8f8;
  --card: #ffffff;
  --ink: #212529;
  --muted: #6f7679;
  --line: #e1e6e7;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --error: #a3271f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent-text); }
.page { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
h1 { font-size: 24px; line-height: 1.25; margin: 4px 0 8px; }
h2 { font-size: 18px; margin: 0 0 8px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent-text); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.strong { font-weight: 600; }
.error { color: var(--error); }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; }
.btn { display: block; width: 100%; text-align: center; text-decoration: none; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); font: inherit; font-weight: 600; background: var(--card); color: var(--ink); cursor: pointer; margin-top: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent-text); font: inherit; text-decoration: underline; cursor: pointer; padding: 8px 0; }
.alt { text-align: center; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; text-align: center; margin-top: 12px; }
.dropzone.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone-title { font-weight: 600; color: var(--accent-text); }
.filename { color: var(--ink); font-weight: 600; }
.lines { list-style: none; padding: 0; margin: 16px 0; }
.line { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.line.is-on { border-color: var(--accent); background: var(--accent-soft); }
.line.is-ask { border-color: var(--warn); background: var(--warn-soft); }
.line.is-off .name { color: var(--muted); text-decoration: line-through; }
.line.is-unknown { border-style: dashed; }
.check { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.box { flex: none; width: 20px; height: 20px; border: 2px solid var(--muted); border-radius: calc(var(--radius-sm) / 2); }
.is-on .box { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }
.name { font-weight: 600; }
.source { display: block; font-size: 13px; color: var(--muted); margin: 2px 0 0 30px; }
.is-unknown .source { margin-left: 0; }
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0 30px; }
.chip { border: 1px solid var(--accent); color: var(--accent-text); background: var(--card); border-radius: var(--pill); padding: 4px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.search { margin-top: 8px; }
input[type=search], input[type=text], input[type=tel], select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--card); color: var(--ink); margin-top: 6px; }
.results { list-style: none; padding: 4px; margin: 6px 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); box-shadow: 0 6px 16px rgba(0, 0, 0, .06); }
.result { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; width: 100%; padding: 10px; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.result .muted { grid-column: 1; }
.result .add { grid-column: 2; grid-row: 1 / span 2; color: var(--accent-text); font-weight: 600; font-size: 14px; }
button.result:hover, button.result:focus { background: var(--accent-soft); outline: none; }
.result.is-added { cursor: default; opacity: .6; }
.quote { width: 100%; border-collapse: collapse; margin: 12px 0; }
.quote td, .quote th { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; }
.quote tfoot th { border-bottom: 0; font-size: 18px; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prep { padding-left: 20px; margin: 0; }
.prep li { margin-bottom: 6px; }
.reading { text-align: center; padding: 24px 0; }
.spinner { width: 36px; height: 36px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.order-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 16px 0 0; padding: 12px; border-radius: var(--radius-sm); background: var(--bg); }
.order-meta div { min-width: 0; }
.order-meta dt { font-size: 12px; color: var(--muted); }
.order-meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.warn { color: var(--warn); font-weight: 400; }
.reading-head { display: flex; gap: 16px; align-items: center; }
.preview { position: relative; flex: none; width: 96px; height: 128px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; }
.preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview.no-image img { display: none; }
.doc-icon { font-size: 12px; font-weight: 700; color: var(--muted); }
.preview img + .doc-icon { visibility: hidden; }
.preview.no-image .doc-icon { visibility: visible; }
.scanline { position: absolute; left: 0; right: 0; height: 24%; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 35%, transparent), transparent); animation: scan 1.8s ease-in-out infinite alternate; }
@keyframes scan { from { top: -24%; } to { top: 100%; } }
.reading-text { flex: 1; min-width: 0; }
.status { font-size: 18px; font-weight: 600; margin: 4px 0 10px; }
.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress span { display: block; width: 40%; height: 100%; border-radius: 4px; background: var(--accent); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.is-done .scanline, .is-done .progress { display: none; }
.ready-banner { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ready-banner p { margin: 0; }
.field { border: 0; padding: 0; margin: 16px 0 0; }
.field legend { padding: 0; margin-bottom: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--pill); font-size: 15px; }
.choice input:checked + span { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.saved { display: inline-block; margin-top: 12px; color: var(--accent-text); }
.summary-line { margin: 0; }
.change { margin-top: 12px; }
.change summary { cursor: pointer; color: var(--accent-text); font-size: 14px; }
.quote .subtotal td { color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; }
gmp-place-autocomplete { width: 100%; margin-top: 6px; color-scheme: light; background-color: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.address-current { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); }
.warn { color: var(--warn); }
.check .action { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.is-on .check .action { color: var(--accent-text); }
.is-ask .check .action { color: var(--warn); }
.lines-hint { margin: 16px 0 -8px; }
.summary-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-row .change { margin-top: 4px; }
.address-map { height: 220px; margin-top: 10px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.lines-hint .count { white-space: nowrap; }
.change-slot { margin-top: 12px; }
.change-slot summary { cursor: pointer; color: var(--accent-text); font-size: 14px; }
label.field { display: block; }
.slot-picker .choice span { min-width: 64px; text-align: center; }
.deal-tag { display: block; font-size: 11px; font-weight: 600; color: #1b7a43; line-height: 1.2; }
.choice.deal span { border-color: #7cc49a; }
.deal-note { color: #1b7a43; }
.slot-picker .hour-name { display: none; }
.slot-picker.tabbed .day-name { display: none; }
.slot-picker.tabbed .hour-name { display: inline; }
.page.page-wide { max-width: 1100px; }
.narrow { max-width: 420px; margin: 40px auto; }
.panel-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
input[type=password], textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; background: var(--card); color: var(--ink); margin-top: 6px; }
.agenda-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.week-nav { display: flex; gap: 6px; flex-shrink: 0; }
.week-nav .chip { text-decoration: none; }
.agenda { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.agenda-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.agenda-day.today { border-color: var(--accent); }
.agenda-day h2 { font-size: 14px; margin-bottom: 8px; }
.visit { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.agenda .visit { flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; }
.visit:hover { background: var(--accent-soft); }
.visit-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; }
.visit-main { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.visit-cancelled { opacity: .55; }
.visit-cancelled strong { text-decoration: line-through; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: var(--pill); background: var(--line); color: var(--ink); white-space: nowrap; }
.badge-requested { background: var(--warn-soft); color: var(--warn); }
.badge-confirmed { background: var(--accent-soft); color: var(--accent-text); }
.badge-completed { background: var(--line); color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions form { flex: 1; min-width: 180px; }
@media (max-width: 900px) {
  .agenda { grid-template-columns: 1fr; }
  .agenda-day { min-height: 0; }
}
.lab-header { display: flex; flex-direction: column; margin: 0 0 16px; }
.lab-name { font-size: 20px; font-weight: 700; }
.reading-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); margin-top: 12px; }
.reading-strip.is-warn { background: var(--warn-soft); color: var(--warn); }
.reading-strip .muted { flex-basis: 100%; }
.reading-strip .tick { color: var(--accent-text); font-weight: 700; }
.mini-spinner { width: 16px; height: 16px; flex-shrink: 0; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.center { text-align: center; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 18px; }
.booked-slot { font-size: 18px; font-weight: 600; margin: 4px 0 8px; }
.reading-strip > span:not(.tick):not(.mini-spinner):not(.muted) { flex: 1; min-width: 0; }

/* Lab-branded layout */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.topbar { border-top: 4px solid var(--brand); background: #fff; font-size: 13px; color: var(--muted); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; }
.topbar .tag { border: 1px solid var(--brand); color: var(--accent-text); padding: 2px 8px; font-weight: 600; font-size: 12px; text-decoration: none; border-radius: var(--radius-sm); }
.brandbar { background: #fff; border-bottom: 1px solid var(--line); }
.brandbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 16px; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
.brand img { max-height: 56px; max-width: 240px; }
.brand-name { font-size: 28px; font-weight: 700; color: var(--brand); letter-spacing: .3px; }
.brand-tagline { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-top: 4px; padding-top: 3px; border-top: 1px solid var(--brand); }
.help { font-size: 13px; text-align: right; color: var(--muted); text-decoration: none; }
.help strong { display: block; color: var(--ink); }
.hero { background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 78%, white)); color: #fff; }
.hero .wrap { padding-top: 26px; padding-bottom: 28px; }
.hero h1 { margin: 0; font-size: 26px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: #fff; }
.hero p { margin: 6px 0 0; max-width: 560px; }
.page { max-width: 680px; }
.steps { display: flex; gap: 6px; margin: 0 0 18px; }
.step { flex: 1; text-align: center; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #9aa3a5; }
.step::before { content: ""; display: block; height: 4px; background: var(--line); margin-bottom: 8px; border-radius: 2px; }
.step.done, .step.on { color: var(--accent-text); }
.step.done::before, .step.on::before { background: var(--brand); }
.card { border-top: 3px solid var(--brand); }
.card h1, .card h2 { color: var(--accent-text); text-transform: uppercase; letter-spacing: .3px; }
.card h1 { font-size: 21px; margin-top: 0; }
.card h2 { font-size: 17px; }
.agenda-day h2, .panel-bar h2 { text-transform: none; }
.btn { border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: .6px; font-size: 14px; }
.btn.primary { background: var(--brand); border-color: var(--brand); }
.sitefoot { background: #fff; border-top: 1px solid var(--line); margin-top: 8px; }
.sitefoot .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 16px; padding-bottom: 16px; font-size: 12px; color: var(--muted); }
.sitefoot a { color: var(--muted); }
@media (max-width: 560px) {
  .help { display: none; }
  .hero h1 { font-size: 21px; }
  .step span { display: none; }
}
.fasting { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 0; padding: 14px; border-left: 4px solid var(--brand); background: var(--accent-soft); }
.fasting-label { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--accent-text); font-weight: 600; }
.fasting strong { font-size: 22px; color: var(--ink); }

.route { list-style: none; margin: 0; padding: 0; }
.route-stop .visit { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: inherit; }
.route-stop.late .visit { border-color: #d98b8b; }
.route-leg { margin: 6px 0 6px 18px; padding-left: 10px; border-left: 2px dashed var(--line); }
.route-link { font-weight: 600; margin-left: 4px; }
.card .badge + h1 { margin-top: 10px; }
.panel-map { height: 360px; margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.facts + .panel-map { height: 260px; }
.lab-stop { background: var(--bg, #f7f9f9); border-style: dashed !important; }
.nurse-title { display: flex; align-items: center; gap: 8px; }
.nurse-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.tile strong { font-size: 26px; line-height: 1.1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.tile span { font-size: 14px; color: var(--muted); }
.nurse-visit h2 { text-transform: none; color: var(--ink); margin: 4px 0; }
.nurse-visit p { margin: 4px 0; }
.nurse-visit.is-done { opacity: .6; }
.nurse-visit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.nurse-visit-head .visit-time { font-size: 20px; }
.nurse-links { display: flex; gap: 16px; }
.nurse-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.nurse-actions form:first-child:nth-last-child(3) { grid-column: 1 / -1; }
.nurse-actions .btn { margin-top: 0; padding: 12px 8px; }
.nurse-status { font-weight: 600; color: var(--accent-text); }
.nurse-lab { margin: 0 4px 16px; }
