:root {
  color-scheme: light;
  --bg: #f7f2ec;
  --surface: #fffdf9;
  --surface-muted: #f2e4e1;
  --text: #322e29;
  --muted: #80736c;
  --line: #e5d8d2;
  --primary: #2f4858;
  --primary-contrast: #ffffff;
  --success: #3c9663;
  --danger: #c64545;
  --shadow: 0 22px 64px rgba(68, 48, 39, .11);
  --radius: 18px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1a1a1a;
  --surface-muted: #222a2e;
  --text: #e2e2e2;
  --muted: #a9a9af;
  --line: #343434;
  --primary: #9698fc;
  --primary-contrast: #101014;
  --success: #00b279;
  --danger: #ef7777;
  --shadow: 0 22px 64px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .56; }

.shell { width: min(1040px, calc(100% - 36px)); margin: 0 auto; padding: 22px 0 56px; }
.topbar { min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: inline-flex; gap: 11px; align-items: center; color: var(--text); text-decoration: none; font-weight: 760; letter-spacing: .01em; }
.brand-mark { width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--primary) 42%, transparent); color: var(--primary); border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.brand-mark svg { width: 20px; height: 20px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .text-button { border: 1px solid var(--line); color: var(--text); background: color-mix(in srgb, var(--surface) 88%, transparent); min-height: 38px; border-radius: 10px; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.icon-button { width: 38px; padding: 8px; display: grid; place-items: center; }
.icon-button svg { width: 18px; height: 18px; }
.text-button { padding: 0 13px; font-weight: 650; }
.icon-button:hover, .text-button:hover { background: var(--surface-muted); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.hidden { display: none !important; }

.hero { max-width: 755px; margin: clamp(56px, 12vw, 126px) auto 28px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--primary); font-size: 13px; font-weight: 760; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(36px, 6vw, 68px); letter-spacing: -.055em; line-height: 1.02; font-weight: 760; }
.lead { margin: 18px auto 0; color: var(--muted); max-width: 620px; font-size: clamp(16px, 2.1vw, 19px); }

.ask-panel { max-width: 900px; margin: 0 auto; position: relative; }
.question-card { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); border-radius: 18px; padding: 12px; }
.question-card:focus-within { border-color: color-mix(in srgb, var(--primary) 60%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent), var(--shadow); }
#question { width: 100%; min-height: 126px; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--text); padding: 10px 10px 4px; font-size: 17px; line-height: 1.55; }
#question::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 4px; }
.composer-tip { color: var(--muted); font-size: 12px; }
.primary-button { border: 0; background: var(--primary); color: var(--primary-contrast); min-height: 42px; padding: 0 17px; border-radius: 10px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; font-weight: 720; transition: filter .16s ease, transform .16s ease; }
.primary-button:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.primary-button svg { width: 18px; height: 18px; }
.quick-prompts { max-width: 900px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px auto 0; }
.prompt { color: var(--text); border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 12px; font-size: 13px; }
.prompt:hover { border-color: var(--primary); color: var(--primary); }

.result { max-width: 900px; margin: 34px auto 0; }
.result[hidden] { display: none; }
.answer-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 36px); box-shadow: 0 14px 42px rgba(0,0,0,.06); }
.answer-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 15px; margin-bottom: 23px; border-bottom: 1px solid var(--line); }
.answer-header h2 { margin: 0; font-size: 16px; letter-spacing: .01em; }
.answer-meta { color: var(--muted); font-size: 13px; }
.markdown { font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
.markdown h1, .markdown h2, .markdown h3 { font-family: Inter, ui-sans-serif, sans-serif; letter-spacing: -.02em; line-height: 1.2; margin: 1.65em 0 .6em; font-size: 1.22em; color: var(--primary); }
.markdown h1 { font-size: 1.45em; }
.markdown p { margin: 0 0 1.05em; }
.markdown ul, .markdown ol { padding-left: 1.3em; margin: 0 0 1em; }
.markdown li + li { margin-top: .35em; }
.markdown strong { color: var(--primary); }
.markdown table { display: block; width: 100%; overflow-x: auto; border-collapse: separate; border-spacing: 0; margin: 1.2em 0; border: 1px solid var(--line); border-radius: 10px; }
.markdown th, .markdown td { padding: 10px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; min-width: 140px; }
.markdown th { background: var(--surface-muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 13px; }
.markdown tr:last-child td { border-bottom: 0; }.markdown th:last-child, .markdown td:last-child { border-right: 0; }
.markdown code { background: var(--surface-muted); padding: .1em .3em; border-radius: 4px; font-size: .86em; }.markdown pre { overflow: auto; padding: 14px; background: var(--surface-muted); border-radius: 10px; }
.sources { margin-top: 18px; display: grid; gap: 8px; }
.source { background: color-mix(in srgb, var(--surface) 75%, var(--surface-muted)); border: 1px solid var(--line); padding: 11px 13px; border-radius: 10px; font-size: 13px; color: var(--muted); }
.source strong { color: var(--text); }

.overlay { position: fixed; inset: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 74%, transparent); display: grid; place-items: center; padding: 18px; backdrop-filter: blur(7px); }
.modal { width: min(460px, 100%); max-height: min(700px, calc(100vh - 36px)); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 18px; padding: 24px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }.modal h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }.modal p { color: var(--muted); margin: 7px 0 0; font-size: 14px; }
.form { display: grid; gap: 13px; }.field { display: grid; gap: 6px; }.field label { font-size: 13px; font-weight: 650; }.field input { width: 100%; min-height: 43px; background: transparent; border: 1px solid var(--line); border-radius: 9px; color: var(--text); outline: 0; padding: 0 11px; }.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 5px; }.link-button { padding: 0; border: 0; background: none; color: var(--primary); font-weight: 680; }.form-message { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; }.price-line { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }.price-line strong { font-size: 22px; color: var(--primary); }
.auth-forgot { justify-self: start; font-size: 13px; }
.verification-modal { text-align: center; }.verification-modal .modal-head { text-align: left; }.verification-mark { width: 56px; height: 56px; display: grid; place-items: center; margin: 4px auto 16px; border-radius: 16px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); font-size: 28px; }.verification-copy { max-width: 370px; margin: 0 auto 14px !important; }
.account-modal { width: min(680px, 100%); }.account-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -24px 20px; padding: 0 24px; overflow-x: auto; }.account-tab { flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; padding: 10px 8px 11px; font-weight: 700; }.account-tab.active { color: var(--primary); border-bottom-color: var(--primary); }.panel-copy, .panel-actions > p { margin: 0; color: var(--muted); font-size: 14px; }.panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }.account-list { display: grid; gap: 8px; }.account-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: color-mix(in srgb, var(--surface) 78%, var(--surface-muted)); }.account-item h3 { margin: 0 0 4px; font-size: 14px; }.account-item p, .account-item small { margin: 0; color: var(--muted); font-size: 12px; }.account-item-actions { display: flex; justify-content: flex-end; margin-top: 8px; }.access-card { border: 1px solid color-mix(in srgb, var(--primary) 36%, var(--line)); border-radius: 12px; padding: 14px; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); margin-bottom: 14px; }.access-card strong { display: block; color: var(--primary); }.access-card span { color: var(--muted); font-size: 13px; }.full-width { width: 100%; margin-top: 14px; }.danger-zone { margin-top: 20px; border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); border-radius: 10px; padding: 13px; }.danger-zone p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }.danger-link, .danger-button { color: var(--danger); }.danger-button { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.toast { position: fixed; z-index: 20; right: 18px; bottom: 18px; max-width: min(420px, calc(100% - 36px)); padding: 12px 14px; border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 14px; transform: translateY(140%); opacity: 0; transition: transform .2s ease, opacity .2s ease; }.toast.show { transform: translateY(0); opacity: 1; }.toast.success { background: var(--success); }.toast.error { background: var(--danger); }
.loading { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); padding: 8px 0; }.spinner { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: spin .75s linear infinite; }@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) { .shell { width: min(100% - 24px, 1040px); padding-top: 12px; }.topbar { min-height: 48px; }.hero { margin-top: 66px; }.composer-footer { align-items: flex-end; }.composer-tip { max-width: 150px; }.quick-prompts { justify-content: flex-start; }.answer-card { border-radius: 14px; }.form-grid { grid-template-columns: 1fr; }.modal { padding: 20px; }.top-actions .text-button { padding: 0 10px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Application workspace */
.shell { width: min(1180px, calc(100% - 40px)); padding-top: 18px; }
.topbar { position: sticky; top: 0; z-index: 4; min-height: 62px; padding: 8px 0; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px); }
.top-nav-button { border: 0; background: transparent; color: var(--muted); min-height: 38px; padding: 0 10px; font-weight: 730; }.top-nav-button.active { color: var(--primary); }
.hero { max-width: none; margin: 52px 0 28px; display: flex; align-items: end; justify-content: space-between; gap: 22px; text-align: left; }.hero h1 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.045em; }.hero .lead { max-width: 600px; margin: 10px 0 0; font-size: 15px; }.hero .eyebrow { margin-bottom: 8px; font-size: 11px; }.account-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 11px; color: var(--muted); font-size: 12px; font-weight: 650; }.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }.account-state.active .state-dot { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 14%, transparent); }.account-state.attention .state-dot { background: #d08c2e; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: start; gap: 22px; }.workspace-main { min-width: 0; }.composer-label { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 9px; color: var(--muted); font-size: 12px; font-weight: 760; text-transform: uppercase; letter-spacing: .075em; }.composer-label .link-button { font-size: 12px; text-transform: none; letter-spacing: normal; }
.ask-panel, .result { max-width: none; }.question-card { border-radius: 8px; padding: 14px; box-shadow: 0 14px 34px rgba(35, 43, 48, .09); }.question-card:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent), 0 14px 34px rgba(35, 43, 48, .09); }.question-card #question { min-height: 150px; padding: 8px 6px 12px; font-size: 16px; }.composer-footer { border-top: 1px solid var(--line); padding: 10px 4px 2px; }.primary-button { min-height: 40px; border-radius: 7px; }.quick-prompts { justify-content: flex-start; margin-top: 12px; }.prompt { border-radius: 7px; background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 7px 10px; }
.result { margin-top: 26px; }.answer-card { border-radius: 8px; padding: clamp(20px, 3vw, 32px); }.answer-header h2 { font-size: 18px; margin-top: 2px; }.answer-kicker { display: block; color: var(--primary); font-size: 11px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }.source { border-radius: 8px; }
.workspace-sidebar { display: grid; gap: 12px; position: sticky; top: 82px; }.sidebar-card { border: 1px solid var(--line); border-radius: 8px; padding: 15px; background: var(--surface); }.sidebar-card-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--text); font-size: 13px; font-weight: 760; }.sidebar-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); font-weight: 800; }.sidebar-card strong { display: block; font-size: 14px; margin-bottom: 5px; }.sidebar-card p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.55; }.sidebar-action { width: 100%; }.sidebar-note { display: flex; gap: 9px; padding: 3px 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }.sidebar-note > span:first-child { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid var(--line); border-radius: 50%; font-weight: 800; font-size: 10px; }
@media (max-width: 840px) { .workspace-grid { grid-template-columns: 1fr; }.workspace-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }.sidebar-note { grid-column: 1 / -1; }.hero { margin-top: 34px; }.topbar { position: static; background: transparent; backdrop-filter: none; } }
@media (max-width: 640px) { .shell { width: min(100% - 24px, 1180px); }.top-actions { gap: 5px; }.top-nav-button { display: none; }.hero { align-items: flex-start; flex-direction: column; gap: 14px; margin: 28px 0 24px; }.hero h1 { font-size: 30px; }.account-state { align-self: stretch; justify-content: center; }.workspace-sidebar { grid-template-columns: 1fr; }.sidebar-note { grid-column: auto; }.question-card #question { min-height: 132px; }.composer-tip { max-width: 185px; }.quick-prompts { gap: 6px; }.answer-card { padding: 18px; } }

/* Response and clinical workspace details */
.composer-note { display: flex; align-items: center; gap: 7px; margin: 12px 2px 0; color: var(--muted); font-size: 12px; }
.composer-note svg { width: 15px; height: 15px; color: var(--primary); flex: 0 0 auto; }
.sources:not(:empty)::before { content: 'Supporting sources'; display: block; padding: 2px 2px 1px; color: var(--muted); font-size: 11px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.answer-loading { display: grid; gap: 12px; color: var(--muted); }
.answer-loading > div { display: flex; align-items: center; gap: 9px; color: var(--text); }
.answer-loading p { margin: -4px 0 3px; font-size: 14px; }
.answer-loading > span { display: block; height: 11px; border-radius: 3px; background: linear-gradient(90deg, var(--surface-muted), color-mix(in srgb, var(--primary) 10%, var(--surface-muted)), var(--surface-muted)); background-size: 200% 100%; animation: answer-pulse 1.2s ease-in-out infinite; }
.answer-loading > span:nth-of-type(2) { width: 87%; }
.answer-loading > span:nth-of-type(3) { width: 62%; }
@keyframes answer-pulse { to { background-position: -200% 0; } }
.answer-error { border-left: 3px solid var(--danger); padding: 2px 0 2px 13px; }
.answer-error strong { color: var(--danger); }
.answer-error p { margin: 5px 0 0; color: var(--muted); }

/* Replace temporary text glyphs with lightweight interface icons. */
.sidebar-icon { color: transparent; position: relative; }
.sidebar-icon::before, .sidebar-icon::after { content: ''; position: absolute; box-sizing: border-box; }
.access-summary .sidebar-icon::before { width: 15px; height: 11px; border: 1.7px solid var(--primary); border-radius: 2px; }
.access-summary .sidebar-icon::after { width: 15px; height: 1.7px; background: var(--primary); top: 11px; }
.sidebar-card:not(.access-summary) .sidebar-icon::before { width: 14px; height: 14px; border: 1.7px solid var(--primary); border-radius: 50%; }
.sidebar-card:not(.access-summary) .sidebar-icon::after { width: 4px; height: 5px; border-right: 1.7px solid var(--primary); border-bottom: 1.7px solid var(--primary); left: 12px; top: 7px; }
.sidebar-note > span:first-child { color: transparent; position: relative; }
.sidebar-note > span:first-child::before { content: ''; position: absolute; width: 13px; height: 13px; border: 1.4px solid var(--muted); border-radius: 50%; }
.sidebar-note > span:first-child::after { content: 'i'; position: absolute; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1; }

@media (max-width: 640px) {
  .composer-note { font-size: 11px; }
  .sources:not(:empty)::before { margin-top: 2px; }
}
