/* Desktop adaptation of the mini program's shared design language. */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2a37;
  background: #f7f9fc;
  --blue: #2f80ed;
  --ink: #1f2a37;
  --muted: #6b7280;
  --line: #e6eaf0;
  --soft: #eef6ff;
  --green: #237249;
  --sidebar-width: 260px;
  --topbar-height: 72px;
  --content-gutter: 28px;
  --surface-shadow: 0 3px 16px rgba(31, 42, 55, .035);
}
body { min-width: 1024px; background: #f7f9fc; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
button { transition: background .16s, border-color .16s, box-shadow .16s; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #9bc5fc; outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
.primary-button, .ghost-button { min-height: 42px; padding: 0 18px; border-radius: 11px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.primary-button { background: var(--blue); border-color: var(--blue); box-shadow: 0 3px 10px rgba(47, 128, 237, .12); }
.primary-button:hover { background: #2372db; border-color: #2372db; }
.primary-button.compact { min-height: 38px; padding: 0 14px; font-size: 13px; }
.primary-button.large { min-height: 44px; }
.ghost-button { color: #475467; border-color: var(--line); background: #fff; }
.ghost-button:hover { border-color: #b9d8ff; background: #f7faff; color: var(--blue); }
.panel { padding: 24px; border-color: var(--line); border-radius: 16px; background: #fff; box-shadow: var(--surface-shadow); }
.panel-title h3 { font-size: 18px; font-weight: 650; }
.panel-title p { line-height: 1.6; }
.eyebrow { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.topbar { height: var(--topbar-height); padding: 0 28px; border-color: var(--line); }
.brand { gap: 11px; font-size: 20px; letter-spacing: .02em; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 3px 12px rgba(47, 128, 237, .08); }
.brand small { margin-left: 5px; padding: 5px 9px; border-radius: 7px; background: var(--soft); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.topbar-actions { gap: 20px; font-size: 13px; }
#clinicName { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#logoutButton { min-height: 36px; padding: 0 13px; }
.workspace { height: calc(100dvh - var(--topbar-height)); grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { display: flex; min-height: 0; padding: 28px 16px 16px; flex-direction: column; overflow: hidden; border-color: var(--line); }
.sidebar-head { padding: 0 8px; align-items: center; }
.sidebar-head h2 { font-size: 20px; font-weight: 650; }
.sidebar-head h2 { flex: 1; }
.search-box { flex: 0 0 auto; margin: 22px 4px 16px; padding: 0 12px; gap: 10px; border-radius: 11px; background: #f7f9fc; }
.search-box:focus-within { border-color: #9bc5fc; box-shadow: 0 0 0 3px #eef6ff; }
.search-box input { min-width: 0; height: 42px; font-size: 13px; }
.search-icon { flex-shrink: 0; color: #8792a2; }
.patient-list { min-height: 0; overflow-y: auto; gap: 5px; padding: 0 3px 16px; scrollbar-width: thin; }
.patient-card { display: flex; width: 100%; min-height: 76px; padding: 13px 11px; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 12px; background: #fff; color: var(--ink); text-align: left; }
.patient-card:hover { border-color: #eef1f4; background: #f7f9fc; }
.patient-card.active { border-color: #d6e8ff; background: #eef6ff; }
.patient-list-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 50%; background: #f0f3f7; color: #667085; font-size: 15px; font-weight: 600; }
.patient-card.active .patient-list-avatar { background: #dcecff; color: var(--blue); }
.patient-list-info { min-width: 0; flex: 1; }
.patient-card strong { margin-bottom: 7px; overflow: hidden; color: #344054; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.patient-card.active strong { color: #216bcb; }
.patient-meta { flex-wrap: wrap; gap: 4px; color: #8a94a3; font-size: 11px; line-height: 1.4; }
.patient-meta span { white-space: nowrap; }
.patient-list-empty { padding: 28px 14px; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; }
.content { min-width: 0; min-height: 0; padding: 28px var(--content-gutter) 48px; background: #f7f9fc; scrollbar-width: thin; scroll-padding-top: 24px; }
.content-head { min-height: 48px; margin-bottom: 24px; gap: 18px; }
.content-head h1 { font-size: 26px; line-height: 1.4; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.secondary-head { display: flex; flex-wrap: wrap; }
.secondary-head > div:not(.report-actions) { min-width: 0; flex: 1; }
.back-button { min-width: 64px; min-height: 38px; padding: 0 14px; flex: 0 0 auto; }
.report-actions { flex-wrap: wrap; gap: 8px; }
.report-actions .primary-button, .report-actions .ghost-button { min-height: 38px; padding: 0 13px; font-size: 12px; }
.empty-state { height: 100%; min-height: 450px; }
.empty-icon { width: 76px; height: 76px; border-radius: 22px; background: #eef6ff; }
.empty-icon img { width: 46px; height: 46px; }
.empty-state h2 { margin: 24px 0 12px; font-size: 24px; font-weight: 650; }
.empty-state p { max-width: 440px; margin-bottom: 26px; font-size: 14px; line-height: 1.8; }

/* Patient dossier and report entries mirror the mini program's overview. */
.content.assistant-docked { display: grid; height: 100%; min-height: 0; padding: 24px var(--content-gutter); grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; overflow: hidden; }
.content.assistant-docked #patientView { height: 100%; min-height: 0; overflow-y: auto; padding: 0 4px 24px 0; scrollbar-width: thin; }
.patient-profile.panel { display: block; margin: 0; padding: 24px; border-radius: 16px; }
.patient-profile-head { display: flex; align-items: center; gap: 14px; }
.patient-profile .patient-avatar { width: 58px; height: 58px; flex: 0 0 58px; border-radius: 50%; color: var(--blue); background: #eef6ff; font-size: 23px; }
.patient-identity { flex: 1; min-width: 0; }
.patient-identity .eyebrow { margin: 0 0 5px; font-size: 11px; color: #98a2b3; }
.patient-identity h1 { margin: 0; font-size: 24px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.patient-profile-head .patient-edit-button { position: static; top: auto; right: auto; flex: 0 0 auto; margin: 0; min-height: 36px; padding: 0 12px; border-color: #b9d8ff; color: var(--blue); background: #fff; font-size: 12px; }
.content.assistant-docked .profile-fields { width: 100%; margin-top: 22px; padding-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; border-top: 1px solid #eef1f4; }
.profile-fields span { margin-bottom: 7px; color: #98a2b3; font-size: 12px; }
.profile-fields strong { color: #344054; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.artifact-toolbar { margin: 28px 2px 16px; }
.artifact-toolbar h2 { margin-bottom: 6px; font-size: 18px; font-weight: 650; }
.artifact-toolbar p { color: #8a94a3; font-size: 12px; line-height: 1.6; }
.content.assistant-docked .artifact-groups { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.artifact-section.panel { margin: 0; padding: 0; border-radius: 14px; }
.artifact-heading { padding: 17px 20px; gap: 12px; }
.artifact-heading h3 { font-size: 15px; font-weight: 650; }
.artifact-heading small { display: grid; min-width: 27px; height: 24px; padding: 0 7px; place-items: center; border-radius: 7px; background: #f7f9fc; color: #98a2b3; font-size: 11px; }
.artifact-icon { width: 36px; height: 36px; border-radius: 10px; background: #eef6ff; color: var(--blue); font-size: 11px; }
.artifact-icon img { display: block; width: 24px; height: 24px; object-fit: contain; }
.artifact-section[data-artifact-kind="previsit"] .artifact-icon { color: #a16714; background: #fff5e4; }
.artifact-section[data-artifact-kind="simulation"] .artifact-icon { color: #7556b8; background: #f2edff; }
.artifact-section[data-artifact-kind="estimate"] .artifact-icon { color: #237249; background: #eaf7ef; }
.artifact-row { min-height: 80px; padding: 17px 20px; border-color: #eef1f4; gap: 14px; }
.artifact-row:hover { background: #f8fbff; }
.artifact-main b { font-size: 14px; font-weight: 600; line-height: 1.5; }
.artifact-main small { margin-top: 7px; font-size: 12px; color: #8a94a3; }
.artifact-row em { padding: 4px 8px; border-radius: 6px; background: #eef6ff; color: #2f80ed; font-size: 10px; white-space: nowrap; }
.artifact-row i { color: #a3adba; }
.artifact-empty-row { min-height: 75px; padding: 17px 20px; border-color: #eef1f4; }
.artifact-empty-row p { color: #98a2b3; font-size: 12px; }
.artifact-empty-row .compact { min-height: 32px; font-size: 12px; }

/* The patient pane scrolls independently from the permanent conversation. */
.content.assistant-docked .assistant-view { position: relative; top: auto; height: 100%; min-height: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--surface-shadow); }
.content.assistant-docked .assistant-header { min-height: 76px; padding: 18px 20px; flex: 0 0 auto; border-color: #eef1f4; }
.content.assistant-docked .assistant-title { gap: 10px; }
.content.assistant-docked .assistant-title img { width: 36px; height: 36px; border-radius: 11px; }
.content.assistant-docked .assistant-title p { font-size: 16px; font-weight: 650; }
.assistant-title p em { margin-left: 6px; padding: 3px 5px; background: #eef6ff; color: var(--blue); font-size: 9px; font-weight: 600; }
.assistant-scope { padding: 10px 12px; background: #f7f9fc; color: #8a94a3; font-size: 10px; line-height: 1.5; }
.content.assistant-docked .assistant-messages { min-height: 100px; padding: 22px 16px 12px; overscroll-behavior: contain; scrollbar-width: thin; }
.assistant-message { margin-bottom: 20px; gap: 8px; }
.assistant-message > img { width: 28px; height: 28px; border-radius: 8px; }
.content.assistant-docked .assistant-message > div { max-width: calc(100% - 36px); min-width: 0; }
.content.assistant-docked .assistant-bubble { padding: 12px 14px; border: 0; border-radius: 3px 13px 13px; background: #f7f9fc; color: #344054; font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.content.assistant-docked .assistant-message.user .assistant-bubble { border-radius: 13px 3px 13px 13px; background: #2f80ed; color: #fff; }
.content.assistant-docked .assistant-message.failed .assistant-bubble { background: #fff3f3; color: #b54747; }
.assistant-message-actions button { padding: 2px 0; color: #98a2b3; font-size: 11px; }
.assistant-message-actions button:hover { color: var(--blue); }
.content.assistant-docked .assistant-starters { padding: 8px 18px 18px; gap: 8px; flex: 0 0 auto; }
.assistant-starters:empty { display: none; }
.assistant-starters p { margin-bottom: 4px; color: #98a2b3; font-size: 11px; }
.assistant-starters button { min-height: 38px; padding: 10px 12px; gap: 12px; border-color: var(--line); border-radius: 10px; background: #fff; color: #667085; font-size: 12px; text-align: left; line-height: 1.45; }
.assistant-starters button:hover { border-color: #b9d8ff; color: var(--blue); background: #f8fbff; }
.content.assistant-docked .assistant-composer-wrap { padding: 14px; flex: 0 0 auto; border-color: #eef1f4; }
.content.assistant-docked .assistant-composer textarea { min-height: 116px; max-height: 160px; padding: 13px 14px 50px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9fc; font-size: 13px; line-height: 1.7; }
.content.assistant-docked .assistant-composer textarea:focus { border-color: #9bc5fc; box-shadow: 0 0 0 3px #eef6ff; background: #fff; }
.content.assistant-docked .assistant-composer button { right: 9px; bottom: 9px; min-width: 56px; min-height: 32px; border-radius: 8px; font-size: 12px; }
.content.assistant-docked .assistant-composer-wrap > p { margin-top: 10px; padding: 0; color: #98a2b3; font-size: 9px; line-height: 1.5; text-align: center; }
.toast { z-index: 1800; padding: 14px 20px; background: #1f2a37; border-radius: 11px; font-size: 13px; }

/* A calm brand introduction, aligned with the actual workspace. */
.login-brand-page { display: block; min-height: 100vh; --login-blue: #2f80ed; --login-ink: #1f2a37; --login-muted: #6b7280; --login-line: #e6eaf0; background: #f7f9fc; }
.login-brand-page:before, .login-orb { display: none; }
.login-nav { width: min(1280px, calc(100% - 80px)); height: 96px; }
.login-brand .brand-logo { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 4px 16px rgba(47,128,237,.08); }
.login-brand strong { font-size: 20px; letter-spacing: .04em; }
.login-brand small { margin-top: 5px; color: #98a2b3; font-size: 10px; }
.login-product-label { padding: 8px 12px; border-color: var(--line); border-radius: 8px; background: #fff; color: #667085; font-size: 12px; }
.login-stage { width: min(1280px, calc(100% - 80px)); min-height: 0; margin: 24px auto 0; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: stretch; }
.login-hero-copy { display: flex; min-width: 0; padding: 0; flex-direction: column; }
.login-eyebrow { margin-bottom: 22px; padding: 0; border: 0; background: transparent; color: #2f80ed; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.login-eyebrow i { width: 6px; height: 6px; background: #2f80ed; box-shadow: 0 0 0 4px #e3efff; }
.login-hero-copy h1 { font-size: clamp(36px, 3.1vw, 48px); line-height: 1.3; letter-spacing: -.03em; font-weight: 650; }
.login-brand-page .login-lead { margin: 20px 0 24px; color: #6b7280; font-size: 14px; line-height: 1.9; }
.login-capabilities { width: 100%; max-width: none; margin-bottom: 24px; gap: 10px; }
.login-capabilities article { padding: 14px 12px; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: none; backdrop-filter: none; }
.login-capabilities b { font-size: 13px; font-weight: 650; }
.login-capabilities small { display: block; margin-top: 5px; color: #98a2b3; font-size: 10px; }
.login-capabilities .capability-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
.login-capabilities .capability-icon img { width: 26px; height: 26px; }
.login-product-preview { width: 100%; max-width: none; margin-top: auto; border: 1px solid #dbe4ef; border-radius: 16px; transform: none; box-shadow: 0 12px 36px rgba(31,42,55,.06); }
.preview-bar { height: 38px; background: #fff; border-color: var(--line); color: #98a2b3; }
.preview-body, .login-product-preview .preview-body { height: 250px; grid-template-columns: 20% minmax(0,1fr) 29%; background: #f7f9fc; }
.preview-patients { padding: 16px 10px; border-color: var(--line); }
.preview-patients > strong { font-size: 10px; }
.preview-patients > span > i { border-radius: 50%; }
.preview-report { padding: 20px 14px; }
.preview-report-card { padding: 10px 8px; gap: 8px; border-color: var(--line); }
.preview-report-card > em { display: none; }
.preview-chat { min-width: 0; padding: 14px 10px; border-color: var(--line); background: #fff; }
.preview-chat-title { gap: 7px; }
.preview-chat-title b { font-size: 9px; }
.preview-chat-title small { font-size: 7px; }
.preview-chat p { background: #f7f9fc; border: 0; font-size: 8px; line-height: 1.7; }
.preview-question { padding: 7px; background: #eef6ff; color: #2f80ed; font-size: 8px; }
.preview-composer { right: 10px; bottom: 12px; left: 10px; background: #f7f9fc; border-color: var(--line); }
.login-brand-page .login-card { align-self: stretch; min-height: 0; margin: 0; padding: 44px 30px 26px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 8px 32px rgba(31,42,55,.04); backdrop-filter: none; }
.login-card-badge { top: 18px; right: 20px; padding: 5px 8px; background: #eaf7ef; color: #237249; font-size: 9px; font-weight: 500; }
.login-card-logo { width: 52px; height: 52px; margin-top: 12px; box-shadow: 0 4px 16px rgba(47,128,237,.08); }
.login-brand-page .login-card h2 { margin: 20px 0 12px; font-size: 25px; font-weight: 650; }
.login-card-lead { color: #6b7280; font-size: 13px; line-height: 1.8; }
.login-brand-page .qr-frame { margin: 25px 0 10px; padding: 12px; border-color: var(--line); border-radius: 14px; box-shadow: none; }
.login-brand-page .qr-frame img { width: 218px; height: 218px; }
.login-brand-page .qr-actions { display: flex; padding-bottom: 18px; align-items: center; flex-direction: column; } /* v294 */
.login-brand-page .qr-status { color: #237249; font-size: 13px; }
.login-brand-page #refreshQr { margin-top: 4px; font-size: 12px; }
.direct-scan-guide { min-height: 100dvh; padding: 32px 20px; place-items: center; background: linear-gradient(145deg, #eef6ff, #fff 54%, #edf9f5); }
.direct-scan-guide:not([hidden]) { display: grid; }
body.direct-scan-mode { min-width: 0; }
.direct-scan-card { width: min(460px, 100%); padding: 38px 30px 30px; border: 1px solid #e0e8f0; border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: 0 20px 64px rgba(31,42,55,.10); text-align: center; }
.direct-scan-card > img { width: 58px; height: 58px; border-radius: 16px; box-shadow: 0 8px 22px rgba(47,128,237,.14); }
.direct-scan-eyebrow { margin: 18px 0 8px; color: #2f80ed; font-size: 12px; font-weight: 650; }
.direct-scan-card h1 { margin: 0; color: #1f2a37; font-size: 25px; line-height: 1.4; }
.direct-scan-copy { margin: 14px auto 24px; color: #6b7280; font-size: 14px; line-height: 1.8; }
.direct-scan-card ol { display: grid; margin: 0; padding: 0; gap: 10px; list-style: none; text-align: left; }
.direct-scan-card li { display: flex; padding: 14px; align-items: center; gap: 13px; border-radius: 13px; background: #f7f9fc; }
.direct-scan-card li > i { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; background: #e5f1ff; color: #2f80ed; font-size: 13px; font-style: normal; font-weight: 650; }
.direct-scan-card li span, .direct-scan-card li strong, .direct-scan-card li small { display: block; }
.direct-scan-card li strong { color: #344054; font-size: 14px; font-weight: 600; }
.direct-scan-card li small { margin-top: 4px; color: #8792a2; font-size: 12px; line-height: 1.55; }
.direct-scan-note { margin: 20px 0 0; color: #98a2b3; font-size: 11px; line-height: 1.7; }
@media (max-width: 520px) { .direct-scan-guide { padding: 20px 14px; } .direct-scan-card { padding: 32px 20px 24px; border-radius: 20px; } .direct-scan-card h1 { font-size: 22px; } }
.login-card-note { min-height: 60px; margin-top: auto; padding: 12px; gap: 10px; background: #f7f9fc; border-radius: 10px; color: #8a94a3; font-size: 10px; line-height: 1.7; }
.login-card-note i { background: #eaf7ef; color: #237249; }
.login-footer { height: 84px; gap: 20px; color: #98a2b3; font-size: 11px; }
.login-footer i { width: 3px; height: 3px; background: #b8c2ce; }

@media (min-width: 1600px) {
  :root { --sidebar-width: 280px; --content-gutter: 36px; }
  .content.assistant-docked { grid-template-columns: minmax(0,1fr) 400px; gap: 28px; }
  .content.assistant-docked .profile-fields { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .content.assistant-docked .artifact-groups { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
}
@media (max-width: 1200px) {
  :root { --sidebar-width: 236px; --content-gutter: 22px; }
  .topbar { padding: 0 22px; }
  .topbar-actions { gap: 14px; }
  .content.assistant-docked { grid-template-columns: minmax(0,1fr) 310px; gap: 16px; padding: 20px var(--content-gutter); }
  .patient-profile.panel { padding: 20px; }
  .patient-profile .patient-avatar { width: 44px; height: 44px; flex-basis: 44px; font-size: 20px; }
  .patient-identity h1 { font-size: 22px; }
  .patient-profile-head { gap: 10px; flex-wrap: wrap; }
  .patient-profile-head .patient-edit-button { margin-left: auto; }
  .artifact-heading, .artifact-row, .artifact-empty-row { padding-right: 16px; padding-left: 16px; }
  .artifact-main small { white-space: normal; line-height: 1.65; }
  .content-head h1 { font-size: 24px; }
  .secondary-head .report-actions { margin-left: 82px; flex-basis: calc(100% - 82px); }
  .login-nav, .login-stage { width: calc(100% - 56px); }
  .login-stage { grid-template-columns: minmax(0,1fr) 320px; gap: 32px; }
  .login-capabilities article { padding: 13px 10px; gap: 8px; }
  .login-capabilities small { display: none; }
  .login-capabilities b { font-size: 12px; }
  .login-brand-page .login-card { padding-right: 22px; padding-left: 22px; }
  .preview-chat-title small { display: none; }
}
@media (max-height: 760px) {
  .content.assistant-docked .assistant-header { min-height: 66px; padding: 14px 18px; }
  .content.assistant-docked .assistant-starters { gap: 6px; padding-bottom: 12px; }
  .assistant-starters button { min-height: 32px; padding: 7px 10px; font-size: 11px; }
  .content.assistant-docked .assistant-composer textarea { min-height: 94px; }
  .login-nav { height: 82px; }
  .login-stage { margin-top: 14px; }
  .login-hero-copy h1 { font-size: 38px; }
  .login-product-preview .preview-body { height: 222px; }
  .login-brand-page .login-card { padding-top: 30px; }
  .login-brand-page .login-card h2 { margin-top: 14px; }
  .login-brand-page .qr-frame { margin-top: 18px; }
  .login-brand-page .qr-frame img { width: 200px; height: 200px; }
  .login-footer { height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition: none !important; }
}
