/* Audiology EMR — single stylesheet. Tokens first, then layout, components, views, print. */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #ccfbf1;
  --accent-hover: #115e59;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --right: #dc2626;   /* audiology convention: right ear red */
  --left: #2563eb;    /* left ear blue */
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 17px; margin: 0; font-weight: 600; }
h3 { font-size: 14px; margin: 0; font-weight: 600; text-transform: none; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.sidebar { background: #0f2a2c; color: #d5e5e4; display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; gap: 10px; align-items: center; padding: 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand strong { display: block; color: #fff; font-size: 13px; line-height: 1.2; }
.brand small { color: #8fb3b0; font-size: 11px; }
.logo-mark { display: flex; gap: 3px; align-items: center; height: 26px; }
.logo-mark span { width: 4px; border-radius: 2px; background: #5eead4; }
.logo-mark span:nth-child(1) { height: 10px; } .logo-mark span:nth-child(2) { height: 22px; }
.logo-mark span:nth-child(3) { height: 15px; } .logo-mark span:nth-child(4) { height: 26px; }
.nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; flex: 1; overflow: auto; }
.nav-link { display: flex; gap: 10px; align-items: center; padding: 9px 10px; color: #cfe1df; text-decoration: none; border-radius: 6px; font-size: 14px; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: #14b8a6; color: #04201e; font-weight: 600; }
.nav-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot .who strong { display: block; color: #fff; font-size: 13px; }
.sidebar-foot .who small { color: #8fb3b0; }
.sidebar-foot .btn { background: transparent; color: #cfe1df; border-color: rgba(255,255,255,.2); }
.sidebar-foot .btn:hover { background: rgba(255,255,255,.08); }
.content { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; gap: 12px; align-items: center; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.qf { position: relative; flex: 1; max-width: 560px; }
.qf input { width: 100%; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; background: var(--panel-2); }
.qf-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 420px; overflow: auto; }
.qf-item { display: block; padding: 8px 12px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.qf-item.sel, .qf-item:hover { background: var(--accent-soft); }
.qf-empty { padding: 12px; color: var(--muted); }
main { flex: 1; overflow: auto; outline: none; }
.page { padding: 20px 24px 40px; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); }

/* ---------- auth ---------- */
.auth-screen, .lock-screen { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #0f2a2c, #134e4a); padding: 16px; }
.lock-screen { position: fixed; inset: 0; z-index: 1000; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border-radius: 12px; padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h1 { margin: 8px 0 4px; }
.auth-logo .logo-mark span { background: var(--accent); }
.form-error { color: var(--danger); min-height: 1em; margin: 0; }
.center-screen { display: grid; place-items: center; height: 100vh; }

/* ---------- components ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: 6px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--panel-2); border-color: #94a3b8; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 8px; border-radius: 4px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); gap: 8px; min-height: 44px; }
.card-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #334155; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.card-body { padding: 14px; }
.card-body > .table-wrap { margin: -14px; }
.card-body > .empty { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-main-side { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .shell { grid-template-columns: 64px 1fr; } .nav-link span, .brand div, .sidebar-foot { display: none; } }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover { background: #f0fdfa; }
.table .right { text-align: right; }
.table tr.muted td { color: var(--muted); }
.table tr.void td { text-decoration: line-through; color: var(--muted); }
.table tfoot td { font-weight: 600; border-top: 2px solid var(--line); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #e2e8f0; color: #334155; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.empty { padding: 20px; text-align: center; color: var(--muted); }
.loading { padding: 30px; text-align: center; color: var(--muted); }
.error-box { background: var(--danger-soft); color: var(--danger); padding: 12px; border-radius: 6px; white-space: pre-wrap; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; border: 1px solid; }
.alert-warn { background: var(--warn-soft); border-color: #fcd34d; color: #78350f; }
.alert-danger { background: var(--danger-soft); border-color: #fca5a5; color: #7f1d1d; }
.alert-info { background: var(--info-soft); border-color: #93c5fd; color: #1e3a8a; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
@media (max-width: 900px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: #475569; }
.field small { color: var(--muted); font-size: 12px; }
.field .req { color: var(--danger); }
input, select, textarea { font: inherit; color: var(--text); padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; min-width: 0; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #99f6e4; border-color: var(--accent); }
input[readonly] { background: var(--panel-2); }
.field-check { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; }
.field-check input { width: auto; }
.field-check span { font-weight: 500; color: var(--text); font-size: 14px; }
.inline-input { width: auto; }
.section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; margin: 18px 0 8px; grid-column: 1 / -1; }
.section-title:first-child { margin-top: 0; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { margin-left: 6px; background: #e2e8f0; color: #334155; border-radius: 999px; padding: 0 7px; font-size: 11px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 200; padding: 16px; }
.modal { background: var(--panel); border-radius: 10px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-wide { max-width: 860px; }
.modal-xl { max-width: 1100px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 10px 10px; }

/* toast */
#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast { background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 420px; transition: opacity .3s; }
.toast-error { background: var(--danger); }
.toast.out { opacity: 0; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 2px; }
.stat.warn .value { color: var(--warn); }
.stat.danger .value { color: var(--danger); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .meta { color: var(--muted); font-size: 12px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- patient chart ---------- */
.chart-header { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; box-shadow: var(--shadow); display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.chart-header .avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.chart-header h1 { margin: 0; }
.chart-header .facts { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.chart-header .facts b { color: var(--text); font-weight: 600; }
.chart-header .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
/* chart alerts: red wherever the patient appears (chart banner, appointment window, schedule, today) */
.patient-alert { background: #fef2f2; border: 1px solid #fca5a5; border-left: 5px solid #dc2626; color: #991b1b; padding: 9px 14px; border-radius: 6px; margin-bottom: 14px; font-weight: 400; font-size: 15px; white-space: pre-line; }
.alert-text { color: #b91c1c; font-weight: 400; font-size: 13px; white-space: pre-line; }

/* ---------- schedule ---------- */
.sched-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.sched-toolbar h2 { min-width: 260px; }
.cal { display: grid; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-head { display: contents; }
.cal-head > div { padding: 8px; text-align: center; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 13px; position: sticky; top: 0; z-index: 2; }
.cal-head > div.today { color: var(--accent); }
.cal-times { border-right: 1px solid var(--line); }
.cal-time { height: var(--slot-h); font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.cal-day { position: relative; border-right: 1px solid var(--line); }
.cal-day:last-child { border-right: 0; }
.cal-slot { height: var(--slot-h); border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.cal-slot.hour { border-bottom-color: var(--line); }
.cal-slot:hover { background: #f0fdfa; }
.cal-slot.off { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 6px, #f1f5f9 6px, #f1f5f9 12px); }
.appt { position: absolute; left: 3px; right: 3px; border-radius: 5px; padding: 3px 6px; font-size: 12px; color: #fff; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.2); border-left: 4px solid rgba(0,0,0,.25); line-height: 1.25; }
.appt:hover { filter: brightness(1.08); z-index: 3; }
.appt.block { background: repeating-linear-gradient(45deg, #94a3b8, #94a3b8 6px, #a3b1c2 6px, #a3b1c2 12px) !important; }
.appt.st-cancelled, .appt.st-no_show { opacity: .45; text-decoration: line-through; }
.appt.st-completed { opacity: .75; }
.appt .t { font-weight: 600; }
.appt .flag { display: inline-block; background: #dc2626; color: #fff; border-radius: 3px; padding: 0 4px; margin-right: 4px; font-size: 11px; line-height: 15px; }
.month-appt .flag { color: #dc2626; font-weight: 700; margin-right: 3px; }
/* appointment hover card */
.appt-tip { position: fixed; z-index: 1000; max-width: 380px; padding: 8px 11px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); font-size: 12.5px; line-height: 1.45; white-space: pre-line; pointer-events: none; }
.appt-tip .tt-head { font-weight: 700; margin-bottom: 1px; }
.appt-tip .tt-patient { color: #b91c1c; margin-top: 4px; }
.appt-tip .tt-patient b { font-weight: 600; }
/* month view */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.month-head { padding: 8px; text-align: center; font-weight: 600; font-size: 13px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.month-day { min-height: 118px; min-width: 0; padding: 4px 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day:hover { background: #f0fdfa; }
.month-day.off { background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 6px, #f1f5f9 6px, #f1f5f9 12px); }
.month-day.other > * { opacity: .45; }
.month-num { align-self: flex-start; font-weight: 600; font-size: 13px; color: inherit; text-decoration: none; padding: 0 6px; border-radius: 999px; margin-bottom: 2px; }
.month-day.today .month-num { background: var(--accent); color: #fff; }
.month-appt { font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; padding: 1px 3px; }
.month-appt:hover { background: rgba(15, 23, 42, .07); }
.month-appt .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.month-appt .mt { color: var(--muted); }
.month-appt.block { color: var(--muted); font-style: italic; }
.month-appt.st-cancelled, .month-appt.st-no_show { text-decoration: line-through; opacity: .5; }
.month-more { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 0 3px; }
@media (max-width: 700px) { .month-day { min-height: 70px; } .month-appt .mt { display: none; } }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.status-pill { font-size: 11px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.25); margin-left: 4px; }

/* ---------- encounter ---------- */
.enc-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.enc-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.enc-nav a { padding: 6px 10px; border-radius: 5px; text-decoration: none; color: var(--text); font-size: 13px; }
.enc-nav a:hover { background: var(--panel-2); }
.enc-status { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow); flex-wrap: wrap; }
.save-state { font-size: 12px; color: var(--muted); }
.ear-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ear-r h4 { color: var(--right); } .ear-l h4 { color: var(--left); }
h4 { margin: 0 0 8px; font-size: 13px; }
.quickpicks { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.quickpicks button { font-size: 12px; padding: 2px 8px; border: 1px solid var(--line-strong); background: var(--panel-2); border-radius: 999px; cursor: pointer; }
.quickpicks button:hover { background: var(--accent-soft); border-color: var(--accent); }
.mini-table { border-collapse: collapse; width: 100%; }
.mini-table th, .mini-table td { padding: 4px; text-align: center; border: 1px solid var(--line); font-size: 13px; }
.mini-table th { background: var(--panel-2); font-weight: 600; font-size: 12px; }
.mini-table th.r { color: var(--right); } .mini-table th.l { color: var(--left); }
.mini-table input, .mini-table select { padding: 3px 4px; text-align: center; border-color: var(--line); }
.mini-table td.label { text-align: left; font-weight: 500; background: var(--panel-2); white-space: nowrap; }
.signed-banner { background: var(--ok-soft); color: var(--ok); border: 1px solid #86efac; padding: 8px 14px; border-radius: 6px; margin-bottom: 12px; }
fieldset[disabled] input, fieldset[disabled] select, fieldset[disabled] textarea { background: var(--panel-2); color: #334155; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.chip-list { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 13px; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }

/* ---------- audiogram ---------- */
.aud-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .aud-wrap { grid-template-columns: 1fr; } }
.aud-svg { width: 100%; height: auto; display: block; user-select: none; background: #fff; }
.aud-svg .grid line { stroke: #e2e8f0; }
.aud-svg .grid line.major { stroke: #cbd5e1; }
.aud-svg .axis text { font-size: 11px; fill: #475569; font-family: var(--font); }
.aud-svg .hit { fill: transparent; cursor: crosshair; }
.aud-svg .hit:hover { fill: rgba(20, 184, 166, .12); }
.aud-svg .sym { fill: none; stroke-width: 2; }
.aud-svg .sym-r { stroke: var(--right); } .aud-svg .sym-l { stroke: var(--left); }
.aud-svg .sym-sf { stroke: #111827; }
.aud-svg .line-r { stroke: var(--right); fill: none; stroke-width: 1.6; }
.aud-svg .line-l { stroke: var(--left); fill: none; stroke-width: 1.6; stroke-dasharray: 5 3; }
.aud-svg .banana { fill: #fde68a; opacity: .35; }
.aud-svg .degree text { font-size: 10px; fill: #94a3b8; }
.aud-tools { display: flex; flex-direction: column; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 6px 10px; font: inherit; cursor: pointer; border-right: 1px solid var(--line-strong); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: #fff; }
.seg button.on.r { background: var(--right); } .seg button.on.l { background: var(--left); }
.legend { display: grid; grid-template-columns: auto 1fr 1fr; gap: 2px 10px; font-size: 12px; align-items: center; }
.legend .r { color: var(--right); font-weight: 700; text-align: center; } .legend .l { color: var(--left); font-weight: 700; text-align: center; }
.aud-summary { font-size: 13px; }
.aud-summary td { padding: 2px 6px; }
.kbd { font-family: var(--mono); font-size: 11px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 4px; }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bars .bar i { display: block; width: 100%; max-width: 38px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 1px; }
.bars .bar i.b2 { background: #99f6e4; }
.bars .bar small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars .pair { display: flex; gap: 2px; align-items: flex-end; width: 100%; justify-content: center; height: 100%; }

/* ---------- print ---------- */
.print-preview { position: fixed; inset: 0; background: #525659; z-index: 500; overflow: auto; display: flex; flex-direction: column; align-items: center; }
.print-toolbar { position: sticky; top: 0; width: 100%; background: #323639; color: #fff; display: flex; gap: 8px; padding: 8px 16px; align-items: center; z-index: 2; }
.print-toolbar .btn { background: #fff; }
.print-page { background: #fff; width: 8.5in; min-height: 11in; padding: .6in .7in; margin: 20px 0; box-shadow: 0 2px 12px rgba(0,0,0,.4); color: #000; font-size: 12px; }
.print-page h1 { font-size: 20px; } .print-page h2 { font-size: 15px; margin: 14px 0 6px; border-bottom: 1px solid #999; padding-bottom: 2px; }
.print-page table { width: 100%; border-collapse: collapse; }
.print-page th, .print-page td { border: 1px solid #999; padding: 4px 6px; text-align: left; font-size: 11.5px; }
.print-page th { background: #eee; }
.print-page .noborder td, .print-page .noborder th { border: 0; padding: 2px 6px 2px 0; }
.print-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 12px; gap: 16px; }
.print-head .practice strong { font-size: 16px; display: block; }
.print-sig { margin-top: 30px; }
.print-sig .line { border-top: 1px solid #000; width: 280px; padding-top: 2px; margin-top: 36px; }
.print-page .aud-svg { max-width: 100%; }
.print-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.print-small { font-size: 10.5px; color: #333; }
.page-break { break-after: page; }
@page { size: letter; margin: 0; }
@media print {
  body { background: #fff; }
  body > *:not(.print-preview) { display: none !important; }
  .print-preview { position: static; background: #fff; display: block; overflow: visible; }
  .print-toolbar { display: none; }
  .print-page { margin: 0; box-shadow: none; width: auto; min-height: 0; }
}

/* two-factor sign-in */
.auth-card.auth-wide { max-width: 460px; }
.tfa-steps { margin: 0; padding-left: 20px; font-size: 14px; }
.tfa-steps li { margin: 2px 0; }
.tfa-qr { display: block; margin: 4px auto; width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--line, #e2e8f0); border-radius: 6px; }
.tfa-key { text-align: center; font-size: 16px; letter-spacing: 1px; padding: 6px; background: var(--bg, #f8fafc); border-radius: 6px; user-select: all; word-break: normal; }
.tfa-code { font-size: 22px; letter-spacing: 4px; text-align: center; font-family: var(--mono); }
.tfa-recovery { columns: 2; margin: 0; padding-left: 28px; font-size: 15px; line-height: 1.8; }
