:root {
  --ink: #1b1f23; --muted: #5f6b76; --line: #d9dee3; --bg: #f6f7f8; --card: #fff;
  --accent: #0d5c63; --accent-ink: #fff; --ok: #1f6f43; --ok-bg: #e5f4e4; --warn: #8a5a00; --warn-bg: #fbf0d9;
  --err: #a1201a; --err-bg: #fbebeb; --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; }
a { color: var(--accent); }
header.top { background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; gap: 4px;
  padding: 0 12px; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
header.top .brand { font-weight: 700; margin-right: 12px; padding: 12px 0; }
header.top nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
header.top a { color: var(--accent-ink); text-decoration: none; padding: 12px 10px; border-radius: 6px; }
header.top a.on, header.top a:hover { background: rgba(255,255,255,.16); }
header.top .who { font-size: 14px; opacity: .9; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 4px 0 12px; } h2 { font-size: 19px; margin: 20px 0 8px; } h3 { font-size: 16px; margin: 14px 0 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 140px; }
.row > .narrow { flex: 0 1 110px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid #b9c1c8; border-radius: 6px;
  background: #fff; min-height: 44px; }
textarea { min-height: 70px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; vertical-align: middle; }
.check { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--ink); min-height: 44px; }
button, .btn { font: inherit; display: inline-block; text-align: center; border: 0; border-radius: 6px; padding: 10px 16px;
  min-height: 44px; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; }
button.secondary, .btn.secondary { background: #e7ecef; color: var(--ink); }
button.danger { background: var(--err); }
button.small, .btn.small { min-height: 34px; padding: 6px 10px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 15px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fafbfb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 10px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.err { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #e7ecef; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.err { background: var(--err-bg); color: var(--err); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 12px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.time { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fff; }
.time .lbl { font-size: 12px; color: var(--muted); } .time .val { font-size: 20px; font-weight: 600; min-height: 28px; }
.time form { display: flex; gap: 4px; margin-top: 4px; } .time input { min-height: 34px; padding: 4px; font-size: 14px; }
.meter { height: 14px; background: #e7ecef; border-radius: 7px; overflow: hidden; }
.meter > div { height: 100%; background: var(--ok); } .meter.warn > div { background: #c98a00; } .meter.err > div { background: var(--err); }
.patient-bar { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }
.patient-bar .name { font-size: 22px; font-weight: 700; }
.allergy { color: var(--err); font-weight: 600; }
details summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.void td { text-decoration: line-through; color: var(--muted); }
.photo-thumb { max-width: 100%; max-height: 260px; border-radius: 6px; border: 1px solid var(--line); }
@media print { header.top, .noprint, form { display: none !important; } body { background: #fff; } .card { border: 0; } }
@media (max-width: 640px) { main { padding: 10px; } h1 { font-size: 20px; } th, td { padding: 6px; font-size: 14px; } }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 2px; }
.chip { background:#eef2f6; color:#1b1f23; border:1px solid #cfd6dd; border-radius:999px; padding:6px 12px; font-size:.9rem; min-height:34px; cursor:pointer; }
.chip.used { background:#dff1e6; border-color:#9fd2b2; }
.graph { overflow-x:auto; background:#fff; border:1px solid #e3e7eb; border-radius:8px; padding:6px; }
.graph svg { min-width:720px; }
.camera { display:flex; align-items:center; justify-content:center; gap:8px; font-size:1.05rem; padding:14px; border:2px dashed #9aa6b2; border-radius:10px; cursor:pointer; background:#f7f9fb; }
.camera input { display:none; }
.running { border-left:4px solid #0d5c63; }
.gasrun { border-left:4px solid #4b2e83; }

.need { outline: 2px solid #f0b429; background: #fff8e6; border-radius: 6px; padding: 4px 6px; }
label.check.need { display: inline-block; }
.multi-chips { min-height: 6px; }
.multi-chips .chip button, .seq-list button { margin-left: 4px; padding: 0 6px; min-height: 22px; }
.seq-list li { margin: 2px 0; }
