/* RAAH MEDI — "scrub green on clinical white". One family (IBM Plex Sans),
   mono only for real identifiers (patient IDs, invoice numbers, tokens). */

:root {
  color-scheme: light;
  --paper: #F3F6F5;
  --surface: #FFFFFF;
  --surface-2: #F8FAF9;
  --ink: #15232A;
  --ink-2: #3C4D55;
  --muted: #5F7078;
  --line: #DCE3E1;
  --line-2: #E9EEEC;
  --brand: #0B6B61;
  --brand-ink: #075148;
  --brand-soft: #E2F1EE;
  --signal: #C2410C;
  --ok: #16794A;   --ok-soft: #E3F4EA;
  --warn: #9A5B00; --warn-soft: #FFF3D6;
  --bad: #B42318;  --bad-soft: #FDECEA;
  --info: #1F5FA8; --info-soft: #E5EEF9;
  --side: #0E2A2B;
  --side-ink: #CFE2DF;
  --side-mute: #7FA19C;
  --shadow: 0 1px 2px rgba(16, 35, 40, .06), 0 4px 14px rgba(16, 35, 40, .05);
  --radius: 10px;
  --radius-sm: 7px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0D1517; --surface: #142024; --surface-2: #18262A; --ink: #E3ECEA; --ink-2: #BCCBC8; --muted: #8DA09D;
    --line: #26373B; --line-2: #1E2D31; --brand: #2BA394; --brand-ink: #5CC7B9; --brand-soft: #123A36;
    --ok: #4CC98A; --ok-soft: #12352A; --warn: #F0B54A; --warn-soft: #3A2C10; --bad: #F2796C; --bad-soft: #3D1A17;
    --info: #79A9EA; --info-soft: #172B45; --side: #0A1416; --side-ink: #C5D8D5; --side-mute: #6E8A86;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0D1517; --surface: #142024; --surface-2: #18262A; --ink: #E3ECEA; --ink-2: #BCCBC8; --muted: #8DA09D;
  --line: #26373B; --line-2: #1E2D31; --brand: #2BA394; --brand-ink: #5CC7B9; --brand-soft: #123A36;
  --ok: #4CC98A; --ok-soft: #12352A; --warn: #F0B54A; --warn-soft: #3A2C10; --bad: #F2796C; --bad-soft: #3D1A17;
  --info: #79A9EA; --info-soft: #172B45; --side: #0A1416; --side-ink: #C5D8D5; --side-mute: #6E8A86;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums; }
body.no-scroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.02rem; font-weight: 600; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .5em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
small { font-size: .82em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.thin { font-weight: 400; }
.block { display: block; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.pre { white-space: pre-wrap; }
.num { text-align: right; white-space: nowrap; }
.text-bad { color: var(--bad); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }
.text-ok { color: var(--ok); font-weight: 600; }
.danger-text { color: var(--bad) !important; }
.grow { flex: 1; }
.link { font-size: .88rem; }
.strong-link { font-weight: 600; color: var(--ink); }
.strong-link:hover { color: var(--brand); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; min-height: 40px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: 500 .92rem/1.2 var(--font); cursor: pointer;
  background: var(--surface); color: var(--ink); white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
:root[data-theme="dark"] .btn.primary, :root:not([data-theme="light"]) .btn.primary { color: #fff; }
.btn.ghost { border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: .84rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--line-2); }
.icon-btn.flip .icon { transform: rotate(180deg); }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, fieldset legend { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.req { color: var(--bad); }
input, select, textarea {
  width: 100%; font: inherit; font-size: .94rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 11px; min-height: 40px;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; margin: 2px 0 0; }
.hint { color: var(--muted); font-size: .8rem; }
.static { margin: 8px 0 0; }
.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: .92rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px 12px; margin: 0; min-width: 0; }
fieldset.checks { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.form-error { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 9px 12px; font-size: .9rem; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 12px; align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field.compact { gap: 2px; }
.field.compact label:empty { display: none; }
.field.compact select, .field.compact input { min-height: 38px; padding: 7px 10px; }
.compact-row { margin: 8px 0; }
.row-actions, .modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.modal-actions.stack { flex-direction: column; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 14px 0 4px; display: flex; gap: 8px; justify-content: flex-end; z-index: 2; }
.card .sticky-actions { background: linear-gradient(transparent, var(--surface) 30%); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; padding: 4px 2px; }
.filter-input { margin-bottom: 6px; }
.time-input { max-width: 180px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40;
}
.sb-brand { display: flex; gap: 11px; align-items: center; padding: 18px 16px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.sb-brand-text { display: grid; min-width: 0; }
.sb-brand-text strong { color: #fff; font-weight: 600; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-brand-text small { color: var(--side-mute); font-family: var(--mono); }
.brand-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; background: #fff; padding: 3px; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.sb-nav { padding: 8px 10px 16px; display: grid; gap: 1px; }
.sb-group { margin: 16px 10px 5px; font-size: .74rem; font-weight: 600; color: var(--side-mute); }
.sb-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; color: var(--side-ink); font-size: .92rem; text-decoration: none; }
.sb-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-nav a.active { background: rgba(43, 163, 148, .2); color: #fff; box-shadow: inset 3px 0 0 #3CC2B1; }
.sb-foot { margin-top: auto; padding: 12px 18px; color: var(--side-mute); }
.sb-overlay { display: none; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 24px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.gsearch { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }
.gsearch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.gsearch > .icon { color: var(--muted); }
.gsearch input { border: 0; box-shadow: none !important; padding: 9px 0; background: transparent; }
.gsearch kbd { font: 500 .75rem var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.gsearch-list, .picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); max-height: 380px; overflow: auto; z-index: 50;
}
.gsearch-list a, .picker-list button {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 7px; color: var(--ink);
  text-decoration: none; width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
}
.gsearch-list a:hover, .gsearch-list a.active, .picker-list button:hover { background: var(--brand-soft); }
.picker-empty { padding: 10px; color: var(--muted); }
.picker-new { color: var(--brand) !important; grid-template-columns: auto 1fr !important; font-weight: 600 !important; }
.tag-in { color: var(--info); font-weight: 600; }
.usermenu { position: relative; margin-left: auto; }
.user-btn { display: flex; align-items: center; gap: 9px; border: 0; background: none; cursor: pointer; color: inherit; font: inherit; padding: 4px 6px; border-radius: 9px; }
.user-btn:hover { background: var(--line-2); }
.user-meta { display: grid; text-align: left; line-height: 1.2; }
.user-meta small { color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; font-size: .84rem; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; }
.user-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14); padding: 6px; z-index: 60; }
.user-pop a, .user-pop button { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 7px; color: var(--ink); width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-decoration: none; }
.user-pop a:hover, .user-pop button:hover { background: var(--line-2); }
.content { padding: 24px; width: 100%; max-width: 1360px; margin: 0 auto; flex: 1; }
.content:focus { outline: none; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 24px; background: var(--info-soft); color: var(--info); font-size: .9rem; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.inline { border-radius: var(--radius); margin-bottom: 16px; padding: 12px 16px; }
.banner a { color: inherit; font-weight: 600; text-decoration: underline; }
.only-mobile { display: none; }

/* ---------- Page scaffolding ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; margin-bottom: 10px; color: var(--muted); }
.back-link .icon { width: 16px; height: 16px; }
.section-title { margin: 26px 0 10px; display: flex; gap: 10px; align-items: center; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 36px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font: 500 .86rem var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--brand-soft); color: var(--brand-ink); }
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.subnav a { padding: 9px 14px; color: var(--muted); font-weight: 500; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.subnav a.on { color: var(--brand-ink); border-color: var(--brand); }
.date-nav { display: flex; align-items: center; gap: 4px; }
.date-nav input { width: auto; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cards { gap: 16px; }
.cards .card + .card { margin-top: 0; }
.sub-h { margin: 8px 0 -2px; font-size: .9rem; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  position: relative; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow);
}
a.stat:hover { border-color: var(--brand); }
.stat-ic { position: absolute; right: 14px; top: 14px; color: var(--muted); }
.stat-label { color: var(--muted); font-size: .84rem; }
.stat-value { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.stat-value small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.stat-sub { color: var(--muted); font-size: .8rem; }
.stat-brand { border-left: 4px solid var(--brand); }
.stat-warn { border-left: 4px solid var(--warn); }
.stat-bad { border-left: 4px solid var(--bad); }

.quicks { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.quick { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; text-decoration: none !important; }
.quick:hover { background: var(--brand); color: #fff; }
.alerts { display: grid; gap: 6px; margin-bottom: 16px; }
.alerts a { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-weight: 500; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid .card + .card { margin-top: 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list li > span:first-child { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.list .time { font-weight: 600; min-width: 74px; color: var(--brand-ink); }
.list-link { display: flex; gap: 10px; align-items: center; color: var(--ink); flex: 1; text-decoration: none !important; }
.list-link:hover strong { color: var(--brand); }
.li-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.bed-tag { font-family: var(--mono); font-size: .82rem; background: var(--info-soft); color: var(--info); padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.chip { display: inline-block; background: var(--line-2); color: var(--ink-2); border-radius: 999px; padding: 1px 8px; font-size: .76rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 5px 9px; font: .82rem var(--mono); cursor: pointer; color: var(--ink); }
.chip-btn.bed-occupied { border-color: var(--info); color: var(--info); }
.chip-btn.bed-maintenance { border-color: var(--warn); color: var(--warn); }

/* ---------- Charts ---------- */
.chart { display: flex; align-items: flex-end; gap: 0; padding-bottom: 20px; position: relative; border-bottom: 1px solid var(--line); }
.chart-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; padding: 0 2px; }
.chart-bar { width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; position: relative; opacity: .85; transition: opacity .15s; }
.chart-col:hover .chart-bar { opacity: 1; }
.chart-tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); font-size: .74rem; padding: 2px 6px; border-radius: 4px; white-space: nowrap; z-index: 2; }
.chart-col:hover .chart-tip { display: block; }
.chart-x { position: absolute; bottom: -19px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.hbar { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hbar li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { background: var(--line-2); border-radius: 4px; height: 9px; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.hbar-val { font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .btn + .btn { margin-left: 4px; }
.table th.num { text-align: right; }
.table input.qty { width: 84px; text-align: right; min-height: 34px; padding: 5px 8px; }
.table select { min-width: 200px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 2px; color: var(--muted); font-size: .86rem; flex-wrap: wrap; }
.pager-btns { display: flex; gap: 6px; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; line-height: 1.6; text-decoration: none !important; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-muted { background: var(--line-2); color: var(--muted); }

.empty { display: grid; justify-items: center; gap: 8px; padding: 48px 16px; color: var(--muted); text-align: center; }
.empty .icon { width: 30px; height: 30px; opacity: .6; }
.empty.small { padding: 18px 8px; font-size: .9rem; }
.empty.error { color: var(--bad); }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 40px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(8, 20, 22, .48); display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
.modal-backdrop.out { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.modal-sm { max-width: 420px; } .modal-md { max-width: 580px; } .modal-lg { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 10px; gap: 10px; }
.modal-head h2 { font-size: 1.1rem; }
.modal-body { padding: 6px 20px 20px; overflow-y: auto; }
.confirm-text { font-size: .98rem; margin-bottom: 16px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: .92rem; animation: pop .2s ease-out; }
.toast-ok .icon { color: #5FD3A0; }
.toast-error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .25s; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 46%) 1fr; }
.auth-side { background: var(--side); color: var(--side-ink); padding: 36px 44px; display: flex; flex-direction: column; gap: 36px; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 56px solid rgba(60, 194, 177, .08); }
.brand-row { display: flex; gap: 12px; align-items: center; }
.brand-row strong { display: block; color: #fff; font-size: 1.05rem; }
.brand-row small { color: var(--side-mute); }
.auth-pitch { margin-top: auto; max-width: 440px; }
.auth-pitch h1 { color: #fff; font-size: 2.1rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 14px; }
.auth-pitch p { color: var(--side-ink); font-size: 1.02rem; }
.auth-points { list-style: none; margin: 0 0 auto; padding: 0; display: grid; gap: 12px; max-width: 440px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; }
.auth-points .icon { color: #3CC2B1; margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.45rem; margin-bottom: 6px; }
.auth-card > p { margin-bottom: 20px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; font-size: .9rem; flex-wrap: wrap; }
.debug-note { margin-top: 18px; font-size: .82rem; color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; }
.steps { display: flex; gap: 6px; margin-bottom: 4px; }
.step { flex: 1; font-size: .8rem; font-weight: 600; color: var(--muted); padding-top: 8px; border-top: 3px solid var(--line); }
.step.on { color: var(--brand-ink); border-color: var(--brand); }
section[data-step] { display: grid; gap: 12px; }
.otp-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.otp-verify { display: grid; gap: 4px; }
.otp-debug { color: var(--warn); font-weight: 600; }
.boot-error { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; text-align: center; }
.boot-error .icon { width: 36px; height: 36px; color: var(--bad); }

/* ---------- Subscription ---------- */
.usage { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.usage div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; display: grid; }
.usage span { color: var(--muted); font-size: .82rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.plan.current { border: 2px solid var(--brand); }
.plan-price { font-size: 1.8rem; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.plan-price small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 6px; font-size: .9rem; }
.plan li { display: flex; gap: 8px; } .plan li .icon { color: var(--brand); width: 16px; }

/* ---------- Patient ---------- */
.patient-hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; margin-bottom: 14px; }
.ph-main { display: flex; gap: 16px; align-items: center; min-width: 0; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); margin: 6px 0 0; }
.ph-meta span { display: inline-flex; gap: 5px; align-items: center; }
.ph-meta .icon { width: 15px; height: 15px; }
.blood { background: var(--bad-soft); color: var(--bad) !important; font-weight: 700; padding: 0 8px; border-radius: 5px; }
.ph-side { display: flex; gap: 8px; align-items: flex-start; justify-content: flex-end; flex-wrap: wrap; }
.due { background: var(--warn-soft); color: var(--warn); padding: 6px 12px; border-radius: 8px; font-size: .86rem; }
.ph-details { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 20px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line-2); }
.ph-details dt { font-size: .78rem; color: var(--muted); }
.ph-details dd { margin: 0; font-size: .92rem; overflow-wrap: anywhere; }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: 500 .9rem var(--font); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--brand-ink); border-color: var(--brand); }
.chosen { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--brand); background: var(--brand-soft); border-radius: var(--radius-sm); }
.picker { position: relative; }
.picker-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; background: var(--surface); }
.picker-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.picker-input input { border: 0; box-shadow: none !important; padding-left: 0; }
.picker-input .icon { color: var(--muted); }
.slots { display: flex; flex-wrap: wrap; gap: 6px; max-height: 200px; overflow: auto; }
.slot { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 6px 10px; font: 500 .84rem var(--font); cursor: pointer; color: var(--ink); }
.slot:hover:not(:disabled) { border-color: var(--brand); }
.slot.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

/* ---------- OPD queue — the token board ---------- */
.queue { display: grid; gap: 10px; }
.qcard { display: grid; grid-template-columns: 84px 1fr auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 12px 12px; box-shadow: var(--shadow); }
.token { display: grid; place-items: center; align-content: center; height: 72px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font: 600 2rem/1 var(--mono); color: var(--ink); }
.token small { font: 500 .66rem var(--font); color: var(--muted); margin-bottom: 4px; }
.status-in_consultation .token { background: var(--brand); color: #fff; border-color: var(--brand); }
.status-in_consultation .token small { color: rgba(255, 255, 255, .8); }
.status-vitals_done .token { border-color: var(--brand); color: var(--brand-ink); }
.status-completed, .status-cancelled { opacity: .7; }
.qbody { min-width: 0; }
.qbody p { margin: 2px 0 0; }
.qcc { font-size: .9rem; color: var(--ink-2); }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px !important; font-size: .82rem; }
.qactions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Visit ---------- */
.visit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.visit-main > * + * { margin-top: 14px; }
.visit-side > * + * { margin-top: 14px; }
.visit-side .card + .card { margin-top: 14px; }
.sticky { position: sticky; top: 76px; }
.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.vitals div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; display: grid; }
.vitals small { color: var(--muted); font-size: .76rem; }
.vitals strong { font-size: 1.05rem; }
.vitals .abn { background: var(--bad-soft); } .vitals .abn strong { color: var(--bad); }
.rx-head, .rx-row { display: grid; grid-template-columns: minmax(160px, 2.2fr) 1fr 1fr 74px 1.3fr 38px; gap: 6px; align-items: center; }
.rx-head { font-size: .76rem; color: var(--muted); font-weight: 600; padding: 0 2px; }
#rx { display: grid; gap: 6px; }
.rx-row input { min-height: 38px; padding: 7px 9px; }
.out-of-stock { border-color: var(--warn) !important; }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: .86rem; } .dl dd { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; }
.facts small { color: var(--muted); font-size: .78rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline li:last-child { padding-bottom: 0; border-color: transparent; }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .88rem; margin-bottom: 4px; }
.tl-head time { margin-left: auto; color: var(--muted); font-size: .8rem; }
.tl-vitals { font-size: .84rem; color: var(--info); margin: 0 0 4px; }

/* ---------- Beds ---------- */
.legend { display: flex; gap: 16px; margin-bottom: 14px; font-size: .84rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-available::before { background: var(--ok-soft); border: 1px solid var(--ok); }
.lg-occupied::before { background: var(--info-soft); border: 1px solid var(--info); }
.lg-maintenance::before { background: var(--warn-soft); border: 1px solid var(--warn); }
.ward { margin-bottom: 22px; }
.ward > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bed { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 9px; border: 1px solid; font: inherit; cursor: pointer; text-decoration: none !important; color: var(--ink); min-height: 76px; align-content: start; }
.bed:disabled { cursor: default; }
.bed-no { font: 600 .84rem var(--mono); }
.bed strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bed small { color: var(--muted); font-size: .76rem; }
.bed-available { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.bed-occupied { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 45%, transparent); }
.bed-maintenance { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
a.bed:hover { border-color: var(--info); }
.ward-admin .chips { margin-top: 4px; }

/* ---------- Pharmacy / billing ---------- */
.add-line { display: flex; gap: 8px; margin-bottom: 12px; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-row.grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 1.15rem; }
.charge-list { list-style: none; margin: 0; padding: 0; }
.charge-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.charge-list li:last-child { border-bottom: 0; }
.item-row, .sched-row { display: grid; grid-template-columns: 1fr 80px 120px 38px; gap: 6px; margin-bottom: 6px; align-items: center; }
.sched-row { grid-template-columns: 1.3fr 1fr 1fr 1fr 38px; }
#rows { margin: 10px 0; }
.visit-side .check { margin: 10px 0; }


/* ---------- Platform settings ---------- */
.health { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.health-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; color: var(--ink); text-decoration: none !important; border: 1px solid var(--line); }
.health-item:hover { border-color: var(--brand); }
.health-item small { color: var(--muted); }
.hi-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.hi-dot .icon { width: 15px; height: 15px; }
.hi-ok .hi-dot { background: var(--ok-soft); color: var(--ok); }
.hi-warn .hi-dot { background: var(--warn-soft); color: var(--warn); }
.hi-bad .hi-dot { background: var(--bad-soft); color: var(--bad); }
.setup-status { margin-bottom: 16px; }
.health-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.hcard { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-width: 180px; }
.hcard div { display: grid; line-height: 1.3; } .hcard small { color: var(--muted); }
.hcard.ok { border-left: 4px solid var(--ok); } .hcard.ok > .icon { color: var(--ok); }
.hcard.warn { border-left: 4px solid var(--warn); } .hcard.warn > .icon { color: var(--warn); }
.hcard.bad { border-left: 4px solid var(--bad); } .hcard.bad > .icon { color: var(--bad); }
.subnav a { display: inline-flex; align-items: center; gap: 7px; }
.subnav a .icon { width: 16px; height: 16px; }
.secret-wrap { display: flex; gap: 4px; align-items: center; }
.secret-wrap input { font-family: var(--mono); }
.linklike { border: 0; background: none; padding: 0; color: var(--bad); font: inherit; font-size: inherit; cursor: pointer; text-decoration: underline; }
.grid-3c { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: start; }
.w-sm { max-width: 220px; }
details.adv > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary h2::before { content: "▸ "; color: var(--muted); }
details.adv[open] > summary h2::before { content: "▾ "; }
details.adv[open] > summary { margin-bottom: 12px; }
details.adv .grid-3 + .grid-3 { margin-top: 12px; }
.req-preview { margin-top: 14px; display: grid; gap: 4px; }
.req-preview code, .copy-row code { display: block; font: .8rem/1.5 var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); }
.test-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.test-row .field { flex: 1; max-width: 280px; }
.test-result { margin-top: 12px; padding: 12px 14px; border-radius: 9px; font-size: .9rem; }
.test-result strong { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.test-result.ok { background: var(--ok-soft); color: var(--ok); } .test-result.bad { background: var(--bad-soft); color: var(--bad); }
.test-result dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 6px 0 0; color: var(--ink); }
.test-result dt { color: var(--muted); font-size: .82rem; } .test-result dd { margin: 0; word-break: break-all; font-size: .84rem; }
p.test-result { display: flex; gap: 8px; align-items: flex-start; }
.tpl-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.tpl-preview { margin: 0; padding: 9px 11px; background: var(--brand-soft); border-radius: 12px 12px 12px 3px; font-size: .88rem; color: var(--ink); min-height: 40px; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-opt { display: flex; gap: 10px; padding: 14px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.mode-opt small { display: block; color: var(--muted); }
.mode-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.mode-opt.live:has(input:checked) { border-color: var(--signal); background: var(--warn-soft); }
.copy-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.copy-row code { flex: 1; }
.color-row { display: flex; gap: 8px; } .color-row input[type=color] { width: 52px; padding: 3px; flex: none; }
.warn-card { border-left: 4px solid var(--warn); }
.rzp-result:empty { display: none; }
.ev-list { display: grid; gap: 8px; }
.ev { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.ev.off { opacity: .6; cursor: default; }
.ev-list .btn { justify-self: start; margin-top: 4px; }
#smsev { margin-top: 14px; }
@media (max-width: 640px) {
  .grid-3c, .mode-pick { grid-template-columns: 1fr; }
  .test-row .field { max-width: none; }
  .test-result dl { grid-template-columns: 1fr; }
  .hcard { flex: 1 1 140px; min-width: 0; }
}


/* ---------- Simple setup page ---------- */
.steps-bar { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.steps-bar li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.steps-bar li span { grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; }
.steps-bar li small { font-weight: 500; color: var(--muted); }
.sb-ok span { background: var(--ok); } .sb-warn span { background: var(--warn); } .sb-bad span { background: var(--bad); }
.sb-ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)) !important; }
.setup-card { display: grid; gap: 14px; margin-bottom: 16px; }
.setup-card + .setup-card { margin-top: 0; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.setup-head > div { display: flex; gap: 12px; align-items: flex-start; }
.setup-head p { margin: 2px 0 0; }
.step-no { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .84rem; font-weight: 600; white-space: nowrap; }
.pill .icon { width: 15px; height: 15px; }
.pill-ok { background: var(--ok-soft); color: var(--ok); } .pill-warn { background: var(--warn-soft); color: var(--warn); } .pill-bad { background: var(--bad-soft); color: var(--bad); }
.sms-bubble { margin: -4px 0 0; max-width: 520px; padding: 10px 13px; background: var(--brand-soft); border-radius: 14px 14px 14px 4px; font-size: .9rem; position: relative; }
.sms-bubble::after { content: attr(data-count); display: block; font-size: .74rem; color: var(--muted); margin-top: 4px; }
.adv-link > summary { cursor: pointer; color: var(--brand); font-size: .9rem; font-weight: 500; width: fit-content; }
.adv-body { display: grid; gap: 12px; margin-top: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; }
.adv-body .btn { justify-self: start; }
.test-box { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.test-result details { margin-top: 8px; color: var(--ink); }
.test-result details summary { cursor: pointer; font-size: .84rem; color: var(--muted); }
.test-result p { margin: 4px 0 0; color: var(--ink); }
.setup-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 14px; }
.mode-note { margin: -4px 0 0; font-size: .88rem; display: flex; gap: 6px; align-items: center; color: var(--ok); }
.mode-note:empty { display: none; }
.mode-note.live { color: var(--signal); font-weight: 600; }
.mode-note .icon { width: 16px; height: 16px; }
.mode-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.mode-opt.live.on { border-color: var(--ok); background: var(--ok-soft); }
.more-settings > summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.more-settings > summary::-webkit-details-marker { display: none; }
.more-settings > summary h2::before { content: "▸ "; color: var(--muted); }
.more-settings[open] > summary h2::before { content: "▾ "; }
.more-settings[open] > summary { margin-bottom: 12px; }
.tpl-mini { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.diag { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--info-soft); color: var(--info); margin-bottom: 16px; font-weight: 500; }
.diag p { margin: 0; flex: 1; }
.diag.bad { background: var(--bad-soft); color: var(--bad); } .diag.ok { background: var(--ok-soft); color: var(--ok); }
.otp-search { margin-bottom: 16px; }
@media (max-width: 640px) {
  .steps-bar { grid-template-columns: 1fr; gap: 6px; }
  .mode-compare { grid-template-columns: 1fr; }
  .setup-actions .btn { flex: 1; }
}


/* ---------- Public website ---------- */
.pub { min-height: 100vh; background: var(--paper); }
.pub-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px clamp(16px, 4vw, 48px); background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.pub-brand { display: flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none !important; }
.pub-brand strong { display: block; font-size: 1.02rem; } .pub-brand small { color: var(--muted); font-size: .76rem; }
.pub-nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pub-nav > a:not(.btn) { color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.promo-strip { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 16px; background: var(--side); color: #E7F3F1; font-size: .92rem; text-align: center; flex-wrap: wrap; }
.promo-strip .icon { color: #3CC2B1; }
.code-chip { font: 600 .9rem var(--mono); border: 1.5px dashed currentColor; background: transparent; color: inherit; padding: 2px 9px; border-radius: 6px; cursor: pointer; letter-spacing: .04em; }
.code-chip.big { font-size: 1.05rem; color: var(--brand-ink); padding: 4px 12px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 64px); align-items: center; padding: clamp(36px, 6vw, 84px) clamp(16px, 4vw, 48px); max-width: 1240px; margin: 0 auto; }
.hero h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.1; letter-spacing: -.025em; margin-bottom: 16px; }
.hero-text > p { font-size: 1.12rem; color: var(--ink-2); max-width: 560px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 18px; }
.hero-cta .btn { min-height: 48px; padding: 12px 22px; font-size: 1rem; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px 20px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; }
.hero-points li { display: flex; gap: 6px; align-items: center; } .hero-points .icon { color: var(--brand); width: 16px; }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 20px 50px rgba(14, 42, 43, .12); display: grid; gap: 10px; transform: rotate(1deg); }
.hc-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; }
.hc-row small { display: block; color: var(--muted); }
.token-mini { width: 44px; height: 44px; border-radius: 9px; display: grid; place-items: center; font: 600 1.3rem var(--mono); background: var(--surface-2); border: 1px solid var(--line); }
.hc-row:first-child .token-mini { background: var(--brand); color: #fff; border-color: var(--brand); }
.hc-foot { display: flex; justify-content: space-between; padding: 10px 6px 2px; color: var(--muted); } .hc-foot strong { color: var(--ink); font-size: 1.2rem; }
.pub-section { max-width: 1240px; margin: 0 auto; padding: clamp(32px, 5vw, 64px) clamp(16px, 4vw, 48px); }
.pub-section > h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); text-align: center; margin-bottom: 10px; letter-spacing: -.015em; }
.center { text-align: center; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 26px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.feat .icon { width: 26px; height: 26px; color: var(--brand); } .feat h3 { margin: 10px 0 4px; font-size: 1.02rem; } .feat p { color: var(--muted); font-size: .92rem; margin: 0; }
.how { background: var(--surface); max-width: none; border-block: 1px solid var(--line); }
.how-steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1100px; margin: 26px auto 0; padding: 0; }
.how-steps li { counter-increment: s; display: grid; gap: 4px; padding-left: 52px; position: relative; }
.how-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.how-steps span { color: var(--muted); font-size: .92rem; }
.pub-plans { margin-top: 26px; }
.plan-price s { color: var(--muted); font-size: .65em; font-weight: 500; margin-right: 4px; }
.plan-promo { margin: -6px 0 0; color: var(--ok); font-weight: 600; font-size: .86rem; }
.faq { max-width: 800px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 600; } .faq details p { margin: 8px 0 0; color: var(--ink-2); }
.pub-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); background: var(--surface); font-size: .9rem; color: var(--muted); }
.pub-foot span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Patient booking ---------- */
.book .pub-top { position: static; }
.book-head { max-width: 860px; margin: 0 auto; padding: 28px 16px 8px; }
.book-hosp { color: var(--ink-2); margin-top: 6px; }
.book-note { display: flex; gap: 8px; align-items: center; background: var(--info-soft); color: var(--info); padding: 10px 12px; border-radius: 10px; font-size: .92rem; }
.book-steps { max-width: 860px; margin: 0 auto; padding: 8px 16px 48px; display: grid; gap: 14px; }
.bstep { display: grid; gap: 14px; } .bstep + .bstep { margin-top: 0; }
.bstep > h2 { display: flex; gap: 10px; align-items: center; font-size: 1.1rem; }
.bstep > h2 span { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.seg.wrap { flex-wrap: wrap; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.doc-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.doc-card small { display: block; color: var(--muted); font-size: .82rem; }
.doc-card:hover { border-color: var(--brand); } .doc-card.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand-soft); }
.date-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.date-btn { flex: none; scroll-snap-align: start; display: grid; justify-items: center; width: 66px; padding: 8px 4px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.date-btn small { font-size: .72rem; color: var(--muted); } .date-btn strong { font-size: 1.3rem; line-height: 1.2; }
.date-btn.on { border-color: var(--brand); background: var(--brand); color: #fff; } .date-btn.on small { color: rgba(255, 255, 255, .85); }
.slots.big { max-height: none; } .slots.big .slot { padding: 9px 14px; font-size: .92rem; min-width: 92px; }
.summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--brand-soft); padding: 10px 12px; border-radius: 10px; margin: 0; }
.booked { text-align: center; justify-items: center; display: grid; gap: 12px; padding: 28px 20px; }
.booked-ic { width: 60px; height: 60px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.booked-ic .icon { width: 30px; height: 30px; }
.booked .dl { text-align: left; max-width: 460px; width: 100%; }

/* ---------- Promo / announcements ---------- */
.promo-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px dashed var(--brand); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.promo-box > .icon { color: var(--brand); } .promo-box label { font-weight: 600; }
.promo-box input { width: 190px; font-family: var(--mono); }
.promo-msg { font-size: .9rem; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.promo-msg.ok { color: var(--ok); } .promo-msg.bad { color: var(--bad); }
.banner.ann { border-bottom: 1px solid var(--line); }
.banner.ann > span { flex: 1; } .banner.ann .icon-btn { width: 30px; height: 30px; color: inherit; }
.ann-info { background: var(--info-soft); color: var(--info); } .ann-warn { background: var(--warn-soft); color: var(--warn); } .ann-success { background: var(--ok-soft); color: var(--ok); }
.chip-online { background: var(--info-soft); color: var(--info); font-weight: 600; }
.switch-row { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.promo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); }
.promo-card.dim { opacity: .7; }
.promo-card header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.promo-off { font-size: 1.25rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.promo-card > p { margin: 0; }
.promo-rules { list-style: none; padding: 0; margin: 0; font-size: .85rem; color: var(--ink-2); display: grid; gap: 2px; }
.promo-rules li::before { content: "· "; color: var(--muted); }
.promo-usage { display: grid; gap: 4px; font-size: .84rem; color: var(--muted); }
.promo-card footer { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 10px; }
.disc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.disc-in { width: 120px; } .max-wrap { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.chip-check { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.checks-row { display: grid; gap: 8px; }
.ann-list { display: grid; gap: 12px; } .ann-card { display: grid; gap: 10px; }
.ann-card .banner { margin: 0; }
.ann-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .86rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; } .hero-card { transform: none; }
  .how-steps { grid-template-columns: 1fr; }
  .pub-nav > a:not(.btn) { display: none; }
}
@media (max-width: 640px) {
  .pub-top { padding: 10px 14px; } .pub-brand small { display: none; }
  .pub-nav .btn.ghost { display: none; }
  .doc-grid { grid-template-columns: 1fr; }
  .promo-box input { flex: 1; width: auto; }
  .disc-in { width: 96px; }
}


/* ---------- Auth v2 ---------- */
.auth2 { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 44%) 1fr; background: var(--paper); }
.a2-side { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #13403E 0%, var(--side) 55%, #071817 100%); color: var(--side-ink);
  padding: clamp(24px, 4vw, 48px); display: flex; flex-direction: column; gap: 28px; }
.a2-side::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 64px solid rgba(60, 194, 177, .07); pointer-events: none; }
.a2-brand { display: flex; gap: 12px; align-items: center; color: #fff; text-decoration: none !important; }
.a2-brand strong { display: block; font-size: 1.08rem; } .a2-brand small { color: var(--side-mute); }
.a2-pitch { margin-top: auto; }
.a2-pitch h1 { color: #fff; font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.08; letter-spacing: -.025em; margin-bottom: 14px; }
.a2-pitch p { font-size: 1.02rem; max-width: 440px; margin: 0; }
.a2-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 520px; }
.a2-stat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); border-radius: 12px; padding: 12px; display: grid; gap: 2px; }
.a2-stat span { font-size: .76rem; color: var(--side-mute); } .a2-stat strong { color: #fff; font-size: 1.25rem; letter-spacing: -.01em; }
.a2-stat strong small { font-size: .8rem; color: var(--side-mute); } .a2-stat em { font-style: normal; font-size: .74rem; color: #6FD6C8; }
.a2-points { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 10px; font-size: .94rem; }
.a2-points li { display: flex; gap: 10px; align-items: center; } .a2-points .icon { color: #3CC2B1; }
.a2-help { margin: 0; font-size: .88rem; } .a2-help a { color: #6FD6C8; }
.a2-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(20px, 4vw, 48px) 16px; gap: 18px; }
.a2-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 3vw, 32px); box-shadow: 0 18px 50px rgba(14, 42, 43, .08); }
.a2-card.wide { max-width: 520px; }
.a2-card > h2 { font-size: 1.5rem; letter-spacing: -.015em; margin-bottom: 4px; }
.a2-card > p.muted { margin-bottom: 18px; }
.a2-foot { color: var(--muted); font-size: .82rem; margin: 0; text-align: center; }
.a2-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .84rem; margin: 18px 0 10px; }
.a2-or::before, .a2-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.a2-switch { text-align: center; margin: 16px 0 0; font-size: .92rem; }
.btn.lg { min-height: 48px; font-size: 1rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lbl { font-size: .82rem; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 6px; }
.phone-in, .pw-in, .code-in { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.phone-in:focus-within, .pw-in:focus-within, .code-in:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.phone-in span { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); font-weight: 600; border-right: 1px solid var(--line); font-size: .92rem; }
.phone-in input, .pw-in input, .code-in input { border: 0; box-shadow: none !important; flex: 1; min-width: 0; }
.phone-in input { letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.pw-eye { border: 0; background: none; padding: 0 12px; color: var(--muted); cursor: pointer; }
.pw-eye.on { color: var(--brand); }
.caps-warn { display: flex; gap: 5px; align-items: center; color: var(--warn); font-size: .8rem; } .caps-warn .icon { width: 14px; height: 14px; }
.pw-meter { display: flex; align-items: center; gap: 10px; }
.pw-meter span { flex: 1; height: 5px; border-radius: 3px; background: var(--line-2); position: relative; overflow: hidden; }
.pw-meter span::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: var(--bad); transition: width .2s, background .2s; }
.pw-meter[data-score="1"] span::after { width: 25%; } .pw-meter[data-score="2"] span::after { width: 50%; background: var(--warn); }
.pw-meter[data-score="3"] span::after { width: 75%; background: var(--ok); } .pw-meter[data-score="4"] span::after { width: 100%; background: var(--ok); }
.pw-meter small { min-width: 64px; text-align: right; color: var(--muted); font-size: .78rem; }
.code-in input { font-family: var(--mono); letter-spacing: .04em; }
.code-state { display: inline-flex; gap: 5px; align-items: center; padding: 0 12px; font-size: .82rem; white-space: nowrap; }
.code-state .icon { width: 15px; height: 15px; } .code-state.ok { color: var(--ok); } .code-state.bad { color: var(--bad); }
.reg-progress { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 18px; padding: 0; }
.reg-progress li { display: flex; gap: 8px; align-items: center; font-size: .84rem; font-weight: 600; color: var(--muted); padding-top: 10px; border-top: 3px solid var(--line); }
.reg-progress li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; background: var(--line-2); color: var(--muted); flex: none; }
.reg-progress li.on { color: var(--brand-ink); border-color: var(--brand); } .reg-progress li.on span { background: var(--brand); color: #fff; }
.reg-progress li.done span { background: var(--ok); }
.otp-area { display: grid; gap: 6px; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.otp-box { text-align: center; font: 600 1.35rem var(--mono); padding: 0; height: 52px; border-radius: 10px; }
.otp-wrap.filled .otp-box { border-color: var(--brand); background: var(--brand-soft); }
.otp-hint .icon { width: 14px; height: 14px; vertical-align: -2px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Durations ---------- */
.cycle-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.cycle-toggle button { border: 0; background: none; padding: 8px 18px; border-radius: 999px; font: 600 .92rem var(--font); color: var(--muted); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.cycle-toggle button.on { background: var(--brand); color: #fff; }
.save-tag { font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.cycle-toggle button.on .save-tag { background: rgba(255, 255, 255, .2); color: #fff; }
.center-block { display: flex; width: fit-content; margin: 18px auto 0; }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dur-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dur { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 6px 10px; font: 600 .84rem var(--font); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.dur small { color: var(--ok); font-weight: 700; }
.dur.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.plan-sub { margin: -6px 0 0; font-size: .86rem; color: var(--muted); min-height: 1.2em; }
.trial-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface); }
.trial-row > span { flex: 1; min-width: 200px; } .trial-row > .icon { color: var(--brand); }
.dur-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dur-table td { padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.dur-table tr:last-child td { border-bottom: 0; } .dur-table tr.dim { opacity: .45; }
.plan-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.plan-admin-grid .card + .card { margin-top: 0; }
.plan-admin.dim { opacity: .7; }
.trial-pill { display: inline-flex; gap: 8px; align-items: center; background: var(--brand-soft); color: var(--brand-ink); padding: 8px 12px; border-radius: 9px; font-weight: 600; margin: 0; }
.small-list { font-size: .82rem; margin: 10px 0 0; }
.dur-row { display: grid; grid-template-columns: 140px 150px 1fr auto 38px; gap: 8px; align-items: center; margin-bottom: 6px; }
.money-in { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.money-in span { padding: 0 8px; color: var(--muted); } .money-in input { border: 0; box-shadow: none !important; padding-left: 0; min-width: 0; }
.dur-calc { font-size: .82rem; }
.quick-durs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: .84rem; }
.tables-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .86rem; margin: -6px 0 12px; }

@media (max-width: 900px) {
  .auth2 { grid-template-columns: 1fr; }
  .a2-side { padding: 18px 18px 22px; gap: 14px; }
  .a2-side::after { display: none; }
  .a2-pitch { margin-top: 4px; } .a2-pitch h1 { font-size: 1.45rem; margin-bottom: 6px; } .a2-pitch p { font-size: .92rem; }
  .a2-preview, .a2-points, .a2-help { display: none; }
  .a2-main { justify-content: flex-start; padding-top: 18px; }
}
@media (max-width: 640px) {
  .a2-card { border-radius: 14px; padding: 18px 16px; box-shadow: none; }
  .a2-pitch p { display: none; }
  .otp-boxes { gap: 6px; } .otp-box { height: 48px; font-size: 1.2rem; }
  .reg-progress li { font-size: .74rem; gap: 5px; }
  .dur-row { grid-template-columns: 1fr 1fr 38px; } .dur-row .dur-calc { grid-column: 1 / -1; order: 5; } .dur-row .check { order: 4; }
  .cycle-toggle { display: flex; } .cycle-toggle button { flex: 1; justify-content: center; padding: 8px 10px; }
  .code-state { padding: 0 8px; font-size: .76rem; }
}

/* ---------- Print frame ---------- */
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .visit-grid { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .rx-head { display: none; }
  .rx-row { grid-template-columns: 1fr 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
  .rx-row .rx-drug { grid-column: 1 / -1; }
  .rx-row [data-rm] { justify-self: end; }
}
@media (max-width: 900px) {
  .only-mobile { display: inline-grid; }
  .only-desktop { display: none !important; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .topbar { padding: 8px 12px; }
  .content { padding: 16px 14px 40px; }
  .banner { padding: 10px 14px; }
  .dash-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 22px 20px; gap: 16px; }
  .auth-pitch h1 { font-size: 1.5rem; }
  .auth-points, .auth-pitch p { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patient-hero { grid-template-columns: 1fr; }
  .ph-side { justify-content: flex-start; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.3rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-head { align-items: stretch; }
  .head-actions, .head-actions .btn { width: 100%; }
  .head-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .head-actions .btn:only-child { grid-column: 1 / -1; }
  .toolbar { align-items: stretch; }
  .toolbar > *, .search-box { max-width: none; width: 100%; }
  .seg { overflow-x: auto; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 1.3rem; }
  .stat-ic { display: none; }
  .card { padding: 14px; }
  /* Tables become stacked cards */
  .table-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 12px; box-shadow: var(--shadow); }
  .table td { display: grid; grid-template-columns: 38% 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); text-align: left !important; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
  .table td[data-label=""]::before { display: none; }
  .table td[data-label=""] { grid-template-columns: 1fr; }
  .table td:last-child { border-bottom: 0; }
  .table td.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
  .table td.actions .btn + .btn { margin-left: 0; }
  .qcard { grid-template-columns: 64px 1fr; padding: 10px; gap: 12px; }
  .token { height: 60px; font-size: 1.55rem; }
  .qactions { grid-column: 1 / -1; justify-content: stretch; }
  .qactions .btn { flex: 1; }
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal { max-height: 92vh; border-radius: 16px 16px 0 0; max-width: none !important; animation: sheet .22s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
  .modal-actions .btn { flex: 1; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .item-row { grid-template-columns: 1fr 64px 90px 38px; }
  .sched-row { grid-template-columns: 1fr 1fr; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
  .hbar li { grid-template-columns: 1fr auto; } .hbar-track { grid-column: 1 / -1; grid-row: 2; }
  #toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .beds { grid-template-columns: repeat(2, 1fr); }
  .gsearch kbd { display: none; }
  .sticky-actions .btn { flex: 1; }
}
@media print { .sidebar, .topbar, .banner { display: none; } }

input[style*="uppercase"]::placeholder { text-transform: none; }

/* ---------- Small-phone hardening (from the responsive audit) ---------- */
.auth2 { grid-template-columns: minmax(340px, 44%) minmax(0, 1fr); }
.stat { min-width: 0; } .stat-value { overflow-wrap: anywhere; }
.date-nav { flex-wrap: wrap; } .date-nav input { min-width: 0; }
@media (max-width: 900px) { .auth2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .head-actions .btn, .a2-card .btn, .action-bar .btn, .quick, .trial-row .btn { white-space: normal; text-align: center; line-height: 1.25; }
  .head-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-nav { width: 100%; } .date-nav input { flex: 1; }
}
@media (max-width: 380px) {
  .head-actions { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .content { padding-left: 10px; padding-right: 10px; }
  .a2-main { padding-left: 10px; padding-right: 10px; }
}

/* ---------- Patient portal ---------- */
.portal .pub-top { position: sticky; top: 0; z-index: 5; }
.portal-login { max-width: 520px; width: 100%; justify-self: center; }
.portal-login h2 .icon { color: var(--brand); }
.family { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.fam { display: flex; gap: 8px; align-items: center; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 12px; font: inherit; color: var(--ink); cursor: pointer; flex: none; }
.fam small { display: block; color: var(--muted); font-size: .76rem; text-align: left; }
.fam.on { border-color: var(--brand); background: var(--brand-soft); }
.pt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pt-head p { margin: 4px 0 0; }
.rec { display: grid; gap: 8px; }
.rec h3 { font-size: 1rem; }
.rx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rx-list li { padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.rec-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.rec-row:last-child { border-bottom: 0; }
.rec-row > span:nth-child(2) { text-align: right; }
.center-row { justify-content: center; }
.danger-zone { margin-top: 22px; border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.danger-zone h2 { display: flex; gap: 8px; align-items: center; color: var(--bad); }
@media (max-width: 640px) {
  .rec-row { grid-template-columns: 1fr auto; }
  .rec-row > button { grid-column: 2; grid-row: 1 / span 2; }
  .rec-row > span:nth-child(2) { text-align: left; grid-column: 1; }
}
@media (max-width: 640px) {
  .otp-row { grid-template-columns: minmax(0, 1fr); }
  .otp-row > .btn { width: 100%; }
}
@media (max-width: 640px) {
  .table td { overflow-wrap: anywhere; word-break: break-word; }
  .table td > * { min-width: 0; }
}

/* ---------- Laboratory ---------- */
.flag { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; font: 700 .72rem var(--font); vertical-align: 1px; }
.flag-H { background: var(--bad-soft); color: var(--bad); } .flag-L { background: var(--info-soft); color: var(--info); }
.flag-A { background: var(--bad-soft); color: var(--bad); } .flag-N { color: var(--ok); }
.trend { font-weight: 700; } .trend.up { color: var(--bad); } .trend.down { color: var(--info); }
.lab-cards { display: grid; gap: 8px; } .lab-cards.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.lab-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); display: grid; gap: 6px; }
.lab-card.has-abn { border-left: 4px solid var(--bad); }
.lab-card header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lab-card header strong { margin-right: auto; }
.res-mini { width: 100%; border-collapse: collapse; font-size: .84rem; }
.res-mini td { padding: 3px 4px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.res-mini tr:last-child td { border-bottom: 0; }
.res-mini tr.abn td:first-child, .res-table tr.abn td:first-child { color: var(--bad); font-weight: 600; }
.res-table tr.abn { background: color-mix(in srgb, var(--bad-soft) 55%, transparent); }
.res-entry { display: grid; gap: 4px; }
.re-head, .re-row { display: grid; grid-template-columns: minmax(130px, 1.4fr) minmax(120px, 1fr) 80px minmax(110px, 1fr) 90px; gap: 8px; align-items: center; }
.re-head { font-size: .76rem; font-weight: 600; color: var(--muted); padding: 0 4px; }
.re-row { padding: 4px; border-radius: 8px; } .re-row.abn { background: var(--bad-soft); }
.re-row label { font-weight: 600; font-size: .9rem; }
.re-val { display: flex; align-items: center; gap: 6px; } .re-val input { min-height: 36px; padding: 6px 9px; font-variant-numeric: tabular-nums; }
.re-flag { min-width: 22px; } .re-row span { font-size: .84rem; }
.pr-head, .pr-main { display: grid; grid-template-columns: minmax(140px, 2fr) 80px 70px 70px minmax(110px, 1.3fr) auto 38px; gap: 6px; align-items: center; }
.pr-head { font-size: .76rem; font-weight: 600; color: var(--muted); }
.pr { border-bottom: 1px solid var(--line-2); padding: 6px 0; } .pr input { min-height: 36px; padding: 6px 8px; }
.pr-ranges { display: grid; gap: 6px; padding: 8px 0 4px 16px; }
.rr { display: grid; grid-template-columns: 130px 64px auto 64px auto 80px 80px 38px; gap: 6px; align-items: center; font-size: .84rem; }
.rr input, .rr select { min-height: 34px; padding: 5px 7px; }
.bulk-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.subnav .count:not(:empty) { margin-left: 4px; background: var(--brand-soft); color: var(--brand-ink); border-radius: 999px; padding: 0 7px; font-size: .74rem; }
.nav-badge { margin-left: auto; background: var(--signal); color: #fff; font: 700 .7rem var(--font); font-style: normal; border-radius: 999px; padding: 1px 7px; }
.followup-of { margin: 4px 0 0; font-size: .86rem; color: var(--info); display: flex; gap: 6px; align-items: center; }
.followup-of .icon { width: 14px; height: 14px; }
.geo-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lab-settings { margin-bottom: 16px; }
/* doctor inbox */
.res-group.has-abn { border-left: 4px solid var(--bad); }
.res-items { list-style: none; margin: 0; padding: 0; }
.res-items li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.res-items li:last-child { border-bottom: 0; }
.res-items li.seen { opacity: .65; }
.res-items li > span:first-child { display: flex; gap: 8px; align-items: flex-start; }
/* phlebotomist visit cards */
#visits { display: grid; gap: 12px; max-width: 640px; }
.visit-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.visit-card.status-en_route { border-left: 5px solid var(--brand); }
.visit-card header { display: flex; justify-content: space-between; align-items: center; }
.vtime { font-size: 1.3rem; font-weight: 700; } .vtime small { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; }
.visit-card h2 { font-size: 1.1rem; }
.vaddr, .vtests, .vnote { display: flex; gap: 8px; margin: 0; font-size: .92rem; align-items: flex-start; }
.vaddr .icon, .vtests .icon, .vnote .icon { margin-top: 2px; color: var(--muted); flex: none; }
.vnote { background: var(--warn-soft); color: var(--warn); padding: 8px 10px; border-radius: 8px; }
.vactions { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.visit-card > .btn.block { min-height: 52px; font-size: 1.02rem; }
.done-note { margin: 0; color: var(--ok); font-weight: 600; }
@media (max-width: 1100px) { .re-head { display: none; } .re-row { grid-template-columns: 1fr 1fr; } .re-row > span:nth-child(3), .re-row > span:nth-child(4), .re-row > span:nth-child(5) { font-size: .78rem; } }
@media (max-width: 640px) {
  .pr-head { display: none; }
  .pr-main { grid-template-columns: 1fr 1fr 1fr; } .pr-main input[name=p_name] { grid-column: 1 / -1; } .pr-main input[name=p_text] { grid-column: span 2; }
  .rr { grid-template-columns: 1fr 1fr 1fr; } .rr span { display: none; }
  .res-items li { grid-template-columns: 1fr auto; } .res-items li > button { grid-column: 1 / -1; }
  .lab-cards.wide { grid-template-columns: 1fr; }
}
.recent-res { border-left: 4px solid var(--brand); }
.recent-res h2 { display: flex; gap: 8px; align-items: center; }
.lab-cards.wide { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.visit-grid > *, .book-steps > * { min-width: 0; }
.book-steps { grid-template-columns: minmax(0, 1fr); }
.res-mini td { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .visit-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) {
  .res-mini td:nth-child(4) { display: none; } /* reference range: shown in the full report view */
  .vitals { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}

/* ---------- Lab billing counter ---------- */
.bill-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.bill-main > * + * { margin-top: 14px; }
.bill-main .card + .card { margin-top: 14px; }
.search-box.sm { min-width: 0; max-width: 340px; flex: 1; }
.pkg-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; margin-bottom: 12px; }
.pkg { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 1.5px dashed var(--brand); border-radius: 10px; background: var(--brand-soft); color: var(--ink); font: inherit; cursor: pointer; }
.pkg small { color: var(--muted); } .pkg small b { color: var(--brand-ink); }
.pkg.on { border-style: solid; background: var(--brand); color: #fff; } .pkg.on small, .pkg.on small b { color: rgba(255, 255, 255, .9); }
.cat-seg { margin-bottom: 10px; max-width: 100%; overflow-x: auto; }
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; padding: 2px; }
.tpick { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: .88rem; cursor: pointer; }
.tpick small { color: var(--muted); white-space: nowrap; }
.tpick:hover { border-color: var(--brand); }
.tpick.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.tpick.on::before { content: "✓"; color: var(--brand); font-weight: 700; margin-right: -2px; }
.tpick.inpkg { opacity: .45; cursor: default; text-decoration: line-through; }
.ref-row { display: flex; gap: 6px; } .ref-row select { flex: 1; min-width: 0; }
.pending-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--info-soft); display: grid; gap: 6px; }
.pending-box > strong { display: flex; gap: 6px; align-items: center; color: var(--info); font-size: .88rem; }
.due-note { display: flex; gap: 6px; align-items: center; color: var(--warn); font-size: .86rem; margin: 8px 0 0; }
.due-note .icon { width: 15px; height: 15px; }
.cart-lines { list-style: none; margin: 0 0 10px; padding: 0; max-height: 300px; overflow-y: auto; }
.cart-lines li { display: grid; grid-template-columns: 1fr auto 30px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.cart-lines .icon-btn { width: 28px; height: 28px; }
#payf { display: grid; gap: 8px; }
.disc-line { display: grid; grid-template-columns: 90px 1fr; gap: 6px; }
.grid-2.tight { gap: 8px; }
.sub-links { display: flex; gap: 16px; flex-wrap: wrap; margin: -6px 0 14px; font-size: .9rem; }
.sub-links a { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.sub-links .icon { width: 16px; height: 16px; color: var(--brand); }
.rec.locked { border-style: dashed; } .rec.locked p { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
@media (max-width: 1100px) { .bill-grid { grid-template-columns: minmax(0, 1fr); } .bill-side .sticky { position: static; } }
@media (max-width: 640px) { .test-grid { max-height: 340px; } }
.check .in-pkg { display: none; color: var(--brand-ink); font-weight: 600; }
.check.covered .in-pkg { display: inline; } .check.covered > span { opacity: .75; }

/* ---------- Public site v2 (no invented data) ---------- */
.module-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mm-tile { display: flex; gap: 10px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-weight: 600; font-size: .92rem; }
.mm-tile .icon { color: var(--brand); width: 22px; height: 22px; }
.mm-tile:nth-child(6) { border-color: var(--brand); background: var(--brand-soft); }
.live-stats { background: var(--side); color: #E7F3F1; padding: 26px clamp(16px, 4vw, 48px) 18px; }
.ls-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 48px; }
.ls-inner div { display: grid; text-align: center; } .ls-inner strong { font-size: 2rem; color: #fff; letter-spacing: -.02em; } .ls-inner span { color: var(--side-ink); font-size: .9rem; }
.ls-note { text-align: center; color: var(--side-mute); font-size: .78rem; margin: 12px 0 0; display: flex; gap: 6px; justify-content: center; align-items: center; }
.ls-note .icon { width: 14px; height: 14px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; margin-top: 24px; }
.role-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 16px; }
.role-card h3 { margin-bottom: 4px; } .role-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.cta-band { text-align: center; } .cta-band p { color: var(--ink-2); }
.pub-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 32px clamp(16px, 4vw, 48px) 18px; margin-top: 24px; }
.pf-cols { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 24px; }
.pf-cols h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.pf-cols > div:not(.pf-brand) { display: grid; gap: 7px; align-content: start; } .pf-cols a { color: var(--ink-2); font-size: .92rem; }
.pf-brand p { margin: 8px 0 0; font-size: .86rem; }
.pf-copy { max-width: 1200px; margin: 22px auto 0; padding-top: 14px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .82rem; }
.legal-wrap { max-width: 1100px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px); display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; }
.legal-wrap:not(:has(.legal-toc)) { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.legal-toc { position: sticky; top: 80px; align-self: start; display: grid; gap: 4px; font-size: .88rem; }
.legal-toc h4 { font-size: .78rem; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; letter-spacing: .06em; }
.legal-toc a { color: var(--ink-2); padding: 3px 0 3px 10px; border-left: 2px solid var(--line); }
.legal-toc a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.legal-body { line-height: 1.7; font-size: 1rem; }
.legal-body h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 6px; } .legal-body h2 { font-size: 1.15rem; margin: 26px 0 8px; scroll-margin-top: 80px; }
.legal-body ul { padding-left: 22px; } .legal-body li { margin: 4px 0; } .legal-body p { color: var(--ink-2); }
.crumbs { font-size: .84rem; color: var(--muted); }
.legal-actions { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.contact-wrap { max-width: 1100px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px); display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: start; }
.contact-info h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.contact-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; } .contact-list .icon { color: var(--brand); margin-top: 2px; }
.contact-list small { display: block; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sent { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 20px 0; } .sent > .icon { width: 40px; height: 40px; color: var(--ok); }
.mini-foot { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; padding: 18px; color: var(--muted); font-size: .82rem; }
.hosp-logo { height: 42px; width: auto; max-width: 140px; object-fit: contain; }
.terms-check { font-size: .86rem; align-items: flex-start; } .terms-check input { margin-top: 3px; }
/* ---------- Logos ---------- */
.brand-card { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.brand-card.col { flex-direction: column; align-items: flex-start; margin-bottom: 0; }
.logo-box { width: 120px; height: 120px; border: 1px dashed var(--line); border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; flex: none; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 8px; }
.logo-box span { display: grid; justify-items: center; color: var(--muted); gap: 4px; }
.brand-info { flex: 1; min-width: 240px; } .brand-info p { margin: 4px 0 10px; }
.row-actions.left { justify-content: flex-start; }
label.btn { cursor: pointer; }
.brand-logo.hosp { background: #fff; object-fit: contain; }
.dash-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.dash-logo { width: 64px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; flex: none; }
.dash-hosp { margin: 0 0 2px; font-weight: 600; color: var(--brand-ink); font-size: .92rem; } .dash-hosp span { color: var(--muted); font-weight: 400; font-style: italic; }
/* ---------- Reports centre ---------- */
.range-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.rb-date { display: inline-flex; gap: 6px; align-items: center; font-size: .86rem; color: var(--muted); } .rb-date input { width: auto; min-height: 38px; }
.rep-range { margin: 0 0 12px; font-size: .86rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.kpi .kl { color: var(--muted); font-size: .82rem; } .kpi strong { font-size: 1.45rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.kd { font-size: .78rem; font-weight: 600; } .kd small { font-weight: 400; color: var(--muted); }
.kd.good, .kd.up-good { color: var(--ok); } .kd.bad { color: var(--bad); } .kd.neutral { color: var(--info); } .kd.muted { font-weight: 400; color: var(--muted); }
.rep-table { margin-top: 18px; }
.rep-tabs .icon { width: 15px; height: 15px; }
/* ---------- Website admin ---------- */
.legal-editor { margin-top: 16px; }
.le-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.le-grid textarea { font: .86rem/1.55 var(--mono); min-height: 480px; }
.le-preview { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; max-height: 560px; overflow-y: auto; background: var(--surface-2); font-size: .92rem; }
.enq { margin-bottom: 12px; } .enq.new { border-left: 4px solid var(--brand); } .enq.spam { opacity: .6; }
.a2-stat strong { font-size: 1.25rem; } .a2-stat span { color: var(--side-mute); font-size: .76rem; }
@media (max-width: 900px) {
  .pf-cols { grid-template-columns: 1fr 1fr; } .pf-brand { grid-column: 1 / -1; }
  .legal-wrap, .contact-wrap, .le-grid { grid-template-columns: minmax(0, 1fr); } .legal-toc { position: static; }
  .le-grid textarea { min-height: 320px; }
}
@media (max-width: 640px) {
  .module-map { grid-template-columns: 1fr 1fr; } .mm-tile { padding: 10px; font-size: .84rem; }
  .ls-inner strong { font-size: 1.5rem; }
  .dash-logo { width: 48px; height: 48px; }
  .range-bar .rb-date { flex: 1; } .range-bar .rb-date input { flex: 1; }
}
@media print { .pub-top, .pub-footer, .legal-toc, .legal-actions, .promo-strip { display: none !important; } .legal-wrap { display: block; } }
.hero > * { min-width: 0; } .mm-tile { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) { .mm-tile { gap: 6px; padding: 9px 8px; font-size: .8rem; } .mm-tile .icon { width: 18px; height: 18px; } }
@media (max-width: 760px) { .pub-nav a:not(.btn) { display: none; } .pub-nav .btn { display: inline-flex; } .pub-nav { gap: 6px; } }
