/* OpenArms — one small stylesheet, mobile first, fast on 3G. */
:root {
  --brand: #0f766e; --brand-dark: #115e59; --brand-soft: #ccfbf1;
  --danger: #dc2626; --danger-soft: #fee2e2;
  --warn: #d97706; --warn-soft: #fef3c7;
  --ok: #16a34a; --ok-soft: #dcfce7;
  --grey: #6b7280; --grey-soft: #f3f4f6;
  --ink: #111827; --muted: #4b5563; --line: #e5e7eb; --bg: #ffffff; --card: #ffffff;
  --radius: 14px; --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Header + emergency strip */
.topbar { display: flex; align-items: center; gap: .5rem; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.strip-112 { background: var(--danger); color: #fff; text-align: center; padding: 8px 12px; font-weight: 600; font-size: .95rem; }
.strip-112 a { color: #fff; }
.drill-banner { background: #7c3aed; color: #fff; text-align: center; padding: 6px; font-weight: 700; letter-spacing: .03em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: 12px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; min-height: 48px; }
.btn:hover { background: var(--brand-dark); }
.btn-lg { width: 100%; font-size: 1.15rem; min-height: 60px; }
.btn-xl { width: 100%; font-size: 1.4rem; min-height: 84px; border-radius: 16px; }
.btn-danger { background: var(--danger); } .btn-danger:hover { background: #b91c1c; }
.btn-ok { background: var(--ok); } .btn-ok:hover { background: #15803d; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); } .btn-ghost:hover { background: var(--grey-soft); }
.btn-sm { padding: 6px 12px; min-height: 36px; font-size: .875rem; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card-ok { border-color: var(--ok); background: var(--ok-soft); }
.card-warn { border-color: var(--warn); background: var(--warn-soft); }
.card-danger { border-color: var(--danger); background: var(--danger-soft); }
.grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Choice tiles (help form) */
.step { margin: 22px 0; }
.step-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tiles.cols-1 { grid-template-columns: 1fr; }
.tiles label { display: flex; align-items: center; min-height: 56px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; background: #fff; }
.tiles input { position: absolute; opacity: 0; pointer-events: none; }
.tiles label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.tiles label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
input[type=text], input[type=tel], select, textarea { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font: inherit; background: #fff; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: 6px 0; font-weight: 600; }
.loc-status { font-weight: 600; }
.loc-status.ok { color: var(--ok); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pill-green { background: var(--ok-soft); color: #166534; } .pill-yellow { background: var(--warn-soft); color: #92400e; }
.pill-red { background: var(--danger-soft); color: #991b1b; } .pill-unknown { background: var(--grey-soft); color: var(--grey); }
.pill-brand { background: var(--brand-soft); color: var(--brand-dark); } .pill-drill { background: #ede9fe; color: #5b21b6; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--ok); } .dot-yellow { background: var(--warn); } .dot-red { background: var(--danger); } .dot-unknown { background: #9ca3af; }

/* Tracking page */
.big-status { text-align: center; padding: 28px 16px; }
.spinner { width: 54px; height: 54px; border: 6px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 14px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ref { font-family: ui-monospace, Menlo, monospace; font-weight: 800; font-size: 1.3rem; letter-spacing: .05em; }
.hospital-name { font-size: 1.5rem; font-weight: 800; }

/* Hospital app */
.status-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-btns button { min-height: 72px; border-radius: 14px; border: 3px solid transparent; font: inherit; font-weight: 800; cursor: pointer; }
.status-btns .s-green { background: var(--ok-soft); color: #166534; } .status-btns .s-yellow { background: var(--warn-soft); color: #92400e; } .status-btns .s-red { background: var(--danger-soft); color: #991b1b; }
.status-btns .active { border-color: var(--ink); box-shadow: inset 0 0 0 2px #fff; }
.toggle-list { display: grid; gap: 8px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.alarm { position: fixed; inset: 0; z-index: 50; background: var(--danger); color: #fff; display: none; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; animation: flash 1s steps(2) infinite; }
.alarm.on { display: flex; }
.alarm h1 { font-size: 2.2rem; } .alarm p { font-size: 1.25rem; }
.alarm .btn { background: #fff; color: var(--danger); font-size: 1.4rem; min-height: 80px; width: min(420px, 100%); }
@keyframes flash { 50% { background: #991b1b; } }
.reason-group { margin: 14px 0; }
.reason-group h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* Ops */
.ops-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.ops-nav a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; }
.ops-nav a.on, .ops-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.kpi { padding: 14px 16px; }
.kpi .v { font-size: 1.8rem; font-weight: 800; } .kpi .l { color: var(--muted); font-size: .85rem; } .kpi .t { font-size: .75rem; color: var(--grey); }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafafa; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.timeline time { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: var(--muted); margin-right: .5rem; }
.bar { height: 8px; background: var(--grey-soft); border-radius: 99px; overflow: hidden; } .bar > span { display: block; height: 100%; background: var(--brand); }
.messages { list-style: none; padding: 0; margin: 12px 0; } .messages li { padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.qr svg { width: 260px; height: 260px; }
footer.site { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 16px; color: var(--muted); font-size: .85rem; }
