@font-face { font-family: Inter; src: url('./fonts/inter-regular.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url('./fonts/inter-medium.woff2') format('woff2'); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url('./fonts/inter-semibold.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
:root { color-scheme: light; --ink: #242a2b; --muted: #626b6d; --line: #e3e7e5; --sidebar: #f7f8f7; --soft: #f2f5f3; --accent: #256d60; --tint: #eaf3ef; --amber: #875c20; --amber-bg: #fcf2df; --rail-width: 216px; --column-width: 720px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 Inter, system-ui, sans-serif; color: var(--ink); background: white; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, textarea, input, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button { touch-action: manipulation; }
svg { display: block; width: 18px; height: 18px; flex: none; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.skip-link:focus { top: 16px; }
.app-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: var(--rail-width); flex: none; display: flex; flex-direction: column; padding: 24px 12px 24px; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 12px; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand-mark, .agent-mark { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: white; border-radius: 7px; font-weight: 600; }
.brand-mark { width: 24px; height: 24px; font-size: 13px; }
.new-request { display: flex; align-items: center; gap: 12px; height: 40px; flex: none; margin: 36px 4px 0; padding: 0 12px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 500; }
.new-request:hover { border-color: #bdcac2; }
.history-header { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; margin: 36px 0 18px; font-size: 11px; font-weight: 500; color: var(--muted); }
.history-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; scrollbar-width: thin; min-height: 0; }
.history-item { display: flex; align-items: center; gap: 11px; min-height: 36px; flex: none; width: 100%; padding: 8px 12px; text-align: left; border-radius: 7px; font-size: 12px; }
.history-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item svg { color: var(--muted); width: 16px; height: 16px; }
.history-item:hover { background: #eef1ee; }
.history-item[aria-current='true'] { background: #e9ede9; font-weight: 500; }
.history-item.is-error svg { color: var(--amber); }
.history-item.is-pending svg { animation: breathe 1.4s ease-in-out infinite; }
.history-empty { margin: 0 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sidebar-footer { margin-top: auto; padding-top: 24px; }
.history-status { color: var(--muted); font-size: 11px; padding: 0 12px; }
.history-status:not(:empty) { margin-bottom: 12px; }
.settings-button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 8px 12px; color: var(--muted); font-size: 13px; border-radius: 7px; }
.settings-button:hover { color: var(--ink); background: #eef1ee; }
.workspace { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; height: 100%; }
.workspace-header { display: flex; align-items: center; gap: 12px; padding: 0 32px; min-height: 72px; flex: none; color: var(--muted); font-size: 13px; }
.request-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.index-label { font-size: 12px; white-space: nowrap; margin-left: auto; }
.content-column { width: min(var(--column-width), calc(100% - 64px)); margin-left: auto; margin-right: auto; }
.content-scroll { min-height: 0; overflow-y: auto; overflow-x: hidden; flex: 1; scrollbar-width: thin; }
.workspace.is-new .content-scroll { flex: none; padding-top: clamp(72px, 23vh, 208px); overflow: visible; }
.welcome h1 { font-size: 32px; line-height: 1.25; letter-spacing: -1px; font-weight: 500; text-wrap: balance; }
.welcome p { font-size: 15px; color: var(--muted); margin-top: 14px; }
.composer-region { flex: none; padding-top: 16px; padding-bottom: 32px; }
.workspace.is-new .composer-region { margin-top: 40px; padding-top: 0; }
.composer { display: flex; flex-direction: column; gap: 4px; border: 1px solid #ced7d2; border-radius: 18px; padding: 10px 10px 8px; background: white; box-shadow: 0 2px 10px #242a2b08; transition: border-color 150ms, box-shadow 150ms; }
.composer-toolbar { display: flex; align-items: center; gap: 6px; min-width: 0; }
.composer-toolbar .send-button { margin-left: auto; }
.attach-picker { position: relative; flex: none; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); }
.tool-button:hover, .tool-button[aria-expanded='true'] { color: var(--ink); background: var(--soft); }
.attachment-tray { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 6px; max-height: 124px; overflow-y: auto; overscroll-behavior: contain; }  /* about two rows; the rest scroll */
.attachment-card { position: relative; display: flex; align-items: center; gap: 10px; width: 216px; max-width: 100%; min-height: 52px; padding: 8px 30px 8px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--sidebar); }
.attachment-card .chip-remove { position: absolute; top: 4px; right: 4px; }
.attachment-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--tint); color: var(--accent); }
.attachment-icon.kind-audio { background: var(--amber-bg); color: var(--amber); }
.attachment-icon.kind-recording { background: #fbe9e6; color: #a2342a; animation: breathe 1.4s ease-in-out infinite; }
.attachment-text { display: grid; min-width: 0; }
.attachment-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.attachment-text small { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.attachment-card.is-busy { animation: breathe 1.4s ease-in-out infinite; }
.attachment-card.is-recording { padding-right: 8px; }
.stop-recording { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px 8px; border-radius: 8px; color: #a2342a; font-size: 12px; font-weight: 500; }
.stop-recording:hover { background: #fbe9e6; }
.stop-recording svg { width: 14px; height: 14px; }
.request-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.drop-overlay { position: absolute; inset: 12px; z-index: 30; display: flex; align-items: center; justify-content: center; border: 2px dashed #8da99b; border-radius: 18px; background: #ffffffe6; pointer-events: none; }
.drop-target { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--accent); }
.drop-target svg { width: 28px; height: 28px; }
.drop-target strong { font-size: 16px; font-weight: 600; color: var(--ink); }
.drop-target small { color: var(--muted); font-size: 12px; }
.mode-toggles { display: grid; gap: 4px; }
.mode-toggle { display: flex; align-items: center; gap: 12px; padding: 8px 4px; cursor: pointer; }
.mode-toggle > svg { color: var(--accent); }
.mode-toggle span { display: grid; gap: 2px; flex: 1; min-width: 0; }
.mode-toggle strong { font-size: 13px; font-weight: 500; color: var(--ink); }
.mode-toggle small { font-size: 11px; color: var(--muted); }
.mode-toggle input { appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; background: #d5dcd8; cursor: pointer; transition: background 150ms; }
.mode-toggle input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 2px #242a2b30; transition: transform 150ms; }
.mode-toggle input:checked { background: var(--accent); }
.mode-toggle input:checked::after { transform: translateX(14px); }
.mode-toggle input:disabled { opacity: .55; cursor: default; }
.composer:focus-within { border-color: #8da99b; box-shadow: 0 0 0 3px #256d6009; }
.task-picker { position: relative; flex: none; display: flex; align-items: center; min-width: 0; }
.task-trigger { display: flex; align-items: center; gap: 7px; padding: 0 6px 0 10px; min-height: 34px; border-radius: 10px; white-space: nowrap; font-size: 13px; font-weight: 500; }
.task-trigger:hover, .task-trigger[aria-expanded='true'] { background: var(--soft); }
#task-icon { color: var(--accent); }
.task-chevron { color: var(--muted); }
.task-chevron svg { width: 14px; height: 14px; }
.popup-menu { position: absolute; bottom: calc(100% + 12px); left: -10px; z-index: 20; width: 336px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 30px #242a2b12; }
.task-option { display: flex; align-items: center; gap: 16px; padding: 12px; width: 100%; text-align: left; border-radius: 7px; min-height: 66px; }
.task-option:hover, .task-option:focus-visible { background: var(--soft); }
.task-option > svg, .task-option > [data-icon] svg { width: 19px; height: 19px; color: var(--accent); }
.task-option > span:not([data-icon]) { display: grid; gap: 4px; }
.task-option:disabled { opacity: .5; }
.attach-menu .task-option { min-height: 56px; }
.task-option strong { font-size: 14px; font-weight: 500; }
.task-option small { font-size: 11px; color: var(--muted); }
.task-option[aria-checked='true'] strong { color: var(--accent); }
#message { display: block; width: 100%; min-width: 0; resize: none; border: 0; outline: none; background: transparent; height: 36px; max-height: 160px; overflow-y: hidden; padding: 7px 8px; font-size: 14px; line-height: 22px; border-radius: 0; }
#message::placeholder { color: var(--muted); opacity: 1; }
#message:focus-visible { outline: none; }
.send-button { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none; background: var(--accent); color: white; border-radius: 11px; }
.send-button:hover:not(:disabled) { background: #19594e; }
.send-button:disabled { background: #edf0ed; color: #8a958e; }
.send-button.is-busy svg { animation: breathe 1.4s ease-in-out infinite; }
.composer-hint { margin-top: 12px; font-size: 11px; line-height: 16px; min-height: 16px; color: var(--muted); }
.composer-hint.is-unavailable { color: var(--amber); }
.inline-settings { padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.sample-section { margin-top: 38px; color: var(--muted); font-size: 11px; font-weight: 500; }
.sample-button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 0; min-height: 44px; width: 100%; font-size: 13px; font-weight: 400; color: var(--ink); }
.sample-button > span:last-child { margin-left: auto; }
.sample-button svg { color: var(--muted); width: 16px; height: 16px; }
.sample-button:hover { color: var(--accent); }
#sample-text { white-space: normal; }
.request-content { padding-top: 48px; padding-bottom: 40px; }
.user-request { padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.user-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
.user-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.6; }
.long-request { margin-top: 12px; }
.long-request summary { color: var(--accent); cursor: pointer; font-size: 12px; width: fit-content; }
.long-request .user-text { font-size: 14px; margin-top: 16px; }
.assistant-response { padding-top: 32px; }
.assistant-header { display: flex; align-items: center; gap: 10px; min-height: 22px; font-size: 12px; font-weight: 600; }
.agent-mark { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.response-task { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); }
.response-heading { font-size: 22px; font-weight: 500; letter-spacing: -.5px; line-height: 1.4; margin-top: 30px; }
.response-description { margin-top: 10px; color: var(--muted); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.result-table { margin-top: 28px; }
.table-heading { display: grid; grid-template-columns: minmax(0, 1fr) 160px 18px; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 500; }
.concept-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 18px; align-items: start; gap: 16px; width: 100%; padding: 18px 0; min-height: 86px; text-align: left; border-bottom: 1px solid var(--line); }
.concept-row:hover, .mention-row:hover { background: var(--sidebar); }
.concept-main { min-width: 0; display: grid; gap: 7px; }
.concept-main strong { font-size: 16px; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
.concept-main small { font-size: 12px; color: var(--muted); }
.concept-code { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; padding-top: 3px; }
.concept-row > svg { color: var(--muted); margin-top: 5px; width: 16px; height: 16px; }
.response-footnote { color: var(--muted); font-size: 12px; margin-top: 32px; }
.diagnosis-list { margin-top: 34px; }
.diagnosis-item { border-bottom: 1px solid var(--line); padding: 0 0 24px; margin-bottom: 24px; }
.diagnosis-title { display: flex; gap: 16px; justify-content: space-between; align-items: baseline; }
.diagnosis-title h3 { font-size: 17px; font-weight: 500; }
.model-likelihood { color: var(--muted); font-size: 11px; flex: none; }
.diagnosis-rationale { color: var(--muted); margin-top: 14px; line-height: 1.7; }
.evidence-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 38px; width: 100%; padding: 10px 0 0; text-align: left; color: var(--accent); font-size: 12px; font-weight: 500; }
.evidence-link:hover span { text-decoration: underline; text-underline-offset: 3px; }
.evidence-link svg { width: 16px; height: 16px; }
.annotation-note { margin-top: 32px; padding: 20px; background: var(--sidebar); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 2; font-size: 15px; }
.note-tag { display: inline; padding: 2px 5px; border-radius: 4px; color: var(--accent); background: var(--tint); line-height: inherit; text-align: left; }
.note-tag:hover { box-shadow: 0 0 0 1px currentColor; }
.note-tag:not(.assertion-present) { color: var(--amber); background: var(--amber-bg); }
.note-tag.assertion-unknown { color: var(--muted); background: #e9eceb; }
.mentions-table { margin-top: 28px; }
.mentions-table .table-heading, .mention-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 150px 18px; align-items: center; gap: 16px; }
.mention-row { width: 100%; min-height: 46px; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mention-code { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mention-row > span:first-child { overflow-wrap: anywhere; }
.mention-row > svg { width: 16px; height: 16px; color: var(--muted); }
.assertion-text { color: var(--muted); font-size: 12px; font-weight: 500; }
.assertion-absent, .assertion-possible, .assertion-historical, .assertion-family_history { color: var(--amber); }
/* A denied family history is reassuring context, not the patient's own finding. */
.note-tag.assertion-family_absent, .assertion-banner.assertion-family_absent { color: var(--muted); background: #e9eceb; }
.assertion-text.assertion-family_absent { color: var(--muted); }
.secondary-section { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 20px; }
.secondary-section > summary { display: flex; align-items: center; gap: 10px; width: fit-content; cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 500; list-style: none; }
.secondary-section > summary::-webkit-details-marker { display: none; }
.secondary-section > summary::after { content: '›'; font-size: 20px; line-height: 1; transition: transform 100ms; }
.secondary-section[open] > summary::after { transform: rotate(90deg); }
.secondary-section .result-table { margin-top: 16px; }
.unlinked-list { list-style: none; padding: 0; margin: 16px 0 0; }
.unlinked-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.unlinked-list strong { font-weight: 500; }
.unlinked-list p { margin-top: 5px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.pending-response { display: flex; align-items: center; gap: 10px; margin-top: 34px; color: var(--muted); }
.pending-response .cancel-request { margin: 0 0 0 auto; padding: 4px 10px; border-radius: 999px; color: var(--muted); }
.pending-response .cancel-request:hover { color: var(--ink); background: var(--soft); }
.pending-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: breathe 1.4s ease-in-out infinite; }
.error-response { margin-top: 32px; }
.error-response h2 { font-size: 20px; font-weight: 500; }
.error-response p { margin-top: 12px; color: var(--muted); overflow-wrap: anywhere; }
.retry-button { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); margin-top: 16px; font-weight: 500; padding: 8px 0; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0; color: var(--muted); border-radius: 8px; }
.icon-button:hover { background: var(--soft); color: var(--ink); }
dialog { color: var(--ink); border: 0; padding: 0; background: white; }
dialog::backdrop { background: #242a2b25; }
.detail-drawer { width: min(380px, 100vw); height: 100vh; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0 0 0 auto; inset: 0; border-left: 1px solid var(--line); box-shadow: -12px 0 36px #242a2b08; }
.detail-drawer::backdrop { background: #242a2b10; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; min-height: 77px; padding: 16px 20px 16px 28px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { font-size: 14px; font-weight: 500; }
.drawer-body { height: calc(100% - 77px); padding: 28px; overflow-y: auto; scrollbar-width: thin; }
.drawer-eyebrow, .detail-label { color: var(--muted); font-size: 12px; font-weight: 400; }
.detail-title { margin-top: 24px; font-size: 24px; line-height: 1.4; font-weight: 500; letter-spacing: -.5px; overflow-wrap: anywhere; }
.detail-section { margin-top: 36px; }
.detail-section p:not(.detail-label) { margin-top: 14px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-copy { display: inline-flex; align-items: center; gap: 12px; margin-top: 12px; padding: 0; color: var(--accent); font-size: 16px; font-weight: 500; text-align: left; }
.code-copy svg { width: 15px; height: 15px; opacity: .65; }
.detail-tag { color: var(--muted); font-size: 12px; margin-top: 8px; }
.detail-rule { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 28px; }
.detail-list { margin: 16px 0 0; padding: 0; list-style: none; }
.detail-list li { margin-bottom: 16px; font-size: 14px; overflow-wrap: anywhere; }
.detail-list .detail-small { margin-top: 3px; }
.detail-small, .drawer-footer { color: var(--muted); font-size: 11px; line-height: 1.7; }
.drawer-footer { margin-top: 56px; }
.assertion-banner { display: block; padding: 12px 14px; margin-top: 28px; border-radius: 8px; color: var(--accent); background: var(--tint); font-size: 13px; font-weight: 500; }
.assertion-banner:not(.assertion-present) { color: var(--amber); background: var(--amber-bg); }
.assertion-banner.assertion-unknown { color: var(--muted); background: #e9eceb; }
.settings-dialog { width: 440px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); border-radius: 14px; margin: auto; box-shadow: 0 20px 80px #242a2b18; overflow-y: auto; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 16px 28px; }
.dialog-header h2 { font-size: 20px; font-weight: 500; }
.settings-body { padding: 12px 28px 28px; }
.settings-body > label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.select-wrap { position: relative; }
.select-wrap > span { pointer-events: none; position: absolute; top: 14px; right: 14px; color: var(--muted); }
.select-wrap svg { width: 15px; height: 15px; }
.select-wrap select { appearance: none; width: 100%; height: 44px; padding: 0 38px 0 14px; border: 1px solid var(--line); background: white; border-radius: 8px; font-size: 13px; }
.field-hint { color: var(--muted); font-size: 12px; margin-top: 14px; line-height: 1.7; }
.candidate-setting { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; }
.candidate-setting label { font-size: 13px; font-weight: 500; }
.candidate-setting input { width: 76px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 13px; }
.settings-footer { margin-top: 32px; font-size: 11px; color: var(--muted); }
.text-button { display: inline-flex; gap: 8px; align-items: center; padding: 8px 0; color: var(--accent); font-size: 12px; margin-top: 20px; }
.text-button svg { width: 14px; height: 14px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; background: var(--ink); color: white; border-radius: 8px; padding: 10px 16px; font-size: 12px; }
.noscript-message { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--amber-bg); padding: 12px 20px; border-radius: 8px; }
.mobile-only { display: none; }
@keyframes breathe { 50% { opacity: .35; } }
@media (max-height: 700px) and (min-width: 761px) {
  .workspace.is-new .content-scroll { padding-top: 64px; }
  .workspace.is-new { overflow-y: auto; }
  .sample-section { margin-top: 24px; }
}
@media (max-width: 1000px) {
  :root { --rail-width: 196px; }
  .content-column { width: calc(100% - 48px); }
  .workspace-header { padding: 0 24px; }
}
@media (max-width: 760px) {
  .mobile-only { display: inline-flex; }
  .sidebar { position: fixed; z-index: 41; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); visibility: hidden; transition: transform 160ms; }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: #242a2b35; }
  .history-header { margin-top: 24px; }
  .history-item { min-height: 42px; }
  .workspace-header { min-height: 64px; padding: 0 16px 0 8px; gap: 8px; }
  .index-label { font-size: 11px; }
  .content-column { width: calc(100% - 40px); }
  .workspace.is-new .content-scroll { padding-top: clamp(56px, 16vh, 144px); }
  .welcome h1 { font-size: 27px; line-height: 1.3; letter-spacing: -.75px; }
  .welcome p { font-size: 14px; }
  .workspace.is-new .composer-region { margin-top: 32px; }
  .composer-region { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .composer { padding: 8px 8px 7px; border-radius: 16px; }
  /* Menus span the composer so they never leave the viewport. */
  .composer { position: relative; }
  .attach-picker, .task-picker { position: static; }
  .popup-menu { left: 0; right: 0; width: auto; max-width: none; bottom: calc(100% + 8px); }
  /* One scrolling row; a sliver of the next card shows there is more. */
  .attachment-tray { flex-wrap: nowrap; max-height: none; overflow: auto hidden; scroll-snap-type: x proximity; }
  .attachment-card { flex: none; width: calc(46% - 4px); scroll-snap-align: start; }
  #message { padding-left: 6px; padding-right: 6px; font-size: 16px; }
  .composer-hint { font-size: 10px; }
  .sample-section { margin-top: 30px; }
  .sample-button { align-items: flex-start; }
  .sample-button svg { margin-top: 2px; }
  .request-content { padding-top: 32px; }
  .user-text { font-size: 16px; }
  .response-task { font-size: 10px; }
  .response-heading { font-size: 21px; }
  .table-heading { grid-template-columns: minmax(0, 1fr) 16px; }
  .table-heading > span:nth-child(2) { display: none; }
  .concept-row { position: relative; grid-template-columns: minmax(0, 1fr) 16px; padding-bottom: 40px; }
  .concept-main strong { font-size: 15px; }
  .concept-code { position: absolute; left: 0; bottom: 12px; font-size: 12px; }
  .concept-row > svg { grid-column: 2; }
  .mentions-table .table-heading, .mention-row { grid-template-columns: minmax(0, 1fr) 80px 105px 16px; gap: 8px; }
  .mentions-table .table-heading > span:nth-child(2) { display: block; }
  .mentions-table .table-heading > span:nth-child(3) { font-size: 10px; }
  .assertion-text { font-size: 11px; }
  .diagnosis-title { flex-wrap: wrap; gap: 4px 12px; }
  .annotation-note { padding: 16px; font-size: 14px; }
  .detail-drawer { width: min(380px, 100vw); }
}
@media (max-height: 560px) and (max-width: 760px) {
  .workspace.is-new { overflow-y: auto; }
  .workspace.is-new .content-scroll { padding-top: 20px; }
}
.markdown { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.7; }
.user-text.markdown, .annotation-note.markdown { white-space: normal; }
.exact-source { margin-top: 16px; }
.exact-source .exact-note { margin-top: 12px; }
.markdown > * + * { margin-top: 12px; }
.markdown p, .detail-section .markdown p, .detail-rule .markdown p { margin-top: 0; white-space: normal; line-height: inherit; }
.markdown p + p, .detail-section .markdown p + p, .detail-rule .markdown p + p { margin-top: 12px; }
.markdown ul, .markdown ol { padding-left: 24px; }
.markdown li + li { margin-top: 4px; }
.markdown :is(h1, h2, h3, h4, h5, h6) { font-size: 16px; font-weight: 600; line-height: 1.5; margin-bottom: 8px; }
.markdown a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.markdown blockquote { padding-left: 14px; border-left: 2px solid var(--line); color: var(--muted); }
.markdown code { padding: 2px 4px; border-radius: 4px; background: #f2f4f3; font: .9em ui-monospace, monospace; }
.markdown pre { max-width: 100%; overflow-x: auto; padding: 12px; border-radius: 8px; background: #f2f4f3; white-space: pre; }
.markdown pre code { padding: 0; background: transparent; }
.markdown table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 13px; }
.markdown th, .markdown td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.markdown th { font-weight: 600; background: #f7f8f7; }
.markdown hr { margin-block: 16px; border: 0; border-top: 1px solid var(--line); }

.encounter-bar { display: grid; gap: 10px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--sidebar); }
.encounter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.encounter-label { width: 96px; flex: none; color: var(--muted); font-size: 11px; font-weight: 500; }
.session-select { flex: 1; min-width: 160px; }
.session-select select { height: 34px; font-size: 13px; }
.session-select > span { top: 10px; }
.chip-button, .attachment-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.chip-button { color: var(--accent); font-weight: 500; }
.chip-button:hover:not(:disabled) { background: var(--tint); }
.chip-button:disabled { color: var(--muted); }
.chip-button svg, .attachment-chip svg { width: 14px; height: 14px; }
.chip-button.is-recording { color: #a2342a; background: #fbe9e6; font-variant-numeric: tabular-nums; }
.attachment-chip { max-width: 100%; background: white; border: 1px solid var(--line); padding-right: 4px; }
.attachment-chip > span { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.attachment-chip > svg { color: var(--muted); }
.attachment-chip.is-busy { color: var(--muted); padding-right: 10px; animation: breathe 1.4s ease-in-out infinite; }
.chip-remove { display: inline-flex; padding: 3px; border-radius: 50%; color: var(--muted); }
.chip-remove:hover { background: var(--soft); color: var(--ink); }
#message:disabled { color: var(--muted); }
.settings-label { margin-top: 28px; }
.text-input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 14px; }
.primary-button { margin-top: 24px; height: 40px; padding: 0 18px; border-radius: 9px; background: var(--accent); color: white; font-weight: 500; }
.primary-button:hover { background: #19594e; }
.encounter-request { display: grid; gap: 10px; margin: 0; }
.encounter-request div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
.encounter-request dt { color: var(--muted); font-size: 12px; padding-top: 2px; }
.encounter-request dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.report-alert { margin-top: 20px; padding: 12px 14px; border-radius: 8px; color: var(--amber); background: var(--amber-bg); font-size: 13px; font-weight: 500; }
.report-warnings { margin: 16px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.report-actions { margin-top: 4px; }
.report-section { margin-top: 32px; }
.report-section .result-table { margin-top: 12px; }
.report-section-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.report-section-title span { color: var(--muted); font-weight: 400; }
.report-section-title:not(.status-current) { color: var(--amber); }
.report-section-title.status-unknown, .report-section-title.status-family_absent { color: var(--muted); }
.source-error { margin-top: 16px; padding: 12px 14px; border-radius: 8px; color: var(--amber); background: var(--amber-bg); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.conflict-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; color: var(--amber); background: var(--amber-bg); font-size: 11px; font-weight: 500; vertical-align: 2px; }
.annotation-note.transcript { display: grid; gap: 10px; }
.turn { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.turn-speaker { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 30px; }
.turn-patient .turn-speaker { color: var(--accent); }
.secondary-section > .annotation-note { margin-top: 16px; }
.source-list li { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.source-quote { margin-top: 4px !important; font-size: 15px; }
@media (max-width: 760px) {
  .encounter-label { width: 100%; }
  .encounter-bar { margin-bottom: 30px; }
  .turn { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .encounter-request div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.backend-setting { display: flex; gap: 8px; align-items: center; }
.backend-setting .text-input { flex: 1; min-width: 0; font-size: 13px; }
.backend-setting .text-button { margin-top: 0; }
