/* Brand variables (--brand, --on-brand, --panel, --on-panel, --accent) are set
   per page from the white-label settings; neutral tokens below are fixed. */
:root {
    --text: #0f172a;
    --muted: rgba(15, 23, 42, 0.55);
    --canvas: #f4f6f8;
    --surface: #ffffff;
    --border: rgba(15, 23, 42, 0.12);
    --danger: #a32d2d;
    --danger-bg: #fcebeb;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    color: var(--text);
    background: var(--canvas);
    font-family: var(--font);
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ── Logo ─────────────────────────────────────────────────────────────────── */
.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    flex: none;
    overflow: hidden;
}
.logo svg { width: 60%; height: 60%; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

.brand-row { display: flex; align-items: center; gap: 10px; }

/* ── Login (design A: brand panel + form) ─────────────────────────────────── */
.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.brand-panel {
    background: var(--panel);
    color: var(--on-panel);
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.brand-name { font-size: 20px; font-weight: 600; }
.tagline { font-size: 34px; line-height: 1.2; font-weight: 600; margin: 0 0 24px; max-width: 460px; }
.features { list-style: none; padding: 0; margin: 0; }
.features li { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 16px; opacity: 0.92; }
.features svg { width: 20px; height: 20px; flex: none; }
.portal-label { margin: 0; font-size: 13px; opacity: 0.75; }

.form-panel {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 24px 0;
}
.form-wrap { width: 100%; max-width: 380px; margin: auto 0; }
.form-wrap h2 { font-size: 26px; margin: 0 0 4px; }
.compact-brand { display: none; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 28px; }

form { margin-top: 24px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 6px; }
input[type=text], input[type=password] {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--canvas);
    color: var(--text);
}
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: var(--surface); }

.password { position: relative; }
.password input { padding-right: 64px; }
.reveal {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; padding: 6px;
}
.remember { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); }
.remember input { accent-color: var(--brand); }
.remember-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.forgot-link { color: var(--brand); font-weight: 600; font-size: 14px; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

button.primary {
    width: 100%;
    margin-top: 22px;
    padding: 13px;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: var(--on-brand);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }

.alert {
    margin-top: 18px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 14px;
}
.notice { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.notice svg { width: 14px; height: 14px; }

.powered-by {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    padding: 18px;
}

/* Narrow screens: hide the brand panel, show a compact brand row */
@media (max-width: 820px) {
    .login { grid-template-columns: 1fr; }
    .brand-panel { display: none; }
    .compact-brand { display: flex; }
    .compact-brand .logo { color: #fff; }
}

/* ── Choose your hospital ─────────────────────────────────────────────────── */
.picker-page { min-height: 100vh; display: flex; flex-direction: column; }
.picker {
    flex: 1;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 72px 24px 24px;
}
.picker-brand { margin-bottom: 40px; font-size: 14px; }
.picker h1 { font-size: 30px; margin: 0 0 8px; }
.picker .lead { font-size: 16px; margin: 0 0 28px; }

.hospital-grid { display: grid; gap: 12px; margin: 0; }
.hospital-card {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    font: inherit;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.hospital-card:hover, .hospital-card:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
    outline: none;
}
.hospital-card:active { transform: scale(0.995); }
.hospital-card.current { border-color: var(--brand); }

.hospital-tile {
    width: 48px; height: 48px; flex: none;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--brand) 12%, white);
    color: var(--brand);
    font-weight: 700;
    font-size: 17px;
}
.hospital-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hospital-name { font-size: 17px; font-weight: 600; }
.hospital-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 999px;
    background: var(--canvas); color: var(--muted);
    white-space: nowrap;
}
.current-badge { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.chevron { width: 20px; height: 20px; color: var(--muted); flex: none; }
.hospital-card:hover .chevron { color: var(--brand); }

.picker-signout { margin-top: 28px; display: flex; align-items: center; gap: 8px; font-size: 14px; }


/* ── Signed-in shell: top bar + tabs ──────────────────────────────────────── */
.app-page { min-height: 100vh; display: flex; flex-direction: column; }
/* Soft brand glow from the top-left fading to white — same as the iPad app
   (RadialGradient at (-1,-0.9), radius 1.7, stops 0/.2/.6/.95). Built from the
   brand accent so white-label tenants get their own colors. */
.app-page, .picker-page {
    background-color: #fff;
    background-image: radial-gradient(170vmin 170vmin at 0% 5%,
        color-mix(in srgb, var(--accent) 58%, white) 0%,
        color-mix(in srgb, var(--accent) 17%, white) 20%,
        color-mix(in srgb, var(--accent) 17%, white) 60%,
        #fff 95%);
    background-attachment: fixed;
}
.app-header {
    background: rgba(255, 255, 255, 0.55); border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    position: sticky; top: 0; z-index: 20;
}
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px 8px; }
.topbar-name { font-weight: 700; font-size: 16px; }
.topbar form { margin: 0; display: flex; align-items: center; gap: 14px; }
@media (max-width: 900px) { .lock-btn span { display: none; } }
.tabs { display: flex; gap: 4px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
    padding: 10px 12px 11px; font-size: 14px; font-weight: 600; color: var(--muted);
    text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
button.link, a.link {
    border: 0; background: none; color: var(--brand); font-weight: 600; cursor: pointer; padding: 0;
    font-size: 14px; text-decoration: none; font-family: inherit;
}

.page { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; }
.page-head p { margin: 0; }
.empty-state { max-width: 560px; margin: 64px auto; text-align: center; }
.loading { padding: 32px; text-align: center; color: var(--muted); font-size: 14px; }
.center { text-align: center; }

/* ── Buttons, pills, tags ─────────────────────────────────────────────────── */
.app-page svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--brand); color: var(--on-brand); font: 600 13px/1.2 var(--font); white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
a.btn { text-decoration: none; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.soft { background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); }
.btn.amber { background: #b45309; color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.pill-link {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--brand) 25%, white); background: color-mix(in srgb, var(--brand) 7%, white);
    color: var(--brand); font: 600 12px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.pill-link svg { width: 13px; height: 13px; }
.pill-link.indigo { background: #e0e7ff; border-color: #c7d2fe; color: #3730a3; }
.pill-link.danger { background: var(--danger-bg); border-color: #f3c7c7; color: var(--danger); }
.icon-btn {
    width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 9px; background: var(--canvas); color: var(--muted); cursor: pointer; font-size: 14px;
}
.icon-btn svg { width: 18px; height: 18px; }
.tag {
    display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: middle;
    font-size: 11px; font-weight: 600; background: var(--canvas); color: var(--muted);
}
.tag.ok { background: #dcfce7; color: #15803d; }
.tag.warn { background: #fef3c7; color: #b45309; }
.count {
    display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-align: center;
    background: color-mix(in srgb, var(--brand) 14%, white); color: var(--brand);
}
.count:empty { display: none; }
.avatar {
    width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); font-weight: 700; font-size: 13px;
}
.avatar.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 19px; }

/* ── Segmented control ────────────────────────────────────────────────────── */
.segmented {
    display: flex; gap: 4px; padding: 4px; margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.segmented button {
    flex: 1; padding: 8px 10px; border: 0; border-radius: 9px; background: none; cursor: pointer;
    font: 600 13px/1.2 var(--font); color: var(--text);
}
.segmented button[aria-selected=true] { background: var(--brand); color: var(--on-brand); }
.segmented button[aria-selected=true] .count { background: rgba(255,255,255,0.25); color: inherit; }
.segmented.small button { padding: 7px 8px; font-size: 12px; }

/* ── Care Queue: list + conversation ──────────────────────────────────────── */
.queue-layout {
    display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 20px;
    height: calc(100vh - 210px); min-height: 520px;
}
.queue-list { display: flex; flex-direction: column; min-height: 0; }
.list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 4px 16px 2px; }
.list-empty { padding: 40px 16px; text-align: center; }
.list-empty p { margin: 6px 0 14px; }

.q-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
    cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.q-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, white); }
.q-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.q-card.claimed { border-color: #fde68a; }
.q-card.assigned { border-color: #bae6fd; }
.q-card.selected, .h-row.selected { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card-title strong { overflow: hidden; text-overflow: ellipsis; }
.claim-chip {
    display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 10px; border-radius: 8px;
    font-size: 12px; font-weight: 600;
}
.claim-chip svg { width: 14px; height: 14px; flex: none; }
.claim-chip.ok { background: #f0fdf4; color: #15803d; }
.claim-chip.warn { background: #fef3c7; color: #b45309; }
.claim-chip.info { background: #f0f9ff; color: #0369a1; }
.chip-tag { margin-left: auto; padding: 1px 7px; border-radius: 6px; background: #e0f2fe; font-size: 11px; }
.msg-preview {
    margin: 10px 0 0; padding: 9px 11px; border-radius: 10px; background: var(--canvas); font-size: 13px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.msg-preview.one { -webkit-line-clamp: 1; background: none; padding: 0; color: var(--muted); }
.reason { margin: 8px 0 0; font-size: 12px; font-style: italic; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.handled { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.pulse { animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.35; } to { opacity: 1; } }

.group-head {
    display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 2px 4px; border: 0; background: none;
    cursor: pointer; font: 700 12px/1 var(--font); letter-spacing: 0.03em; color: var(--muted); text-transform: uppercase;
}
.group-head svg { width: 12px; height: 12px; transition: transform 0.15s; }
.group-head.open svg { transform: rotate(90deg); }
.group-head .count { background: var(--canvas); color: var(--muted); }
.h-row {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border);
}

.chat-pane {
    min-height: 0; display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.chat-empty { margin: auto; text-align: center; color: var(--muted); padding: 24px; }
.chat-empty svg { width: 40px; height: 40px; opacity: 0.5; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.chat-head .back { display: none; }
.head-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status { margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: middle; }
.status.pending { background: #e0f2fe; color: #0369a1; }
.status.mine { background: #dcfce7; color: #15803d; }
.status.other { background: var(--canvas); color: var(--muted); }
.status.other.warn { background: #fef3c7; color: #b45309; }
.status.done { background: var(--canvas); color: var(--muted); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 18px 8px; background: #f6f7fb; display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: flex; flex-direction: column; max-width: 72%; }
.bubble-row.patient { align-self: flex-start; align-items: flex-start; }
.bubble-row.staff { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.patient .bubble { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.staff .bubble { background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px; }
.bubble-meta { font-size: 11px; color: var(--muted); margin: 3px 4px 0; }
.sys-line { align-self: center; display: flex; align-items: center; gap: 6px; font-size: 12px; font-style: italic; color: var(--muted); }
.sys-line svg { width: 13px; height: 13px; }
.request-note { align-self: center; max-width: 80%; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--border); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.request-note .info-row { display: flex; gap: 12px; justify-content: space-between; }
.call-card { align-self: center; width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.call-top { display: flex; align-items: center; gap: 10px; }
.call-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #e0e7ff; color: #3730a3; flex: none; }
.call-icon svg { width: 16px; height: 16px; }
.call-details { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.players { display: flex; flex-wrap: wrap; gap: 8px; }
.players audio { width: 100%; height: 36px; }
.transcript { margin: 0; max-height: 220px; overflow: auto; padding: 10px; border-radius: 10px; background: var(--canvas); font: 13px/1.5 var(--font); white-space: pre-wrap; }
.chat-foot { border-top: 1px solid var(--border); padding: 12px 14px; background: var(--surface); }
.chat-foot textarea {
    width: 100%; resize: none; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px;
    font: 14px/1.45 var(--font); color: var(--text); background: var(--canvas); max-height: 180px;
}
.chat-foot textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; background: var(--surface); }
.composer-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.composer-actions .hint { flex: 1; text-align: right; }
.foot-gate { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.foot-note { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ── Dialogs ──────────────────────────────────────────────────────────────── */
dialog.sheet {
    width: min(480px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 48px)); padding: 0;
    border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); color: var(--text);
}
dialog.sheet.wide { width: min(640px, calc(100vw - 32px)); }
dialog.sheet.narrow { width: min(400px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(15, 23, 42, 0.4); }
dialog[open].sheet { display: flex; flex-direction: column; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.sheet-head h2, .sheet-body h2 { margin: 0 0 2px; font-size: 18px; }
.sheet-head p { margin: 0; }
.sheet-body { padding: 16px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.note { padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.note.ok { background: #f0fdf4; color: #15803d; }
.note.warn { background: #fff7ed; color: #c2410c; }
.staff-row {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; font: inherit; color: var(--text);
}
.staff-row:hover { border-color: var(--brand); }
.staff-row.primary { background: #f0fdf4; border-color: #bbf7d0; }
.staff-row .chev { width: 16px; height: 16px; color: var(--muted); }
.day-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.day-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: 600 12px/1 var(--font); color: var(--text); }
.day-chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.hours { display: flex; flex-direction: column; gap: 2px; }
.hour-row { display: grid; grid-template-columns: 56px 1fr 30px 28px 30px; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13px; }
.hour-row .hour { color: var(--muted); font-weight: 600; }
.hour-row.on .hour { color: var(--text); }
.hour-row .bar { height: 8px; border-radius: 99px; background: var(--canvas); overflow: hidden; }
.hour-row .bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.hour-row .value { text-align: center; font-weight: 700; }
.step { width: 30px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 16px; color: var(--text); }
.step:disabled { opacity: 0.4; cursor: default; }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
    padding: 11px 18px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25); max-width: calc(100vw - 32px);
}

/* ── Patient chart ────────────────────────────────────────────────────────── */
.chart-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-banner { display: flex; gap: 16px; align-items: flex-start; padding: 20px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.chart-banner h1 { margin: 0 0 6px; font-size: 24px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.alerts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; font-size: 13px; color: var(--danger); }
.alert-chip { padding: 2px 9px; border-radius: 999px; background: var(--danger-bg); color: var(--danger); font-weight: 600; font-size: 12px; }
.chart-grid { columns: 2 380px; column-gap: 18px; }
.chart-card { break-inside: avoid; margin: 0 0 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.chart-card h2 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 4px; }
.chart-card h3 { margin: 12px 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.chart-list { list-style: none; margin: 0; padding: 0; }
.chart-list > li { padding: 8px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.chart-list > li:first-child { border-top: 0; padding-top: 0; }
.li-main { font-weight: 600; font-size: 14px; }
.chart-list > li > button.link, .chart-list > li > .chip-row { align-self: flex-start; }
.answer { font-size: 13px; padding: 6px 9px; border-radius: 8px; background: #f0fdf4; }
.meds { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vital { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; background: var(--canvas); }
.vital strong { font-size: 18px; }
.unit { font-size: 12px; font-weight: 500; color: var(--muted); }
.lab-group { border-top: 1px solid var(--border); padding: 6px 0; }
.lab-group:first-of-type { border-top: 0; }
.lab-group summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }
table.labs { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0; }
table.labs td { padding: 4px 6px; border-top: 1px solid var(--canvas); }
table.labs tr.flag td { color: var(--danger); font-weight: 600; }

/* ── Shared form bits ───────────────────────────────────────────────────── */
input.field, textarea.field, select.field, .field {
    width: 100%; padding: 10px 12px; font: 14px/1.4 var(--font); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
input.field:focus, textarea.field:focus, select.field:focus { outline: 2px solid var(--brand); outline-offset: 0; background: var(--surface); }
.field:disabled { background: var(--canvas); color: var(--muted); }
textarea.field { resize: vertical; }
select.field { appearance: auto; }
.sheet-body label, .form-field label { margin: 4px 0 2px; font-size: 12px; color: var(--muted); }
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text); margin: 0; cursor: pointer; }
.check-row input { accent-color: var(--brand); width: 16px; height: 16px; }
.check-row.inline { white-space: nowrap; }
.check-list { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.check-list .check-row { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.card-row h2 { margin: 0; }
.card-row.end { justify-content: flex-end; margin: 12px 0 0; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.progress { height: 4px; border-radius: 99px; background: var(--canvas); margin-top: 8px; width: 220px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); }
dl.summary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 12px; font-size: 14px; }
dl.summary dt { color: var(--muted); }
dl.summary dd { margin: 0; font-weight: 600; }
dl.summary.intake dd { font-weight: 500; }
.span-all { grid-column: 1 / -1; margin: 0; }
.tag.info { background: #e0f2fe; color: #0369a1; }
.tag.bad { background: var(--danger-bg); color: var(--danger); }
.form-error { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 13px; }

/* Hospital join link: QR code beside the link and its actions */
.join-body { flex-direction: row; align-items: flex-start; gap: 18px; }
.join-qr { flex: 0 0 168px; width: 168px; height: 168px; padding: 8px; background: #fff; border: 1px solid var(--line, #E2E8F0); border-radius: 12px; }
.join-qr svg { width: 100%; height: 100%; display: block; }
.join-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 560px) { .join-body { flex-direction: column; align-items: center; } .join-side { width: 100%; } }
.empty-invite { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tag.good { background: #dcfce7; color: #15803d; }
.btn.blue { background: #2563eb; color: #fff; }
.btn.orange { background: #ea580c; color: #fff; }
.danger-text { color: var(--danger) !important; }
.pre { white-space: pre-wrap; }
.avatar.indigo { background: #e0e7ff; color: #4f46e5; }
.audit { font-weight: 600; color: var(--muted); }
.audit.info { color: #0891b2; }
.audit.good { color: #059669; }
.audit.bad { color: #dc2626; }
.appt-status {
    display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: middle;
    color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); white-space: nowrap;
}
.toolbar { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.toolbar .field { max-width: 420px; }

/* ── Date & slot pickers ──────────────────────────────────────────────────── */
.date-strip, .day-pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.date-pill, .day-pill {
    flex: none; min-width: 54px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px;
    border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: 12px/1.2 var(--font); color: var(--muted);
}
.date-pill strong, .day-pill strong { font-size: 16px; color: var(--text); }
.day-pills { display: grid; grid-template-columns: repeat(7, 1fr); }
.day-pill { min-width: 0; }
.day-pill.has { background: color-mix(in srgb, var(--brand) 8%, white); border-color: color-mix(in srgb, var(--brand) 25%, white); }
.day-pill.today { border: 1.5px solid var(--brand); }
.day-pill.dirty::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #d97706; }
.date-pill.active, .day-pill.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.date-pill.active strong, .day-pill.active strong { color: var(--on-brand); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
    padding: 9px 6px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--brand) 30%, white);
    background: color-mix(in srgb, var(--brand) 5%, white); color: var(--brand); font: 600 13px/1.2 var(--font); cursor: pointer;
}
.slot:hover:not(:disabled) { border-color: var(--brand); }
.slot.booked { background: var(--canvas); border-color: var(--border); color: var(--muted); text-decoration: line-through; cursor: default; }
.slot.toggle { background: var(--surface); border-color: var(--border); color: var(--text); }
.slot.toggle.active { background: color-mix(in srgb, var(--brand) 16%, white); border-color: color-mix(in srgb, var(--brand) 45%, white); color: var(--brand); }
.slot.active:not(.toggle) { background: var(--brand); color: var(--on-brand); }

/* ── Staff Schedule ───────────────────────────────────────────────────────── */
.view-switch { max-width: 560px; }
.split { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-list .list { overflow: visible; padding: 0; }
.split-list p { margin: 0 0 8px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; min-height: 320px; display: flex; flex-direction: column; gap: 14px; }
.panel > .chat-empty { margin: auto; }
.staff-row.current { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.editor-head { display: flex; align-items: center; gap: 12px; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.editor-info { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.editor-slots { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.editor-foot { display: flex; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); padding-top: 6px; }
.date-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.date-label { position: relative; font-size: 17px; font-weight: 700; margin: 0; padding: 6px 10px; border-radius: 10px; cursor: pointer; color: var(--text); }
.date-label:hover { background: var(--canvas); }
.date-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.day-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 9px; border-radius: 8px; font: 600 12px/1.2 var(--font); border: 1px solid transparent; }
.chip.free { background: var(--surface); border-color: color-mix(in srgb, var(--brand) 35%, white); color: var(--brand); cursor: pointer; }
.chip.free:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 8%, white); }
.chip.free:disabled { opacity: 0.5; cursor: default; }
.chip.booked { background: var(--brand); color: var(--on-brand); }
.chip.checked { background: #0891b2; color: #fff; }
.chip.done { background: #059669; color: #fff; }
.segmented.inline { display: inline-flex; margin-bottom: 14px; }
.appt-day h3 { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; font-size: 14px; color: var(--muted); }
.appt-row, .appt-card {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border);
}
.appt-row.cancelled, .appt-card.cancelled { background: #fef2f2; border-color: #fecaca; }
.appt-row.cancelled strong { text-decoration: line-through; }
.time-box {
    flex: none; min-width: 72px; padding: 8px; border-radius: 10px; text-align: center; font-weight: 700; font-size: 13px;
    background: color-mix(in srgb, var(--brand) 8%, white); color: var(--brand);
}
.staff-pill { align-self: flex-start; margin-top: 2px; padding: 2px 8px; border-radius: 999px; background: var(--canvas); font-size: 12px; font-weight: 600; color: var(--muted); }
.staff-pill.mine { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions.wrap { justify-content: flex-start; }

/* ── My Schedule ──────────────────────────────────────────────────────────── */
.queue-layout.single { grid-template-columns: 1fr; height: auto; min-height: 0; }
.queue-layout.single .chat-pane { display: none; }
.queue-layout.single .list { overflow: visible; }
.queue-layout.single .segmented { max-width: 620px; }
.appt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 10px; margin-bottom: 6px; }
.appt-card { flex-direction: column; align-items: stretch; gap: 6px; margin: 0; }
.appt-card .card-head { align-items: center; }

/* ── Visit (SOAP) ─────────────────────────────────────────────────────────── */
.visit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.visit-head h1 { margin: 0 0 4px; font-size: 24px; }
.visit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; padding-bottom: 80px; }
.soap { display: flex; flex-direction: column; gap: 14px; }
.soap-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px 18px; }
.soap-card summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; margin-bottom: 4px; }
.soap-card summary::-webkit-details-marker { display: none; }
.soap-letter { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand); color: var(--on-brand); font-weight: 800; }
.soap-card h3 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.soap-fields { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.vitals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.soap-field label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--text); }
.soap-field.compact label { font-size: 12px; }
.field-meta { font-weight: 500; }
.author { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.author.md { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.author.rn { background: #ede9fe; color: #7c3aed; }
.visit-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 110px; }
.chart-card.side { margin: 0; }
.chart-card.side > summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.visit-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: flex-end; align-items: center; gap: 10px;
    padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border);
}
.visit-bar #save-state { margin-right: auto; }

/* What the scribe heard behind a SOAP version, with its recording */
.scribe-source { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; padding: 6px 8px;
    border-radius: 8px; background: #f5f3ff; color: #475569; font-style: italic; }
.scribe-source .small { flex: 1; }
.scribe-source .play { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #ede9fe; color: #7c3aed;
    font-style: normal; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }

/* Patient chart beside the visit notes (not modal — notes stay editable) */
.visit-chart {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 25; width: min(46vw, 720px);
    display: none; flex-direction: column; background: var(--canvas);
    border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(15, 23, 42, 0.12);
}
body.visit-chart-open .visit-chart { display: flex; }
body.visit-chart-open .visit-page { width: auto; margin-right: min(46vw, 720px); max-width: none; }
body.visit-chart-open .visit-bar { right: min(46vw, 720px); }
body.visit-chart-open .visit-layout { grid-template-columns: 1fr; }
body.visit-chart-open .visit-side { position: static; }
@media (max-width: 1000px) {
    .visit-chart { width: 100vw; }
    body.visit-chart-open .visit-page { margin-right: 0; }
}

/* ── Care: patient list + details ─────────────────────────────────────────── */
.patient-table { display: flex; flex-direction: column; gap: 8px; }
.patient-row {
    display: grid; grid-template-columns: 36px minmax(180px, 1.3fr) minmax(140px, 1fr) minmax(200px, 1.4fr) minmax(120px, 0.8fr) 110px;
    align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface);
    border: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.patient-row:hover { border-color: color-mix(in srgb, var(--brand) 45%, white); }
.patient-row.mine { border-color: color-mix(in srgb, var(--brand) 40%, white); }
.p-col { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.p-col .tag { align-self: flex-start; margin: 2px 0 0; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; align-self: flex-start; }
.btn-select { width: auto; font-weight: 600; font-size: 13px; padding: 9px 12px; }
.subtabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 16px; border-bottom: 1px solid var(--border); }
.subtabs button {
    padding: 10px 12px; border: 0; background: none; cursor: pointer; font: 600 14px/1 var(--font); color: var(--muted);
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.subtabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.two-col.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); }
.two-col .chart-card { margin: 0; }
.rx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.rx-grid .chart-card { margin: 0; }
.summary-line { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.chat-pane.inline { height: 560px; }
.chat-body.dialog-chat { max-height: 55vh; border-radius: 12px; }
.bubble-row.ai .bubble { background: #f5f3ff; border-color: #ddd6fe; }
.bubble .summary-line { margin: 0 0 6px; }
.bubble .summary-line:last-child { margin: 0; }
.ai-intro { margin: auto; text-align: center; max-width: 420px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.link-row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 2px 0;
    border: 0; background: none; cursor: pointer; font: inherit; color: var(--text); text-align: left;
}
.link-row:hover .li-main { color: var(--brand); }
.composer { display: flex; flex-direction: column; gap: 8px; }
.composer audio { height: 32px; vertical-align: middle; }
.rx-med { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }
.rx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.chart-card details > summary.small { cursor: pointer; }

/* ── Add existing patient ─────────────────────────────────────────────────── */
.requests:empty { display: none; }
.requests { margin-bottom: 8px; }
.request-row { grid-template-columns: 36px minmax(0, 1fr) auto; border-style: dashed; border-color: var(--border); }
.request-row.declined { opacity: 0.85; }
.muted-avatar { background: var(--canvas); color: var(--muted); }
.staff-row.static { cursor: default; }
.staff-row.static:hover { border-color: var(--border); }

/* ── Lock button + lock screen ────────────────────────────────────────────── */
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-actions form { margin: 0; }
.lock-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 13px/1 var(--font);
}
.lock-btn:hover { border-color: var(--brand); color: var(--brand); }
/* View switch (doctors and nurses): tinted while the Inbox · Staff view is on */
.view-btn.on { background: var(--brand-soft, #ccfbf1); border-color: var(--brand); color: var(--brand); }
.lock-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.lock-page {
    min-height: 100vh; margin: 0; display: flex; flex-direction: column; overflow: hidden; color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--panel) 85%, black), color-mix(in srgb, var(--panel) 45%, #0f172a) 60%, #0f172a);
}
.saver { position: fixed; inset: 0; overflow: hidden; cursor: pointer; }
.blob { position: absolute; border-radius: 50%; filter: blur(10px); opacity: 0.55; }
.b1 { width: 520px; height: 520px; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%);
    top: -120px; left: -80px; animation: drift1 26s ease-in-out infinite alternate; }
.b2 { width: 600px; height: 600px; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 75%, transparent), transparent 70%);
    bottom: -200px; right: -140px; animation: drift2 32s ease-in-out infinite alternate; }
.b3 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(99, 102, 241, 0.55), transparent 70%);
    bottom: -60px; left: 30%; animation: drift3 22s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(28vw, 22vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-30vw, -24vh) scale(0.9); } }
@keyframes drift3 { to { transform: translate(-18vw, -40vh) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }
.lock-center { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 32px 16px; text-align: center; pointer-events: none; }
.lock-center > * { pointer-events: auto; }
.lock-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.12); font-weight: 700; font-size: 13px; }
.lock-badge svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lock-clock { margin-top: 22px; font-size: clamp(64px, 12vw, 112px); font-weight: 200; line-height: 1; letter-spacing: -0.02em; }
.lock-clock small { font-size: 22px; font-weight: 500; opacity: 0.7; margin-left: 8px; }
.lock-date { margin: 12px 0 2px; font-size: 18px; opacity: 0.85; }
.lock-hospital { margin: 0 0 40px; font-size: 14px; opacity: 0.6; }
.lock-hint { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lock-avatar { width: 68px; height: 68px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.3); font-size: 22px; font-weight: 800; }
.lock-hint strong { font-size: 18px; }
.lock-reveal { margin-top: 16px; border: 0; background: none; color: rgba(255, 255, 255, 0.7); font: 14px var(--font); cursor: pointer; }
.lock-reveal:hover { color: #fff; }
.lock-panel { display: none; width: min(380px, 100%); margin: 0; padding: 22px 22px 12px; border-radius: 20px; background: #fff;
    color: var(--text); text-align: left; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.lock-panel label { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--text); text-align: center; }
.lock-panel .alert { margin-top: 10px; }
.unlock-btn { width: 100%; margin-top: 14px; padding: 12px; font-size: 15px; }
.lock-signout { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.panel-open .lock-hint { display: none; }
.panel-open .lock-panel { display: block; }
.lock-page .powered-by { position: relative; z-index: 1; color: rgba(255, 255, 255, 0.5); }

/* ── Left menu (My Schedule): flush left, full height under the header ──── */
.side-shell { flex: 1; display: flex; min-height: 0; }
.side-shell > .page { flex: 1; min-width: 0; }
.side-shell .queue-layout:not(.single) { grid-template-columns: minmax(240px, 380px) minmax(320px, 1fr); }
.side-nav {
    flex: none; width: 224px; padding: 20px 12px;
    background: rgba(255, 255, 255, 0.6); border-right: 1px solid var(--border);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.side-nav .segmented {
    position: sticky; top: 112px; flex-direction: column; gap: 4px; padding: 0; margin: 0;
    background: none; border: 0; border-radius: 0;
}
.side-nav .segmented button {
    flex: none; display: flex; justify-content: space-between; align-items: center;
    padding: 11px 14px; text-align: left; font-size: 14px; border-radius: 10px;
}
.side-nav .segmented button:hover:not([aria-selected=true]) { background: color-mix(in srgb, var(--brand) 8%, white); }

/* ── Small screens ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .page { padding: 16px; }
    .topbar { padding: 10px 16px 6px; }
    .topbar-who { display: none; }
    .tabs { padding: 0 8px; }
    .queue-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
    .list { overflow: visible; }
    .chat-pane { display: none; }
    .queue-layout.chat-open .chat-pane {
        display: flex; position: fixed; inset: 0; z-index: 30; border-radius: 0; border: 0;
    }
    .chat-head .back { display: inline-flex; }
    .chat-head .close { display: none; }
    .bubble-row { max-width: 86%; }
    .composer-actions .hint { display: none; }
    .composer-actions { justify-content: space-between; }
    .page-head { align-items: flex-start; flex-direction: column; }
    .split, .two-col, .two-col.wide-left, .visit-layout { grid-template-columns: 1fr; }
    .visit-side { position: static; }
    .patient-row { grid-template-columns: 36px 1fr; }
    .patient-row .p-col, .patient-row > span:last-child:empty { grid-column: 2; }
    .patient-row .p-col.narrow { display: none; }
    .appt-grid, .day-grid { grid-template-columns: 1fr; }
    .chart-banner { flex-wrap: wrap; }
    .banner-actions { margin-left: 0; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .appt-row { flex-wrap: wrap; }
}

/* Left menu on narrow screens: a scrollable strip under the header */
@media (max-width: 900px) {
    .side-shell { flex-direction: column; }
    .side-nav { width: auto; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
    .side-nav .segmented { position: static; flex-direction: row; overflow-x: auto; }
    .side-nav .segmented button { white-space: nowrap; }
}

/* ── Patient list: slide-in panel from the left ───────────────────────────── */
.drawer-backdrop {
    position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, 0.35);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.drawer {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 41; width: 99vw;
    display: flex; flex-direction: column; background: var(--canvas);
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.2); border-radius: 0 18px 18px 0; overflow: hidden;
    transform: translateX(-104%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer-head {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.drawer-title { font-size: 16px; }
.drawer-frame { flex: 1; width: 100%; border: 0; background: transparent; }
body.drawer-open { overflow: hidden; }
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-backdrop { transition: none; } }

/* Patient page inside the drawer: no app chrome, tighter padding */
.app-page.embedded .page { padding: 16px 20px; }

/* ── Care Queue: left menu action + cards grid ────────────────────────────── */
.side-stack { position: sticky; top: 112px; display: flex; flex-direction: column; gap: 4px; }
.side-stack .segmented { position: static; }
.side-link {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 11px 14px; border: 0; border-radius: 10px; background: none; cursor: pointer;
    font: 600 14px/1.2 var(--font); color: var(--text); text-align: left;
}
.side-link svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.side-link:hover { background: color-mix(in srgb, var(--brand) 8%, white); }
.side-sep { height: 1px; margin: 4px 6px; background: var(--border); border: 0; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; align-items: start; }

/* ── Care Queue: conversation slides up from the bottom ───────────────────── */
.sheet-backdrop {
    position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, 0.35);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.chat-sheet {
    position: fixed; left: 50%; bottom: 0; z-index: 41;
    width: min(1100px, 100vw - 32px); height: min(86vh, 900px);
    display: flex; flex-direction: column;
    transform: translate(-50%, 104%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.chat-sheet .chat-pane {
    display: flex; flex: 1; border-radius: 18px 18px 0 0; border-bottom: 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.22);
}
body.chat-open { overflow: hidden; }
body.chat-open .chat-sheet { transform: translate(-50%, 0); }
body.chat-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
@media (max-width: 900px) {
    .side-stack { position: static; flex-direction: row; align-items: center; }
    .side-link { width: auto; white-space: nowrap; }
    .side-sep { width: 1px; height: 24px; margin: 0 4px; }
    .q-grid { grid-template-columns: 1fr; }
    .chat-sheet { width: 100vw; height: 92vh; }
    .chat-sheet .chat-head .close { display: inline-flex; }
    .chat-sheet .chat-head .back { display: none; }
}
@media (prefers-reduced-motion: reduce) { .chat-sheet, .sheet-backdrop { transition: none; } }

/* ── Patient chart: slides up from the bottom, above an open conversation ── */
.chart-backdrop {
    position: fixed; inset: 0; z-index: 44; background: rgba(15, 23, 42, 0.35);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.chart-sheet {
    position: fixed; left: 50%; bottom: 0; z-index: 45;
    width: min(1240px, 100vw - 24px); height: 92vh;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--canvas); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.25);
    transform: translate(-50%, 104%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-frame { flex: 1; width: 100%; border: 0; background: transparent; }
body.chart-open { overflow: hidden; }
body.chart-open .chart-sheet { transform: translate(-50%, 0); }
body.chart-open .chart-backdrop { opacity: 1; pointer-events: auto; }
@media (max-width: 900px) { .chart-sheet { width: 100vw; height: 96vh; } }
@media (prefers-reduced-motion: reduce) { .chart-sheet, .chart-backdrop { transition: none; } }

/* Conversation: toggle between this request's messages and the whole thread */
.thread-toggle {
    align-self: center; margin: 0 auto 12px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); color: var(--brand); font: 600 12px var(--font); cursor: pointer;
}
.thread-toggle:hover { background: color-mix(in srgb, var(--brand) 8%, white); }

/* ── Sign-in: brand panel artwork (doctor with Medora, patient on video, checklist) ── */
.brand-panel { position: relative; overflow: hidden; justify-content: flex-start; gap: 30px;
    background: url('/images/landing-town.webp') center bottom / 100% auto no-repeat,
                linear-gradient(90deg, #02705f 0%, #0a9078 50%, #11a086 100%); }   /* same teal as medora-medical.com */
.brand-panel .brand-row { gap: 14px; }
.brand-panel .brand-name { font-size: 30px; font-weight: 700; }
.brand-panel .panel-logo { background: #11C1A6; color: #fff; border-radius: 12px; }
.brand-panel .panel-logo svg { width: 64%; height: 64%; }
.brand-panel .tagline { font-size: 40px; line-height: 1.18; font-weight: 700; max-width: 600px; margin-bottom: 18px; }
.brand-panel .features li { font-size: 18px; margin: 14px 0; opacity: 1; gap: 14px; }
.feat-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #15B8A2; display: inline-flex; align-items: center; justify-content: center; }
.feat-icon svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-panel .portal-label { display: none; }
@media (min-width: 821px) { .brand-panel { padding-bottom: calc(50vw * 0.18 + 24px); } }

/* Chart: each visit row opens that visit's SOAP notes */
.visit-link { display: block; color: inherit; text-decoration: none; border-radius: 8px; margin: -4px -6px; padding: 4px 6px; }
.visit-link:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.visit-link .li-main::after { content: ' ›'; color: var(--muted); }

/* ── My profile ───────────────────────────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.profile-layout .chart-card { margin: 0; padding: 18px 20px; }
.profile-layout h2 { margin: 0 0 4px; font-size: 17px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.profile-grid .wide { grid-column: 1 / -1; }
.voice-status { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.voice-status.good { background: color-mix(in srgb, var(--brand) 8%, white); border: 1px solid color-mix(in srgb, var(--brand) 30%, white); }
.voice-status.warn { background: #fffbeb; border: 1px solid #fde68a; }
.voice-passage { margin: 0 0 12px; padding: 12px 14px; border-left: 3px solid var(--brand); background: var(--surface);
    border-radius: 8px; font-style: italic; line-height: 1.5; }
.voice-progress { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; margin-bottom: 6px; }
.voice-progress span { display: block; height: 100%; background: var(--brand); transition: width 0.9s linear; }
@media (max-width: 900px) { .profile-layout, .profile-grid { grid-template-columns: 1fr; } }

/* ── Ambient scribe on the visit page ─────────────────────────────────────── */
.scribe-btn { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.scribe-btn.recording { background: #fff; color: #b91c1c; border-color: #fca5a5; }
.live-transcript { border-color: color-mix(in srgb, var(--brand) 40%, white); }
.live-transcript .card-row { display: flex; justify-content: space-between; align-items: center; }
.live-dot { color: #ef4444; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; animation: live-pulse 1.1s ease-in-out infinite alternate; }
.live-dot::before { content: '● '; }
@keyframes live-pulse { from { opacity: 0.35; } to { opacity: 1; } }
.live-lines { list-style: none; margin: 8px 0 0; padding: 0; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.live-lines li { display: grid; grid-template-columns: 70px 74px 1fr; gap: 8px; align-items: baseline; font-size: 14px; }
.live-lines li.plain { grid-template-columns: 70px 1fr; }
.live-partial { margin: 8px 0 0 78px; font-size: 14px; font-style: italic; color: var(--muted, #94a3b8); }
.live-transcript .card-row-end { display: inline-flex; align-items: center; gap: 8px; }
.live-transcript .card-row-start { display: inline-flex; align-items: center; gap: 8px; }
.chip.where { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.chip.where.local { color: #0f766e; background: #f0fdfa; border: 1px solid #99f6e4; }
.chip.where.remote { color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; }
.chip.where.local::before { content: '\25CF  '; font-size: 8px; vertical-align: 1px; }
.chip.where.remote::before { content: '\2601  '; }
@media (max-width: 600px) { .live-partial { margin-left: 0; } }
.speaker { text-align: center; border-radius: 6px; padding: 1px 0; font-size: 11px; font-weight: 800; }
.speaker.provider { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.speaker.patient { background: #ede9fe; color: #7c3aed; }

/* ── Medora voice ───────────────────────────────────────────────────────────── */
.listen-btn { white-space: nowrap; }
.bubble-meta .listen-btn { padding: 0 6px; min-height: 0; font-size: 11px; line-height: 18px; margin-left: 4px; }
.talk-btn { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.voice-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #f5f3ff;
    border-bottom: 1px solid #ddd6fe; font-size: 13px; color: #5b21b6; }
.voice-bar[hidden] { display: none; }
.voice-bar > span:nth-child(2) { flex: 1; }

/* ── Locked SOAP sections ─────────────────────────────────────────────────── */
.soap-card summary .lock-chip { margin-left: auto; }
.lock-chip { border: 0; border-radius: 10px; padding: 4px 10px; font-size: 12px; font-weight: 800; cursor: pointer;
    background: #f1f5f9; color: #475569; }
.lock-chip.static { cursor: default; }
.soap-card.locked { border-color: #fcd34d; }
.soap-card.locked .lock-chip { background: #fef3c7; color: #b45309; }
.soap-card.locked .sec-hint { color: #b45309; font-weight: 600; }
.soap-card.locked .field { background: #f1f5f9; color: #475569; }

/* Profile: ambient scribe settings */
.profile-side { display: flex; flex-direction: column; gap: 18px; }
.profile-scribe .soap-field { margin-top: 12px; }
.profile-scribe .soap-field p { margin: 0 0 4px; }
.scribe-estimate { margin: 14px 0 8px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
    background: color-mix(in srgb, var(--brand) 8%, white); color: var(--brand); }

/* Visit recording popup */
.rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rec-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.rec-row:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.rec-row.playing { background: color-mix(in srgb, var(--brand) 10%, white); }
.rec-row.playing .rec-time::before { content: '🔊 '; }
.rec-lines { display: flex; flex-direction: column; gap: 4px; }
.rec-line { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: baseline; font-size: 14px; }
.rec-line .speaker { padding: 1px 0; }
.rec-line.plain { grid-template-columns: 1fr; }   /* recorded before speaker labels */
.hybrid-switch label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.hybrid-switch input { width: 18px; height: 18px; accent-color: #0d9488; }
.audit.warn { color: #b45309; }

/* Intake questions editor */
.intake-page .chart-card { margin-bottom: 16px; }
.iq-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.iq-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.iq-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.iq-options { color: var(--brand); }
.iq-base summary { cursor: pointer; padding: 4px 0; }
.iq-base .iq-row { background: transparent; }
.iq-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 640px) { .iq-row { flex-direction: column; align-items: stretch; } }

.iq-sets { margin-bottom: 14px; flex-wrap: wrap; }
.iq-row.retired { opacity: 0.6; border-style: dashed; }

/* Brand line above the sign-in tagline */
.motto { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }

/* Care Queue → Lab requests (patients asking for a lab appointment) */
.lab-requests-note { margin: 0 0 12px; }

/* Conversations that came in on WhatsApp */
.tag.wa { background: #dcfce7; color: #15803d; }
.q-card > .tag.wa { align-self: flex-start; margin-top: 6px; }
.wa-note { font-size: 13px; color: var(--muted); padding: 6px 2px 8px; line-height: 1.4; }
.wa-note.closed { color: #b45309; }

/* ── Join staff (invite → set your password) ──────────────────────────────── */
.join-lead { font-size: 15px; line-height: 1.5; margin: 6px 0 0; }
input.readonly, input[readonly] { color: var(--muted); cursor: default; }
input.readonly:focus { outline: none; background: var(--canvas); }
.field-hint { margin: 6px 0 0; }
.join-check {
    width: 52px; height: 52px; border-radius: 50%; margin-bottom: 18px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand);
}
.join-check svg { width: 28px; height: 28px; }
.join-username {
    display: flex; flex-direction: column; gap: 2px; margin: 20px 0 4px; padding: 12px 14px;
    border-radius: 10px; background: var(--canvas); word-break: break-all;
}
.join-actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 16px; }
.join-actions:empty { display: none; }
a.button-link {
    display: block; text-align: center; padding: 13px; border-radius: 10px;
    font-size: 15px; font-weight: 600; text-decoration: none;
}
a.button-link.primary { background: var(--brand); color: var(--on-brand); }
a.button-link.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
a.button-link:hover { filter: brightness(1.06); }

/* ── Admin app ────────────────────────────────────────────────────────────── */
.admin-layout {
    flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px;
    display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start;
}
.admin-side, .admin-main, .card-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.admin-side { padding: 14px; position: sticky; top: 76px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 2px 10px; }
.side-head h2 { margin: 0; font-size: 15px; }
.hospital-list { display: flex; flex-direction: column; gap: 6px; }
.admin-hospital {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; text-align: left;
    border: 1px solid transparent; border-radius: 12px; background: none; cursor: pointer; font: inherit; color: var(--text);
}
.admin-hospital:hover { background: var(--canvas); }
.admin-hospital.selected { background: color-mix(in srgb, var(--brand) 8%, white); border-color: color-mix(in srgb, var(--brand) 35%, white); }
.hospital-tile.sm { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.admin-hospital-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-hospital-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { padding: 20px; min-height: 320px; }
.admin-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-title h1 { margin: 0 0 4px; font-size: 24px; display: flex; align-items: center; gap: 6px; }
.admin-title p { margin: 0; }
.admin-title-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn.ghost { background: none; }
.icon-btn.ghost:hover { background: var(--canvas); color: var(--brand); }
.admin-tabs { max-width: 320px; }
.admin-panel { display: flex; flex-direction: column; gap: 12px; }
.admin-search { max-width: 360px; }
.admin-help { margin: 6px 0 2px; }
.admin-rows { display: flex; flex-direction: column; }
.admin-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--border);
}
.admin-row:first-child { border-top: 0; }
.admin-row.off .avatar { background: var(--canvas); color: var(--muted); }
.admin-row.off .admin-row-name strong { color: var(--muted); }
.admin-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.admin-row-name { font-size: 15px; }
.admin-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.admin-badges .tag { margin-left: 0; }
.role-chip {
    padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
    background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand);
}
.tag.super { background: #ede9fe; color: #6d28d9; }
.tag.off { background: var(--danger-bg); color: var(--danger); }
.admin-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.admin-status.on { color: #15803d; }
.admin-status.off { color: var(--danger); }
.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.action-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.action-item {
    width: 100%; padding: 11px 12px; text-align: left; cursor: pointer; font: 600 14px/1.2 var(--font);
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
}
.action-item:hover { border-color: var(--brand); color: var(--brand); }
.action-item.danger { color: var(--danger); }
.action-item.danger:hover { border-color: var(--danger); }
.admin-form { margin: 0; }
.admin-form .alert { margin-top: 0; }
.admin-form .check-row { margin-top: 4px; }
.link-field { font-size: 13px; }
.admin-denied { padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.admin-denied h1 { margin: 12px 0 4px; font-size: 22px; }
.admin-denied form { margin-top: 16px; }
.admin-denied .avatar svg { width: 26px; height: 26px; }

@media (max-width: 820px) {
    .admin-layout { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 14px; }
    .admin-side { position: static; padding: 12px; min-width: 0; }
    .admin-page .topbar-name { white-space: nowrap; }
    .admin-page .topbar-actions { gap: 10px; }
    .hospital-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .admin-hospital { width: auto; flex: none; max-width: 240px; border-color: var(--border); }
    .admin-main { padding: 16px; }
    .admin-title h1 { font-size: 20px; }
    .admin-tabs { max-width: none; }
    .admin-search { max-width: none; }
    .admin-row { flex-wrap: wrap; }
    .admin-row-main { flex-basis: calc(100% - 100px); }
    .admin-row-actions { width: 100%; justify-content: flex-start; padding-left: 48px; }
    .topbar { padding: 10px 16px 8px; }
    .topbar-who { display: none; }
}

/* ── Booking from a conversation / doctor → nurse hand-off ─────────────────── */
.handoff-note { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: #e1f5ee; border: 1px solid #9fe1cb; }
.handoff-note strong { display: block; color: #0f6e56; font-size: 13px; }
.handoff-note p { margin: 4px 0 2px; font-size: 13px; }
.chat-booking { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line, #e2e8f0); background: var(--surface, #fff); }
.chat-booking .handoff-note { margin: 0; flex: 1 1 260px; }
#handoff-dialog .chip { background: var(--surface, #fff); border-color: #9fe1cb; color: #0f6e56; cursor: pointer; }
#handoff-dialog .chip.active { background: #e1f5ee; border-color: #0f6e56; }
.form-stack { display: flex; flex-direction: column; gap: 6px; }
.form-stack label { margin-top: 6px; }
.previsit { margin-bottom: 14px; padding: 14px; border-radius: 14px; background: var(--surface, #fff); border: 1px solid #9fe1cb; }
.previsit h3 { margin: 0 0 6px; font-size: 14px; color: #0f6e56; }
.previsit .summary-text { white-space: pre-wrap; font-size: 13px; line-height: 1.45; margin: 0; }
.previsit .doctor-note { margin: 10px 0 0; padding: 10px; border-radius: 8px; background: #e1f5ee; font-size: 13px; }
.previsit details { margin-top: 8px; }
.previsit summary { cursor: pointer; color: #0f6e56; font-weight: 700; font-size: 12px; }
.previsit .line { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; }
.previsit .line b { color: var(--muted); }
.previsit .line.patient b { color: inherit; }

/* Staff schedule editor: the whole day (48 slots) grouped by part of day, scrolls inside the panel */
.editor-parts { max-height: min(60vh, 560px); overflow-y: auto; position: relative; padding-right: 2px; }
.day-part { margin-bottom: 14px; }
.day-part-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; position: sticky; top: 0; background: var(--surface, #fff); padding: 4px 0; z-index: 1; }
.day-part-head .btn { margin-left: auto; }

/* ── Visit records, chart updates, health record (VISIT-RECORD-SPEC.md) ── */
.tag.info { background: #e0f2fe; color: #0369a1; }
.sugg-card .sugg { padding: 10px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.sugg-card .sugg:first-of-type { border-top: 0; }
.sugg-actions { margin-top: 4px; }
.sugg-decided { margin-top: 8px; }
.record-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.record-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.record-heading { font-size: 16px; margin: 4px 0; display: flex; gap: 8px; align-items: center; }
.record-soap { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.record-soap dt { font-weight: 600; font-size: 13px; color: var(--muted, #64748b); }
.record-soap dd { margin: 0; }
.snapshot { display: flex; flex-direction: column; gap: 12px; }
.chart-list li.chg-added { background: #f0fdf4; border-radius: 8px; padding-left: 8px; }
.chart-list li.chg-changed { background: #fffbeb; border-radius: 8px; padding-left: 8px; }
.chart-list li.chg-removed { background: #fef2f2; border-radius: 8px; padding-left: 8px; }
.timeline-filters { margin-bottom: 12px; }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-date { font-size: 13px; margin: 0 0 4px; color: var(--muted, #64748b); text-transform: uppercase; letter-spacing: .03em; }
.tl-item .visit-link { display: block; color: inherit; text-decoration: none; }
.tl-item.tl-visit { border-left: 3px solid var(--brand); padding-left: 10px; }
.tag.tl-visit { background: color-mix(in srgb, var(--brand) 14%, white); color: var(--brand); }
.tag.tl-prescription, .tag.tl-chart_change { background: #f0fdf4; color: #15803d; }
.tag.tl-lab_result { background: #e0f2fe; color: #0369a1; }
.tag.tl-connect_request { background: #fef3c7; color: #b45309; }
.tl-chart { margin-top: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; background: var(--surface); }
.tl-chart > summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.tl-chart[open] > summary { margin-bottom: 10px; }
.tl-chart .chart-card { margin: 0; }
@media (max-width: 900px) { .record-layout { grid-template-columns: 1fr; } .record-soap { grid-template-columns: 1fr; } }

/* ── Doctor self sign-up: sign-up form, Get started, verification banner ─── */
.signup-link { margin: 18px 0 6px; font-size: 14px; }
.signup-link a { color: var(--brand); font-weight: 600; text-decoration: none; }
.signup-link a:hover { text-decoration: underline; }
.alert.ok { background: #dcfce7; color: #15803d; }
.alert-link { margin-left: 8px; color: inherit; font-weight: 700; }
.signup-wrap { max-width: 420px; padding-bottom: 24px; }
.form-wrap input[type=email], .form-wrap input[type=tel], .form-wrap select {
    width: 100%; padding: 12px 14px; font-size: 15px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--canvas); color: var(--text); font-family: inherit;
}
.phone-row { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
.consent { align-items: flex-start; margin-top: 18px; line-height: 1.4; }
.consent input { margin-top: 3px; }
.verify-banner {
    display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 10px 14px; border-radius: 10px;
    background: #fef3c7; color: #92400e; font-size: 14px; font-weight: 500;
}
.app-header .verify-banner { margin: 0; border-radius: 0; padding: 8px 24px; }
.verify-banner svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tag.practice-tag { background: #e0f2fe; color: #0369a1; }
.picker-brand-links { margin-left: auto; display: flex; gap: 16px; font-size: 14px; }
.get-started { max-width: 920px; }
.gs-section { margin-bottom: 28px; }
.gs-section h2 { font-size: 16px; margin: 0 0 10px; }
.gs-enter { margin-left: auto; color: var(--brand); font-weight: 600; font-size: 14px; }
.gs-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .gs-cards { grid-template-columns: 1fr; } }
.gs-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.gs-card form { margin-top: 0; }
.gs-card label { margin: 14px 0 6px; }
.gs-card .field { width: 100%; }
.gs-card-head { display: flex; gap: 12px; align-items: flex-start; }
.gs-card-head h2 { margin: 0 0 2px; font-size: 18px; }
.gs-card-head p { margin: 0; }
.gs-icon { width: 38px; height: 38px; flex: none; padding: 8px; border-radius: 10px; fill: none; stroke: var(--brand); stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round; background: color-mix(in srgb, var(--brand) 10%, white); }
.gs-inline { display: flex; gap: 8px; }
.gs-inline .field { flex: 1; text-transform: uppercase; letter-spacing: 0.08em; }
.gs-results { display: grid; gap: 6px; margin-top: 8px; }
.gs-result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.gs-result-text { flex: 1; display: flex; flex-direction: column; }
.gs-requests { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.gs-requests h3 { font-size: 14px; margin: 0 0 8px; }
.gs-request { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.gs-request > div { flex: 1; }
.gs-practice { margin: 16px 0 8px; font-size: 16px; }
.gs-locations { margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: 14px; }
.gs-loc-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.gs-loc-row { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 6px; }
.gs-actions { margin-top: 16px; }
.chevron { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Admin: staff join code, doctor join requests */
.join-code-line { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.join-code { font: 700 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.1em; padding: 2px 8px;
    border-radius: 6px; background: var(--canvas); color: var(--text); }
.request-message { margin: 6px 0 2px; font-size: 14px; font-style: italic; }

/* Practice patient who hasn't approved sharing their own record (PRACTICE-PATIENTS-SPEC.md) */
.consent-note { border-left: 3px solid #D97706; background: #FFFBEB; padding: 10px 14px; border-radius: 8px; margin: 8px 0; }
.consent-note p { margin: 4px 0 0; }
@media (prefers-color-scheme: dark) { .consent-note { background: rgba(217, 119, 6, 0.12); } }

/* Notes templates (visit page): template chip, picker, folding headings, dental tooth chart */
.template-chip { font-size: 12.5px; font-weight: 700; color: #085041; background: #e1f5ee; border-radius: 99px; padding: 4px 10px; }
.tpl-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; cursor: pointer; }
.tpl-option:has(input:checked) { border: 2px solid #0f6e56; background: #e1f5ee; }
details.soap-group { border-top: 1px solid var(--border); padding: 4px 0; }
details.soap-group > summary { cursor: pointer; list-style: revert; }
details.soap-group > summary h3 { display: inline; }
.tooth-chart { margin-top: 6px; }
.tooth-chart .tooth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tooth-chart .arch { display: flex; justify-content: center; gap: 3px; flex-wrap: nowrap; }
.tooth-chart .arch .mid { width: 10px; flex: none; }
.tooth-chart .arch-line { height: 1px; background: var(--border); margin: 5px 0; }
.tooth-chart .tooth { width: 30px; height: 40px; flex: 0 1 30px; min-width: 16px; border: 1px solid #cbd5e1; border-radius: 7px; background: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 3px 0; cursor: pointer; }
.tooth-chart .tooth.sel { border: 2px solid #0f6e56; }
.tooth-chart .tooth.missing { background: #f1f5f9; }
.tooth-chart .tooth b { font-size: 11px; }
.tooth-chart .dots { display: flex; flex-wrap: wrap; gap: 1px; justify-content: center; max-width: 24px; min-height: 6px; }
.tooth-chart .dots i, .tooth-chart .finding i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.tooth-chart .tooth-panel { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc;
    display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tooth-chart .tooth-findings { display: flex; flex-wrap: wrap; gap: 6px; }
.tooth-chart .finding { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 99px; background: #fff; cursor: pointer; }
.tooth-chart .finding.on { border-color: #0f6e56; background: #e1f5ee; }
.tooth-chart .finding input { margin: 0; }
.tooth-chart .tooth-panel .field { width: 100%; }

.perio-sites { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.perio-site { display: flex; flex-direction: column; gap: 2px; width: 64px; }
.perio-site .field { width: 64px; text-align: center; }
.perio-grade { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.perio-grade > span { width: 96px; }
.canals .canal-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.5fr auto; gap: 6px; margin-bottom: 6px; }

/* Get started — first set-up in two steps */
.gs-wizard { max-width: 560px; display: flex; flex-direction: column; gap: 12px; }
.gs-wizard h2 { margin: 6px 0 0; font-size: 22px; }
.gs-progress { display: flex; align-items: center; gap: 6px; }
.gs-progress i { width: 24px; height: 4px; border-radius: 2px; background: var(--border); display: inline-block; }
.gs-progress i.on { background: #0f6e56; }
.gs-choice { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px; border-radius: 16px;
    border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.gs-choice.on { border: 2px solid #0f6e56; background: #e1f5ee; }
.gs-choice > span { display: flex; flex-direction: column; gap: 2px; }
.gs-choice strong { font-size: 16px; }
.gs-continue { align-self: stretch; padding: 12px; }
.gs-back { align-self: flex-start; }

/* Privacy policy / delete-account links in the small footer */
.powered-by a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ══ New look (STAFF-WEBSITE-REDESIGN-SPEC.md, 2026-11-22) ═══════════════════════════════════════════════════
   Grouped sidebar instead of the top bar + tabs, a calm page background, white cards with soft shadows. */
:root {
    --canvas: #f3f6f6;
    --sb-width: 252px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.07);
    --line: #e3e8ec;
}
.app-page, .picker-page {
    background: var(--canvas);
    background-image: radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
    background-attachment: fixed;
}

/* Shell: room for the fixed sidebar (embedded pages have no header) */
@media (min-width: 901px) {
    body.app-page:has(> .app-header) { padding-left: var(--sb-width); }
}
.app-header {
    position: static; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.app-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sb-width); z-index: 25;
    display: flex; flex-direction: column;
    background: #fff; border-right: 1px solid var(--line);
}
.sb-place { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; border-bottom: 1px solid var(--line); }
.sb-place .logo { border-radius: 11px; }
.sb-place-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sb-place-name { font-weight: 800; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sb-place-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sb-place-sub a { color: var(--brand); font-weight: 700; text-decoration: none; }
.sb-place-sub .tag { margin: 0; }

.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sb-group { margin: 18px 12px 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; }
.sb-link {
    display: flex; align-items: center; gap: 12px; width: 100%; margin: 1px 0; padding: 10px 12px; border: 0; border-radius: 10px;
    background: none; color: var(--text); font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer; text-align: left;
}
.sb-link:hover { background: #f1f5f9; }
.sb-link.active { background: color-mix(in srgb, var(--brand) 11%, white); color: var(--brand); font-weight: 800; }
.sb-link.small { padding: 8px 12px; font-size: 13.5px; color: #334155; }
.sb-icon { width: 20px; height: 20px; display: inline-flex; flex: none; color: #64748b; }
.sb-link.active .sb-icon { color: var(--brand); }
.sb-icon svg { width: 20px; height: 20px; }
.sb-foot { border-top: 1px solid var(--line); padding: 8px 12px 12px; }
.sb-foot form { margin: 0; }
.sb-me { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 8px 4px 0 6px; border-top: 1px solid var(--line); }
.sb-me-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; text-decoration: none; color: var(--text); }
.sb-me-link:hover { background: #f1f5f9; }
.sb-me-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-me-name { font-weight: 800; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-me-role { font-size: 12px; color: var(--muted); }
.sb-signout {
    width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 9px; background: none; color: #64748b; cursor: pointer;
}
.sb-signout:hover { background: var(--danger-bg); color: var(--danger); }
.sb-signout svg { width: 18px; height: 18px; }
.app-header .verify-banner { margin: 16px 24px 0; border-radius: 12px; padding: 10px 14px; }

/* Pages */
.page { max-width: 1320px; padding: 28px 32px 40px; }
.page-head { margin-bottom: 22px; align-items: center; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { font-size: 14px; }

/* Cards, rows, panes: white, soft shadow */
.q-card, .h-row, .chat-pane { border-color: var(--line); box-shadow: var(--shadow-sm); }
.q-card { border-radius: 16px; padding: 16px; }
.q-card:hover { box-shadow: var(--shadow-md); }
.chat-pane { border-radius: 18px; }
.chat-body { background: #f7f9fa; }

/* Buttons */
.btn { border-radius: 11px; padding: 10px 16px; font-weight: 700; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.btn.secondary { border-color: var(--line); box-shadow: none; }
.btn.secondary:hover:not(:disabled) { background: #f8fafc; filter: none; }
.btn.small { padding: 7px 11px; }
.pill-link { border-radius: 9px; padding: 6px 11px; }

/* Segmented controls: soft pills */
.segmented { background: #fff; border-color: var(--line); border-radius: 13px; box-shadow: var(--shadow-sm); }
.segmented button { border-radius: 10px; color: #334155; }
.segmented button:hover:not([aria-selected=true]) { background: #f1f5f9; }

/* My Schedule: its sections as a pill row above the list (the main sidebar is on the left) */
@media (min-width: 901px) {
    .side-shell { flex-direction: column; }
    .side-nav {
        width: 100%; padding: 24px 32px 0; background: none; border: 0;
        -webkit-backdrop-filter: none; backdrop-filter: none;
        max-width: 1320px; margin: 0 auto; box-sizing: border-box; align-self: stretch;
    }
    .side-nav .segmented {
        position: static; flex-direction: row; display: inline-flex; gap: 4px; padding: 4px;
        background: #fff; border: 1px solid var(--line); border-radius: 13px;
    }
    .side-nav .segmented button { padding: 9px 16px; justify-content: center; gap: 6px; }
    /* Inbox: the section pills and "Manage queue" side by side */
    .side-nav .side-stack { position: static; display: flex; flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
    .side-nav .side-stack .segmented { width: auto; flex: none; }
    .side-nav .side-sep { display: none; }
    .side-nav .side-link { width: auto; margin: 0; }
    .side-shell > .page { width: 100%; padding-top: 18px; }
    .side-shell .page-head { margin-bottom: 18px; }
}

/* Inputs */
input[type=text], input[type=password], input[type=search], input[type=email], input[type=tel], select, textarea {
    border-color: var(--line);
}

/* Small screens: the sidebar becomes a top bar, pages in a scrolling row */
@media (max-width: 900px) {
    .app-sidebar {
        position: sticky; top: 0; width: auto; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
        border-right: 0; border-bottom: 1px solid var(--line);
    }
    .sb-place { flex: 1; border: 0; padding: 10px 14px; }
    .sb-place .logo { width: 30px !important; height: 30px !important; }
    .sb-nav { order: 3; flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; padding: 0 10px 8px; scrollbar-width: none; }
    .sb-group { display: none; }
    .sb-link { width: auto; white-space: nowrap; padding: 8px 12px; }
    .sb-nav .sb-icon { display: none; }
    .sb-foot { border: 0; padding: 0 10px; display: flex; align-items: center; gap: 2px; }
    .sb-foot .sb-link.small span:not(.sb-icon) { display: none; }
    .sb-me { border: 0; margin: 0; padding: 0; }
    .sb-me-text { display: none; }
    .page { padding: 16px; }
    .page-head { align-items: flex-start; }
}
/* No top bar any more: lists and conversations get the height back */
@media (min-width: 901px) {
    .queue-layout { height: calc(100vh - 150px); }
    .side-shell .queue-layout { height: calc(100vh - 210px); }
}
/* Patient drawer: opens beside the sidebar, which stays in view */
@media (min-width: 901px) {
    body.app-page:has(> .app-header) .drawer { left: var(--sb-width); width: calc(100vw - var(--sb-width) - 1vw); }
    body.app-page:has(> .app-header) .drawer-backdrop { left: var(--sb-width); }
    body.app-page:has(> .app-header) .chart-sheet { left: calc(50% + var(--sb-width) / 2); width: min(1240px, 100vw - var(--sb-width) - 24px); }
    body.app-page:has(> .app-header) .chart-backdrop { left: var(--sb-width); }
    .app-sidebar { z-index: 42; }
}
/* Visit page: the Save / Complete bar starts beside the sidebar */
@media (min-width: 901px) {
    body.app-page:has(> .app-header) .visit-bar { left: var(--sb-width); }
    .visit-side { top: 24px; }
}
/* Visit + chart side by side beside the sidebar: a slimmer chart, and the visit header wraps instead of squeezing */
@media (min-width: 901px) {
    body.app-page:has(> .app-header) .visit-chart { width: min(38vw, 600px); }
    body.app-page:has(> .app-header).visit-chart-open .visit-page { margin-right: min(38vw, 600px); }
    body.app-page:has(> .app-header).visit-chart-open .visit-bar { right: min(38vw, 600px); }
}
.visit-head { flex-wrap: wrap; }
.visit-head > div:first-child { min-width: 220px; }

/* Sidebar count badge */
.sb-badge { margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: #dc2626; color: #fff;
    font-size: 11.5px; font-weight: 800; text-align: center; }

/* ── Appointment requests (F1) ───────────────────────────────────────────────── */
.narrow-page { max-width: 920px; }
.req-list { display: flex; flex-direction: column; gap: 12px; }
.req-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.req-top { display: flex; align-items: flex-start; gap: 12px; }
.req-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.req-who strong { font-size: 16px; }
.req-for { color: var(--brand); font-weight: 700; font-size: 13px; }
.req-line { margin: 10px 0 0; font-size: 14px; display: flex; gap: 10px; }
.req-label { flex: none; width: 70px; color: var(--muted); font-weight: 600; font-size: 13px; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.req-error { margin: 10px 0 0; color: var(--danger); font-size: 13px; }
.req-section { margin: 28px 2px 10px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.req-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.req-dot { width: 30px; height: 30px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; background: #f1f5f9; color: #64748b; }
.req-dot.accepted { background: #ccfbf1; color: #0f766e; }
.req-dot.declined { background: #fee2e2; color: #b91c1c; }
.req-empty { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.req-empty-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); font-size: 22px; font-weight: 800; }
.req-empty p { margin: 6px 0 0; }
dialog.sheet .field, dialog.sheet select, dialog.sheet textarea { width: 100%; }

/* ── Referrals (F2) ──────────────────────────────────────────────────────────── */
.ref-tabs { display: inline-flex; margin-bottom: 16px; }
.ref-tabs button { flex: none; padding: 9px 18px; }
.ref-layout { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ref-list { display: flex; flex-direction: column; gap: 10px; }
.ref-card { width: 100%; text-align: left; font: inherit; color: inherit; }
.ref-card.new { border-left: 4px solid var(--brand); }
.ref-new { margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 10.5px; font-weight: 800; vertical-align: middle; }
.ref-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.ref-state { font-size: 12px; font-weight: 700; color: var(--muted); }
.ref-state.ok { color: var(--brand); }
.ref-urgency { flex: none; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.ref-urgency.routine { background: #e0f2f1; color: #0f766e; }
.ref-urgency.soon { background: #fef3c7; color: #b45309; }
.ref-urgency.urgent { background: #fee2e2; color: #b91c1c; }
.ref-detail { position: sticky; top: 24px; min-height: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 22px 24px; }
.ref-detail .chat-empty { margin: 120px auto; }
.ref-name { margin: 0; font-size: 20px; }
.ref-facts { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; margin: 16px 0 6px; font-size: 14px; }
.ref-facts dt { color: var(--muted); font-weight: 600; }
.ref-facts dd { margin: 0; }
.ref-block { margin-top: 18px; }
.ref-label { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ref-reason { margin: 0; font-size: 16px; font-weight: 700; }
.ref-note { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; padding: 14px 16px; border-radius: 12px; background: #f7f9fa; border: 1px solid var(--line); }
.ref-book { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.ref-book p { margin: 8px 0 0; }
.ref-form .sheet-body { display: flex; flex-direction: column; gap: 8px; }
.ref-step { margin: 14px 0 2px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }
.ref-field label { margin: 6px 0 4px; }
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ref-form textarea.field { resize: vertical; flex: none; min-height: 96px; }
.ref-form textarea.field[rows="8"] { min-height: 180px; }
@media (max-width: 900px) { .ref-layout, .ref-grid { grid-template-columns: 1fr; } .ref-detail { position: static; } }

/* ── Finish the visit: prescription (F3) ─────────────────────────────────────── */
dialog.fv-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
dialog.fv-dialog[open] { display: flex; }
.fv-body { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.fv-body textarea.field { flex: none; min-height: 64px; resize: vertical; }
.fv-section { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.fv-section h3 { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.fv-allergy { padding: 10px 14px; border-radius: 12px; background: #fef2f2; color: #b91c1c; font-size: 14px; }
.fv-earlier { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #f8fafc; }
.fv-earlier > summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.fv-prior { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.fv-prior-head { display: flex; align-items: center; gap: 10px; }
.fv-prior-head .muted { flex: 1; }
.fv-prior-med { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0 4px 12px; font-size: 13.5px; }
.fv-meds { display: flex; flex-direction: column; gap: 10px; }
.fv-med { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.fv-med.off { opacity: 0.55; }
.fv-med-top { display: grid; grid-template-columns: auto 1.6fr 1fr auto; gap: 8px; align-items: center; }
.fv-med-top input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.fv-med-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; margin-top: 8px; align-items: center; }
.fv-qty { font-size: 12.5px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.fv-warn { margin: 8px 0 0; font-size: 12.5px; color: #b45309; }
.fv-warn.danger { color: #b91c1c; font-weight: 700; }
.fv-foot { border-top: 1px solid var(--line); padding: 12px 20px 16px; }
.fv-hint { margin: 0 0 8px; }
.fv-view { margin-left: 8px; }
@media (max-width: 700px) { .fv-med-top, .fv-med-grid { grid-template-columns: 1fr; } }

/* ── Prescription letter ─────────────────────────────────────────────────────── */
dialog.rx-dialog { width: min(720px, calc(100vw - 32px)); background: #e8eeec; }
.rx-body { max-height: calc(100vh - 200px); overflow-y: auto; }
.rx-paper { background: #fff; border-radius: 6px; padding: 32px 36px; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08); color: #0f172a; font-size: 14px; }
.rx-head { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 16px; border-bottom: 2px solid var(--brand); }
.rx-logo { width: 64px; height: 64px; object-fit: contain; }
.rx-doc { flex: 1; display: flex; flex-direction: column; gap: 2px; color: #475569; font-size: 13px; }
.rx-doc-name { font-size: 18px; color: #0f172a; }
.rx-date { font-size: 13px; color: #475569; white-space: nowrap; }
.rx-patient { margin: 16px 0; font-size: 15px; }
.rx-allergy { margin-top: 4px; color: #b91c1c; font-size: 13px; font-weight: 700; }
.rx-block { margin-top: 14px; }
.rx-block p { margin: 0; }
.rx-label { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; margin-bottom: 4px !important; }
.rx-symbol { font-size: 26px; font-weight: 700; color: var(--brand); }
.rx-meds { margin: 6px 0 0; padding-left: 22px; }
.rx-meds li { margin: 8px 0; }
.rx-med-detail { color: #475569; font-size: 13px; margin-top: 2px; }
.rx-legend { margin-top: 8px !important; font-size: 12px; color: #64748b; }
.rx-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid #e2e8f0; font-size: 12px; color: #64748b; text-align: right; }
.rx-actions { padding: 0 20px 16px; }
/* Print: only the prescription */
@media print {
    body.printing-rx > *:not(dialog.rx-dialog) { display: none !important; }
    body.printing-rx { padding: 0 !important; background: #fff !important; }
    body.printing-rx dialog.rx-dialog { position: static; width: auto; max-height: none; border: 0; box-shadow: none; background: #fff; padding: 0; }
    body.printing-rx dialog.rx-dialog .sheet-head, body.printing-rx dialog.rx-dialog .rx-actions { display: none; }
    body.printing-rx .rx-body { max-height: none; overflow: visible; padding: 0; }
    body.printing-rx .rx-paper { box-shadow: none; padding: 0; }
    body.printing-rx dialog.rx-dialog::backdrop { display: none; }
}

/* ── Orders & follow-up (F4) ─────────────────────────────────────────────────── */
dialog.od-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog.od-dialog[open] { display: flex; flex-direction: column; }
.od-body { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.od-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.od-follow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
    background: color-mix(in srgb, var(--brand) 7%, white); border: 1px solid color-mix(in srgb, var(--brand) 22%, white); }
.od-follow p { margin: 2px 0 0; }
.od-review { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px;
    background: #fffbeb; color: #92400e; font-weight: 700; font-size: 14px; }
.od-label, .od-group-title { margin: 8px 0 0; font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.od-order { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.od-order.cancelled { opacity: 0.55; }
.od-order-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.od-order-head .tag { margin: 0; }
.tag.muted { background: #f1f5f9; color: #64748b; }
.od-sub { margin: 4px 0 8px; }
.od-actions { margin-top: 8px; }
.od-add { align-self: flex-start; }
.od-catalog { border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px 14px; background: #fff; }
.od-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; margin-top: 6px; }
.od-item { display: flex; flex-direction: column; gap: 4px; }
.od-check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 0; }
.od-check input { width: 17px; height: 17px; accent-color: var(--brand); }
.od-details { margin-bottom: 4px; }
.od-catalog-foot { justify-content: flex-end; margin-top: 12px; }
.danger-text { color: var(--danger) !important; }
.audit.review-flag { color: #b45309; font-weight: 800; }

/* ── Payments (F5) ───────────────────────────────────────────────────────────── */
dialog.pay-dialog { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog.pay-dialog[open] { display: flex; flex-direction: column; }
.pay-body { overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.pay-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.pay-top { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.pay-scan { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--line); text-align: center; }
.pay-qr { width: 220px; height: 220px; object-fit: contain; background: #fff; border-radius: 12px; }
.pay-upi { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 0; }
.pay-upi strong { font-size: 16px; word-break: break-all; }
.pay-payee { margin: 0; font-weight: 700; }
.pay-side { display: flex; flex-direction: column; gap: 10px; }
.pay-side > .btn { align-self: flex-start; }
.pay-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-totals > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.pay-totals strong { font-size: 20px; }
.pay-editor { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pay-editor label { margin: 8px 0 4px; }
.pay-editor-foot { justify-content: flex-end; margin-top: 10px; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pay-row .tag { margin-left: 4px; }
.pay-procs { display: flex; flex-direction: column; gap: 6px; }
.pay-proc { display: grid; grid-template-columns: 26px 110px 1fr 120px 34px; gap: 8px; align-items: center; }
.pay-proc.off { opacity: 0.55; }
.pay-proc.new { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); grid-template-columns: 26px 140px 1fr 120px auto; }
.pay-code { font-weight: 800; font-size: 13px; }
@media (max-width: 760px) { .pay-top, .pay-grid { grid-template-columns: 1fr; } .pay-proc, .pay-proc.new { grid-template-columns: 26px 1fr; } }

/* ── Payments & revenue page ─────────────────────────────────────────────────── */
.rev-periods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.rev-period { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--muted); }
.rev-period strong { font-size: 24px; color: var(--text); }
.rev-period.on { background: var(--brand); color: rgba(255,255,255,0.85); border-color: var(--brand); }
.rev-period.on strong { color: #fff; }
.rev-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.rev-presets { margin: 0; display: inline-flex; }
.rev-presets button { flex: none; padding: 8px 14px; }
.rev-pending { margin-left: auto; }
.rev-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.rev-tile { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.rev-tile strong { font-size: 20px; }
.rev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.rev-card { padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.rev-card.wide { grid-column: 1 / -1; }
.rev-card h3 { margin: 0 0 12px; font-size: 15px; }
.rev-chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.rev-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 3px; }
.rev-stack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.rev-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
.rev-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #f1f5f9; }
.rev-row:first-of-type { border-top: 0; }
.rev-row-main { flex: 1; display: flex; flex-direction: column; }
.rev-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.rev-split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: 10px; }
.rev-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
@media (max-width: 1000px) { .rev-tiles { grid-template-columns: 1fr 1fr; } .rev-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .rev-periods { grid-template-columns: 1fr; } }

/* ── Today (F6) ──────────────────────────────────────────────────────────────── */
:root { --td-done: #0d9488; --td-invisit: #0ea5e9; --td-waiting: #5eead4; --td-noshow: #f43f5e; }
.td-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.td-main, .td-side { display: flex; flex-direction: column; gap: 14px; }
.td-card { padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.td-card h3 { margin: 0 0 12px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.td-brief { padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, #f0fdfa, #ecfeff); border: 1px solid color-mix(in srgb, var(--brand) 25%, white); }
.td-brief-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.td-brief p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #334155; white-space: pre-wrap; }
.td-todo { display: flex; flex-direction: column; }
.td-todo-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid #f1f5f9; text-decoration: none; color: inherit; border-radius: 10px; }
.td-todo-row:first-child { border-top: 0; }
.td-todo-row:hover { background: #f8fafc; }
.td-todo-icon { width: 36px; height: 36px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.td-todo-icon.flag { background: #e0e7ff; color: #4338ca; }
.td-todo-icon.pending { background: #fef3c7; color: #b45309; }
.td-todo-icon.chat { background: #e0f2fe; color: #0369a1; }
.td-todo-icon.money { background: #ffe4e6; color: #be123c; }
.td-todo-text { flex: 1; display: flex; flex-direction: column; }
.td-chev { color: #94a3b8; font-size: 20px; }
.td-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.td-today { display: flex; align-items: center; gap: 20px; }
.td-donut { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.td-donut > div { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.td-donut strong { font-size: 26px; line-height: 1; }
.td-donut span { font-size: 12px; color: var(--muted); }
.td-legend { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.td-legend li { display: flex; align-items: center; gap: 8px; }
.td-legend strong { margin-left: auto; }
.td-dot { width: 9px; height: 9px; border-radius: 50%; }
.td-next { display: flex; flex-direction: column; gap: 4px; }
.td-next strong { font-size: 28px; color: var(--brand); }
.td-hours { display: flex; align-items: flex-end; gap: 4px; height: 130px; }
.td-hour { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.td-hour > span { font-size: 10.5px; color: var(--muted); height: 13px; }
.td-hour-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.td-hour-bar .booked { width: 100%; background: #ccfbf1; border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; min-height: 2px; }
.td-hour-bar .done { width: 100%; background: var(--td-done); border-radius: 4px 4px 0 0; }
.td-hour.now .td-hour-bar .booked { outline: 2px solid var(--brand); }
.td-week .td-hour-bar .booked { background: var(--td-done); }
.td-link { display: flex; flex-direction: column; gap: 2px; padding: 10px 6px; border-top: 1px solid #f1f5f9; text-decoration: none; color: inherit; border-radius: 10px; }
.td-link:first-of-type { border-top: 0; }
.td-link:hover { background: #f8fafc; }
.td-patients { display: flex; flex-direction: column; gap: 8px; }
.td-patient { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: inherit; }
.td-patient:hover { border-color: color-mix(in srgb, var(--brand) 45%, white); }
.td-patient-head { display: flex; gap: 8px; align-items: center; }
.td-flags { font-size: 12.5px; color: #b45309; font-weight: 700; }
@media (max-width: 1100px) { .td-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .td-two { grid-template-columns: 1fr; } }

/* ── Voice (F7) ──────────────────────────────────────────────────────────────── */
dialog.vc-dialog .sheet-body { display: flex; flex-direction: column; gap: 10px; }
.vc-live { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; background: #f0fdfa; }
.vc-meter { flex: 1; height: 56px; display: flex; align-items: center; gap: 3px; }
.vc-meter span { flex: 1; height: 8%; min-height: 4px; border-radius: 3px; background: var(--brand); transition: height 0.08s; }
.vc-status { margin: 0; font-weight: 700; color: var(--brand); }
.fv-speak { align-self: flex-start; margin-top: 6px; }
.vc-changed { background: #fef9c3 !important; transition: background 0.6s; border-radius: 10px; }

/* ── Scribe: listening panel (voice wave + red Stop) ─────────────────────────── */
.scribe-live {
    display: flex; align-items: center; gap: 18px; margin: -4px -4px 14px; padding: 14px 16px; border-radius: 16px;
    background: linear-gradient(135deg, #f5f3ff, #eef2ff); border: 1px solid #ddd6fe;
}
.scribe-live-left { display: flex; flex-direction: column; gap: 2px; flex: none; min-width: 96px; }
.scribe-rec { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: #6d28d9; font-size: 14px; }
.scribe-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); animation: scribe-pulse 1.4s infinite; }
@keyframes scribe-pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.scribe-time { font: 800 22px/1.1 var(--font); color: #1e1b4b; font-variant-numeric: tabular-nums; }
.scribe-wave { flex: 1; height: 56px; display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 0; }
.scribe-wave span { flex: 1; max-width: 6px; height: 6%; border-radius: 3px; background: linear-gradient(180deg, #8b5cf6, #6d28d9); transition: height 0.1s ease-out; }
.scribe-stop {
    flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border: 0; border-radius: 14px; cursor: pointer;
    background: #dc2626; color: #fff; font: 800 15px/1 var(--font); box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
    transition: transform 0.1s, background 0.15s;
}
.scribe-stop:hover { background: #b91c1c; }
.scribe-stop:active { transform: scale(0.97); }
.scribe-stop-icon { width: 12px; height: 12px; border-radius: 3px; background: #fff; }
.scribe-btn.recording { background: #7c3aed; color: #fff; }
@media (prefers-reduced-motion: reduce) { .scribe-rec-dot { animation: none; } .scribe-wave span { transition: none; } }
@media (max-width: 700px) { .scribe-live { flex-wrap: wrap; } .scribe-wave { order: 3; flex-basis: 100%; } }

/* ── Tooth chart (the app's arches) ──────────────────────────────────────────── */
.tc { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.tc-top { display: flex; justify-content: center; }
.tc-dentition { margin: 0; display: inline-flex; }
.tc-dentition button { flex: none; padding: 7px 18px; }
.tc-body { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr); gap: 14px; align-items: start; }
.tc-arches { background: linear-gradient(180deg, #f8fafc, #fff); border: 1px solid var(--line); border-radius: 18px; padding: 4px 2px; }
.tc-svg { width: 100%; height: auto; display: block; overflow: visible; }
.tc-mid { stroke: #e2e8f0; stroke-width: 1; }
.tc-side { font: 600 10px var(--font); letter-spacing: .12em; fill: #94a3b8; }
.tc-center-num { font: 700 26px var(--font); fill: #0f6e56; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tc-center-name { font: 500 12px var(--font); fill: #475569; }
.tc-center-small { font: 600 9.5px var(--font); fill: #94a3b8; letter-spacing: .14em; text-transform: uppercase; }
.tc-center-hint { font: 500 13px var(--font); fill: #64748b; }
.tc-tooth { cursor: pointer; outline: none; }
.tc-tooth path { transition: fill 0.25s, stroke 0.2s; filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.08)); }
.tc-tooth:hover path { stroke: #0f6e56; stroke-width: 1.8; }
.tc-tooth:focus-visible path { stroke: #0f6e56; stroke-width: 2.4; }
.tc-tooth.sel path { filter: drop-shadow(0 3px 6px rgba(15, 110, 86, 0.35)); }
.tc-num { font-family: var(--font); font-weight: 600; fill: #334155; letter-spacing: -.02em; font-variant-numeric: tabular-nums; pointer-events: none; }
.tc-svg text { text-rendering: geometricPrecision; -webkit-font-smoothing: antialiased; }
.tc-tooth.sel .tc-num { fill: #0f6e56; font-weight: 700; }
.tc-tooth.missing .tc-num { fill: #94a3b8; }
.tc-tooth circle { pointer-events: none; }
.tc-panel { border: 1px solid #ccfbf1; background: #f8fafc; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tc-panel.empty { align-items: center; justify-content: center; min-height: 160px; text-align: center; }
.tc-panel-head { display: flex; align-items: center; gap: 10px; }
.tc-panel-head > div { flex: 1; display: flex; flex-direction: column; text-align: center; }
.tc-panel-head strong { font-size: 16px; }
.tc-panel-head .icon-btn { font-size: 20px; background: #fff; border: 1px solid var(--line); }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
    font: 600 12.5px var(--font); color: #334155; cursor: pointer; }
.tc-chip i, .tc-legend-item i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.tc-chip.on { font-weight: 800; color: #0f172a; }
.tc-chip:disabled { cursor: default; }
.tc-clear { align-self: flex-start; color: #94a3b8; }
.tc-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
    background: #fff; font: 600 12px var(--font); color: #334155; cursor: pointer; }
.tc-summary { margin: 0; }
@media (max-width: 1100px) { .tc-body { grid-template-columns: 1fr; } }

/* ── Steps before the notes ──────────────────────────────────────────────────── */
.vs-page { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 120px); }
.vs-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.vs-head h1 { margin: 0; font-size: 24px; }
.vs-head p { margin: 2px 0 0; }
.vs-head .icon-btn { font-size: 18px; background: #fff; border: 1px solid var(--line); width: 38px; height: 38px; }
.vs-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.vs-foot { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0;
    background: linear-gradient(180deg, transparent, var(--canvas) 30%); }
.vs-foot .btn { padding: 12px 22px; font-size: 14.5px; }
.vs-spacer { flex: 1; }
.vs-group { margin: 14px 4px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #94a3b8; }
.vs-type { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 14px;
    border: 1px solid var(--line); background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.vs-type > span:first-child { display: flex; flex-direction: column; gap: 3px; }
.vs-type strong { font-size: 15px; }
.vs-type:hover { border-color: color-mix(in srgb, var(--brand) 45%, white); }
.vs-type.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.vs-type.current { border-color: color-mix(in srgb, var(--brand) 35%, white); }
.vs-type.saved { cursor: default; }
.vs-continue { font-weight: 800; color: var(--brand); }
.vs-suggested { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #fef3c7; color: #b45309; font-size: 10.5px; font-weight: 800; vertical-align: middle; }
.vs-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cbd5e1; flex: none; }
.vs-radio.on { border-color: var(--brand); background: radial-gradient(circle, var(--brand) 45%, transparent 50%); }
.vs-others { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 16px; margin-top: 8px; border-radius: 14px;
    border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; text-align: left; }
.vs-others.open { border-color: var(--brand); border-width: 1.5px; }
.vs-others > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.vs-others .count { margin-left: 8px; }
.vs-caret { color: var(--muted); font-size: 18px; transition: transform 0.15s; }
.vs-others.open .vs-caret { transform: rotate(180deg); }
.vs-types { display: flex; flex-direction: column; gap: 8px; }
.vs-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.vs-add { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 16px;
    border: 2px dashed color-mix(in srgb, var(--brand) 40%, white); background: color-mix(in srgb, var(--brand) 4%, white); color: var(--brand); cursor: pointer; font: inherit; }
.vs-image { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.vs-image-top { display: flex; justify-content: space-between; align-items: center; }
.vs-img { width: 100%; max-height: 260px; object-fit: contain; background: #0f172a; border-radius: 10px; }
.vs-notes-label { margin: 4px 0 0; font-size: 12.5px; font-weight: 700; }
.vs-image textarea.field { min-height: 70px; resize: vertical; }
.vs-review { display: flex; flex-direction: column; gap: 8px; }
.vs-prop { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.vs-prop p { margin: 4px 0 0; }
.vs-prop.off { opacity: 0.4; text-decoration: line-through; }
.vs-question { margin: 6px 0 12px; font-size: 20px; }
.vs-how { display: flex; align-items: center; gap: 16px; width: 100%; padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: #fff;
    text-align: left; font: inherit; color: inherit; cursor: pointer; box-shadow: var(--shadow-sm); }
.vs-how:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.vs-how > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.vs-how strong { font-size: 17px; }
.vs-how-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px;
    background: color-mix(in srgb, var(--brand) 12%, white); flex: none; }
.vs-set-row { padding: 8px 0; border-top: 1px solid var(--line); }
.vs-set-row p { margin: 4px 0 0; white-space: pre-wrap; }

/* ── My Schedule timeline (as on the iPad) ───────────────────────────────────── */
.tl { display: flex; flex-direction: column; max-width: 980px; }
.tl-row { display: grid; grid-template-columns: 78px 28px minmax(0, 1fr); align-items: stretch; }
.tl.with-date .tl-row { grid-template-columns: 96px 28px minmax(0, 1fr); }
.tl-when { display: flex; flex-direction: column; align-items: flex-end; padding: 18px 4px 0 0; gap: 2px; text-align: right; }
.tl-date { font-weight: 800; font-size: 14px; color: var(--text); }
.tl-time { font-weight: 800; font-size: 13px; color: var(--brand); white-space: nowrap; }
.tl.with-date .tl-time { font-weight: 700; color: #475569; font-size: 12.5px; }
.tl-year { font-size: 11px; color: #94a3b8; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 2px; background: #e2e8f0; }
.tl-rail.first::before { top: 24px; }
.tl-rail.last::before { bottom: calc(100% - 24px); }
.tl-rail.first.last::before { display: none; }
.tl-dot { position: relative; margin-top: 20px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 2px #e2e8f0; }
.tl-card { padding: 6px 0 6px 4px; }
.tl-card .appt-card { margin: 0; }
.tl-card .time-box { display: none; }
@media (max-width: 700px) { .tl-row, .tl.with-date .tl-row { grid-template-columns: 64px 22px minmax(0, 1fr); } }

/* Admin: list explanation + groups */
.side-intro { margin: -4px 2px 10px; line-height: 1.4; }
.admin-group { display: flex; flex-direction: column; gap: 1px; margin: 10px 4px 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.admin-group:first-child { margin-top: 0; }
.admin-group-hint { font-weight: 500; letter-spacing: 0; text-transform: none; color: #94a3b8; }
@media (max-width: 900px) { .admin-group { display: none; } .side-intro { display: none; } }

/* My profile — like the app's Profile (header with photo, tiles, folded cards, Sign out / Save changes) */
.profile-page { max-width: 1180px; padding-bottom: 96px; }
.pf-hero { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, #0D9488, #065F5B); box-shadow: 0 10px 30px rgba(6, 95, 91, .18); margin-bottom: 18px; }
.pf-hero h1 { margin: 0; font-size: 26px; color: #fff; }
.pf-hero p { margin: 2px 0 0; color: rgba(255,255,255,.82); font-size: 14px; }
.pf-hero .pf-pending { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 12px; font-weight: 700; }
.pf-photo { position: relative; width: 72px; height: 72px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); flex: none; }
.pf-photo img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; }
.pf-initials { display: grid; place-items: center; width: 100%; height: 100%; font-size: 24px; font-weight: 900; color: #0F766E; }
.pf-photo-cam { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: #0F766E;
  border: 2px solid #fff; display: grid; place-items: center; }
.pf-photo-cam svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; }
.pf-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pf-col { display: flex; flex-direction: column; gap: 12px; }
.pf-tile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border-radius: 18px; background: #fff;
  border: 1px solid #E2E8F0; text-align: left; font: inherit; color: inherit; text-decoration: none; cursor: pointer; }
button.pf-tile:hover, a.pf-tile:hover { border-color: #99F6E4; box-shadow: 0 4px 14px rgba(15, 118, 110, .08); }
.pf-tile-icon, .pf-card-icon { width: 34px; height: 34px; border-radius: 10px; background: #F0FDFA; display: grid; place-items: center; flex: none; }
.pf-tile-icon svg, .pf-card-icon svg { width: 18px; height: 18px; fill: none; stroke: #0D9488; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-tile-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pf-tile-text strong { font-size: 15px; color: #0f172a; }
.pf-tile-text span { font-size: 12.5px; color: #64748b; }
.pf-tile-go { font-size: 20px; color: #64748b; }
.pf-tile.warn { background: #FFFBEB; border-color: #FDE68A; }
.pf-tile.warn .pf-tile-icon { background: #FEF3C7; } .pf-tile.warn .pf-tile-icon svg { stroke: #B45309; }
.pf-tile.warn .pf-tile-text span { color: #92400E; }
.pf-tile.danger { background: #FEF2F2; border-color: #FCA5A5; }
.pf-tile.danger .pf-tile-icon { background: #FEE2E2; } .pf-tile.danger .pf-tile-icon svg { stroke: #DC2626; }
.pf-tile.danger .pf-tile-text strong, .pf-tile.danger .pf-tile-go { color: #DC2626; } .pf-tile.danger .pf-tile-text span { color: #991B1B; }
.pf-logo-tile { cursor: default; }
.pf-logo { width: 44px; height: 44px; object-fit: contain; border: 1px solid #E2E8F0; border-radius: 8px; background: #fff; }
.pf-logo-actions { display: flex; gap: 6px; }
.pf-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 18px; padding: 16px 18px 18px; box-shadow: 0 3px 10px rgba(0,0,0,.04); }
.pf-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pf-card-head h2 { margin: 0; font-size: 15px; font-weight: 800; }
.pf-hosp-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pf-hosp { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #F0FDFA; border: 1px solid #99F6E4; }
.pf-hosp strong { flex: 1; font-size: 14px; }
.pf-hosp-tick { width: 18px; height: 18px; border-radius: 50%; background: #0D9488; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.pf-current { padding: 2px 8px; border-radius: 8px; background: #CCFBF1; color: #0F766E; font-size: 11px; font-weight: 800; }
.pf-join { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.pf-join p { margin: 0; flex: 1; font-size: 12.5px; color: #64748b; line-height: 1.35; }
.pf-bar { position: fixed; left: var(--sb-width, 252px); right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 28px; background: rgba(255,255,255,.96); border-top: 1px solid #E2E8F0; backdrop-filter: blur(6px); z-index: 20; }
.pf-signout { display: inline-flex; align-items: center; gap: 8px; background: #FEF2F2 !important; color: #DC2626 !important; border: 1px solid #FCA5A5 !important; }
.pf-signout svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
@media (max-width: 900px) { .pf-layout { grid-template-columns: 1fr; } .pf-bar { left: 0; } }

/* Appointment card extras (as the app): reason row, treatment line, Show / Hide details */
.card-reason { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0 2px; padding: 2px 0; border: 0; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; text-align: left; }
.card-reason.set { color: #0f172a; font-weight: 800; font-size: 13.5px; }
.card-reason svg, .card-treat svg, .ct-row svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button.card-reason:hover span { text-decoration: underline; }
.card-treat { display: flex; align-items: center; gap: 6px; margin: 4px 0 0 2px; font-size: 13px; font-weight: 700; color: #0F6E56; }
.card-fold { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 2px 0; border: 0; background: none; font: inherit;
  font-size: 13px; font-weight: 700; color: #64748b; cursor: pointer; }
.card-fold-chev { transition: transform .2s; }
.card-fold[aria-expanded="true"] .card-fold-chev { transform: rotate(180deg); }
.card-details { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.card-details hr { border: 0; border-top: 1px solid #E2E8F0; margin: 4px 0; width: 100%; }
.ct-head { font-size: 11px; letter-spacing: .06em; font-weight: 800; text-transform: uppercase; color: #94a3b8; }
.ct-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 12px; background: #F0FDFA;
  border: 1px solid #CCFBF1; font: inherit; text-align: left; color: #0F6E56; }
.ct-row.current { background: #fff; border: 1.4px solid #0F6E56; cursor: pointer; }
.ct-row strong { flex: 1; color: #0f172a; font-size: 13.5px; }
.ct-open { display: flex; align-items: center; gap: 8px; flex: 1; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.ct-badge { padding: 2px 9px; border-radius: 99px; background: #E1F5EE; color: #085041; font-size: 11px; font-weight: 800; }
.ct-go { font-size: 13px; font-weight: 800; color: #0F6E56; white-space: nowrap; }
.ct-del { color: #94a3b8; }

/* Patient page: Talk to Medora / Messages / Dr Notes open in a sheet on the right */
dialog.sheet.side-sheet { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(980px, calc(100vw - 24px)); border-radius: 22px 0 0 22px; }
dialog.sheet.side-sheet .sheet-body { flex: 1; overflow: auto; }
dialog.sheet.side-sheet .two-col.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.btn.soft.medora { background: linear-gradient(135deg, #F0FDFA, #EEF2FF); }
.chart-page.in-tab { padding: 0; max-width: none; }
.chart-page.in-tab .chart-note { margin: 0 0 10px; }
@media (max-width: 900px) { dialog.sheet.side-sheet { border-radius: 0; width: 100vw; } dialog.sheet.side-sheet .two-col.wide-left { grid-template-columns: 1fr; } }

/* Slide-up (sidebar Admin): full width, 95% of the height, rises from the bottom */
dialog.slideup { position: fixed; inset: auto 0 0 0; margin: 0; width: 100vw; max-width: 100vw; height: 95vh; max-height: 95vh; padding: 0;
  border: 0; border-radius: 22px 22px 0 0; background: #F6F7FB; box-shadow: 0 -10px 40px rgba(15, 23, 42, .25); overflow: hidden; }
dialog.slideup[open] { display: flex; flex-direction: column; animation: slideup-in .28s cubic-bezier(.2, .8, .2, 1); }
dialog.slideup::backdrop { background: rgba(15, 23, 42, .35); }
@keyframes slideup-in { from { transform: translateY(100%); } to { transform: none; } }
.slideup-grip { width: 44px; height: 5px; border-radius: 3px; background: #CBD5E1; margin: 8px auto 0; flex: none; }
.slideup-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 8px 24px; flex: none; }
.slideup-head strong { font-size: 16px; }
.slideup-close { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #E2E8F0; cursor: pointer; font-size: 15px; }
dialog.slideup iframe { flex: 1; width: 100%; border: 0; background: transparent; }
body.admin-page.embedded { padding-left: 0 !important; background: transparent; }
body.embedded .pf-bar { left: 0; }
body.embedded.app-page { padding-left: 0 !important; }
body.embedded .profile-page { padding-top: 8px; }

/* Scribe wizard (as the app's _VisitWizard): Scribe → Verify → Notes in the slide-up */
dialog.slideup.sw { background: #F6F7FB; }
.sw-head { display: flex; align-items: center; gap: 16px; padding: 6px 18px 10px 24px; flex: none; }
.sw-head > div:first-child { flex: 1; }
.sw-steps { display: flex; gap: 6px; }
.sw-step { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #64748b; background: #fff; border: 1px solid #E2E8F0; }
.sw-step-n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #E2E8F0; color: #334155; }
.sw-step.active { color: #0F766E; border-color: #0D9488; background: #F0FDFA; }
.sw-step.active .sw-step-n { background: #0D9488; color: #fff; }
.sw-step.done .sw-step-n { background: #CCFBF1; color: #0F766E; }
.sw-body { flex: 1; overflow: auto; padding: 8px 24px 20px; }
.sw-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: #fff; border-top: 1px solid #E2E8F0; }
.sw-spacer { flex: 1; }
.sw-scribe { max-width: 720px; margin: 4vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.sw-orb { width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #F0FDFA, #CCFBF1); display: grid; place-items: center; }
.sw-orb .scribe-rec-dot { width: 18px; height: 18px; }
.sw-orb.on { animation: sw-pulse 1.6s ease-in-out infinite; }
@keyframes sw-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .25); } 50% { box-shadow: 0 0 0 18px rgba(220, 38, 38, 0); } }
.sw-time { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; color: #0f172a; }
.sw-wave { display: flex; align-items: center; gap: 3px; height: 110px; width: 100%; }
.sw-wave span { flex: 1; height: 6%; border-radius: 3px; background: linear-gradient(180deg, #8B5CF6, #0D9488); transition: height .1s; }
.sw-wave.idle span { height: 6% !important; opacity: .35; }
.sw-status { color: #475569; margin: 0; max-width: 520px; }
.btn.sw-start { font-size: 17px; padding: 14px 28px; border-radius: 14px; }
.sw-done { font-size: 17px; padding: 14px 28px; }
.sw-verify { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sw-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 18px; padding: 16px 18px; }
.sw-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sw-card-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.sw-said { max-height: 58vh; overflow: auto; }
.sw-card .sugg-card.in-wizard { border: 0; padding: 0; margin: 0; box-shadow: none; }
.sw-card .sugg-card.in-wizard > summary { display: none; }
.sw-writing { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #F0FDFA; color: #0F766E; font-weight: 700; }
.sw-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #99F6E4; border-top-color: #0D9488; animation: sw-rot .8s linear infinite; }
@keyframes sw-rot { to { transform: rotate(360deg); } }
.sw-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.sw-row { padding: 8px 0; border-top: 1px solid #F1F5F9; }
.sw-row-label { font-size: 12px; font-weight: 700; color: #64748b; display: flex; align-items: center; gap: 6px; }
.sw-row-value { white-space: pre-wrap; font-size: 14px; color: #0f172a; margin-top: 2px; }
.sw-row.new .sw-row-value { background: #FEFCE8; border-radius: 6px; padding: 2px 6px; margin-left: -6px; }
.sw-new { padding: 1px 7px; border-radius: 999px; background: #FEF3C7; color: #92400E; font-size: 10.5px; font-weight: 800; }
.sw-edit-field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 12px; font-weight: 700; color: #64748b; }
.sw-sec.editing { border-color: #0D9488; box-shadow: 0 0 0 3px rgba(13, 148, 136, .12); }
@media (max-width: 900px) { .sw-verify, .sw-notes { grid-template-columns: 1fr; } .sw-steps { display: none; } }
.sw-step { font: inherit; font-size: 13px; cursor: pointer; } .sw-step:disabled { cursor: default; opacity: 1; }
/* Confirmation slide-up (No Show, Cancel visit): short sheet from the bottom */
dialog.slideup.short { height: auto; max-height: 60vh; }
.slideup-confirm { padding: 6px 24px 24px; max-width: 760px; width: 100%; margin: 0 auto; }
.slideup-confirm p { font-size: 16px; color: #334155; margin: 4px 0 18px; }
.slideup-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.slideup-confirm-actions .btn { padding: 12px 22px; font-size: 15px; }
.btn.danger { background: #DC2626; border-color: #DC2626; color: #fff; }
body.embedded.app-page { padding-left: 0 !important; }
body.embedded .record-page .chart-top > a.link { display: none; }
.sb-place .sb-hospital-logo { width: 36px; height: 36px; border-radius: 11px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
@media (max-width: 900px) { .sb-place .sb-hospital-logo { width: 30px; height: 30px; } }
/* Vitals: one line per label, boxes aligned (author shown as a short MD / RN tag) */
.vitals-grid .soap-field { display: flex; flex-direction: column; justify-content: flex-end; }
.vitals-grid .soap-field > label { display: flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 22px; }
.vitals-grid .field-meta { margin: 0; }
.vitals-grid .author { white-space: nowrap; }
.vitals-grid .author-name { display: none; }
/* Patient Messages: full-width conversation, history folded under it */
.msg-stack { display: flex; flex-direction: column; gap: 14px; }
.msg-stack > .chat-pane.inline { min-height: 52vh; }
.msg-history > summary { cursor: pointer; font-weight: 800; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
.msg-history > summary::before { content: '›'; display: inline-block; transition: transform .2s; color: #64748b; font-size: 18px; }
.msg-history[open] > summary::before { transform: rotate(90deg); }
.msg-history[open] > summary { margin-bottom: 10px; }
dialog.sheet.side-sheet > .sheet-head { padding: 16px 20px 12px 24px; }
.msg-stack > .chat-pane.inline, .patient-panel .chat-pane.inline, .sheet-body .chat-pane.inline { display: flex !important; }
.lab-order { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
.lab-order .li-main { grid-column: 1; } .lab-order .muted { grid-column: 1; } .lab-order .pill-link { grid-column: 2; grid-row: 1 / span 2; }
.lab-results-title { font-size: 16px; margin: 18px 0 10px; }
.chart-list li.lab-order { display: grid !important; grid-template-columns: 1fr auto; text-align: left; align-items: center; justify-items: start; } .chart-list li.lab-order .pill-link { justify-self: end; }

/* Graphs animate in (api.js adds .anim-in with a staggered delay) */
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes split-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes donut-in { from { transform: rotate(-120deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.td-hour-bar .booked.anim-in, .rev-stack.anim-in, .td-week-bar.anim-in { transform-origin: bottom; animation: bar-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.rev-split > div.anim-in { transform-origin: left; animation: split-grow .8s cubic-bezier(.2, .8, .2, 1) both; }
.td-donut.anim-in { animation: donut-in .9s cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) { .anim-in { animation: none !important; } }

/* Make payment (as the app): the patient's QR side and the doctor's side */
dialog.sheet.wide.make-pay { width: min(980px, calc(100vw - 32px)); max-width: none; }
.mp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mp-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.05); }
.mp-card.left { align-items: stretch; text-align: left; border-radius: 18px; box-shadow: none; gap: 6px; }
.mp-card.left label { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.mp-side { display: flex; flex-direction: column; gap: 14px; }
.mp-pay { margin: 0; font-size: 20px; }
.mp-upi { margin: 0; }
.mp-qr { padding: 10px; border: 2px solid #99F6E4; border-radius: 16px; margin-top: 10px; }
.mp-qr img { width: 220px; height: 220px; object-fit: contain; display: block; }
.mp-noqr { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; margin-top: 10px; border: 2px dashed #CBD5E1; border-radius: 16px; }
.mp-amount { font-size: 34px; font-weight: 900; color: #0f172a; margin-top: 10px; }
.mp-proc { font-size: 14px; font-weight: 600; color: var(--muted); }
.mp-scan { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--brand); }
.mp-patient { font-size: 15px; }
.mp-method { margin: 0; display: flex; } .mp-method button { flex: 1; }
.btn.mp-received { margin-top: 12px; padding: 14px; font-size: 15px; }
.btn.mp-pending { background: #fff; color: #B45309; border: 1px solid #FDE68A; padding: 12px; }
@media (max-width: 800px) { .mp-grid { grid-template-columns: 1fr; } }
/* Slide-in from the right (Current chart, Open visit): 95% wide, full height */
dialog.slideup.slidein { inset: 0 0 0 auto; width: 95vw; max-width: 95vw; height: 100vh; max-height: 100vh; border-radius: 22px 0 0 22px; }
dialog.slideup.slidein[open] { animation: slidein-in .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes slidein-in { from { transform: translateX(100%); } to { transform: none; } }
dialog.slideup.slidein .slideup-head { padding-top: 14px; }
body.embedded.app-page .visit-bar { left: 0; }
.toggle-hint { margin: -6px 0 10px; text-align: right; }
/* Booking · Pick Time Slot: other date & time in one tidy box, empty state across the grid */
.bk-other { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.bk-other-title { margin: 0 0 10px; font-weight: 800; font-size: 13px; }
.bk-other-grid { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.bk-other-grid > label { font-size: 13px; font-weight: 700; color: var(--muted); }
.bk-other-grid .field { margin: 0; }
.bk-time { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-time select.field { width: auto; min-width: 72px; }
.bk-colon { font-weight: 800; color: var(--muted); }
.slot-grid > .span-all, .slot-grid > .list-empty { grid-column: 1 / -1; }
.slot-grid > .list-empty { text-align: center; padding: 24px 12px; }
/* Orders: result files as clear links */
.od-files { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.od-file { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 100%; padding: 8px 12px; border-radius: 12px; border: 1px solid #99F6E4;
  background: #F0FDFA; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.od-file:hover { border-color: #0D9488; background: #E6FFFA; }
.od-file-icon { width: 34px; height: 34px; border-radius: 9px; background: #fff; border: 1px solid #CCFBF1; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #0F766E; flex: none; }
.od-file-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.od-file-text strong { color: #0F766E; font-size: 14px; }
.od-file-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-file-go { font-size: 20px; color: #0F766E; }
dialog.od-viewer { padding: 0; border: 0; border-radius: 18px; max-width: 92vw; max-height: 92vh; background: #0f172a; overflow: hidden; }
dialog.od-viewer::backdrop { background: rgba(15, 23, 42, .6); }
.od-viewer-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; }
.od-viewer-head strong { flex: 1; }
dialog.od-viewer img { display: block; max-width: 92vw; max-height: calc(92vh - 56px); object-fit: contain; margin: 0 auto; }
/* Today: Pending card */
.td-pending-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.td-pending-head h3 { margin: 0; }
.td-pending-head .pill-link { margin-left: auto; }
.td-pending-count { padding: 1px 9px; border-radius: 999px; background: #FEF3C7; color: #92400E; font-size: 12px; font-weight: 800; }
.td-pending-list { display: flex; flex-direction: column; }
.td-pending-row { display: grid; grid-template-columns: 12px 74px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid #f1f5f9; }
.td-pending-row:first-child { border-top: 0; }
.td-pending-when, .td-pending-who { display: flex; flex-direction: column; min-width: 0; }
.td-pending-who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-pending-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
.td-late { height: 150px; }
.td-late .td-hour { gap: 3px; }
.td-late-n { font-size: 12px; font-weight: 800; color: #0f172a; height: 15px; }
.td-late-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; height: auto !important; }
.td-late .td-hour-bar .booked { border-radius: 6px 6px 0 0; }
.td-pending-row { grid-template-columns: 12px minmax(0, 1fr) auto auto; }
.td-late-tag { padding: 2px 9px; border-radius: 999px; background: #FEF9C3; color: #854D0E; font-size: 12px; font-weight: 800; white-space: nowrap; }
.td-late-tag.warn { background: #FFEDD5; color: #9A3412; } .td-late-tag.bad { background: #FEE2E2; color: #B91C1C; }
@media (max-width: 1000px) { .td-pending-body { grid-template-columns: 1fr; } }
/* Past-due visits: the status dot throbs (a ring pulses out from it) */
.td-pending-row .tl-dot { position: relative; animation: due-throb 1.6s ease-in-out infinite; }
.td-pending-row .tl-dot::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid currentColor;
  color: inherit; animation: due-ring 1.6s ease-out infinite; }
.td-pending-row .tl-dot { color: #EA580C; }
@keyframes due-throb { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.35); } }
@keyframes due-ring { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .td-pending-row .tl-dot, .td-pending-row .tl-dot::after { animation: none; } }
.td-pending-row .tl-dot { margin-top: 0; }
/* Pending dots, refined (owner): a small dot that breathes — grows, then settles back small — with a soft glow */
.td-pending-row .tl-dot { width: 8px; height: 8px; border: 0; box-shadow: none; justify-self: center;
  animation: due-breathe 2.4s cubic-bezier(.45, 0, .55, 1) infinite; }
.td-pending-row .tl-dot::after { inset: 0; border: 0; background: inherit; opacity: .35;
  animation: due-glow 2.4s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes due-breathe { 0%, 100% { transform: scale(.75); } 50% { transform: scale(1.3); } }
@keyframes due-glow { 0%, 100% { transform: scale(1); opacity: 0; } 50% { transform: scale(2.4); opacity: .28; } }

/* Referral link page (REFERRAL-LINK-SPEC.md) */
body.rl-page { background: linear-gradient(180deg, #F0FDFA, #F8FAFC 320px); min-height: 100vh; margin: 0; }
.rl { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; }
.rl-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 16px; }
.rl-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.rl-card h1 { margin: 0; font-size: 22px; } .rl-card h2 { margin: 12px 0 4px; font-size: 15px; }
.rl-card label { font-weight: 700; font-size: 13px; margin-top: 8px; }
.rl-code { font-size: 26px; letter-spacing: .4em; text-align: center; max-width: 240px; }
.rl-open { align-self: flex-start; padding: 12px 22px; }
.rl-head { display: flex; align-items: center; gap: 10px; }
.rl-urgency { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #E0F2FE; color: #075985; }
.rl-urgency.urgent { background: #FEE2E2; color: #B91C1C; } .rl-urgency.soon { background: #FEF3C7; color: #92400E; }
.rl-facts { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 6px 0; }
.rl-facts dt { color: var(--muted); font-weight: 700; font-size: 13px; } .rl-facts dd { margin: 0; font-weight: 600; }
.rl-note { white-space: normal; line-height: 1.55; padding: 12px 14px; border-radius: 12px; background: #F8FAFC; border: 1px solid var(--line); }
.rl-actions { margin-top: 8px; }
.rl-join { text-align: center; margin-top: 18px; }
@media print { .rl-brand, .rl-join, .rl-actions { display: none; } .rl-card { box-shadow: none; border: 0; } }
.td-pick { display: flex; flex-direction: column; }
.td-pick-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 0 10px; padding: 12px 6px; border: 0; border-bottom: 1px solid #f1f5f9;
  background: none; font: inherit; text-align: left; cursor: pointer; }
.td-pick-row .td-chev { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.td-pick-row:hover { background: #f8fafc; }
.tl-time-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 8px; background: #CCFBF1; color: #0F766E; font-size: 12px; font-weight: 800; }

/* ── Add patient: shared email / mobile (SHARED-CONTACT-SPEC.md) ───────────── */
.form-hint { margin: -4px 0 0; }
.contact-card { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.contact-card.here { background: #fffbeb; border: 1px solid #fcd34d; color: #78350f; }
.contact-card.elsewhere { background: #f0f9ff; border: 1px solid #bae6fd; color: #0c4a6e; }
.contact-card p { margin: 0; }
.contact-card-title { font-weight: 600; }
.email-hint { margin: -4px 0 0; font-size: 13px; color: #78350f; }
.email-hint .link { margin-left: 4px; }
.contact-matches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.contact-matches li { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.7); border-radius: 10px; padding: 6px 8px; }
.contact-matches .avatar { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.contact-match-name { flex: 1; min-width: 0; color: var(--text); }
.family-step { border: 1px solid var(--line, var(--border)); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.family-step-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rel-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--brand) 35%, white); background: var(--surface); color: var(--brand); font: 600 13px/1.2 var(--font); cursor: pointer; }
.rel-chip:hover { background: color-mix(in srgb, var(--brand) 8%, white); }
.rel-chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand, #fff); }
.family-result { display: flex; align-items: flex-start; gap: 12px; }
.family-result p { margin: 0; }

/* Optional "Confirm email / mobile" with a tapped code (contact-codes.js) */
.cc-panel { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc;
    display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc-optional { margin: 0; }
.cc-row { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cc-row p { margin: 0; }
.cc-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cc-ask { font-weight: 600; font-size: 13px; }
.cc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; }
.cc-num { height: 52px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; color: var(--text);
    font: 800 20px/1 var(--font); letter-spacing: 2px; cursor: pointer; }
.cc-num:hover:not(:disabled) { border-color: var(--accent, #0d9488); }
.cc-num:disabled { color: var(--muted); cursor: default; }
.form-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--border);
    color: var(--text); font-size: 13px; }

/* Sign in with Google (STAFF-WEB-GOOGLE-SIGNIN-SPEC.md) — Google draws its own button inside .google-button */
.google-signin { margin-top: 16px; }
.google-signin[hidden] { display: none; }
.google-signin.google-top { margin: 6px 0 4px; }
.google-button { display: flex; justify-content: center; min-height: 44px; width: 100%; }
.google-button[aria-busy="true"] { opacity: .6; pointer-events: none; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; color: var(--muted, #64748b); font-size: 13px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.google-top .or-line { margin: 16px 0 4px; }
.lock-google { margin-top: 12px; }
.lock-google .or-line { margin-bottom: 10px; }
.google-chosen { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; padding: 12px 14px;
    border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; font-size: 14px; }
.google-chosen div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.google-chosen span { color: var(--muted, #64748b); overflow: hidden; text-overflow: ellipsis; }
.google-chosen a { color: var(--brand); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.google-chosen a:hover { text-decoration: underline; }

/* ── Sign-in matches medora-medical.com (STAFF-LANDING-SPEC.md): brand row links home; narrow screens (tablets upright —
   phones go to the app) get the teal page with the brand above a white card, copied from medora_patient_web ── */
a.brand-row { color: inherit; text-decoration: none; }
a.phone-hero { color: #fff; text-decoration: none; }
.phone-hero .logo { display: inline-flex; align-items: center; justify-content: center; }
.login-page .form-wrap .google-signin, .login-page .form-wrap .signup-link { text-align: left; }
/* ── Sign-in on phones: teal like the app's sign-in, brand on top, white card, town artwork ── */
.phone-hero { display: none; }
@media (max-width: 820px) {
    body.login-page {
        background: url('/images/landing-town.webp') center bottom / 140% auto no-repeat,
                    linear-gradient(160deg, #02705f 0%, #0a9078 55%, #11a086 100%);
        background-color: #0a9078;
    }
    .login-page .login { min-height: 100svh; }
    .login-page .form-panel { background: transparent; justify-content: flex-start; padding: 44px 20px 0; }
    .phone-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; margin-bottom: 26px; }
    .phone-hero .logo { background: #fff; color: #0a9078; border-radius: 50%; box-shadow: 0 10px 30px rgba(0,0,0,.18); margin-bottom: 8px; }
    .phone-hero .logo svg { width: 58%; height: 58%; }
    .phone-hero-name { font-size: 26px; font-weight: 800; letter-spacing: -.2px; }
    .phone-hero-motto { font-size: 15px; font-weight: 600; color: #c9f5e9; }
    .login-page .form-wrap { margin: 0; background: #fff; border-radius: 24px; padding: 26px 22px 22px;
        box-shadow: 0 0 60px rgba(94,234,212,.35), 0 20px 40px rgba(0,0,0,.2); }
    .login-page .compact-brand { display: none; }
    .login-page .form-wrap h2 { font-size: 28px; }
    .login-page form { margin-top: 16px; }
    /* 16px+ text: iOS Safari doesn't zoom the page in when a box is focused */
    .login-page input[type=text], .login-page input[type=password] { font-size: 16px; padding: 14px; border-radius: 12px; }
    .login-page button.primary { font-size: 16px; padding: 15px; border-radius: 12px; }
    .login-page .powered-by { color: rgba(255,255,255,.8); margin-top: auto; padding-bottom: 40vw; }
    .login-page .form-wrap .signup-link a { color: var(--brand); }
}

