:root {
  --ink: #182c46;
  --muted: #52627a;
  --accent: #2459a2;
  --accent-ink: #ffffff;
  --canvas: #f3f6f8;
  --surface: #ffffff;
  --line: #d5dee7;
  --danger: #a1291b;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eaeff5;
    --muted: #a9b7c6;
    --accent: #7fb0ee;
    --accent-ink: #10202f;
    --canvas: #0e1720;
    --surface: #16222e;
    --line: #2c3d4d;
    --danger: #ff9d8f;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surface);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }
.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { margin: 0; font-weight: 700; letter-spacing: 0.01em; }
.lang { display: inline-flex; gap: 0.4rem; align-items: center; }
.wrap { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.6rem; }
h1[tabindex="-1"]:focus { outline: none; }
h1[tabindex="-1"]:focus-visible { outline: none; }
h2 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.lead { color: var(--muted); margin-top: 0; }
.banner {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.live { min-height: 1.4rem; margin: 0 0 0.5rem; color: var(--muted); }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input, select, textarea, button {
  font: inherit;
  color: inherit;
}
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
textarea { min-height: 6.5rem; resize: vertical; }
input[type="checkbox"] { width: 1.15rem; min-height: 1.15rem; height: 1.15rem; }
/* Radios are choices, not text fields: the generic 100% field rule above stretched every slot,
   waiting-list and prior-file radio into a 44 px box that pushed its label off-screen. */
input[type="radio"] { width: 1.15rem; min-height: 1.15rem; height: 1.15rem; padding: 0; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}
button.primary, .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
button.ghost, button.link {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  padding: 0.4rem 0.2rem;
  min-height: 40px;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.field { margin-bottom: 1rem; }
.field .hint { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0; }
.error { color: var(--danger); font-weight: 600; margin: 0.4rem 0; }
.note { color: var(--muted); font-size: 0.92rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.92rem; }
/* Standalone discovery page (staff.html): a plain stacked card, never a dashboard grid. */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
  margin: 0 0 1rem;
}
.panel h2 { margin-top: 0; }
.list { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 0.5rem; }
.list li { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.75rem; overflow-wrap: anywhere; }
.list a { font-weight: 600; }
.safety {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
}
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-size: 1.15rem; font-weight: 700; padding: 0; margin-bottom: 0.5rem; }
.cards { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 0.6rem; }
.cards li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.8rem 0.9rem;
}
.cards li.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.cards button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  text-align: left;
  display: block;
  width: 100%;
}
.cards .name { font-weight: 700; }
.conflict {
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.9rem;
  margin-bottom: 1rem;
  background: var(--surface);
}
/* Open windows at the review stage: one tappable chip per 30-minute slot, plus the waiting list. */
.slot-picker { border-top: 1px solid var(--line); margin-top: 0.9rem; padding-top: 0.6rem; }
.slot-picker h3 { font-size: 0.98rem; margin: 0.2rem 0; }
.slot-options { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.4rem 0; }
.slot-options .consent { margin: 0; border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.88rem; background: var(--surface); }
.slot-options .consent:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.consent { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; margin: 0.8rem 0; }
.consent input { flex: 0 0 auto; }
.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; }
.home-link { color: var(--muted); text-decoration: none; font-weight: 600; }
.home-link:hover { color: var(--accent); }
.prior fieldset { display: grid; gap: 0.4rem; margin: 1rem 0; }
.prior legend { font-size: 1.1rem; }
.prior label { display: flex; gap: 0.6rem; align-items: center; font-weight: 500; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.progress { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; padding: 0; margin: 0 0 1rem; color: var(--muted); font-size: 0.85rem; }
.progress li[aria-current="step"] { color: var(--accent); font-weight: 700; }
.progress li[data-done="true"] { color: var(--ink); }
.progress li[data-done="true"]::before { content: "✓ "; }
.stage { border: 0; padding: 0; margin: 0; }
.stage h2 { margin-top: 0; }
.review { display: grid; grid-template-columns: minmax(8rem, 0.6fr) minmax(0, 1.4fr); gap: 0.45rem 1rem; margin: 0.5rem 0 1rem; }
.review dt { color: var(--muted); font-size: 0.9rem; }
.review dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; counter-reset: step; padding: 0; margin: 1rem 0; display: grid; gap: 0.5rem; }
.timeline li { position: relative; padding: 0.6rem 0.8rem 0.6rem 2.4rem; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.timeline li::before { counter-increment: step; content: counter(step); position: absolute; left: 0.7rem; top: 0.55rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; border: 1px solid var(--line); }
.timeline li[data-done="true"] { color: var(--ink); }
.timeline li[data-done="true"]::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.timeline li[aria-current="step"] { color: var(--ink); font-weight: 700; border-color: var(--accent); }
.timeline li[aria-current="step"]::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.timeline li[data-upcoming="true"] { opacity: 0.75; }
.timeline .timeline-alert { border-color: var(--danger); color: var(--danger); font-weight: 700; }
.callback { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 0.7rem 0.9rem; background: var(--surface); font-weight: 600; }
.tracking-retention { font-size: 0.82rem; margin-top: 1.4rem; }
.notify-block { margin-top: 1rem; }
.notify-block .note { margin: 0.5rem 0 0; }
.status { font-size: 1.25rem; font-weight: 700; }
.pharmacy { font-weight: 600; }
/* Fiction label for a demonstration deployment (relay config `demoNotice`). */
.demo-notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
}
@media (max-width: 420px) {
  .wrap { padding: 1rem 0.75rem 3rem; }
  h1 { font-size: 1.35rem; }
  .actions button, .actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* A tracking capability is a long unbroken string; it must wrap instead of widening the page. */
#tracking-box p,
#tracking-link {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---- Staff discovery page: bright Québec-French paper surface, never a dark void ---- */
.discovery {
  --ink: #182c46;
  --muted: #52627a;
  --accent: #2459a2;
  --accent-ink: #ffffff;
  --canvas: #f3f6f8;
  --surface: #ffffff;
  --line: #d5dee7;
  --danger: #a1291b;
  --paper: #fffdf8;
  color-scheme: light;
}
.discovery .top { background: var(--surface); }
.discovery .brand { display: inline-flex; align-items: baseline; gap: 0.45rem; text-decoration: none; color: var(--ink); }
.discovery .brand small { font-weight: 500; color: var(--muted); font-size: 0.82rem; }
.discovery .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  line-height: 1;
}
.discovery .lang { flex-wrap: wrap; }
.discovery .lang a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 0.35rem 0.5rem; border-radius: 999px; }
.discovery .lang a:hover { color: var(--accent); }
.discovery .wrap { max-width: 56rem; padding-top: 2rem; }
.discovery h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); letter-spacing: -0.01em; }
.discovery .lead { max-width: 44rem; font-size: 1.05rem; }
.discovery .eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}
.discovery .section-title { margin: 1.6rem 0 0.8rem; font-size: 1.1rem; }
.discovery .actions { margin: 0.9rem 0 1.6rem; }
.discovery .panel.onboarding { background: var(--paper); border-radius: 18px; box-shadow: 0 10px 30px rgba(24, 44, 70, 0.08); }
.pharmacy-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.pharmacy-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 10px 26px rgba(24, 44, 70, 0.07);
}
.pharmacy-card-head { display: flex; align-items: center; gap: 0.5rem; }
.pharmacy-name { margin: 0; font-size: 1.12rem; line-height: 1.25; }
.pharmacy-facts { margin: 0; color: var(--muted); font-size: 0.92rem; }
.origin-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  overflow-wrap: anywhere;
}
.pharmacy-card .button.primary { margin-top: 0.35rem; }
.pharmacy-card .button.primary::after { content: none; }
