:root {
  --bg: #eef0f2;
  --panel: #ffffff;
  --line: #dde2e7;
  --text: #1d2730;
  --muted: #6b7782;
  --accent: #0b203c;      /* Atlas navy */
  --accent-ink: #ffffff;
  --sage: #7a907a;        /* Atlas sage */
  --tan: #d7c7b2;         /* Atlas tan */
  --tint: #e8ecf2;        /* light navy tint for selected things */
  --in: #eef1f4;
  --out: #e1e7ef;
  --danger: #b42318;
  --warn: #9a6700;
  --allergy-bg: #fff1f0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 Almarai, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; }
.error { color: var(--danger); }
.warn { color: var(--warn); }
.center { text-align: center; }

.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 6px; padding: 7px 12px; cursor: pointer; font: inherit; }
.btn:hover { border-color: #b8c1ca; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.small { padding: 4px 9px; font-size: 12px; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0 4px; font: inherit; font-size: 12px; }

.layout { flex: 1; display: grid; grid-template-columns: 300px 1fr 340px; min-height: 0; overflow: hidden; }
.pane { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.pane:last-child { border-right: 0; }
.pane-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pane-head input[type=search] { flex: 1; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

.conv-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.conv-list li { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.conv-list li:hover { background: #f7f9fb; }
.conv-list li.active { background: #eaf2ff; }
.conv-list .row { display: flex; justify-content: space-between; gap: 8px; }
.conv-list .name { font-weight: 600; }
.conv-list .preview { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 600; }

.thread #threadView { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thread #threadView[hidden] { display: none; }
.empty { margin: auto; color: var(--muted); padding: 24px; text-align: center; }
.t-name { font-weight: 700; font-size: 16px; }
.match-bar { padding: 8px 12px; background: #fff8e6; border-bottom: 1px solid #f0e0b0; font-size: 13px; }
.timeline { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #fbfcfd; }
.bubble { max-width: 70%; padding: 8px 11px; border-radius: 12px; }
.bubble.inbound { background: var(--in); align-self: flex-start; border-bottom-left-radius: 3px; }
.bubble.outbound { background: var(--out); align-self: flex-end; border-bottom-right-radius: 3px; }
.bubble .text { white-space: pre-wrap; word-wrap: break-word; }
.bubble .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.event { align-self: center; font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 5px 12px; max-width: 85%; }
.event.emr { border-color: #c9d8f5; }
.event .note { margin-top: 4px; color: var(--text); white-space: pre-wrap; }

.composer { border-top: 1px solid var(--line); padding: 10px 12px; }
.composer textarea { width: 100%; resize: vertical; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.composer-row { display: flex; align-items: center; margin-top: 6px; }

.chart-body { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.card h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card ul { margin: 0; padding-left: 18px; }
.card li { margin: 2px 0; }
.card.allergies { background: var(--allergy-bg); border-color: #f5c2bd; }
.card.allergies h4 { color: var(--danger); }
.code { font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); }


dialog { border: 1px solid var(--line); border-radius: 10px; padding: 18px; width: min(520px, 92vw); }
dialog h3 { margin-top: 0; }
dialog label { display: block; margin: 8px 0; }
dialog label input, dialog label textarea { display: block; width: 100%; margin-top: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
dialog label.check { display: flex; gap: 8px; align-items: center; }
dialog label.check input { width: auto; display: inline; margin: 0; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 14px 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.pick-list { list-style: none; padding: 0; }
.pick-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2730; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 9999; }
.toast.err { background: var(--danger); }

.login-body { align-items: center; justify-content: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: min(360px, 92vw); display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; }
.login-card input { padding: 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

/* ---- header pill */
.pill { background: var(--tint); color: #2a4a7a; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.pill:empty { display: none; }

/* ---- right panel: tabs, docked phone, chart */
.side { display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 3px solid transparent; cursor: pointer; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .btn { margin-bottom: 6px; }
.phone-slot { flex: 1; min-height: 0; position: relative; }
.phone-slot[hidden], .chart-body[hidden] { display: none !important; }
.side .chart-body { flex: 1; }
/* RingCentral widget: hide its own drag/minimize header; app.js positions it over .phone-slot */
#rc-widget .Adapter_header { display: none !important; }
#rc-widget { box-shadow: none !important; border-radius: 0 !important; }

/* ---- live call bar */
.call-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: #eef2ee; }
.call-bar.ringing { background: #fff4d6; animation: ringpulse 1.2s ease-in-out infinite; }
.call-bar.dialing { background: var(--tint); }
@keyframes ringpulse { 50% { background: #ffe9a8; } }
.call-icon { font-size: 20px; }
.call-name { font-weight: 700; }
.call-state { font-size: 12px; color: var(--muted); }
.btn.call-ok { background: #5d775d; border-color: #5d775d; color: #fff; }
.btn.call-end, .btn.danger { background: #c0392b; border-color: #c0392b; color: #fff; }
.btn.call-ok:hover, .btn.call-end:hover, .btn.danger:hover { filter: brightness(1.08); }
.call-bar.active { background: #dfe7df; }
.call-who { min-width: 0; }
.call-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-state { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-bar .btn { white-space: nowrap; }

/* ---- staff management */
dialog.wide { width: min(860px, 95vw); }
.staff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.staff-table th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 6px; }
.staff-table td { border-bottom: 1px solid var(--line); padding: 6px; vertical-align: middle; }
.staff-table tr.inactive td { color: var(--muted); }
.staff-table td.actions { text-align: right; white-space: nowrap; }
.staff-table td.actions .btn { margin-left: 4px; }
dialog select { display: block; width: 100%; margin-top: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.span2 { grid-column: 1 / -1; }
.ok { color: #1f8a4c; }
#newContactResults:empty { display: none; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 240px 1fr 320px; }
}

/* ---- AI call notes */
.event.call { max-width: 90%; }
.ai-notes { margin-top: 6px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; text-align: left; }
.ai-notes.working { background: #f3f0ff; color: #5b4bb7; }
.ai-notes.problem { background: #fff4f2; color: #9a3412; }
.ai-notes.done { background: #f6f4ff; border: 1px solid #e2dcff; color: var(--text); }
.ai-head { font-weight: 600; margin-bottom: 4px; }
.ai-summary { white-space: pre-wrap; line-height: 1.45; }
.ai-notes details { margin-top: 6px; }
.transcript { max-height: 260px; overflow-y: auto; margin-top: 4px; padding: 6px; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.tline { margin: 3px 0; }

/* ---- Inbox / Settings switch */
.views { display: flex; gap: 2px; margin-left: 12px; }
.view-tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.view-tab.active { background: var(--tint); color: var(--accent); }
.call-bar.in-settings.idle { display: none; }

/* ---- inbox filters + assignee */
.filters { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-count:not(:empty)::before { content: '· '; }
.assignee { color: #5b4bb7; margin-top: 2px; }
.assign { display: flex; flex-direction: column; gap: 1px; margin-left: 14px; }
.assign select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 220px; }
.event.assign { border-color: #e2dcff; color: #5b4bb7; }

/* ---- settings */
.settings { flex: 1; display: grid; grid-template-columns: 220px 1fr; min-height: 0; background: var(--panel); }
.settings-nav { border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.snav { text-align: left; border: 0; background: none; font: inherit; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text); }
.snav.active { background: var(--tint); color: var(--accent); font-weight: 600; }
.settings-body { overflow-y: auto; padding: 16px 24px; }
.settings-head { display: flex; align-items: center; gap: 12px; }
.settings-head h2 { margin: 0 0 8px; font-size: 20px; }
.role-pill { border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #eef1f4; }
.role-pill.super_admin { background: #fde8e8; color: #9b1c1c; }
.role-pill.admin { background: var(--tint); color: var(--accent); }
.perm-table { border-collapse: collapse; width: 100%; max-width: 760px; font-size: 13px; }
.perm-table th, .perm-table td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; }
.perm-table th:not(:first-child), .perm-table td.center { text-align: center; width: 110px; }
.perm-group td { background: #f7f9fb; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.perm-actions { margin-top: 14px; }
.me-card { max-width: 520px; margin: 8px 0 14px; }
dialog menu .spacer { flex: 1; }
.copy-input { width: 100%; padding: 8px; font: 12px ui-monospace, monospace; border: 1px solid var(--line); border-radius: 6px; }
.login-card .link { align-self: center; margin-top: 4px; font-size: 13px; }

/* ---- tags */
.list-tools { display: flex; gap: 6px; padding: 6px 12px; border-bottom: 1px solid var(--line); align-items: center; }
.list-tools select { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; flex: 1; }
.list-tools .btn { flex: none; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; }
.row-meta .assignee { margin: 0 4px 0 0; }
.tag { display: inline-flex; align-items: center; gap: 2px; border-radius: 999px; padding: 0 8px; font-size: 11.5px; font-weight: 600; line-height: 19px; white-space: nowrap; background: #eef1f4; color: #36424d; }
.tag .x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 3px; font-size: 14px; line-height: 1; opacity: .6; }
.tag .x:hover { opacity: 1; }
.tag.c-blue   { background: #e3edff; color: #1d4ed8; }
.tag.c-green  { background: #dcf5e6; color: #166534; }
.tag.c-amber  { background: #fdf0d2; color: #92400e; }
.tag.c-red    { background: #fde4e2; color: #9b1c1c; }
.tag.c-purple { background: #ede8ff; color: #5b21b6; }
.tag.c-teal   { background: #d7f3f1; color: #0f5f5a; }
.tag.c-pink   { background: #fce4f1; color: #9d174d; }
.tag.c-gray   { background: #e9ecef; color: #374151; }
.tag-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip.add { border-style: dashed; color: var(--muted); }
.tag-add-wrap { position: relative; }
.pop { position: absolute; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 24, 40, .14); }
#tagMenu { top: calc(100% + 4px); left: 0; width: 240px; padding: 6px; }
#tagMenu input { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; }
.pop-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 240px; overflow-y: auto; }
.pop-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pop-list li:hover, .pop-list li.active { background: #f1f5fb; }
.pop-list li.on { background: #f4f8ff; }
.pop-list li.create { color: var(--accent); font-weight: 600; }
.new-tag { display: flex; gap: 6px; margin: 10px 0; }
.new-tag input { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.new-tag select, .tags-list select { width: auto; display: inline-block; margin: 0; padding: 5px; }
.tags-list { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow-y: auto; }
.tags-list li { display: grid; grid-template-columns: 110px 1fr auto auto auto auto; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tags-list .t-name-input { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; min-width: 0; }
.tags-list .tag { justify-self: start; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

/* ---- composer modes */
.mode-switch { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; }
.mode { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.mode.active { color: #fff; border-color: transparent; }
.mode[data-mode=text].active { background: var(--accent); }
.mode[data-mode=secure].active { background: #15803d; }
.mode[data-mode=note].active { background: #b45309; }
.mode-hint { color: var(--muted); margin-left: 6px; }
.composer.mode-secure { background: #f0faf3; border-top: 3px solid #15803d; }
.composer.mode-note { background: #fffaeb; border-top: 3px solid #d97706; }
.composer.mode-secure textarea { border-color: #a7d7b8; }
.composer.mode-note textarea { border-color: #f1cf8a; background: #fffdf6; }
.composer.mode-secure #sendBtn { background: #15803d; border-color: #15803d; }
.composer.mode-note #sendBtn { background: #b45309; border-color: #b45309; }
.input-wrap { position: relative; }
.mention-menu { bottom: calc(100% + 4px); left: 0; width: min(360px, 100%); padding: 4px; margin: 0; }

/* ---- timeline: staff notes, secure messages, pictures */
.bubble.note { align-self: flex-start; background: #fff7e0; border: 1px solid #f3d38c; max-width: 78%; }
.bubble.note.mine { align-self: flex-end; }
.note-head, .secure-head { font-size: 11px; font-weight: 700; letter-spacing: .02em; margin-bottom: 3px; }
.note-head { color: #92400e; }
.mention { background: #fde68a; color: #78350f; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention.me { background: #f59e0b; color: #fff; }
.bubble.secure { border: 1px solid #a7d7b8; }
.bubble.secure.outbound { background: #e5f6ea; }
.bubble.secure.inbound { background: #f1faf3; }
.secure-head { color: #166534; }
.secure-bar { padding: 7px 12px; background: #fff4f2; border-bottom: 1px solid #f5c2bd; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.thumb { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); background: #fff; object-fit: cover; }
.file-chip { display: inline-block; padding: 5px 9px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--accent); text-decoration: none; }
.event.assign { display: block; margin-left: 0; }
#newConvBtn { white-space: nowrap; }
#tagsDialog { width: min(680px, 94vw); }
.tags-list li { grid-template-columns: 100px minmax(120px, 1fr) auto auto auto auto; }
select.chip { appearance: none; -webkit-appearance: none; padding-right: 22px; max-width: 150px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 8px) 55%; background-size: 4px 4px; background-repeat: no-repeat; }
select.chip.active { background-color: var(--accent); }
select.chip option, select.chip optgroup { color: var(--text); background: #fff; }
.filters { flex-wrap: nowrap; align-items: center; }
.filters .chip { white-space: nowrap; flex: none; line-height: 18px; }
select.chip { max-width: 150px; font-size: 12px; height: 26px; padding-top: 3px; padding-bottom: 3px; }
.composer.forced-note #sendBtn { background: #b45309; border-color: #b45309; }
/* ---- chart: copy / insert */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card-tools { display: inline-flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.card:hover .card-tools, .card-tools:focus-within { opacity: 1; }
.icon-btn { border: 1px solid transparent; background: none; color: var(--accent); font: inherit; font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 2px 6px; border-radius: 5px; cursor: pointer; }
.icon-btn:hover { background: var(--tint); border-color: #d6e2f5; }
.pane-head input[type=search] { min-width: 0; }
.number-list label.check { margin: 0; }
.number-other { width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; margin: 2px 0 8px; }
#numberBtn { white-space: nowrap; }
/* ---- +New eCW search, create patient */
.search-row { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
dialog label .search-row input { margin-top: 0; flex: 1; }
.ecw-list li { flex-wrap: wrap; }
.num-btns { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.list-label { border-bottom: 0 !important; padding-bottom: 0 !important; color: var(--muted); }
#newEcwResults:empty { display: none; }
dialog.wide-ish { width: min(620px, 94vw); }
.grid2.tight { gap: 0 8px; }
dialog select { font: inherit; }
#numberKind { display: inline-block; width: auto; margin: 0 3px; padding: 3px 5px; }
.call-note { background: #fff4d6; border: 1px solid #f3d38c; border-radius: 8px; padding: 8px 10px; }

/* ---- schedule */
.sched { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.sched-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sched-nav { display: flex; align-items: center; gap: 4px; }
.sched-nav input[type=date] { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; margin-left: 6px; }
.sched-title { margin-left: 8px; font-size: 15px; white-space: nowrap; }
.sched-bar select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: #fff; font: inherit; font-size: 12.5px; padding: 4px 11px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent); color: #fff; }
.seg.small button { padding: 3px 10px; }
.sched-providers { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px; border-bottom: 1px solid var(--line); }
.prov-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 6px; font-size: 12.5px; cursor: pointer; background: #fff; }
.prov-chip.on { background: var(--tint); border-color: #c9d8f5; color: var(--accent); font-weight: 600; }
.prov-chip input { margin: 0; }
.sched-grid { flex: 1; overflow: auto; position: relative; }
.sg { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(170px, 1fr)); min-width: max-content; }
.sg .col-head { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); height: 38px; padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.sg .col-head.today { background: var(--tint); }
.gutter { position: sticky; left: 0; z-index: 6; background: #fff; border-right: 1px solid var(--line); }
.gutter .col-head { z-index: 7; }
.gutter-body { position: relative; }
.gutter .hr { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.gutter .hr:first-child { transform: none; }
.col { border-right: 1px solid var(--line); min-width: 0; }
.col-body { position: relative; cursor: copy; }
.col-body .ln { position: absolute; left: 0; right: 0; border-top: 1px dashed #eef1f4; }
.col-body .ln.hour { border-top: 1px solid #e3e8ed; }
.blk { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #f3f4f6, #f3f4f6 6px, #e9ebee 6px, #e9ebee 12px); color: #6b7280; font-size: 11px; padding: 2px 6px; overflow: hidden; pointer-events: none; }
.blk span { background: rgba(255,255,255,.8); border-radius: 3px; padding: 0 4px; }
.now { position: absolute; left: 0; right: 0; border-top: 2px solid #e11d48; z-index: 3; pointer-events: none; }
.ap { position: absolute; z-index: 2; border: 0; border-left: 3px solid; border-radius: 5px; padding: 1px 5px; text-align: left; font: inherit; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.ap:hover { filter: brightness(.97); box-shadow: 0 2px 6px rgba(0,0,0,.12); z-index: 4; }
.ap .ap-t { font-weight: 700; }
.ap .ap-n { font-weight: 600; }
.ap .ap-y { color: inherit; opacity: .75; }
.ap.short { white-space: nowrap; text-overflow: ellipsis; }
.ap:not(.short) .ap-y { display: block; }
.st-booked { background: #fff; border-color: #2563eb; color: #1e3a8a; box-shadow: inset 0 0 0 1px #dbe4f5; }
.st-confirmed { background: #f1f6ff; border-color: #2563eb; color: #1e3a8a; }
.st-here { background: #22a559; border-color: #146c3a; color: #fff; }
.st-ready { background: #146c3a; border-color: #0b3f21; color: #fff; }
.st-done { background: #eceff3; border-color: #9ca3af; color: #4b5563; }
.st-noshow { background: #fff5f5; border-color: #dc2626; color: #991b1b; }
.st-late { border-color: #f59e0b !important; background: #fff8e8; }
.st-pending { background: #fdf0d2; border-color: #d97706; color: #78350f; }
.st-cancel { background: repeating-linear-gradient(135deg, #fff, #fff 5px, #fbeaea 5px, #fbeaea 10px); border-color: #dc2626; color: #991b1b; text-decoration: line-through; opacity: .8; }
.status-pill { border-radius: 999px; padding: 1px 8px; font-size: 12px; border-left: 0 !important; text-decoration: none !important; }
.appt-body > div { margin: 4px 0; }
.appt-cancel { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 10px; padding: 10px; background: #fff4f2; border-radius: 8px; }
.appt-cancel label { margin: 0; }

/* booking */
.book-patient { margin: 6px 0 4px; }
#bookPatientMode { margin: 4px 0 6px; }
.open-times { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.open-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.open-head .muted { flex: 1; }
.open-list { max-height: 190px; overflow-y: auto; }
.open-day { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.open-day:last-child { border-bottom: 0; }
.open-day .od { width: 92px; font-size: 12px; font-weight: 600; color: var(--muted); }
.slot { border: 1px solid #c9d8f5; background: #f4f8ff; color: #1d4ed8; border-radius: 6px; padding: 2px 7px; font: inherit; font-size: 12px; cursor: pointer; }
.slot:hover { background: #e3edff; }
.slot.on { background: var(--accent); color: #fff; border-color: var(--accent); }
dialog input[type=time], dialog input[type=date] { font: inherit; }
.chart-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.appt-actions { margin: -6px 0 0 4px; font-size: 12px; }
#apptDialog { width: min(640px, 94vw); }
#apptDialog menu .btn { white-space: nowrap; }
.sched-bar #schedLocation { max-width: 190px; }
.sched-bar .btn { white-space: nowrap; }
@media (max-width: 1500px) { #schedStatus { flex-basis: 100%; order: 10; text-align: right; } }
/* ---- DeepCura */
.dc-card { align-self: stretch; background: #f5f9ff; border: 1px solid #cfe0fb; border-radius: 10px; padding: 9px 12px; max-width: 92%; margin: 0 auto; }
.dc-card.compact { max-width: none; margin: 0; }
.dc-head { margin-bottom: 4px; }
.dc-field { border-top: 1px solid #e1ebfa; padding: 5px 0; }
.dc-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.dc-name .card-tools { opacity: 1; }
.dc-value { white-space: pre-wrap; font-size: 13px; }
.dc-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.dc-actions a.btn { text-decoration: none; }
.dc-full { margin-top: 6px; white-space: pre-wrap; font-size: 12.5px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px; max-height: 300px; overflow-y: auto; }
.dc-setup h4 { margin: 10px 0 4px; }
.dc-setup h4:first-child { margin-top: 0; }
.copy-row { display: flex; gap: 6px; align-items: center; }
.copy-row input { flex: 1; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.dc-h3 { font-size: 15px; margin: 18px 0 6px; }
.dc-grid { margin-bottom: 8px; }
.dc-def { width: 100%; border-collapse: collapse; font-size: 13px; }
.dc-def td { border-top: 1px solid var(--line); padding: 5px 6px; vertical-align: top; }
.dc-def td:first-child { width: 210px; white-space: nowrap; }
#stabDeepcura { max-width: 980px; }
.tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #e11d48; vertical-align: middle; margin-left: 3px; }
.notes-head .notes-pick { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.notes-head select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 100%; }
.notes-head .dc-full { margin-top: 8px; }
.tabs .tab { white-space: nowrap; padding: 8px 9px; }
.chart-actions a.btn { text-decoration: none; color: var(--text); }
.dc-empty { margin: 2px 4px 8px; }
/* ---- green bar: name centered, clickable */
.call-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.cb-left { display: flex; align-items: center; gap: 10px; justify-self: start; min-width: 0; }
.cb-left .assign { margin-left: 4px; }
.cb-right { display: flex; align-items: center; gap: 8px; justify-self: end; flex-wrap: wrap; justify-content: flex-end; }
.call-who { text-align: center; min-width: 0; max-width: 60vw; }
button.call-name { border: 0; background: none; font: inherit; font-weight: 700; font-size: 17px; color: var(--accent); font-family: "Libre Baskerville", Georgia, serif; cursor: pointer; padding: 0 4px; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.call-name:hover { text-decoration-style: solid; }
button.call-name:disabled { cursor: default; text-decoration: none; color: inherit; }
/* patient details */
.hosp-card { background: #fff7ed; border-color: #fed7aa; }
.hosp-card h4 { color: #9a3412; }
#patientDialog textarea, #patientDialog input { font: inherit; }
.row-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }
#patientDialog .card { margin: 10px 0; }
.pcp-line { margin-top: 2px; }
.hosp-line { margin-top: 4px; font-size: 12.5px; color: #7c2d12; background: #fff7ed; border-radius: 6px; padding: 3px 7px; }
/* assign moved to the tags row */
.assign-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.assign-inline select { font: inherit; font-size: 12.5px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 210px; }
.bar-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.assign-inline[hidden] + .bar-sep { display: none; }
/* hospitality in the green bar */
.call-who { position: relative; }
.hosp-pop label { display: block; margin: 0 0 6px; }
.hosp-pop input, .hosp-pop textarea { display: block; width: 100%; margin-top: 3px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; }

/* hospitality box on the left of the green bar */
.cb-left { position: relative; align-items: flex-start; }
.hosp-box { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 4px 9px 5px; max-width: min(34vw, 420px); cursor: pointer; text-align: left; }
.hosp-box:hover { border-color: #fb923c; }
.hosp-box.empty { background: rgba(255,247,237,.6); border-style: dashed; }
.hosp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hosp-label { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #9a3412; }
.hosp-box .icon-btn { color: #9a3412; padding: 0 4px; }
.hosp-text { font-size: 13px; color: #431407; line-height: 1.35; }
.hosp-name b { color: #7c2d12; }
.hosp-notes { white-space: pre-wrap; max-height: 3.9em; overflow-y: auto; }
.hosp-none { color: #9a3412; opacity: .75; font-size: 12.5px; }
.hosp-pop { top: calc(100% + 6px); left: 0; width: 340px; padding: 10px; text-align: left; z-index: 70; }
.hosp-pop .check { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0 6px; }
.hosp-pop .check input { width: auto; margin: 2px 0 0; display: inline; }
#patientDialog .check { display: flex; gap: 6px; align-items: flex-start; }
#patientDialog .check input { width: auto; display: inline; margin: 2px 0 0; }

/* ---- green bar v3: big name, details to its right */
.call-bar { grid-template-columns: minmax(0, 1.35fr) auto minmax(0, 1fr); }
.call-who { display: flex; align-items: center; gap: 14px; text-align: left; max-width: 62vw; }
button.call-name { font-size: 21px; line-height: 1.15; padding: 0; }
.call-who .call-state { font-size: 12px; line-height: 1.35; white-space: normal; max-width: 340px; color: #4a5a4a; overflow: visible; text-overflow: clip; border-left: 2px solid #c5d1c5; padding-left: 10px; }
.call-who .call-state:empty { display: none; }
.call-who .call-state { white-space: pre-line; }

/* Auto-replies */
.ar-hours, .ar-test { margin: 10px 0; }
.ar-hours-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ar-hours-row input[type=time] { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.ar-days { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ar-day { font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
.ar-rule { margin: 10px 0; }
.ar-rule.off { opacity: .6; }
.ar-rule-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ar-rule-head .spacer { flex: 1; }
.ar-kw { background: #eef4ff; border: 1px solid #cfe0fb; color: var(--accent); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.ar-reply { margin-top: 6px; padding: 6px 10px; background: #f3f6f8; border-radius: 8px; white-space: pre-wrap; font-size: 13px; }
.ar-test .copy-row input { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
dialog select { width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; margin-top: 3px; }
.ar-active { margin-top: 30px !important; }

/* Locations & teams */
.org-loc, .org-team { margin: 10px 0; }
.org-loc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.org-loc-head .spacer { flex: 1; }
.org-city { font-size: 16px; font-weight: 700; }
.org-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .org-cols { grid-template-columns: 1fr; } }
.org-role { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.org-role-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); min-width: 88px; }
.org-person { display: inline-flex; align-items: center; gap: 2px; background: #f3f6f8; border: 1px solid var(--line); border-radius: 999px; padding: 1px 4px 1px 9px; font-size: 12px; }
.org-person:not(:has(.x)) { padding-right: 9px; }
.org-person .x, .org-team-mini .x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; padding: 0 4px; }
.org-person .x:hover, .org-team-mini .x:hover { color: var(--danger); }
.org-add { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.org-add select, .org-team-opts select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; background: #fff; }
.org-team-mini { border-top: 1px solid var(--line); padding: 6px 0; }
.org-team-mini:first-of-type { border-top: 0; }
.org-team.mine { border-color: #9ccfb0; background: #f6fbf8; }
.org-team-row { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
@media (max-width: 900px) { .org-team-row { grid-template-columns: 1fr; } }
.org-team-opts { display: flex; flex-direction: column; gap: 6px; }
.org-team-opts label { display: flex; flex-direction: column; gap: 3px; }
.org-team-opts label.check { flex-direction: row; align-items: center; gap: 6px; }
.loc-ecw { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }

dialog.wide-dialog { width: min(860px, 94vw); }
.imp-src { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-list { max-height: 55vh; overflow: auto; margin-top: 8px; }
.imp-list h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.imp-table td { padding: 4px 6px; }
.imp-table tr.exists, .imp-table tr.skip { opacity: .65; }
.portal-sections { display: flex; flex-direction: column; gap: 8px; }
.portal-sections label.check { display: flex; gap: 8px; align-items: center; }

/* Conversation status: open | urgent | addressed */
.status-tabs { display: grid; grid-template-columns: repeat(4, auto); gap: 2px; background: #eef1f4; border-radius: 8px; padding: 3px; margin: 8px 12px 0; }
.status-tabs button { border: 0; background: none; font: inherit; font-size: 12.5px; padding: 5px 6px; border-radius: 6px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.status-tabs button.on { background: #fff; color: var(--ink, #1d2730); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.st-count:not(:empty)::before { content: '· '; }
.status-tabs.has-urgent #urgentCount { color: var(--danger); font-weight: 700; }
.conv-list li.st-urgent { box-shadow: inset 3px 0 0 var(--danger); background: #fff6f5; }
.conv-list li.st-urgent.active { background: #fdeceb; }
.conv-list li.st-addressed .name, .conv-list li.st-addressed .preview { color: var(--muted); }
.urgent-pill { background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; border-radius: 4px; padding: 1px 5px; vertical-align: 1px; }
.addr-mark { color: #1f7a4d; font-weight: 700; }
.conv-list li .row { position: relative; }
.row-quick { display: none; gap: 4px; position: absolute; right: 0; top: -2px; background: inherit; }
.conv-list li:hover .row-quick { display: inline-flex; }
.conv-list li:hover .row > .muted.small-text { visibility: hidden; }
.q-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 26px; height: 24px; font-size: 13px; font-weight: 700; cursor: pointer; color: #1f7a4d; line-height: 1; padding: 0; }
.q-btn.urgent { color: var(--danger); }
.q-btn:hover { background: #f3f6f8; }
.tag-bar .spacer { flex: 1; }
.status-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.status-ctl button { border: 0; border-left: 1px solid var(--line); background: #fff; font: inherit; font-size: 12.5px; padding: 4px 10px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.status-ctl button:first-child { border-left: 0; }
.status-ctl button.on[data-set-status="open"] { background: var(--tint); color: var(--accent); font-weight: 600; }
.status-ctl button.on[data-set-status="urgent"] { background: var(--danger); color: #fff; font-weight: 600; }
.status-ctl button.on[data-set-status="addressed"] { background: #e3f4ea; color: #1f7a4d; font-weight: 600; }
.status-ctl button[data-set-status="addressed"]:not(.on) { color: #1f7a4d; font-weight: 600; }

#alertBox { position: fixed; right: 16px; bottom: 16px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, 92vw); }
.alert-toast { display: flex; align-items: center; gap: 8px; background: #fff4f2; border: 1px solid #f5c2bd; border-left: 4px solid var(--danger); border-radius: 8px; padding: 10px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.12); font-size: 14px; }
.alert-toast span { flex: 1; }
.alert-toast .x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }

/* Appointment texts settings */
.am-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.am-mode button { border: 0; border-left: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer; color: var(--muted); }
.am-mode button:first-child { border-left: 0; }
.am-mode button.on[data-mode="off"] { background: #eef1f4; color: var(--ink, #1d2730); font-weight: 600; }
.am-mode button.on[data-mode="preview"] { background: #fff4d6; color: #8a5a00; font-weight: 600; }
.am-mode button.on[data-mode="live"] { background: #1f7a4d; color: #fff; font-weight: 600; }
.am-card { margin: 10px 0; }
.am-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 6px 0; }
.am-row label.check { display: inline-flex; align-items: center; gap: 6px; }
.am-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; }
.am-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.am-card input:not([type=checkbox]), .am-card select, .am-card textarea { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; background: #fff; }
.am-card textarea { width: 100%; resize: vertical; }
.am-inline { display: inline-flex; align-items: center; gap: 6px; }
.am-num { width: 70px; }
.am-sub { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 4px; }
.am-table-wrap { overflow-x: auto; }
.am-rules td { padding: 4px 6px; white-space: nowrap; }
.am-rules input[type=number] { width: 64px; }
.am-days label { display: inline-flex; flex-direction: column; align-items: center; font-size: 10px; margin-right: 2px; }
.am-plan { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 8px 0; }
.am-plan.off { opacity: .7; }
.am-plan-head { display: flex; align-items: center; gap: 10px; }
.am-plan-head .spacer { flex: 1; }
.am-plan-name { font-weight: 600; font-size: 14px !important; min-width: 240px; }
.am-types { display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: 120px; overflow: auto; }
.am-types label.check { display: inline-flex; align-items: center; gap: 4px; }
.am-step { display: grid; grid-template-columns: 170px 1fr; gap: 6px 10px; align-items: start; padding: 6px 0; border-top: 1px dashed var(--line); }
.am-step-opts { grid-column: 2; display: flex; gap: 12px; align-items: center; }
.am-step .am-sample { grid-column: 2; }
.am-sample:not(:empty) { background: #f3f6f8; border-radius: 6px; padding: 6px 8px; font-size: 13px; white-space: pre-wrap; margin-top: 4px; }
.am-tpl { display: block; margin: 8px 0; font-size: 13px; }
.am-tpl > span { display: block; margin-bottom: 2px; font-weight: 600; }
.linkish { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0 4px; font: inherit; }
.am-log td { padding: 4px 6px; vertical-align: top; }
.am-log tr.preview td { color: #6b5a2a; }
.am-body { max-width: 420px; white-space: pre-wrap; font-size: 12px; }
.am-save { position: sticky; bottom: 0; background: var(--panel, #fff); padding: 10px 0; border-top: 1px solid var(--line); }

/* Mass texts */
.mass-list { gap: 8px; }
.mt-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.mt-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.mt-list li:hover { background: #f3f6f8; }
.mt-list li.active { background: var(--tint); }
.mt-name { font-weight: 600; font-size: 14px; }
.mt-st { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; background: #eef1f4; color: var(--muted); }
.mt-st.sending { background: #e3f4ea; color: #1f7a4d; }
.mt-st.scheduled { background: var(--tint); color: var(--accent); }
.mt-st.paused { background: #fff4d6; color: #8a5a00; }
.mt-st.done { background: #e3f4ea; color: #1f7a4d; }
.mt-st.cancelled { background: #fde8e8; color: #9b1c1c; }
.mt-src { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; flex-wrap: wrap; }
.mt-src button { border: 0; border-left: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.mt-src button:first-child { border-left: 0; }
.mt-src button.on { background: var(--tint); color: var(--accent); font-weight: 600; }
.mt-form { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin: 6px 0; }
.mt-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.mt-form label.check { flex-direction: row; align-items: center; gap: 6px; }
.mt-form input, .mt-form select, .mt-label input, .mt-label textarea { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; background: #fff; }
.mt-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mt-checks label.check { display: inline-flex; gap: 5px; align-items: center; }
.mt-types { margin: 6px 0; }
.mt-summary { margin: 8px 0 4px; font-size: 14px; }
.mt-table-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.mt-table td { padding: 4px 8px; }
.mt-table tr.off td { color: var(--muted); }
.mt-label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; margin: 6px 0; }
.mt-label textarea { width: 100%; resize: vertical; }
.mt-vars { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 8px; }
.mt-vars .chip { font-family: ui-monospace, monospace; font-size: 11.5px; padding: 2px 8px; }
.mt-preview-box { margin: 8px 0; }
.mt-bubble { background: #eaf2ff; border-radius: 14px 14px 14px 4px; padding: 10px 12px; max-width: 420px; white-space: pre-wrap; font-size: 14px; }
.mt-progress { height: 8px; background: #eef1f4; border-radius: 999px; overflow: hidden; margin: 8px 0; max-width: 520px; }
.mt-progress div { height: 100%; background: #1f7a4d; }
.mt-rs.sent { color: #1f7a4d; font-weight: 600; }
.mt-rs.failed { color: var(--danger); font-weight: 600; }
.mt-rs.skipped { color: var(--muted); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Locations & teams sub-tabs + rules editor */
.sub-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 12px; flex-wrap: wrap; }
.sub-tabs button { border: 0; background: none; font: inherit; font-size: 13.5px; padding: 8px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.org-bar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 6px; }
.am-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.am-switch { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.am-switch input { position: absolute; opacity: 0; pointer-events: none; }
.am-knob { flex: none; width: 36px; height: 20px; border-radius: 999px; background: #cfd6dc; position: relative; transition: background .15s; margin-top: 2px; }
.am-knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.am-switch.on { border-color: #9ccfb0; background: #f6fbf8; }
.am-switch.on .am-knob { background: #1f7a4d; }
.am-switch.on .am-knob::after { left: 18px; }
.am-partial { border-top: 1px solid var(--line); margin-top: 8px; }
.am-prow { display: grid; grid-template-columns: 170px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.am-prow:last-child { border-bottom: 0; }
.am-plabel { font-weight: 600; font-size: 13px; padding-top: 4px; }
.am-prow input[type=time] { padding: 3px 5px; }
.am-tri { min-width: 130px; }
.am-num-badge { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--tint); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.am-type.off { opacity: .75; }
.am-provtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.am-provtabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer; }
.am-provtabs button.on { background: var(--tint); border-color: #b9cdf0; color: var(--accent); font-weight: 600; }
.am-count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 2px; }
.am-steps { margin-top: 6px; }

/* Rules on provider cards + hours + rule picker */
.am-rulepick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #f7f9fc; }
.am-rulepick select { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 320px; margin-left: 8px; }
.am-hours { border-collapse: collapse; margin: 4px 0; }
.am-hours td { padding: 3px 10px 3px 0; font-size: 13px; }
.am-hours input[type=time] { padding: 3px 5px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; }
.am-hours select { padding: 3px 5px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 12.5px; }
.am-hours-wrap summary { cursor: pointer; margin-top: 4px; }
.am-prov { margin-top: 10px; }
.am-prov-box { border-top: 1px solid var(--line); padding-top: 8px; }
.am-prov-sw { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.am-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.am-mini input { position: absolute; opacity: 0; pointer-events: none; }
.am-mini .am-knob { width: 30px; height: 17px; }
.am-mini .am-knob::after { width: 13px; height: 13px; }
.am-mini.on .am-knob { background: #1f7a4d; }
.am-mini.on .am-knob::after { left: 15px; }
.am-mini.dim { opacity: .5; }
.am-ex { margin-top: 8px; }
.am-ex > summary { cursor: pointer; padding: 4px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.am-ex > summary::marker { content: ''; }
.am-ex > summary::before { content: '▸'; color: var(--muted); }
.am-ex[open] > summary::before { content: '▾'; }
.am-count.zero { background: #cfd6dc; }
.am-ex-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 8px 0; background: #fcfdfe; }
.org-prov-locs { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.org-prov-locs label.check { display: inline-flex; gap: 4px; align-items: center; }

/* Billing tab */
.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.bill-big { font-size: 22px; font-weight: 700; }
.bill-due { background: #fff8ed; border-color: #f3d9a8; }
.bill-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bill-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 3px 4px; border-bottom: 1px solid var(--line); }
.bill-table td { padding: 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
#billingBody .card { margin-bottom: 8px; }
.pd-portal { margin: 10px 0 0; padding: 8px 10px; background: #f3f6f8; border-radius: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.mt-ontime { width: 100%; margin-top: 8px; }

/* ---- pathways */
.pw-badge { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
#pwTabCount:not(:empty) { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
.pw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.pw-card { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; color: inherit; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; }
.pw-card:hover { border-color: #9fb0c6; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.pw-card-head { display: flex; align-items: center; gap: 8px; }
.pw-card-head b { flex: 1; }
.pw-mode { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: #eef1f4; color: var(--muted); }
.pw-mode.preview { background: #fff4d6; color: #8a5a00; }
.pw-mode.live { background: #dff5e8; color: #1c6b3c; }
.pw-steps-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 15px; }
.pw-steps-mini i { color: var(--muted); font-style: normal; font-size: 12px; margin: 0 1px; }
.pw-modes button:disabled { opacity: .6; }
.pw-step { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; background: #fbfcfd; }
.pw-step-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #f5f7f9; border-radius: 10px 10px 0 0; }
.pw-step-head input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; width: 180px; }
.pw-step-head select { font: inherit; font-weight: 600; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.pw-num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.pw-step-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.pw-step-body textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.pw-step-body input, .pw-step-body select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.pw-branches { border-left: 3px solid var(--tint); padding-left: 10px; display: flex; flex-direction: column; gap: 6px; }
.pw-branch { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pw-go { max-width: 260px; }
.pw-assign { display: inline-flex; gap: 4px; }
.pw-table td { vertical-align: top; }
.pw-actions { white-space: nowrap; }
.pw-actions .btn { margin: 1px; }
.pw-st { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 0 5px; background: #eef1f4; }
.pw-st.active { background: var(--out); color: var(--accent); }
.pw-st.paused { background: #fff4d6; color: #8a5a00; }
.pw-log { margin: 0; padding-left: 18px; font-size: 12px; }
.pw-log li { margin: 2px 0; }
.pw-task { margin: 8px 0; padding: 10px 12px; border-left: 4px solid var(--accent); }
.pw-task.overdue { border-left-color: var(--danger); }
.pw-task.done, .pw-task.expired, .pw-task.cancelled { opacity: .75; border-left-color: #b9c3cc; }
.pw-task-head { display: flex; align-items: center; gap: 6px; }
.pw-instr { background: #f6f8fa; border-radius: 6px; padding: 6px 8px; margin: 6px 0; white-space: pre-wrap; }
.pw-task-do { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.pw-task-do input { flex: 1; min-width: 140px; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.pw-bar { padding: 6px 12px; border-bottom: 1px solid var(--line); background: #f8f7ff; }
.pw-bar .pw-task { background: #fff; margin: 4px 0 6px; }
.pw-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pw-chip { border: 1px solid #d9d2ff; background: #fff; color: #5b4bb7; border-radius: 999px; padding: 1px 8px; }
.pw-chip.paused { border-style: dashed; }
.pw-add { font: inherit; font-size: 12px; padding: 2px 4px; border: 1px dashed #c5bdf5; border-radius: 6px; background: #fff; color: #5b4bb7; }
.pw-modes button.on[data-pw-mode="off"] { background: #eef1f4; color: var(--text); font-weight: 600; }
.pw-modes button.on[data-pw-mode="preview"] { background: #fff4d6; color: #8a5a00; font-weight: 600; }
.pw-modes button.on[data-pw-mode="live"] { background: #dff5e8; color: #1c6b3c; font-weight: 600; }

/* ---- care partners */
.care-bar { padding: 6px 12px; border-bottom: 1px solid var(--line); background: #effaf8; }
.care-req { margin: 6px 0; padding: 10px 12px; border-left: 4px solid #2c9c8a; }
.care-req.staff_review { border-left-color: var(--danger); }
.care-req.awaiting_patient, .care-req.new { border-left-color: #d9a400; }
.care-req.declined, .care-req.ended, .care-req.expired { border-left-color: #b9c3cc; opacity: .8; }
.care-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.care-st { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; background: #eef1f4; }
.care-st.active { background: #dff5e8; color: #1c6b3c; }
.care-st.staff_review { background: #fde8e8; color: #9b1c1c; }
.care-st.awaiting_patient, .care-st.new { background: #fff4d6; color: #8a5a00; }
.care-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.care-act input { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.care-reply { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.care-reply textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.care-reply .btn { align-self: flex-end; }
.bubble.care { background: #e9f7f4; border: 1px solid #bfe5dc; }
.bubble.care.outbound { background: #dff1ec; }

/* ---- labs & imaging */
.res-item { border-top: 1px solid var(--line); padding: 6px 0; }
.res-item:first-of-type { border-top: 0; }
.res-item > summary { cursor: pointer; list-style-position: outside; }
.res-kind { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 4px; background: var(--tint); color: var(--accent); }
.res-kind.img { background: #f1e8ff; color: #5b21b6; }
.res-flagcount { font-size: 11px; font-weight: 700; color: var(--danger); }
.res-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 4px 0 2px; }
.res-table td { padding: 2px 4px; border-bottom: 1px solid #f0f2f4; vertical-align: top; }
.res-table tr.abn td:first-child, .res-table tr.abn .res-val { color: var(--danger); font-weight: 600; }
.res-val { white-space: nowrap; }
.res-flag { font-size: 10px; font-weight: 700; background: var(--danger); color: #fff; border-radius: 3px; padding: 0 3px; }
.res-impr { white-space: pre-wrap; font-size: 12px; background: #f7f8fa; border-radius: 6px; padding: 6px 8px; }

/* ---- Atlas branding */
.topbar { border-bottom: 3px solid var(--sage); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.brand-logo { height: 34px; width: auto; }
.brand-name { font-family: "Libre Baskerville", Georgia, serif; font-weight: 700; letter-spacing: .14em; font-size: 17px; }
.brand-name.big { font-size: 30px; }
.brand-sub { font-size: 12px; color: var(--sage); font-weight: 700; letter-spacing: .02em; border-left: 1px solid var(--line); padding-left: 8px; }
.login-brand { text-align: center; color: var(--accent); margin-bottom: 4px; }
.login-brand .brand-sub { border: 0; padding: 0; margin-top: 2px; }
.login-logo { height: 120px; width: auto; display: block; margin: 0 auto 8px; }
.login-logo + .brand-name { display: none; } /* the logo already says ATLAS Internal Medicine */
h1, h2, h3, .settings-head h2, .login-card h1 { font-family: "Libre Baskerville", Georgia, serif; color: var(--accent); }
.settings-head h2 { font-size: 19px; }
.btn.primary:hover { background: #15305a; border-color: #15305a; }
a { color: var(--accent); }

/* eCW encounter dialog: what to attach */
.emr-attach { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 6px; }
.emr-attach-label { font-size: 13px; font-weight: 600; }
.emr-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; align-self: flex-start; }
.emr-seg label { display: inline-flex; align-items: center; margin: 0; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--muted); background: #fff; }
.emr-seg label + label { border-left: 1px solid var(--line); }
.emr-seg input { position: absolute; opacity: 0; pointer-events: none; }
.emr-seg label:has(input:checked) { background: var(--accent); color: #fff; }
.emr-seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.emr-attach-label { display: flex; align-items: center; }
#emrDialog select.emr-days, .emr-days { width: auto; display: inline-block; font: inherit; font-size: 12.5px; font-weight: 400; padding: 1px 4px; margin-left: 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.emr-time-row { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.emr-time-row input { width: 64px; padding: 4px 6px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }

/* AI transcript: who said what */
.tline { display: flex; gap: 4px; align-items: baseline; padding: 2px 4px; border-radius: 4px; }
.tline b { flex: none; }
.tline.role-staff b { color: var(--accent); }
.tline.role-patient b { color: #6b4e16; }
.tline.moved { background: #fff8e6; }
.tl-move { margin-left: auto; flex: none; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 4px; opacity: 0; }
.tline:hover .tl-move, .tl-move:focus-visible { opacity: 1; }
@media (hover: none) { .tl-move { opacity: .6; } }
.tl-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0; }
.ai-unsure { margin-top: 4px; color: #9a3412; }
.ai-terms { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }

/* Inbox / Missed calls */
.box-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 12px 0; border-bottom: 1px solid var(--line); }
.box-tabs button { border: 0; background: none; font: inherit; font-size: 13.5px; padding: 7px 4px 8px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.box-tabs button.on { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.box-tabs.has-missed #missedCount { background: var(--danger, #c0392b); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11.5px; font-weight: 700; }

/* Feedback */
.fb-btn { position: relative; margin-right: 6px; }
.fb-btn[data-count]:not([data-count=""])::after { content: attr(data-count); position: absolute; top: -6px; right: -6px; background: var(--danger, #c0392b); color: #fff; border-radius: 9px; font-size: 10.5px; font-weight: 700; padding: 0 5px; line-height: 16px; }
.fb-dialog { width: min(520px, calc(100vw - 32px)); }
.fb-dialog form > label { display: block; margin: 10px 0 4px; }
.fb-dialog input:not([type]), .fb-dialog textarea { width: 100%; }
.fb-kinds { margin: 4px 0 6px; }
.fb-mine { max-height: 200px; overflow-y: auto; margin-top: 6px; }
.fb-mine-row { padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.fb-mine-row > span:first-child { flex: 1; min-width: 0; }
.fb-st { font-size: 11.5px; padding: 1px 7px; border-radius: 9px; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.fb-st.st-new { background: var(--tint, #e8ecf2); color: var(--accent); }
.fb-st.st-doing, .fb-st.st-planned { background: #fff3d6; color: #7a5300; }
.fb-st.st-done { background: #e3f3e6; color: #1f6b33; }
.fb-tabs { grid-template-columns: repeat(4, auto); margin: 8px 0 12px; display: inline-grid; }
.fb-filter { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; }
.fb-list { display: flex; flex-direction: column; gap: 10px; }
.fb-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.fb-item.st-new { border-left: 4px solid var(--accent); }
.fb-item.st-done, .fb-item.st-wont { opacity: .75; }
.fb-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-kind { font-size: 11.5px; padding: 1px 7px; border-radius: 9px; background: #eef1f4; white-space: nowrap; }
.fb-kind.k-bug { background: #fde8e6; color: #9a3412; }
.fb-kind.k-idea { background: #fff3d6; color: #7a5300; }
.fb-title { font-size: 14px; }
.fb-status { font: inherit; font-size: 12.5px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; }
.fb-body { white-space: pre-wrap; margin: 6px 0; font-size: 13.5px; }
.fb-note { display: flex; gap: 6px; margin-top: 8px; }
.fb-note input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 700px) { .fb-btn { padding: 4px 8px; } }
.fb-openlog { margin-right: auto; }
.ai-assign { display: block; margin-top: 4px; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; } .ai-extusers select { font: inherit; font-size: 13px; padding: 2px 4px; }
.ai-trial { color: #7a5300; background: #fff3d6; border-radius: 8px; padding: 0 6px; }

/* AI scribe */
.settings.scribe { display: block; overflow-y: auto; }
.sc-wrap { max-width: 1100px; margin: 0 auto; padding: 16px 20px 40px; }
.sc-center { max-width: 560px; text-align: center; }
.sc-center .sc-actions { justify-content: center; }
.sc-pilot { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; background: var(--tan, #d7c7b2); color: #4a3b22; border-radius: 8px; padding: 1px 7px; vertical-align: middle; font-family: inherit; }
.sc-appts { display: flex; flex-direction: column; }
.sc-appt { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); }
.sc-appt:first-child { border-top: 0; }
.sc-appt.rec { opacity: .7; }
.sc-time { width: 72px; flex: none; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.sc-other { margin-top: 10px; }
.sc-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sc-row input { flex: 1; min-width: 140px; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.sc-vrow { cursor: pointer; }
.sc-vrow:hover { background: var(--tint, #e8ecf2); }
.sc-st { font-size: 12px; white-space: nowrap; }
.sc-st.st-draft { color: var(--accent); font-weight: 600; }
.sc-st.st-failed { color: #9a3412; }
.sc-st.st-recording { color: #c0392b; }
.sc-consent { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 15px; margin: 18px 0 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sc-consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.sc-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.sc-big { font-size: 16px; padding: 12px 22px; }
.sc-live { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px 0 10px; }
.sc-clock { font-size: 44px; font-variant-numeric: tabular-nums; font-weight: 600; }
.sc-dot { width: 16px; height: 16px; border-radius: 50%; background: #bbb; }
.sc-dot.on { background: #d93025; animation: scPulse 1.4s infinite; }
@keyframes scPulse { 50% { opacity: .35; } }
.sc-meter { height: 8px; border-radius: 4px; background: #eef1f4; overflow: hidden; margin: 0 auto 10px; max-width: 360px; }
.sc-meter div { height: 100%; width: 0; background: var(--sage, #7a907a); transition: width .12s; }
.sc-working { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--tint, #e8ecf2); border-radius: 10px; margin: 10px 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: scSpin .8s linear infinite; display: inline-block; }
@keyframes scSpin { to { transform: rotate(360deg); } }
.sc-fail { padding: 10px 12px; background: #fff4f2; color: #9a3412; border-radius: 10px; margin: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sc-flags { padding: 10px 12px; background: #fff8e6; border: 1px solid #f0dca8; border-radius: 10px; margin: 10px 0; font-size: 13.5px; }
.sc-flags ul { margin: 4px 0 0 18px; padding: 0; }
.sc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-top: 10px; }
@media (max-width: 900px) { .sc-grid { grid-template-columns: 1fr; } }
.sc-notehead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sc-note { width: 100%; min-height: 520px; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; resize: vertical; }
.sc-side .card { margin-bottom: 12px; }
.sc-list { margin: 0; padding-left: 18px; font-size: 13.5px; }
.sc-rate { margin: 4px 0 8px; }
.sc-ratenote, .sc-text, .sc-num { width: 100%; font: inherit; font-size: 13.5px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.sc-num { width: 80px; display: inline-block; }
.sc-num.wide { width: 240px; }
.sc-lab { display: block; margin: 12px 0; font-size: 13.5px; }
.sc-tx { margin-top: 16px; }
.sc-tx .transcript { max-height: 420px; }
.sc-bottom { border-top: 1px solid var(--line); padding-top: 14px; }
.link.danger { color: #9a3412; }
/* Scribe: templates, codes */
.sc-tplpick { display: block; margin: 14px 0 0; font-size: 14px; }
.sc-tplpick select, #scRedraftTpl { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; margin-left: 6px; max-width: 100%; }
.sc-mine { font-size: 11px; background: var(--tint, #e8ecf2); color: var(--accent); border-radius: 8px; padding: 1px 7px; }
.sc-tplbtns { text-align: right; white-space: nowrap; }
.sc-mono { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sc-codes { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.sc-ords { border-top: 1px solid var(--line); padding-top: 6px; }
.sc-code { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.sc-code span:first-of-type { flex: 1; min-width: 0; }
.sc-code select { font-size: 12px; padding: 1px 2px; border: 1px solid var(--line); border-radius: 4px; max-width: 86px; }
.sc-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.sc-x:hover { color: #9a3412; }
.sc-new { font-size: 10.5px; background: #fff3d6; color: #7a5300; border-radius: 6px; padding: 0 5px; }
.sc-usual { font-size: 10.5px; background: var(--tint, #e8ecf2); color: var(--accent); border-radius: 6px; padding: 0 5px; }
.sc-ok { font-size: 11px; color: #1f6b33; font-weight: 600; text-transform: none; letter-spacing: 0; }
.sc-todo { font-size: 11px; color: #7a5300; font-weight: 600; text-transform: none; letter-spacing: 0; }
.sc-search { margin: 8px 0; }
.sc-kind { margin-bottom: 6px; }
.sc-search input { width: 100%; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.sc-results { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; }
.sc-res { text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; font-size: 12.5px; padding: 5px 6px; cursor: pointer; }
.sc-res:hover { background: var(--tint, #e8ecf2); }
.sc-stats, .sc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0; }
@media (max-width: 800px) { .sc-stats, .sc-grid2 { grid-template-columns: 1fr; } }
.sc-settabs { display: inline-grid; grid-template-columns: auto auto; margin: 4px 0 14px; }
.sc-heads { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.sc-head { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: start; }
.sc-headname { font-size: 13px; font-weight: 600; padding-top: 6px; }
.sc-head textarea { width: 100%; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
@media (max-width: 700px) { .sc-head { grid-template-columns: 1fr; } }
.sc-headtbl select, .sc-headtbl input { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.sc-headtbl td:nth-child(2) { width: 150px; }
#scPFor, #scPTpl { display: block; margin-top: 4px; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.sc-pt { margin: 6px 0 10px; }
.sc-pthead { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.sc-ptval { white-space: pre-wrap; font-size: 13px; }
/* ---- Scribe: inbox-style layout (schedule | note | start / record / review) */
.sc-layout .pane { min-width: 0; }
.sc-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.sc-mainpane .sc-wrap { max-width: 980px; padding: 14px 20px 40px; }
.sc-sidepane { background: #fbfcfd; }
.sc-sidewrap { padding: 14px 14px 30px; }
.sc-sidetitle { margin: 0 0 6px; font-size: 15px; }
.sc-sidept { margin: 0 0 8px; }
.sc-sideempty { margin-top: 30px; text-align: center; }
.sc-full { width: 100%; margin: 6px 0; }
.sc-sidewrap .sc-consent { font-size: 13.5px; margin: 12px 0 6px; padding: 10px; }
.sc-usechart { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 12px 0 0; }
.sc-sidewrap .sc-tplpick select { display: block; width: 100%; margin: 4px 0 0; }
.sc-sidewrap .sc-clock { font-size: 38px; }
.sc-recpanel .sc-live { margin: 14px 0 8px; }
.sc-dayhead { gap: 6px; }
.sc-daylabel { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 2px; white-space: nowrap; color: var(--ink, #1d2730); }
.sc-daylabel:hover { color: var(--accent); }
.sc-dayhead.sc-novisits #scPrev, .sc-dayhead.sc-novisits #scNext, .sc-dayhead.sc-novisits #scDay { visibility: hidden; }
.sc-stagetabs { grid-template-columns: repeat(3, 1fr); }
.sc-filters { position: relative; }
.sc-provwrap { position: relative; }
.sc-provmenu { left: 0; top: 30px; width: 270px; padding: 8px; }
.sc-provmenu .pop-list li { cursor: default; }
.sc-provmenu label.check { display: flex; gap: 6px; align-items: center; width: 100%; cursor: pointer; }
.sc-provquick { display: flex; gap: 12px; padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
#scList li.sc-none { cursor: default; padding: 18px 12px; text-align: center; }
#scList li.sc-none:hover { background: none; }
.sc-li .preview { font-size: 12.5px; }
.sc-li.stage-out .name, .sc-li.stage-out .preview { color: var(--muted); }
.sc-li.stage-in { box-shadow: inset 3px 0 0 #2e8b57; }
.sc-li.sc-live-row { box-shadow: inset 3px 0 0 #d93025; background: #fff6f5; }
.sc-li .sc-time { font-variant-numeric: tabular-nums; width: auto; }
.sc-badges { display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.sc-stage-b { font-size: 11px; border-radius: 8px; padding: 0 7px; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.sc-stage-b.in { background: #e3f4ea; color: #1f6b33; font-weight: 600; }
.sc-stage-b.out { background: #ece9f6; color: #4b3f8a; }
.sc-provtag { margin-left: auto; }
.sc-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-emptymsg { margin: 40px auto; }
.sc-pthd { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.sc-pthd h2 { margin: 0 0 2px; font-size: 20px; }
.sc-ptmeta { text-align: right; line-height: 1.5; }
.sc-vbar { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.sc-mainpane .sc-note { min-height: 480px; }
.sc-charthead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.sc-charthead h4 { margin: 0; }
.sc-cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.sc-clist { margin: 2px 0 6px; padding-left: 16px; font-size: 12.5px; }
.sc-cmore { margin-top: 6px; }
.sc-prior { white-space: pre-wrap; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px; max-height: 320px; overflow-y: auto; }
.sc-model { display: block; margin: 4px 0; font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; min-width: 300px; }
@media (max-width: 1100px) { .sc-cgrid { grid-template-columns: 1fr; } }
/* iPad portrait / phone: stack — schedule, then the recording tools, then the note */
@media (max-width: 900px) {
  .sc-layout { display: flex; flex-direction: column; overflow-y: auto; }
  .sc-layout .pane { border-right: 0; border-bottom: 1px solid var(--line); flex: none; }
  .sc-listpane #scList { max-height: 38vh; }
  .sc-sidepane { order: 2; }
  .sc-mainpane { order: 3; }
  .sc-scroll { overflow: visible; }
  .sc-pthd { flex-direction: column; }
  .sc-ptmeta { text-align: left; }
}
.sc-title { margin: 0 0 8px; font-size: 20px; }
/* Scribe v3: recording over the schedule, chart on the right */
.sc-listpane { position: relative; }
.sc-listpane.sc-recmode > :not(#scRecPane) { display: none !important; }
.sc-recpane { flex: 1; overflow-y: auto; background: #fff8f7; }
.sc-recpane .sc-recpanel { padding: 18px 16px; }
.sc-recpane .sc-full { width: 100%; margin: 6px 0; }
.sc-sidepane .chart-body .sc-sideempty { margin-top: 40px; }
.sc-sidepane .chart-body > .sc-sidewrap { padding: 0; }
.sc-inline { display: inline; }
.card details > summary { cursor: pointer; }
.sc-startcard { max-width: 560px; }
.sc-startcard .sc-tplpick select { margin-left: 6px; }
.sc-startcard .sc-consent { font-size: 14px; }
/* ---- shared patient panel + patient timer (every module) */
.pt-timer { font-size: 12px; font-variant-numeric: tabular-nums; background: #eef6ef; color: #1f6b33; border: 1px solid #cfe5d3; border-radius: 999px; padding: 2px 9px; white-space: nowrap; cursor: default; }
.pt-timer.idle { background: #f3f4f6; color: var(--muted); border-color: var(--line); }
.sc-ptmeta .pt-timer { display: inline-block; margin-bottom: 4px; }
.pt-card h4 { margin-bottom: 4px; }
.pt-sec { margin: 4px 0 6px; }
.pt-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pt-row.pt-total { font-size: 13.5px; border-bottom: 1px solid var(--line); padding-bottom: 2px; margin-bottom: 2px; }
#patientPanel.ctx-noconv [data-insert], #patientPanel.ctx-noconv [data-dc-insert], #patientPanel.ctx-noconv [data-dc-insert-all] { display: none; }
/* Scribe: review tools under the note (the right side is the shared patient panel) */
.sc-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
.sc-review:empty { display: none; }
.sc-review .card { margin: 0; }
/* ---- patient header on the shared panel (click the name to open) */
.pp-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.pp-name { border: 0; background: none; font: inherit; font-size: 16px; font-weight: 700; padding: 0; cursor: pointer; color: var(--ink, #1d2730); text-align: left; display: flex; align-items: baseline; gap: 4px; }
.pp-name:hover #ppNameText { text-decoration: underline; }
.pp-caret { font-size: 11px; color: var(--muted); transition: transform .15s; display: inline-block; }
.pp-head.open .pp-caret { transform: rotate(90deg); }
.pp-sub { margin: 1px 0 0 16px; }
.pp-hint { margin: 4px 0 0 16px; font-style: italic; }
.pp-open { margin-top: 8px; }
.pp-timerow { display: flex; align-items: center; gap: 8px; }
.pp-timerow .pt-timer { font-size: 13px; padding: 3px 10px; }
.pp-actions:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pp-actions .sc-starttitle { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.pp-actions .sc-tplpick { display: block; font-size: 13px; margin: 0; }
.pp-actions .sc-tplpick select { display: block; width: 100%; margin: 3px 0 0; }
.pp-actions .sc-usechart { font-size: 13px; margin: 8px 0 0; }
.pp-actions .sc-consent { font-size: 13px; margin: 8px 0 4px; padding: 8px; }
.pp-actions .sc-full { width: 100%; }
.pp-actions .sc-big { font-size: 15px; padding: 10px 14px; }
/* ---- reports */
.rp-wrap { max-width: 1200px; }
.rp-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 14px; }
.rp-controls select, .rp-controls input { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.rp-month { min-width: 130px; text-align: center; }
.rp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rp-big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-table td { vertical-align: top; }
.rp-min { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-barcell { width: 160px; }
.rp-bar { height: 8px; background: #eef1f4; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.rp-bar div { height: 100%; background: var(--sage, #7a907a); }
.rp-reached { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; color: #1f6b33; background: #e3f4ea; border-radius: 8px; padding: 0 7px; }
/* ---- LCP: the selected patient's box (timer + module actions) */
.lcp-open { margin: 8px -4px -2px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: default; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.conv-list li.active .lcp-open { border-color: #c9d8f5; }
.lcp-timerow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lcp-timerow .pt-timer { font-size: 12.5px; }
.lcp-actions:not(:empty) { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.lcp-actions .sc-starttitle { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.lcp-actions .sc-tplpick { display: block; font-size: 12.5px; margin: 0; }
.lcp-actions .sc-tplpick select { display: block; width: 100%; margin: 3px 0 0; font-size: 12.5px; }
.lcp-actions .sc-usechart { font-size: 12.5px; margin: 6px 0 0; }
.lcp-actions .sc-consent { font-size: 12.5px; margin: 6px 0 4px; padding: 7px; gap: 8px; }
.lcp-actions .sc-consent input { width: 18px; height: 18px; }
.lcp-actions p.muted { margin: 2px 0 6px; font-size: 11.5px; }
.lcp-actions .sc-big { font-size: 14px; padding: 9px 12px; width: 100%; }
.sc-walkinbox .lcp-open { margin: 0; border: 0; box-shadow: none; padding: 0; }
.sc-walkinbox { max-width: 420px; }
/* ---- recent summary card (RCP) + settings */
.ps-card .ps-ov { margin: 2px 0 6px; font-size: 13.5px; }
.ps-sec { margin: 6px 0; }
.ps-sec ul { margin: 2px 0 0; }
.ps-st { font-size: 11px; border-radius: 8px; padding: 0 6px; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.ps-st.ps-improving, .ps-st.ps-resolved { background: #e3f4ea; color: #1f6b33; }
.ps-st.ps-worsening { background: #fdeceb; color: #9a3412; }
.ps-st.ps-new { background: #fff3d6; color: #7a5300; }
.ps-onoff { font-weight: 600; font-size: 13px; border-radius: 999px; padding: 2px 10px; }
.ps-onoff.on { background: #e3f4ea; color: #1f6b33; }
.ps-onoff.off { background: #f3f4f6; color: var(--muted); }
#psumBody input[type=datetime-local], #psumBody select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; margin-left: 4px; }
/* ---- fax inbox */
.fx-title { font-size: 14px; }
.fx-tabs { grid-template-columns: repeat(4, 1fr); }
.fx-li.fx-urgent { box-shadow: inset 3px 0 0 var(--danger); background: #fff6f5; }
.fx-li.fx-urgent.active { background: #fdeceb; }
.fx-foot { padding: 6px 12px; margin: 0; }
.fx-wrap { max-width: none; }
.fx-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
@media (max-width: 1500px) { .fx-grid { grid-template-columns: 1fr; } }
.fx-pdf { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 8px; background: #f3f4f6; }
.fx-side .card { margin-bottom: 10px; }
.fx-cand { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 8px; margin: 5px 0; font: inherit; font-size: 13px; cursor: pointer; }
.fx-cand:hover { background: var(--tint, #e8ecf2); }
.fx-chosen { padding: 6px 8px; background: #eef6ef; border: 1px solid #cfe5d3; border-radius: 6px; }
.fx-search { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
.fx-search input { font: inherit; font-size: 12.5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.fx-search button { grid-column: 1 / -1; }
.fx-side select { display: block; width: 100%; margin-top: 3px; font: inherit; font-size: 13px; padding: 5px; border: 1px solid var(--line); border-radius: 6px; }
.fx-urgentbar { font-size: 14px; }
.fx-links { margin: 8px 0 0; }
/* menu bar: keep every tab on one line */
.views { flex-wrap: nowrap; }
.view-tab { white-space: nowrap; padding: 6px 10px; }
@media (max-width: 1500px) { #smsFrom { display: none; } .view-tab { padding: 6px 8px; } }
@media (max-width: 1250px) { .brand-sub { display: none; } }
/* Inbox LCP: Phone box — open missed calls in red */
.conv-list li.is-missed { box-shadow: inset 3px 0 0 var(--danger, #c0392b); }
.conv-list li.is-missed .name { color: var(--danger, #c0392b); }
.conv-list .preview.missed-line { color: var(--danger, #c0392b); font-weight: 600; }
/* schedule: provider dropdown grouped by city */
.sched-provwrap { position: relative; }
.sched-provmenu { top: 32px; left: 0; width: 300px; padding: 8px 10px; max-height: 70vh; overflow-y: auto; }
.sched-provquick { display: flex; gap: 12px; flex-wrap: wrap; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.sched-provgroup { margin: 6px 0; }
.sched-provgroup label.check { display: flex; gap: 6px; align-items: center; padding: 2px 0; cursor: pointer; }

.tl-heard { color: var(--muted, #888); font-size: 11px; cursor: help; }

.ap-badge { font-weight: 700; font-size: 10px; letter-spacing: .02em; }
.ap-badge.ns { color: #b91c1c; } .ap-badge.late { color: #b45309; }
.ap-ok { color: #2563eb; font-weight: 700; }
.st-here .ap-y, .st-ready .ap-y { color: #e8f7ee; }
.el-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 3px; vertical-align: 0; border: 1px solid rgba(0,0,0,.25); }
.ap .el-dot { position: absolute; top: 3px; right: 3px; margin: 0; }
.el-green { background: #22c55e; } .el-yellow { background: #facc15; } .el-red { background: #ef4444; }
.sched-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sched-legend .lg { border-left: 3px solid; border-radius: 4px; padding: 0 6px; font-size: 11px; }
.sched-legend .lg-el { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; }
.elig-box { margin: 6px 0; padding: 6px 8px; border-radius: 6px; border-left: 3px solid; }
.el-b-green { background: #effaf3; border-color: #22c55e; } .el-b-yellow { background: #fffbea; border-color: #eab308; } .el-b-red { background: #fef2f2; border-color: #ef4444; }
.pk-btn { margin-top: 8px; width: 100%; background: #fff; border: 1px solid var(--accent); color: var(--accent); }
.fx-note { width: 100%; resize: vertical; font: inherit; } .fx-review { display: flex; flex-direction: column; gap: 4px; }
.fx-signb { background: #fef3c7; color: #92400e; border-radius: 8px; padding: 0 6px; font-weight: 700; }
.fx-needsign { border-left: 4px solid #f59e0b; }
.fx-doctabs { margin-bottom: 4px; } .fx-doctabs .on { font-weight: 700; text-decoration: underline; }
.sg-overlay { position: fixed; inset: 0; z-index: 9000; background: #3b4250; display: flex; flex-direction: column; }
.sg-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fff; border-bottom: 1px solid #d5dae1; flex-wrap: wrap; }
.sg-tools button { margin-left: 4px; border: 1px solid #c7cdd6; background: #fff; border-radius: 6px; padding: 3px 8px; cursor: pointer; font: inherit; font-size: 13px; }
.sg-hint { color: #6b7280; font-size: 13px; } .sg-spacer { flex: 1; }
.sg-pages { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.sg-page { position: relative; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); flex: none; }
.sg-page canvas { display: block; }
.sg-pnum { position: absolute; top: -16px; left: 0; color: #e5e7eb; font-size: 11px; }
.sg-adding .sg-page { cursor: crosshair; }
.sg-box { position: absolute; border: 2px dashed #f59e0b; background: rgba(250, 204, 21, .18); cursor: move; touch-action: none; box-sizing: border-box; }
.sg-box.k-date, .sg-box.k-name { border-color: #2563eb; background: rgba(37, 99, 235, .12); }
.sg-lab { position: absolute; top: -18px; left: -2px; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px 4px 4px 0; white-space: nowrap; }
.sg-box.k-date .sg-lab, .sg-box.k-name .sg-lab { background: #2563eb; }
.sg-x { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #dc2626; color: #fff; font-weight: 700; line-height: 18px; cursor: pointer; padding: 0; }
.sg-h { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #f59e0b; border-radius: 2px; cursor: nwse-resize; }

/* ---------- Reports › Monthly billing (CCM / APCM / RPM) */
.bm .bm-up { cursor: pointer; }
.bm-drop { border: 2px dashed var(--line); border-radius: 8px; padding: 10px; text-align: center; color: var(--muted, #6b7280); font-size: 13px; margin-bottom: 12px; }
.bm-drop.on { border-color: var(--sage, #7a907a); background: #f1f6f1; color: inherit; }
.bm-tile { cursor: pointer; }
.bm-tile.on { outline: 2px solid var(--sage, #7a907a); }
.bm-e { color: #b42318; }
.bm-panels { display: flex; gap: 8px; margin: 4px 0 8px; }
.bm-card { margin-bottom: 12px; }
.bm-rules label { display: block; margin: 6px 0; font-size: 13px; }
.bm-rules input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.bm-list { display: flex; flex-direction: column; gap: 6px; }
.bm-claim { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-left: 4px solid #2e9e5b; border-radius: 8px; background: #fff; }
.bm-claim.lv-warn { border-left-color: #d4a017; }
.bm-claim.lv-error { border-left-color: #d92d20; }
.bm-claim.is-done { opacity: .55; }
.bm-chk input { width: 20px; height: 20px; margin-top: 2px; cursor: pointer; }
.bm-main { flex: 1; min-width: 0; }
.bm-row1, .bm-row2, .bm-row3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.bm-row2 { font-size: 13px; margin-top: 2px; }
.bm-row3 { margin-top: 4px; gap: 4px 6px; }
.bm-prog { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; background: #e8eef7; color: #1e3a8a; }
.bm-prog.p-apcm { background: #efe8f7; color: #5b21b6; }
.bm-prog.p-rpm { background: #e6f4f1; color: #0f5e52; }
.bm-acct { font-size: 13px; }
.bm-cpt { font-size: 13px; background: #f3f4f6; border-radius: 6px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.bm-dx { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 8px; }
.bm-dx span { font-size: 12px; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.bm-flags { margin: 5px 0 0; padding-left: 18px; font-size: 12.5px; }
.bm-flags .f-error { color: #b42318; font-weight: 600; }
.bm-flags .f-warn { color: var(--warn); }
.bm-flags .f-info { color: var(--muted, #6b7280); }
.bm-dxed { margin-top: 8px; padding: 8px; background: #fafafa; border-radius: 6px; }
.bm-dxgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 3px 10px; margin: 6px 0 8px; font-size: 13px; }
.bm-dxgrid label.nc { color: var(--muted, #6b7280); }
.bm-new { font-size: 10px; color: #fff; background: #2563eb; border-radius: 4px; padding: 0 4px; }

/* ---------- Copay payment links */
.cp-card h4 { display: flex; align-items: center; gap: 8px; }
.cp-test { font-size: 11px; font-weight: 700; background: #fff7e6; color: #9a6700; border-radius: 6px; padding: 1px 6px; }
.cp-send { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.cp-send input { width: 90px; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.cp-send select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.cp-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.cp-list li { padding: 5px 0; border-top: 1px solid var(--line); }
.cp-st { font-weight: 600; }
.cp-st.st-paid { color: #1f6b33; }
.cp-st.st-expired, .cp-st.st-cancelled, .cp-st.st-skipped { color: var(--muted, #6b7280); }
.cp-st.st-failed { color: #b42318; }
.cp-set label { display: block; margin: 8px 0; font-size: 13px; }
.cp-set input, .cp-set select, .cp-set textarea { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.cp-set textarea { display: block; width: 100%; margin-top: 3px; }
.fx-junkbtn { margin-right: 8px; }
.fx-junktag { font-size: 12px; font-weight: 700; color: #6b7280; background: #eef1f4; border-radius: 6px; padding: 2px 8px; }

/* Settings → Voice agent */
.va-set label { display: block; margin: 8px 0; font-size: 13px; }
.va-set input, .va-set select, .va-set textarea, .va-try input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; }
.va-set textarea { display: block; width: 100%; margin-top: 3px; }
.va-ready { list-style: none; padding: 0; margin: 0 0 6px; font-size: 13px; }
.va-ready li { margin: 3px 0; }
.va-try { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.va-chat { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--bg, #fafafa); }
.va-line { margin: 4px 0; font-size: 14px; }
.va-line.agent b { color: #6b3fa0; }
.va-act { color: #6b7280; margin: 2px 0 2px 12px; }
.va-pre { white-space: pre-wrap; font-size: 12px; max-height: 300px; overflow: auto; background: #f6f6f6; padding: 8px; border-radius: 6px; }
tr.clickable { cursor: pointer; }
.va-voice { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 8px 0; }
.va-voice label { margin: 0; }
