/* After-Hours Reception: a night-desk console. Midnight panels, lamp-amber accents; the morning summary switches to daylight. */
:root {
  color-scheme: dark;
  --bg: #0a0f26;
  --bg-2: #0f1638;
  --panel: rgba(255, 255, 255, .045);
  --panel-2: rgba(255, 255, 255, .07);
  --solid: #131a40;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .17);
  --text: #eef0ff;
  --muted: #a6aedb;
  --dim: #7a82b6;
  --amber: #ffb84d;
  --amber-soft: rgba(255, 184, 77, .14);
  --amber-ink: #2b1b00;
  --mint: #62e3bf;
  --mint-soft: rgba(98, 227, 191, .13);
  --coral: #ff6f7d;
  --coral-soft: rgba(255, 111, 125, .14);
  --peri: #97abff;
  --peri-soft: rgba(151, 171, 255, .14);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --radius: 16px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
html.morning {
  color-scheme: light;
  --bg: #fbf5ea;
  --bg-2: #fffaf2;
  --panel: #ffffff;
  --panel-2: #fff7ea;
  --solid: #ffffff;
  --line: rgba(29, 34, 70, .1);
  --line-2: rgba(29, 34, 70, .2);
  --text: #1d2246;
  --muted: #565c84;
  --dim: #858aab;
  --amber: #d97f00;
  --amber-soft: rgba(217, 127, 0, .12);
  --amber-ink: #ffffff;
  --mint: #0b8f69;
  --mint-soft: rgba(11, 143, 105, .1);
  --coral: #cf3346;
  --coral-soft: rgba(207, 51, 70, .09);
  --peri: #4058d0;
  --peri-soft: rgba(64, 88, 208, .09);
  --shadow: 0 14px 40px rgba(73, 52, 10, .1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 85% -10%, rgba(120, 110, 255, .16), transparent 60%), radial-gradient(900px 600px at -10% 20%, rgba(255, 184, 77, .06), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 500 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s ease, color .5s ease;
}
html.morning body { background: radial-gradient(1000px 600px at 90% -20%, rgba(255, 196, 92, .35), transparent 60%), var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--peri); }
.mono { font-family: var(--mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1420px; margin: 0 auto; padding: 0 24px; }

/* ── Top bar ─────────────────────────────── */
.top {
  position: sticky;
  top: var(--lab-bar-h, 0px);
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 18px; padding: 14px 0 10px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.brand-mark { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #1c2560, #0e1335); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
html.morning .brand-mark { background: linear-gradient(145deg, #ffe2b0, #ffc56b); border-color: rgba(217, 127, 0, .3); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { min-width: 0; }
.brand-name { margin: 0; font: 600 19px/1.1 var(--serif); letter-spacing: -.01em; }
.brand-sub { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.clinic-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); flex: none; }
.clinic-switch button { border: 0; background: none; padding: 7px 13px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.clinic-switch button:hover { color: var(--text); }
.clinic-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.clinic-select { display: none; }
.clinic-select select { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--solid); font-weight: 700; }

.status { display: flex; align-items: center; gap: 12px; flex: none; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--mint-soft); color: var(--mint); font-weight: 800; font-size: 12px; white-space: nowrap; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); animation: pulse 2s infinite; }
.status-pill.paused { background: var(--amber-soft); color: var(--amber); }
.status-pill.paused .dot { animation: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

.switch { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; font-weight: 700; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.switch .track { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch[aria-checked="true"] .track { background: var(--mint); }
.switch[aria-checked="true"] .track::after { transform: translateX(18px); }
.switch:disabled { opacity: .55; cursor: not-allowed; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--muted); padding: 10px 12px 12px; font-weight: 700; font-size: 13.5px; border-bottom: 2px solid transparent; }
.tabs button svg { width: 16px; height: 16px; opacity: .8; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--amber); }
.tabs .count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--amber); color: var(--amber-ink); font-size: 11px; font-weight: 800; text-align: center; }

/* ── Shared bits ─────────────────────────── */
main { padding: 26px 0 70px; }
.paused-note { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); background: var(--amber-soft); color: var(--text); }
.paused-note b { color: var(--amber); }
.paused-note button { margin-left: auto; flex: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.eyebrow { margin: 0; font: 600 11px/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--dim); }
h1, h2, h3 { margin: 0; }
.h-view { font: 500 30px/1.15 var(--serif); letter-spacing: -.02em; }
.h-card { font: 600 17px/1.25 var(--serif); letter-spacing: -.01em; }
.lede { margin: 8px 0 0; color: var(--muted); max-width: 70ch; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ok { background: var(--mint); border-color: var(--mint); color: #062a20; }
html.morning .btn.ok { color: #fff; }
.btn.danger { color: var(--coral); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); padding-left: 8px; padding-right: 8px; }
.btn.ghost:hover { color: var(--text); }
.btn.sm { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.chip.book { background: var(--peri-soft); color: var(--peri); border-color: transparent; }
.chip.reschedule { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip.question { background: var(--mint-soft); color: var(--mint); border-color: transparent; }
.chip.emergency { background: var(--coral-soft); color: var(--coral); border-color: transparent; }
.chip.ok { background: var(--mint-soft); color: var(--mint); border-color: transparent; }
.chip.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip.bad { background: var(--coral-soft); color: var(--coral); border-color: transparent; }

/* ── Tonight ─────────────────────────────── */
.tonight { display: grid; grid-template-columns: 300px minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.queue-list { display: grid; gap: 8px; }
.qitem { width: 100%; text-align: left; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; padding: 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--panel); transition: border-color .15s, background .15s; }
.qitem:hover { border-color: var(--line-2); background: var(--panel-2); }
.qitem.active { border-color: var(--amber); background: var(--amber-soft); }
.qitem .qtime { grid-row: span 2; font: 500 12px/1.2 var(--mono); color: var(--dim); padding-top: 2px; width: 58px; }
.qitem .qwho { font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.qitem .qwho span:first-child { overflow-wrap: anywhere; }
.qitem .qout { color: var(--muted); font-size: 12.5px; }
.earlier { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.earlier-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 6px 12px; font-size: 12.5px; color: var(--muted); }
.earlier-row .mono { font-size: 12px; color: var(--dim); }

.live { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 560px; }
.live-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #3b3f8f, #22285e); font: 600 17px/1 var(--serif); color: #fff; border: 1px solid var(--line-2); }
.live-who { min-width: 0; flex: 1 1 160px; }
.live-who b { display: block; font-size: 16px; }
.live-who span { color: var(--muted); font-size: 12.5px; }
.wave { display: flex; align-items: center; gap: 3px; height: 26px; }
.wave i { width: 3px; border-radius: 2px; background: var(--amber); height: 6px; opacity: .5; }
.wave.on i { animation: wv 1s ease-in-out infinite; opacity: 1; }
.wave.on i:nth-child(2) { animation-delay: .1s } .wave.on i:nth-child(3) { animation-delay: .25s } .wave.on i:nth-child(4) { animation-delay: .4s } .wave.on i:nth-child(5) { animation-delay: .15s } .wave.on i:nth-child(6) { animation-delay: .3s } .wave.on i:nth-child(7) { animation-delay: .05s }
@keyframes wv { 0%, 100% { height: 5px } 50% { height: 24px } }
.live-state { font: 500 12px/1 var(--mono); color: var(--muted); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); white-space: nowrap; }
.live-state.on { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.live-state.em { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 45%, transparent); }

.transcript { flex: 1 1 auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 560px; min-height: 340px; scroll-behavior: smooth; }
.msg { max-width: 86%; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg .who { font: 600 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.msg .bubble { padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--panel-2); border: 1px solid var(--line); line-height: 1.55; overflow-wrap: anywhere; }
.msg.caller { align-self: flex-end; }
.msg.caller .who { justify-content: flex-end; }
.msg.caller .bubble { border-radius: 16px 4px 16px 16px; background: var(--peri-soft); border-color: color-mix(in srgb, var(--peri) 25%, transparent); }
.msg.sys { align-self: center; max-width: 94%; }
.msg.sys .bubble { border-radius: 12px; background: var(--coral-soft); border-color: color-mix(in srgb, var(--coral) 35%, transparent); color: var(--text); font-size: 13px; text-align: center; }
.msg.sys.calm .bubble { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.msg mark { background: color-mix(in srgb, var(--amber) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); width: max-content; }
.typing.caller { align-self: flex-end; background: var(--peri-soft); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s } .typing i:nth-child(3) { animation-delay: .3s }
@keyframes blink { 50% { opacity: .25 } }
.live-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px 24px; }
.live-empty .moon { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 35%, #ffd38a, #ffb84d 45%, #c9861d); box-shadow: 0 0 60px rgba(255, 184, 77, .35); }
.live-empty .moon svg { width: 34px; height: 34px; }
.live-empty h3 { font: 500 24px/1.2 var(--serif); }
.live-empty p { color: var(--muted); max-width: 44ch; margin: 8px auto 18px; }
.live-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.live-foot .hint { color: var(--dim); font-size: 12px; }

.side { display: grid; gap: 14px; }
.intent-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 42px; align-items: center; gap: 10px; margin: 9px 0; font-size: 13px; font-weight: 700; }
.intent-row .bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.intent-row .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--dim); transition: width .7s cubic-bezier(.2, .8, .2, 1), background .3s; }
.intent-row.top .bar i { background: var(--amber); }
.intent-row.top.emergency .bar i { background: var(--coral); }
.intent-row .pct { font: 500 12px/1 var(--mono); color: var(--muted); text-align: right; }
.intent-row.top .pct, .intent-row.top .lbl { color: var(--text); }
.intent-verdict { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.intent-verdict b { color: var(--text); }
.kv { display: grid; gap: 10px; margin: 0; }
.kv div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: 13px; animation: rise .35s ease both; }
.kv dt { color: var(--dim); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.rules { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rules li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: 12.5px; animation: rise .35s ease both; }
.rules .rid { font: 600 11px/1.6 var(--mono); color: var(--dim); }
.rules .res { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.res.ok { background: var(--mint-soft); color: var(--mint); }
.res.auto { background: var(--mint-soft); color: var(--mint); }
.res.hold { background: var(--amber-soft); color: var(--amber); }
.res.route { background: var(--peri-soft); color: var(--peri); }
.res.flag { background: var(--coral-soft); color: var(--coral); }
.placeholder { color: var(--dim); font-size: 13px; margin: 0; }

.outcome { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); background: linear-gradient(180deg, var(--amber-soft), transparent 70%), var(--panel); }
.outcome.good { border-color: color-mix(in srgb, var(--mint) 45%, var(--line)); background: linear-gradient(180deg, var(--mint-soft), transparent 70%), var(--panel); }
.outcome.em { border-color: color-mix(in srgb, var(--coral) 55%, var(--line)); background: linear-gradient(180deg, var(--coral-soft), transparent 70%), var(--panel); }
.outcome.cb { border-color: color-mix(in srgb, var(--peri) 45%, var(--line)); background: linear-gradient(180deg, var(--peri-soft), transparent 70%), var(--panel); }
.outcome h3 { font: 600 18px/1.25 var(--serif); margin: 6px 0 4px; }
.outcome p { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.slot { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin: 10px 0 12px; }
.slot .day { text-align: center; width: 52px; flex: none; padding: 6px 0; border-radius: 9px; background: var(--solid); border: 1px solid var(--line); }
.slot .day b { display: block; font: 600 18px/1 var(--serif); }
.slot .day span { font: 600 10px/1 var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.slot .info { min-width: 0; font-size: 13px; }
.slot .info b { display: block; }
.steps { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 0; }
.steps li { position: relative; padding: 0 0 14px 26px; font-size: 13px; color: var(--dim); }
.steps li::before { content: ""; position: absolute; left: 5px; top: 5px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--bg); }
.steps li::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--coral); border-color: var(--coral); }
.steps li.now { color: var(--text); }
.steps li.now::before { border-color: var(--coral); animation: ring 1s infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 6px var(--coral-soft); } }
.handoff { margin: 12px 0; padding: 14px; border-radius: 12px; background: var(--solid); border: 1px solid var(--line); }
.handoff .kv div { grid-template-columns: 84px minmax(0, 1fr); }
.signed { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 10px; }
.signed svg { width: 14px; height: 14px; color: var(--mint); flex: none; }

/* ── Calendar ────────────────────────────── */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.cal-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lg-exist { background: var(--panel-2); border: 1px solid var(--line-2); }
.lg-ai { background: var(--amber); }
.lg-held { border: 2px dashed var(--amber); }
.lg-rel { border: 1px dashed var(--dim); opacity: .7; }
.day-pick { display: none; gap: 4px; }
.day-pick button { border: 1px solid var(--line); background: var(--panel); padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: 12.5px; color: var(--muted); }
.day-pick button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.cal { display: grid; grid-template-columns: 54px repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.cal-head { display: contents; }
.cal-h { padding: 12px 10px 10px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 0; }
.cal-h:first-child { border-left: 0; }
.cal-h b { font: 600 15px/1.1 var(--serif); display: block; }
.cal-h .lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin-top: 8px; }
.cal-h .lanes span { font: 600 10px/1.3 var(--mono); color: var(--dim); text-align: center; border-top: 2px solid; padding-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 8px; font: 500 10.5px/1 var(--mono); color: var(--dim); transform: translateY(-50%); }
.cal-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 36px; min-width: 0; }
.cal-col .lane-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cal-col .lane-grid i { border-left: 1px dashed color-mix(in srgb, var(--line) 60%, transparent); }
.cal-col .lane-grid i:first-child { border-left: 0; }
.blk { position: absolute; padding: 4px 6px; border-radius: 7px; font-size: 10.5px; line-height: 1.25; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); text-align: left; }
.blk b { display: block; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk.ai { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); cursor: pointer; box-shadow: 0 6px 18px rgba(255, 184, 77, .3); z-index: 2; }
.blk.ai b { color: var(--amber-ink); }
.blk.held { background: var(--amber-soft); border: 2px dashed var(--amber); color: var(--text); cursor: pointer; z-index: 2; }
.blk.held b { color: var(--amber); }
.blk.released { background: transparent; border: 1px dashed var(--dim); opacity: .6; text-decoration: line-through; }
.blk.mine { border-color: var(--peri); cursor: pointer; }
.blk.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.cal-empty { margin-top: 14px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.why blockquote { margin: 12px 0; padding: 12px 14px; border-left: 3px solid var(--amber); background: var(--panel-2); border-radius: 0 10px 10px 0; font: 400 14px/1.55 var(--serif); font-style: italic; }

/* ── Morning ─────────────────────────────── */
.am-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: end; margin-bottom: 26px; }
.am-hero .sun svg { width: 18px; height: 18px; flex: none; }
.am-hero .sun { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--mono); color: var(--amber); letter-spacing: .06em; text-transform: uppercase; }
.am-hero h1 { font: 500 40px/1.08 var(--serif); letter-spacing: -.025em; margin: 10px 0 8px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.stat b { display: block; font: 500 30px/1 var(--serif); }
.stat span { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); font-weight: 700; line-height: 1.3; }
.am-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.am-grid .card { box-shadow: var(--shadow); }
.am-item { padding: 14px 0; border-top: 1px solid var(--line); }
.am-item:first-of-type { border-top: 0; padding-top: 4px; }
.am-item-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.am-item-head b { font-size: 14.5px; }
.am-item p { margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
.am-item .quote { font: italic 400 13.5px/1.5 var(--serif); color: var(--text); margin: 6px 0 10px; padding-left: 10px; border-left: 2px solid var(--line-2); }
.ff-note { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.empty-row { color: var(--dim); font-size: 13px; padding: 6px 0; margin: 0; }

/* ── Audit ───────────────────────────────── */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--panel); padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: 12.5px; color: var(--muted); }
.filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 120px 150px minmax(0, 1fr); gap: 14px; padding: 13px 4px; border-top: 1px solid var(--line); font-size: 13px; align-items: start; }
.log li:first-child { border-top: 0; }
.log .t { font: 500 12px/1.5 var(--mono); color: var(--dim); }
.actor { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12px; }
.actor i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.actor.ai i { background: var(--peri); } .actor.rule i { background: var(--mint); } .actor.staff i { background: var(--amber); } .actor.clin i { background: var(--coral); }
.log .what { overflow-wrap: anywhere; }
.log .what small { display: block; color: var(--dim); margin-top: 3px; font-size: 12px; }
.audit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.versions li { font-size: 13px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.versions li b { font-family: var(--mono); font-size: 12px; }
.versions li span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ── Rules ───────────────────────────────── */
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; }
.setting .lbl { min-width: 0; }
.setting .lbl b { display: block; font-size: 13.5px; }
.setting .lbl span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.setting .lbl b .rid { display: inline; font: 600 11px/1 var(--mono); color: var(--dim); margin: 0 6px 0 0; }
.setting select, .setting input[type="number"] { padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--solid); font-weight: 700; max-width: 100%; }
.setting input[type="number"] { width: 76px; }
.range { display: flex; align-items: center; gap: 10px; flex: none; }
.range input { width: 140px; accent-color: var(--amber); }
.range output { font: 600 13px/1 var(--mono); width: 38px; text-align: right; }
.locked { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; color: var(--dim); white-space: nowrap; }
.locked svg { width: 13px; height: 13px; }
.crit { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.crit span { padding: 6px 10px; border-radius: 9px; background: var(--coral-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--coral) 30%, transparent); font-size: 12.5px; font-weight: 700; }
.nevers { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.nevers li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 9px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.hours { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }

/* ── Toast ───────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); max-width: min(520px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 13px; background: #fff; color: #161b3d; font-weight: 700; font-size: 13px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast small { display: block; font-weight: 600; color: #5a5f86; margin-top: 2px; }

.foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 1280px) {
  .tonight { grid-template-columns: 270px minmax(0, 1fr); }
  .tonight .side { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tonight .side .outcome { grid-column: 1 / -1; }
  .clinic-switch button { padding: 7px 10px; }
}
@media (max-width: 1100px) {
  .top-row { flex-wrap: wrap; }
  .clinic-switch { display: none; }
  .clinic-select { display: block; order: 3; flex: 1 1 100%; }
  .cal-wrap, .audit-grid { grid-template-columns: minmax(0, 1fr); }
  .am-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .tonight { grid-template-columns: minmax(0, 1fr); }
  .queue-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-grid, .rules-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .log li { grid-template-columns: 96px minmax(0, 1fr); }
  .log li .what { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .cal { grid-template-columns: 48px minmax(0, 1fr); }
  .cal .hide-sm { display: none; }
  .day-pick { display: flex; }
}
@media (max-width: 640px) {
  .tonight .side { grid-template-columns: minmax(0, 1fr); }
  .queue-list { grid-template-columns: minmax(0, 1fr); }
  .h-view { font-size: 25px; }
  .am-hero h1 { font-size: 31px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .status { flex: 1 1 100%; justify-content: space-between; order: 2; }
  .brand-sub { white-space: normal; }
  .live { min-height: 0; }
  .transcript { max-height: 460px; min-height: 260px; padding: 16px; }
  .msg { max-width: 94%; }
  .setting { flex-wrap: wrap; }
  .range input { width: 120px; }
  .intent-row { grid-template-columns: 84px minmax(0, 1fr) 40px; }
  .paused-note { flex-wrap: wrap; }
  .paused-note button { margin-left: 0; }
}
.tabs .sh { display: none; }
.day-pick button { position: relative; }
.day-pick .dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.setting .lbl { flex: 1 1 180px; }
@media (min-width: 1281px) {
  .tonight > section { position: sticky; top: calc(var(--lab-bar-h, 0px) + 128px); }
  .transcript { max-height: 470px; }
  .live { min-height: 0; }
}
@media (max-width: 640px) {
  .tabs button svg { display: none; }
  .tabs .lg { display: none; }
  .tabs .sh { display: inline; }
  .tabs button { padding-left: 10px; padding-right: 10px; }
}
/* ── Quality pass: touch targets, phone header, wide screens ── */
@media (max-width: 1024px) {
  .btn, .btn.sm, .tabs button, .filters button, .seg button, .srcs button, .day-pick button, .clinic-switch button, .spec button, .firm button, .slot, .opt, .chk, .check-line { min-height: 44px; }
  .switch { min-height: 44px; }
  select, input[type="number"] { min-height: 44px; }
  .tabs button { display: inline-flex; align-items: center; }
}
@media (max-width: 1100px) {
  .top { position: relative; top: 0; }
}
@media (min-width: 1680px) {
  .wrap { max-width: 1600px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
