:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f6fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 10px;
  background: #2457d6;
  color: white;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 650;
}
button:hover { filter: brightness(.96); }
button.secondary { background: #e7ecf8; color: #23334f; }
button.danger { background: #b42318; }
button.small { padding: 7px 10px; font-size: .84rem; }

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  background: white;
  border-bottom: 1px solid #dfe4ee;
}
.nav-current { margin-left: auto; color: #33415e; font-weight: 700; }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: .85rem; }

.app-shell { max-width: 1440px; margin: 0 auto; padding: 28px; }
.page-header, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.create-visit-controls { display: flex; align-items: end; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.create-visit-controls label { display: grid; gap: 5px; color: #52617a; font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.create-visit-controls select, .create-visit-controls input { min-width: 120px; padding: 9px 10px; border: 1px solid #bfc9da; border-radius: 9px; background: white; color: #172033; }
.create-visit-controls input { width: 100px; min-width: 0; }
.directory-manager { margin: 16px 0; padding: 14px 16px; border: 1px solid #dfe4ee; border-radius: 14px; background: white; }
.directory-manager summary { cursor: pointer; font-weight: 800; }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: 14px; }
.directory-grid form, .directory-grid > div { display: grid; align-content: start; gap: 9px; padding: 13px; border-radius: 10px; background: #f8faff; }
.directory-grid label { display: grid; gap: 5px; font-size: .78rem; font-weight: 750; }
.directory-grid input, .directory-grid select { width: 100%; padding: 9px; border: 1px solid #bfc9da; border-radius: 8px; background: white; }
.directory-grid article { display: grid; gap: 4px; margin-bottom: 10px; }
.directory-grid article span { color: #52617a; font-size: .84rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 8px; }
h2 { margin-bottom: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .11em; font-size: .72rem; font-weight: 800; color: #5c6c8a; margin-bottom: 6px; }
.muted { color: #68758d; }

.dashboard-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 20px; margin-top: 20px; }
.clinician-workspace { display: grid; grid-template-columns: minmax(310px, 370px) minmax(0, 1fr); align-items: start; gap: 20px; margin-top: 20px; }
.clinician-left-rail, .clinician-main { display: grid; min-width: 0; gap: 20px; }
.queue-panel, .visit-panel, .patient-card {
  background: white;
  border: 1px solid #dfe4ee;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 28px rgba(32, 49, 82, .06);
}
.queue-card {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
  background: #f5f7fb;
  color: #172033;
  margin-top: 10px;
  border: 1px solid transparent;
}
.queue-card.selected { border-color: #2457d6; background: #edf2ff; }
.queue-card span { font-size: .82rem; }

.video-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.provider-call-stage { position: relative; display: block; min-height: clamp(360px, 48vw, 680px); overflow: hidden; border-radius: 16px; background: #080d17; }
.patient-video-frame { position: absolute; inset: 0; }
.patient-video-frame video { width: 100%; height: 100%; min-height: 0; border-radius: 16px; object-fit: cover; }
.provider-pip { position: absolute; z-index: 5; top: 86px; right: 16px; width: clamp(150px, 20%, 240px); aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid rgba(255,255,255,.9); border-radius: 12px; background: #111827; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.provider-pip video { width: 100%; height: 100%; object-fit: cover; }
.video-name-label { position: absolute; left: 9px; bottom: 8px; z-index: 2; padding: 4px 7px; border-radius: 6px; background: rgba(15,23,42,.76); color: white; font-size: .72rem; font-weight: 750; }
.screen-share-layer { display: none; position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; min-height: 0; border-radius: 16px; background: #080d17; object-fit: contain; }
.screen-share-layer.screen-share-active { display: block; }
.video-placeholder {
  min-height: clamp(230px, 32vw, 520px);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #bdc8dc;
  background: #101828;
}
.controls { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0; }

.status { display: inline-flex; width: fit-content; border-radius: 999px; padding: 5px 9px; background: #e8eef9; color: #334d7a; font-size: .72rem; font-weight: 800; }
.status-patient_waiting, .status-patient_ready { background: #fff4cc; color: #7a5800; }
.status-in_progress, .status-admitted { background: #dff7e9; color: #116239; }
.status-completed { background: #e6e8ec; color: #4a5261; }

.video-with-timer { position: relative; margin: 18px 0; }
.video-with-timer .video-stage, .video-with-timer .single-video { margin: 0; }
.video-with-timer .timer { position: absolute; z-index: 4; top: 10px; left: 10px; right: 10px; margin: 0; border: 1px solid rgba(255,255,255,.3); box-shadow: 0 5px 18px rgba(0,0,0,.28); backdrop-filter: blur(8px); }
.timer { border-radius: 13px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.timer strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.timer-stat { display: grid; gap: 2px; }
.timer-stat span { font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.timer-stat-right { text-align: right; }
.timer-stat-center { text-align: center; }
.timer.neutral { background: rgba(238,241,246,.94); }
.timer.timer-green { background: rgba(227,245,236,.94); color: #0d5b33; }
.timer.timer-yellow { background: rgba(255,244,204,.95); color: #785500; }
.timer.timer-red { background: rgba(253,231,231,.95); color: #9f1c1c; }
.media-icon-controls { position: absolute; z-index: 5; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 12px; }
.media-icon-button { position: relative; width: 52px; height: 52px; display: grid; place-items: center; padding: 0; border: 2px solid rgba(255,255,255,.85); border-radius: 50%; box-shadow: 0 5px 18px rgba(0,0,0,.35); }
.media-icon-button img { width: 27px; height: 27px; object-fit: contain; }
.media-icon-button.media-on { background: #15803d; }
.media-icon-button.media-off { background: #c81e1e; }
.media-icon-button.media-off::after { content: ""; position: absolute; width: 42px; height: 4px; border-radius: 4px; background: white; transform: rotate(-45deg); box-shadow: 0 0 0 2px #c81e1e; }
.video-display-controls { position: absolute; z-index: 7; top: 82px; right: 14px; display: flex; gap: 7px; }
.video-overlay-button { padding: 7px 10px; border: 1px solid rgba(255,255,255,.65); border-radius: 8px; background: rgba(15,23,42,.78); color: white; font-size: .76rem; backdrop-filter: blur(6px); }
.live-transcript { position: absolute; z-index: 6; right: 14px; bottom: 80px; width: min(390px, calc(100% - 28px)); max-height: min(36vh, 280px); display: grid; overflow: hidden; border: 1px solid rgba(255,255,255,.35); border-radius: 12px; background: rgba(15,23,42,.84); color: white; box-shadow: 0 8px 28px rgba(0,0,0,.3); backdrop-filter: blur(8px); transition: opacity .2s ease, transform .2s ease; }
.live-transcript.collapsed { opacity: 0; transform: translateY(10px); pointer-events: none; }
.live-transcript-heading { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; border-bottom: 1px solid rgba(255,255,255,.18); }
.live-transcript-heading span { font-size: .7rem; color: #cbd5e1; }
.live-transcript-lines { overflow: auto; padding: 10px 11px; }
.live-transcript-lines p { margin: 0 0 7px; line-height: 1.35; }
.live-transcript-empty { color: #cbd5e1; font-style: italic; }
.video-with-timer.video-expanded { position: fixed; z-index: 9000; inset: 0; margin: 0; padding: 12px; background: #070b14; display: grid; place-items: stretch; }
.video-with-timer.video-expanded .video-stage { height: 100%; }
.video-with-timer.video-expanded video { width: 100%; height: 100%; min-height: 0; max-height: none; object-fit: contain; }
.video-with-timer.video-expanded .provider-pip { top: 86px; right: 18px; width: clamp(160px, 18vw, 250px); height: auto; }
.video-with-timer.video-expanded .provider-pip video { object-fit: cover; }
.video-with-timer.video-expanded .single-video { height: 100%; margin: 0; }
body.video-expanded-open { overflow: hidden; }

.timer-border-target {
  border: 5px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.timer-border-green { border-color: #16a34a !important; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.timer-border-yellow { border-color: #f2b705 !important; box-shadow: 0 0 0 3px rgba(242, 183, 5, .22); }
.timer-border-red { border-color: #dc2626 !important; box-shadow: 0 0 0 4px rgba(220, 38, 38, .22); }
.timer-border-blinking { animation: timer-border-blink .75s ease-in-out infinite; }

@keyframes timer-border-blink {
  0%, 100% { border-color: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .28); }
  50% { border-color: #ff8a8a; box-shadow: 0 0 0 10px rgba(220, 38, 38, .58); }
}

@media (prefers-reduced-motion: reduce) {
  .timer-border-blinking { animation: none; box-shadow: 0 0 0 8px rgba(220, 38, 38, .48); }
}

.time-up-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, .82);
  backdrop-filter: blur(5px);
}
.time-up-card {
  width: min(760px, 100%);
  padding: clamp(30px, 7vw, 72px);
  border: 8px solid #dc2626;
  border-radius: 24px;
  background: white;
  text-align: center;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .4);
}
.time-up-kicker { margin-bottom: 8px; color: #991b1b; font-size: 1rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.time-up-card h2 { margin: 0; color: #b91c1c; font-size: clamp(3.2rem, 11vw, 7.5rem); line-height: .95; letter-spacing: -.04em; }
.time-up-card p:not(.time-up-kicker) { max-width: 620px; margin: 24px auto 0; color: #374151; font-size: clamp(1rem, 2.4vw, 1.35rem); }
.time-up-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.time-up-actions button { min-width: 150px; font-size: 1.05rem; }

.chat-panel { border-top: 1px solid #e2e6ee; padding-top: 16px; margin-top: 18px; }
.scribe-panel { border-top: 1px solid #e2e6ee; padding-top: 18px; margin-top: 20px; }
.scribe-panel h3 { margin-bottom: 3px; }
.scribe-status { border-radius: 999px; padding: 6px 9px; background: #eef1f6; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.scribe-status.active { background: #fee2e2; color: #991b1b; }
.scribe-active { display: flex; align-items: center; gap: 8px; color: #991b1b; font-weight: 750; }
.scribe-active span { width: 11px; height: 11px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 5px rgba(220,38,38,.15); }
.consent-card { margin-top: 12px; padding: 16px; border: 2px solid #2457d6; border-radius: 14px; background: #f5f8ff; }
.consent-card p { margin: 8px 0 0; line-height: 1.5; }
.transcript-compose, .note-editor { display: grid; gap: 8px; margin: 12px 0; font-weight: 700; }
.transcript-compose textarea, .transcript-compose select, .note-editor textarea { width: 100%; border: 1px solid #bfc9da; border-radius: 10px; padding: 10px 12px; background: white; color: #172033; }
.note-editor textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; line-height: 1.5; }
.scribe-history { margin-top: 16px; border-top: 1px solid #e5e7eb; padding-top: 12px; }
.scribe-history summary { cursor: pointer; font-weight: 750; }
.scribe-history article { margin-top: 12px; padding: 12px; background: #f7f8fb; border-radius: 10px; display: grid; gap: 5px; }
.scribe-history pre { white-space: pre-wrap; margin: 8px 0 0; font: inherit; }
.resource-panel, .upload-panel { border-top: 1px solid #e2e6ee; padding-top: 18px; margin-top: 20px; }
.resource-panel h3, .upload-panel h3 { margin-bottom: 3px; }
.guest-list article, .file-list article { display: grid; gap: 8px; margin-top: 10px; padding: 12px; border: 1px solid #dfe4ee; border-radius: 10px; background: #f8faff; }
.guest-list article > div:first-child, .file-list article > div:first-child, #patient-file-list p { display: flex; justify-content: space-between; gap: 12px; margin: 0; }
.guest-list code { overflow-wrap: anywhere; color: #475569; }
.button-link { display: inline-flex; align-items: center; border-radius: 10px; padding: 10px 16px; text-decoration: none; font-weight: 650; background: #e7ecf8; color: #23334f; }
.upload-panel > button { margin-top: 10px; }
#patient-file { display: block; width: 100%; padding: 10px; border: 1px dashed #aab5c7; border-radius: 10px; }
#patient-file-list span { font-size: .78rem; font-weight: 800; color: #52617a; }
.encounter-history { padding: 20px; border: 1px solid #dfe4ee; border-radius: 18px; background: white; box-shadow: 0 8px 28px rgba(32,49,82,.06); }
.encounter-workspace { display: grid; grid-template-columns: minmax(390px, 36%) minmax(0, 1fr); gap: 18px; min-height: 520px; margin-top: 18px; }
.encounter-list { min-width: 0; overflow: hidden; border: 1px solid #dfe4ee; border-radius: 12px; background: #fff; }
.table-scroll { max-height: min(58vh, 620px); overflow: auto; overscroll-behavior: contain; }
.encounter-history table { width: 100%; border-collapse: separate; border-spacing: 0; }
.encounter-history th, .encounter-history td { padding: 11px 12px; border-bottom: 1px solid #e5e7eb; text-align: left; white-space: nowrap; }
.encounter-history th { position: sticky; top: 0; z-index: 1; color: #52617a; background: #f7f9fc; box-shadow: 0 1px #dfe4ee; font-size: .71rem; text-transform: uppercase; letter-spacing: .05em; }
.encounter-history th:nth-child(1) { width: 126px; }
.encounter-history th:nth-child(2) { width: 88px; }
.encounter-history td { font-size: .84rem; }
.encounter-history td:last-child { width: 100%; }
.encounter-history tbody tr[data-encounter-id] { cursor: pointer; }
.encounter-history tbody tr[data-encounter-id]:hover { background: #f5f8ff; }
.encounter-history tbody tr[data-encounter-id].selected { background: #eaf0ff; box-shadow: inset 4px 0 #2457d6; }
.encounter-history tbody tr:focus-visible { outline: 3px solid rgba(36,87,214,.35); outline-offset: -3px; }
.encounter-patient, .encounter-row-status { display: block; }
.encounter-patient { max-width: 180px; overflow: hidden; font-weight: 750; text-overflow: ellipsis; }
.encounter-row-status { margin-top: 3px; color: #68758d; font-size: .72rem; }
.encounter-empty { padding: 30px 14px !important; text-align: center !important; white-space: normal !important; }
.encounter-detail { min-width: 0; padding: 20px; border: 1px solid #c7d5f5; border-radius: 12px; background: #f8faff; }
.encounter-detail-empty { display: grid; place-items: center; min-height: 420px; text-align: center; }
.encounter-detail-empty > div { max-width: 360px; }
.encounter-metadata { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 18px; color: #52617a; }
.transcript-record, .note-record { max-height: 420px; overflow: auto; white-space: pre-wrap; padding: 14px; border: 1px solid #dfe4ee; border-radius: 10px; background: white; font: .9rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.chat-lines { min-height: 130px; max-height: 260px; overflow: auto; padding: 10px; background: #f7f8fb; border-radius: 10px; }
.chat-lines p { margin: 0 0 8px; }
.chat-compose { display: flex; gap: 8px; margin-top: 9px; }
.chat-compose input { flex: 1; min-width: 0; border: 1px solid #cfd6e4; border-radius: 10px; padding: 10px 12px; }
.privacy-label { font-size: .75rem; color: #52617a; background: #edf0f5; padding: 5px 8px; border-radius: 999px; }

.notice, .error { border-radius: 12px; padding: 13px 15px; margin: 16px 0; display: grid; gap: 5px; }
.notice { background: #edf3ff; color: #203f83; }
.notice code { overflow-wrap: anywhere; }
.error { background: #fdecea; color: #8a1f17; }
.empty-state { min-height: 360px; display: grid; place-items: center; color: #6c7890; }

.patient-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.patient-card { width: min(720px, 100%); }
.device-check { border: 1px solid #dce2ec; border-radius: 14px; padding: 18px; margin-top: 20px; }
.device-setup { border: 1px solid #dce2ec; border-radius: 14px; padding: 16px; margin: 14px 0; background: #f8faff; }
.device-setup h3 { margin-bottom: 3px; }
.device-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.device-grid label { display: grid; gap: 6px; font-size: .78rem; font-weight: 800; text-transform: uppercase; color: #52617a; }
.device-grid select { width: 100%; min-width: 0; padding: 9px; border: 1px solid #bfc9da; border-radius: 9px; background: white; color: #172033; text-transform: none; }
.device-test-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; margin-top: 12px; }
.device-test-row > div > span { display: block; margin-bottom: 5px; font-size: .78rem; font-weight: 800; color: #52617a; }
.microphone-meter { height: 12px; overflow: hidden; border-radius: 999px; background: #dfe4ee; }
.microphone-meter i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #16a34a 0 65%, #f2b705 65% 85%, #dc2626 85%); transition: width .08s linear; }
.device-status { margin: 10px 0 0; font-size: .84rem; }

@media (max-width: 900px) {
  .nav { align-items: flex-start; flex-direction: column; padding: 16px 20px; gap: 10px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .clinician-workspace { grid-template-columns: 1fr; }
  .encounter-workspace { grid-template-columns: 1fr; }
  .encounter-list .table-scroll { max-height: 360px; }
  .encounter-detail-empty { min-height: 260px; }
  .video-stage { grid-template-columns: 1fr; }
  .provider-call-stage { min-height: clamp(340px, 70vh, 620px); }
  .provider-pip { top: 92px; right: 10px; width: clamp(120px, 30%, 180px); }
  .device-grid { grid-template-columns: 1fr; }
  .directory-grid { grid-template-columns: 1fr; }
  .live-transcript { bottom: 76px; max-height: 28vh; }
  .video-display-controls { top: 86px; }
  .app-shell { padding: 18px; }
}
.hidden { display: none !important; }
.single-video { width: 100%; min-height: clamp(260px, 52vw, 620px); max-height: 72vh; background: #101828; border-radius: 14px; margin: 16px 0; object-fit: cover; }
.video-stage video { width: 100%; object-fit: cover; }
.system-line { color: #6b7280; font-style: italic; }

.name-entry {
  display: grid;
  gap: 8px;
  margin: 18px 0 4px;
  padding: 16px;
  border: 1px solid #dce2ec;
  border-radius: 14px;
  background: #f8faff;
}
.name-entry label { font-weight: 750; color: #25334e; }
.name-entry input {
  width: 100%;
  border: 1px solid #bfc9da;
  border-radius: 10px;
  padding: 12px 13px;
  background: white;
  color: #172033;
}
.name-entry input:focus { outline: 3px solid rgba(36, 87, 214, .2); border-color: #2457d6; }
.name-entry p { margin: 0; }
.field-error { margin: 0; color: #a61b13; font-weight: 650; }
.front-desk-login { display: grid; gap: 9px; max-width: 480px; }
.front-desk-login label { font-weight: 750; color: #25334e; }
.front-desk-login input { width: 100%; border: 1px solid #bfc9da; border-radius: 10px; padding: 12px 13px; }
button:disabled { cursor: default; opacity: .72; }

/* Refined application shell */
:root {
  --ink: #142033;
  --muted-ink: #64748b;
  --line: #dce3ed;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --brand: #2859c5;
  --brand-dark: #1d459f;
  --focus: rgba(40, 89, 197, .22);
  background: #f3f6fa;
  color: var(--ink);
}

body { overflow-x: hidden; background: radial-gradient(circle at 50% -180px, #fff 0, #f3f6fa 520px); }
button { min-height: 40px; border-radius: 9px; background: var(--brand); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); transition: background .15s ease, transform .15s ease, box-shadow .15s ease; }
button:hover { filter: none; background: var(--brand-dark); box-shadow: 0 4px 12px rgba(29, 69, 159, .18); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button.secondary { background: #eef2f8; color: #263750; box-shadow: none; }
button.secondary:hover { background: #e3e9f2; }
button.danger { background: #b42318; }

.nav {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 64px;
  padding: 0 clamp(18px, 3vw, 40px);
  gap: 16px;
  border-color: rgba(203, 213, 225, .8);
  box-shadow: 0 1px 8px rgba(15, 23, 42, .04);
}
.nav strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav-current { margin-left: auto; white-space: nowrap; }
.nav .small { flex: 0 0 auto; }

.app-shell { width: 100%; max-width: 1560px; padding: clamp(20px, 3vw, 40px); }
.page-header { align-items: flex-end; flex-wrap: wrap; padding-bottom: 4px; }
.page-header > div:first-child { flex: 1 1 360px; min-width: 0; }
.page-header h1 { letter-spacing: -.035em; }
.page-header .muted { max-width: 620px; margin-bottom: 0; line-height: 1.55; }
.create-visit-controls { flex: 1 1 620px; display: grid; grid-template-columns: minmax(150px, 1.25fr) minmax(145px, 1fr) minmax(120px, .8fr) auto; width: 100%; max-width: 760px; }
.create-visit-controls label { min-width: 0; }
.create-visit-controls select, .create-visit-controls input { width: 100%; min-width: 0; min-height: 40px; }
.create-visit-controls button { white-space: nowrap; }

.directory-manager { margin: 20px 0 0; padding: 16px 18px; border-color: var(--line); box-shadow: 0 1px 3px rgba(15, 23, 42, .03); }
.directory-manager summary { color: #27364c; }
.clinician-workspace { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.clinician-left-rail, .clinician-main { gap: 24px; }
.queue-panel, .visit-panel, .patient-card, .encounter-history {
  border-color: var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(30, 45, 75, .055);
}
.queue-panel, .encounter-history { padding: 18px; }
.visit-panel { padding: clamp(18px, 2vw, 26px); }
.section-heading h2 { font-size: 1.28rem; letter-spacing: -.015em; }

.queue-card { margin-top: 8px; padding: 13px 14px; border: 1px solid transparent; border-radius: 11px; background: var(--surface-soft); box-shadow: none; }
.queue-card:hover { background: #eef3fa; box-shadow: none; transform: none; }
.queue-card.selected { border-color: #7da2ee; background: #edf3ff; box-shadow: inset 3px 0 var(--brand); }
.queue-card strong { font-size: .95rem; }
.queue-card span:not(.status) { color: var(--muted-ink); }
.status { letter-spacing: .025em; }

.provider-call-stage { min-height: clamp(360px, 43vw, 650px); border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.patient-video-frame video, .screen-share-layer { border-radius: 14px; }
.video-with-timer .timer { top: 12px; left: 12px; right: 12px; }
.timer { padding: 10px 16px; }
.timer strong { font-size: 1.3rem; }
.visit-panel > .controls { padding: 14px 0 2px; border-top: 1px solid #e5eaf1; }
.visit-panel > .controls button { min-width: 108px; }
.resource-panel, .upload-panel, .scribe-panel, .chat-panel { border-color: #e5eaf1; }
.device-setup { border-color: #e1e7ef; background: #f8fafc; }
.encounter-detail { border-color: var(--line); background: #fafbfe; }

.patient-shell { padding: clamp(18px, 5vw, 48px); }
.front-desk-login { position: relative; gap: 11px; max-width: 460px; padding: clamp(24px, 4vw, 36px); }
.front-desk-login::before { content: ""; width: 38px; height: 5px; margin-bottom: 5px; border-radius: 999px; background: var(--brand); }
.front-desk-login h1 { margin-bottom: 2px; font-size: clamp(1.8rem, 5vw, 2.25rem); }
.front-desk-login > p:not(.eyebrow):not(.field-error) { margin-bottom: 10px; color: var(--muted-ink); line-height: 1.5; }
.front-desk-login input { min-height: 46px; border-color: #c9d2df; background: #fbfcfe; }
.front-desk-login input:focus { border-color: var(--brand); background: white; }
.front-desk-login > button { width: 100%; margin-top: 6px; }

@media (max-width: 1300px) {
  .create-visit-controls { flex-basis: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
  .create-visit-controls button { grid-column: 1 / -1; justify-self: end; width: min(220px, 100%); }
  .clinician-workspace { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .nav { position: static; flex-direction: row; align-items: center; padding: 12px 18px; }
  .nav-current { display: none; }
  .nav .small { margin-left: auto; }
  .create-visit-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-visit-controls button { grid-column: 1 / -1; width: 100%; }
  .clinician-workspace { grid-template-columns: 1fr; }
  .queue-panel { max-height: 440px; overflow: auto; }
}

@media (max-width: 560px) {
  .nav strong { max-width: calc(100vw - 120px); font-size: .9rem; }
  .app-shell { padding: 16px; }
  .create-visit-controls { grid-template-columns: 1fr; }
  .page-header > div:first-child { flex-basis: 100%; }
  .page-header h1 { font-size: 2rem; }
  .queue-panel, .visit-panel, .encounter-history { padding: 15px; border-radius: 13px; }
  .provider-call-stage { min-height: 360px; }
  .timer-stat-center { display: none; }
  .visit-panel > .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visit-panel > .controls button { width: 100%; min-width: 0; }
  .chat-compose { flex-direction: column; }
  .chat-compose button { width: 100%; }
}
