/* PostWatchHQ / EMS (ADR-0028). The same layout as the PostWatch/HQ sign-in and header; only the colours differ.
   Police is red and blue. EMS is blues, white and navy, with no red.
   Night: PostWatch's navy with softer text, so a screen in a dark ambulance doesn't glare.
   Day: whites and light blues. "Auto" follows the device; Day and Night are set by the switch. */

:root {
  color-scheme: light;
  --page: #eaf2fb;
  --card: #ffffff;
  --card-2: #f4f8fd;
  --line: #c9daee;
  --text: #0b1f3f;
  --muted: #4d6482;
  --blue: #1f6fd6;
  --blue-solid: #1f6fd6;
  --blue-hover: #1859ad;
  --on-blue: #ffffff;
  --field: #ffffff;
  --focus: #0b3d91;
  --error-bg: #fdecea;
  --error-line: #b3261e;
  --error-text: #8c1d18;
  --pulse: #1f6fd6;
  --shadow: 0 14px 40px rgba(31, 79, 140, 0.14);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* Night values: used when Night is chosen, or when the device is dark and nothing is chosen. */
:root[data-theme="night"] {
  color-scheme: dark;
  --page: #0b1626;
  --card: #132238;
  --card-2: #0f1b2d;
  --line: #2a4060;
  --text: #d3deec;
  --muted: #94a6bd;
  --blue: #7fb1f7;
  --blue-solid: #2f66c4;
  --blue-hover: #3b78e7;
  --on-blue: #e8f0fb;
  --field: #0b1626;
  --focus: #9cc4ff;
  --error-bg: rgba(127, 177, 247, 0.12);
  --error-line: #7fb1f7;
  --error-text: #d3deec;
  --pulse: #4fa3ff;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --page: #0b1626;
    --card: #132238;
    --card-2: #0f1b2d;
    --line: #2a4060;
    --text: #d3deec;
    --muted: #94a6bd;
    --blue: #7fb1f7;
    --blue-solid: #2f66c4;
    --blue-hover: #3b78e7;
    --on-blue: #e8f0fb;
    --field: #0b1626;
    --focus: #9cc4ff;
    --error-bg: rgba(127, 177, 247, 0.12);
    --error-line: #7fb1f7;
    --error-text: #d3deec;
    --pulse: #4fa3ff;
    --shadow: none;
  }
}

/* Which colouring of the logo shows. */
html .for-night { display: none; }
:root[data-theme="night"] .for-day { display: none; }
:root[data-theme="night"] .for-night { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .for-day { display: none; }
  :root[data-theme="auto"] .for-night { display: block; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 16px/1.5 var(--font); }
h1, h2 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button, input { font: inherit; }

/* ---------- sign-in and set-up: a card under the logo, as in PostWatch/HQ ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(440px, 100%); padding: 32px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.login-logo { display: block; width: 100%; max-width: 330px; height: auto; margin-bottom: 22px; }
.tenant {
  display: flex; flex-direction: column; gap: 1px; margin-bottom: 20px; padding: 10px 12px;
  background: var(--card-2); border: 1px solid var(--line); border-left: 4px solid var(--blue-solid); border-radius: 6px;
}
.tenant-kind { color: var(--blue); font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.tenant-name { font-weight: 600; }
.login-card h1 { font-size: 1.4rem; }
.step { margin: 0 0 6px; color: var(--blue); font-weight: 600; font-size: .9rem; }

.fields label { display: block; margin: 14px 0 5px; font-weight: 600; font-size: .92rem; }
.fields input:not([type="hidden"]) {
  width: 100%; padding: 9px 11px; min-height: 44px;
  background: var(--field); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
}
.primary {
  width: 100%; margin-top: 22px; padding: 11px; min-height: 46px;
  border: 1px solid var(--blue-solid); border-radius: 6px; background: var(--blue-solid); color: var(--on-blue);
  font-weight: 600; cursor: pointer;
}
.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.login-error {
  margin-top: 16px; padding: 9px 12px; color: var(--error-text);
  background: var(--error-bg); border: 1px solid var(--error-line); border-radius: 6px;
}
.login-note { margin: 18px 0 0; color: var(--muted); font-size: .86rem; text-align: center; }
.hint { margin: 6px 0; color: var(--muted); font-size: .88rem; }
/* ---------- the Admin portal (ADR-0028 Amendment 15) ---------- */
.admin-tabs { display: flex; gap: 6px; margin: 14px 0 0; }
.admin-tabs a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .9rem; text-decoration: none; }
.admin-tabs a[aria-current="page"] { background: var(--blue-solid); border-color: var(--blue-solid); color: var(--on-blue); }
.admin-sum { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 0; color: var(--muted); }
.admin-sum b { color: var(--text); font-size: 1.15rem; }
.part { margin-top: 10px; }
.perm-list { margin: 16px 0 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 6px; }
.perm-list legend { padding: 0 6px; font-weight: 600; font-size: .92rem; }
.fields .perm { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 7px 0; font-weight: 400; }
.fields .perm input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; padding: 0; flex: none; accent-color: var(--blue-solid); }
.perm-what { display: block; color: var(--muted); font-size: .86rem; }
.pick { margin-top: 12px; }
.pick summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.fields .admin-go { width: auto; min-width: 180px; padding: 11px 26px; }
.invite-link { user-select: all; font-size: .92rem; }
.hint-list { margin: 10px 0 16px; padding-left: 20px; color: var(--muted); font-size: .92rem; }
.hint-list li { margin: 4px 0; }

/* The square a phone scans to add the authenticator. Black on white whatever the page's colours. */
.qr { width: min(240px, 100%); margin: 12px auto; padding: 6px; background: #ffffff; border: 1px solid var(--line); border-radius: 6px; }
.qr-svg { display: block; width: 100%; height: auto; }
.setup-key {
  margin: 12px 0; padding: 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px;
  font: 600 1.02rem/1.5 Consolas, "SF Mono", Menlo, monospace; text-align: center; overflow-wrap: anywhere; user-select: all;
}

/* ---------- Day / Night / Auto ---------- */
.theme { display: flex; width: fit-content; margin: 16px auto 0; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card-2); }
.theme-btn {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  border-radius: 999px; padding: 5px 14px; min-height: 30px; font-size: .84rem; font-weight: 600;
}
.theme-btn[aria-pressed="true"] { background: var(--blue-solid); color: var(--on-blue); }

/* ---------- workspace header, as in PostWatch/HQ ---------- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top-logo { display: block; }
.top-logo-img { width: 212px; height: auto; }
.top-tenant { display: flex; flex-direction: column; line-height: 1.25; padding-left: 16px; border-left: 1px solid var(--line); }
.top-tenant-name { font-weight: 600; }
.top-tenant-kind { color: var(--muted); font-size: .8rem; }
.top-right { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.top-right .theme { margin: 0; }
.top-user { color: var(--muted); font-size: .92rem; }
.link-button { padding: 4px 6px; background: none; border: 0; color: var(--blue); cursor: pointer; text-decoration: underline; }
.link-button:hover { color: var(--text); }

/* ---------- the workspace ---------- */
.space-main { max-width: 960px; margin: 0 auto; padding: 36px 16px 48px; }
.space-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: .1em; }
.space-sub { color: var(--muted); }
.empty { margin-top: 26px; padding: 60px 24px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 10px; }
.empty-pulse { width: min(320px, 80%); height: 60px; }
.empty h2 { font-size: 1.2rem; margin: 14px 0 4px; }
.empty p { color: var(--muted); }
.space-note { margin-top: 18px; color: var(--muted); font-size: .86rem; }

.pulse-line {
  fill: none; stroke: var(--pulse); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 460; stroke-dashoffset: 460;
  animation: pulse-draw 3.6s ease-in-out infinite;
}
@keyframes pulse-draw {
  0% { stroke-dashoffset: 460; opacity: 1; }
  55% { stroke-dashoffset: 0; opacity: 1; }
  85% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-line { animation: none; stroke-dashoffset: 0; }
}

/* ---------- sections, cards and the medication list (ADR-0028 Amendment 3) ---------- */
.nav { display: flex; gap: 4px; padding: 0 12px; background: var(--card-2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.nav a { padding: 10px 12px; color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--blue-solid); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 24px; }
.card { display: block; padding: 18px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--blue-solid); border-radius: 10px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.card:hover { border-color: var(--blue-solid); }
.card h2 { font-size: 1.1rem; margin-bottom: 4px; }
.card p { color: var(--muted); font-size: .92rem; }
.card .card-go { margin-top: 10px; color: var(--blue); font-weight: 600; }

.narrow { max-width: 640px; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.crumb { margin-bottom: 8px; font-size: .9rem; }
.notice { margin-top: 16px; padding: 10px 12px; background: var(--card-2); border: 1px solid var(--line); border-left: 4px solid var(--blue-solid); border-radius: 6px; color: var(--muted); font-size: .9rem; }
.button { display: inline-block; padding: 9px 16px; min-height: 42px; border: 1px solid var(--blue-solid); border-radius: 6px; background: var(--blue-solid); color: var(--on-blue); font-weight: 600; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.button-quiet { background: transparent; color: var(--blue); border-color: var(--line); }
.button-quiet:hover { background: var(--card-2); border-color: var(--blue-solid); }
.empty form { margin-top: 16px; }

.search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 18px; }
.search label { font-weight: 600; font-size: .92rem; }
.search input { flex: 1 1 180px; max-width: 320px; padding: 8px 11px; min-height: 42px; background: var(--field); color: var(--text); border: 1px solid var(--line); border-radius: 6px; }

.table-wrap { margin-top: 14px; overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
.list th, .list td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.list thead th { color: var(--muted); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; background: var(--card-2); white-space: nowrap; }
.list tbody tr:last-child th, .list tbody tr:last-child td { border-bottom: 0; }
.list tbody th { font-weight: 600; }
.list abbr { text-decoration: none; }
.list .retired th a, .list .retired td { color: var(--muted); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid var(--blue-solid); border-radius: 999px; color: var(--blue); font-size: .72rem; font-weight: 700; letter-spacing: .04em; vertical-align: middle; white-space: nowrap; }
.tag-quiet { border-color: var(--line); color: var(--muted); }

.entry { margin-top: 6px; }
.entry fieldset { margin: 16px 0 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.entry legend { padding: 0 6px; font-weight: 600; font-size: .92rem; }
.fields .tick { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 36px; font-weight: 400; }
.fields .tick input { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--blue-solid); }
.entry .primary { width: auto; padding: 11px 26px; }
.retire { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.facts { margin: 18px 0 0; padding: 4px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.facts dt { margin-top: 12px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.facts dd { margin: 0 0 12px; }
.history { margin-top: 28px; }
.history h2 { font-size: 1.05rem; }
.history ol { margin: 0; padding: 0; list-style: none; }
.history li { padding: 10px 0; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.history-what { color: var(--text); font-weight: 600; }
.history-detail { display: block; margin-top: 2px; overflow-wrap: anywhere; }

/* ---------- the regional map (ADR-0030). Status is told by letters and by shade, never by colour alone. ---------- */
.wide { max-width: 1180px; }
.map { margin: 16px 0 0; }
.map svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.map figcaption { margin-top: 6px; color: var(--muted); font-size: .82rem; }
.map-ground { fill: var(--card-2); }
.county { fill: var(--card); stroke: var(--line); stroke-width: 1.5; }
.county-name { fill: var(--muted); font-size: 13px; text-anchor: middle; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.town { fill: var(--muted); }
.town-name { fill: var(--text); font-size: 14px; opacity: .85; }
.rig { transition: transform 5s linear; }
.rig-shape { stroke-width: 2.5; }
.rig-code { font-size: 11px; font-weight: 700; text-anchor: middle; }
.rig-name { font-size: 13px; font-weight: 700; text-anchor: middle; fill: var(--text); paint-order: stroke; stroke: var(--card); stroke-width: 4px; }
.rig-rough { fill: none; stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 5 4; }
.rig-quiet { opacity: .5; }
.rig-lost { opacity: .28; }
.rig-available .rig-shape { fill: var(--card); stroke: var(--blue-solid); }
.rig-available .rig-code { fill: var(--blue); }
.rig-enroute .rig-shape { fill: var(--blue-solid); stroke: var(--blue-solid); }
.rig-enroute .rig-code { fill: var(--on-blue); }
.rig-on_scene .rig-shape { fill: var(--text); stroke: var(--text); }
.rig-on_scene .rig-code { fill: var(--page); }
.rig-transporting .rig-shape { fill: var(--pulse); stroke: var(--text); }
.rig-transporting .rig-code { fill: var(--page); }
.rig-at_hospital .rig-shape { fill: var(--card-2); stroke: var(--muted); }
.rig-at_hospital .rig-code { fill: var(--muted); }
.rig-out .rig-shape { fill: none; stroke: var(--muted); stroke-dasharray: 4 3; }
.rig-out .rig-code { fill: var(--muted); font-size: 9px; }
.rig-located .rig-shape { fill: var(--card); stroke: var(--blue-solid); stroke-dasharray: 2 2; }
.rig-located .rig-code { fill: var(--blue); font-size: 9px; }
/* The street map (ADR-0030 Amendment 1). The pins reuse the status pills, so the letters and shades match. */
.streets { height: min(72vh, 780px); min-height: 380px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.map { position: relative; }
.streets-loading { position: absolute; left: 0; right: 0; top: 0; visibility: hidden; }
.map-streets svg[hidden] { display: none; }
.pin { display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.pin .pin-dot { min-width: 30px; padding: 3px 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.pin-air .pin-dot { border-radius: 4px; }
.pin-name { padding: 0 5px; border-radius: 4px; background: var(--card); color: var(--text); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.pin-rough .pin-dot { outline: 2px dashed var(--blue); outline-offset: 9px; }
.pin.rig-quiet { opacity: .55; }
.pin.rig-lost { opacity: .3; }
.status-pill.rig-airborne { background: var(--blue-solid); color: var(--on-blue); border-radius: 4px; }
.status-pill.rig-ground { background: var(--card-2); border-color: var(--muted); color: var(--muted); border-radius: 4px; }
.air-box { margin-top: 26px; padding: 4px 16px 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--blue-solid); border-radius: 10px; }
form.inline { display: inline; margin: 0 10px; }
/* Reference links on the protocol shelf (ADR-0028 Amendment 23). */
.ref-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 12px 0 22px; padding: 0; list-style: none; }
.ref-list li { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.ref-list li p { margin: 0; }
.ref-list li form { margin-top: auto; }
ul.plain { padding-left: 18px; }
.list .history-detail { display: block; color: var(--muted); font-size: .84rem; font-weight: 400; }
.areas { margin-top: 14px; }
.areas-note { margin: 10px 0 4px; padding: 9px 12px; background: var(--card-2); border: 1px solid var(--line); border-left: 4px solid var(--blue-solid); border-radius: 6px; font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; padding: 0; list-style: none; font-size: .88rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 7px; }
.status-pill { display: inline-block; min-width: 34px; padding: 2px 8px; border: 2px solid var(--blue-solid); border-radius: 999px; font-size: .76rem; font-weight: 700; text-align: center; white-space: nowrap; }
.status-pill.rig-available { background: var(--card); color: var(--blue); }
.status-pill.rig-enroute { background: var(--blue-solid); color: var(--on-blue); }
.status-pill.rig-on_scene { background: var(--text); border-color: var(--text); color: var(--page); }
.status-pill.rig-transporting { background: var(--pulse); border-color: var(--text); color: var(--page); }
.status-pill.rig-at_hospital { background: var(--card-2); border-color: var(--muted); color: var(--muted); }
/* The one-page explainer for an agency (ADR-0030 Amendment 8). Plain reading width; prints cleanly. */
.sharing-page section { margin: 22px 0; }
.sharing-page h2 { margin: 0 0 8px; font-size: 1.15rem; }
.sharing-page li { margin: 6px 0; line-height: 1.5; }
.sharing-page p { line-height: 1.55; }
@media print { .top, .sharing-page .crumb, .sharing-page .space-note { display: none; } .sharing-page { max-width: none; } }
.status-pill.rig-located { background: var(--card); border-style: dotted; color: var(--blue); }
.status-pill.rig-out { background: transparent; border-style: dashed; border-color: var(--muted); color: var(--muted); }
.legend-shape { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--blue-solid); }
.legend-air { transform: rotate(45deg); }
.legend-rough { border-radius: 50%; border-style: dashed; border-color: var(--blue); }
.heard-quiet td, .heard-lost td { color: var(--muted); }
.list td form, .list th form { display: inline; margin-left: 8px; }
.code { margin: 8px 0; padding: 10px 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; font: .86rem/1.5 Consolas, "SF Mono", Menlo, monospace; overflow-x: auto; }
code { font: .9em Consolas, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
.key-once { margin-top: 16px; padding: 4px 16px 14px; background: var(--card); border: 2px solid var(--blue-solid); border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { .rig { transition: none; } }

/* ---------- intake and the time buttons (ADR-0028 Amendment 4) ---------- */
.button-big { padding: 14px 26px; min-height: 54px; font-size: 1.05rem; }
.times { margin-top: 20px; }
.times h2, .intake-form h2 { font-size: 1.1rem; margin: 26px 0 8px; }
.h-note { color: var(--muted); font-size: .84rem; font-weight: 400; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.time-form { display: contents; }
.time-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
  width: 100%; min-width: 0; min-height: 96px; padding: 14px 18px; text-align: left; cursor: pointer;
  background: var(--blue-solid); color: var(--on-blue); border: 2px solid var(--blue-solid); border-radius: 12px;
}
.time-btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.time-label { font-size: 1.2rem; font-weight: 700; }
.time-at { font-size: .9rem; opacity: .9; }
.time-done { cursor: default; background: var(--card); color: var(--text); border-color: var(--line); border-left: 6px solid var(--blue-solid); }
.time-done:hover { background: var(--card); border-color: var(--line); border-left-color: var(--blue-solid); }
.time-done .time-at { font: 700 1.35rem/1.2 Consolas, "SF Mono", Menlo, monospace; opacity: 1; }
.time-note { color: var(--muted); font-size: .8rem; }
.time-btn:disabled { cursor: default; }
button.time-done { text-align: left; }
.events { margin-top: 8px; }
.events h2 { font-size: 1.1rem; margin: 26px 0 8px; }
.event-btn { background: var(--card); color: var(--text); border-style: dashed; border-color: var(--blue-solid); }
.event-btn:hover { background: var(--card-2); border-color: var(--blue-hover); }
.event-btn .time-label::before { content: "+ "; color: var(--blue); }
.event-list { margin: 12px 0 0; padding: 0; list-style: none; }
.event-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.event-at { font: 700 1rem/1.3 Consolas, "SF Mono", Menlo, monospace; }
.event-what { color: var(--muted); }
.event-go { margin-left: auto; font-size: .9rem; font-weight: 600; }
.time-fix { margin-top: 2px; font-size: .84rem; font-weight: 600; }
.fields .fix-clear { margin: 22px 0 0 12px; }
.time-status { min-height: 1.4em; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.time-waiting { padding: 9px 12px; color: var(--text); background: var(--card-2); border: 1px solid var(--blue-solid); border-radius: 6px; font-weight: 600; }
.saved { margin-top: 14px; padding: 8px 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; font-weight: 600; }
.intake-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.grid-tight { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.f-wide { grid-column: 1 / -1; }
.fields textarea, .fields select {
  width: 100%; padding: 9px 11px; min-height: 44px; font: inherit;
  background: var(--field); color: var(--text); border: 1px solid var(--line); border-radius: 6px;
}
.intake-form .primary { width: auto; min-width: 180px; padding: 12px 30px; }

.unseen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.med-camera { margin: 4px 0 18px; }
.med-camera .button { cursor: pointer; }
.med-camera .unseen:focus-visible + .hint { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- medications a person takes, and the check screen (ADR-0028 Amendment 5) ---------- */
.sub { font-size: 1.1rem; margin: 26px 0 8px; }
.med-box { margin-top: 14px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.med-box-title { display: block; font-weight: 600; font-size: .92rem; }
.med-list { margin: 8px 0 12px; padding: 0; list-style: none; }
.med-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.med-list li:first-child { border-top: 0; }
.med-list form { margin-left: auto; }
.med-name { font-weight: 600; }
.med-rows { margin: 12px 0 0; padding: 0; list-style: none; }
.med-row { margin-top: 12px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--blue-solid); border-radius: 8px; }
.med-look-alike, .med-unsure, .med-unread { border-left-style: dashed; background: var(--card-2); }
.med-typed { border-left-color: var(--line); }
.fields .med-keep { font-weight: 700; min-height: 44px; }
.med-flag { margin: 4px 0; padding: 7px 10px; border: 1px solid var(--blue-solid); border-radius: 6px; font-weight: 600; font-size: .9rem; }
.med-read { margin-top: 8px; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.fields .med-save { width: auto; min-width: 220px; padding: 12px 30px; }
.med-again { margin-left: 16px; }

@media (max-width: 560px) {
  .time-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .top-right { width: 100%; margin-left: 0; justify-content: flex-end; }
  .top-user { display: none; }
  .login-card { padding: 22px; }
}
