/* VCIS case application — mobile demo layout (VCIS-DEMO-UI-BATCH-001) in the VCIS-UI-023 colours and type.
   No external assets and no script. Bottom-menu icons are the application's own
   SVG shapes (web.py _icon / _workspace_nav). */
:root {
  color-scheme: light dark;
  --a: #1f62d6;          /* action: links, focus, active states */
  --btn: #1f62d6;        /* primary button */
  --a-text: #ffffff;     /* text on the primary button */
  --a-soft: #e6eefb;
  --m: #55696e;          /* muted text */
  --b: #dce4e3;          /* borders */
  --bg: #f2f5f4;
  --app: #f2f5f4;
  --surface: #ffffff;
  --surface-2: #e7eef0;  /* the clinician's own messages */
  --text: #13272c;
  --field-border: #c5d1d0;
  --placeholder: #5c6f73;
  --red: #b42318;
  --red-bg: #fdecea;
  --red-border: #f0b4ac;
  --red-text: #5f1710;
  --amber: #8a5a00;
  --amber-bg: #fff3d1;
  --amber-border: #ebd9a4;
  --amber-text: #644600;
  --green: #0e7a62;      /* book source and confirmations only */
  --green-bg: #e3f3ee;
  --green-border: #a9d8cb;
  --green-text: #0b5a49;
  --info-border: #b9cdf3;
  --info-text: #173f8a;
  --demo-bg: #fff3d1;
  --demo-text: #644600;
  --nav-bg: #fffffff2;
  --side-bg: #ffffff;    /* the menu follows the scheme */
  --side-text: #13272c;
  --side-muted: #55696e;
  --side-border: #dce4e3;
  --side-hover: #e7eef0;
  --side-accent: #1f62d6;
  --shadow: 0 1px 2px rgba(16, 42, 50, .06), 0 10px 28px rgba(16, 42, 50, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  /* One type scale (VCIS-UI-POLISH-001). */
  --fs-meta: 13px;
  --fs-small: 14px;
  --fs-base: 16px;
  --fs-title: 28px;
}
/* VCIS-UI-023: the dark tokens. Used when the clinician chose "Gece", and for a system set to dark unless the
   clinician chose "Aydınlık" (the choice is the data-theme attribute the page carries). */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --a: #8dbbff;
  --btn: #2f6fdb;
  --a-text: #ffffff;
  --a-soft: #1c3558;
  --m: #9ab3b7;
  --b: #27434a;
  --bg: #0d1b20;
  --app: #0d1b20;
  --surface: #14272d;
  --surface-2: #1d343b;
  --text: #e4eeef;
  --field-border: #345058;
  --placeholder: #819ca1;
  --red: #ff8a7a;
  --red-bg: #3a1f1b;
  --red-border: #7a3a30;
  --red-text: #ffd9d2;
  --amber: #f2c14e;
  --amber-bg: #2a1f0a;
  --amber-border: #4a3a14;
  --amber-text: #f0d9a0;
  --green: #63d9a8;
  --green-bg: #16352e;
  --green-border: #2f6a57;
  --green-text: #bff0dc;
  --info-border: #35558f;
  --info-text: #cfe0ff;
  --demo-bg: #2a1f0a;
  --demo-text: #f2c14e;
  --nav-bg: #0f1e24f2;
  --side-bg: #0a1519;
  --side-text: #e6f0f0;
  --side-muted: #9db5b8;
  --side-border: #1d3239;
  --side-hover: #14272d;
  --side-accent: #4a8af0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --a: #8dbbff;
    --btn: #2f6fdb;
    --a-text: #ffffff;
    --a-soft: #1c3558;
    --m: #9ab3b7;
    --b: #27434a;
    --bg: #0d1b20;
    --app: #0d1b20;
    --surface: #14272d;
    --surface-2: #1d343b;
    --text: #e4eeef;
    --field-border: #345058;
    --placeholder: #819ca1;
    --red: #ff8a7a;
    --red-bg: #3a1f1b;
    --red-border: #7a3a30;
    --red-text: #ffd9d2;
    --amber: #f2c14e;
    --amber-bg: #2a1f0a;
    --amber-border: #4a3a14;
    --amber-text: #f0d9a0;
    --green: #63d9a8;
    --green-bg: #16352e;
    --green-border: #2f6a57;
    --green-text: #bff0dc;
    --info-border: #35558f;
    --info-text: #cfe0ff;
    --demo-bg: #2a1f0a;
    --demo-text: #f2c14e;
    --nav-bg: #0f1e24f2;
    --side-bg: #0a1519;
    --side-text: #e6f0f0;
    --side-muted: #9db5b8;
    --side-border: #1d3239;
    --side-hover: #14272d;
    --side-accent: #4a8af0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);
  }
}
/* Keep a focused or targeted element clear of the fixed bottom menu. */
html { scroll-padding-bottom: 96px; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, textarea, select { font: inherit; }
a { color: var(--a); }
img, table { max-width: 100%; }
.app { max-width: 720px; min-height: 100dvh; margin: 0 auto; background: var(--app); }
.skip-link { position: absolute; left: 12px; top: -120px; z-index: 40; padding: 12px; background: var(--surface);
  border: 2px solid var(--a); border-radius: 8px; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Banner and header (demo). */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 0; }
.brand { font-size: 22px; font-weight: 800; color: var(--text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.brand-mark { color: var(--a); margin-right: 4px; }
.top-side { display: flex; gap: 12px; align-items: flex-start; text-align: right; }
.clock { color: var(--m); font-size: 13px; line-height: 1.45; }
.account-area:empty { display: none; }
.logout { display: inline-flex; margin: 0; }
.logout button { min-height: 40px; padding: 6px 12px; font-size: 12px; }

/* Main column. */
.wrap { padding: 12px 22px calc(110px + env(safe-area-inset-bottom)); }
.sign-in .wrap { padding-bottom: 40px; }
/* VCIS-CL-FLOW-COMPOSER-PIN-001: .composer-dock is now pinned to the viewport (see below), so a page that has one
   needs its trailing content (the dose calculator, footer links) kept clear of it. The dock's own height varies
   (staged files, a grown textarea), so dev-flow.js measures it into --composer-h; the 140px fallback covers the
   un-measured first paint. Wins over .sign-in .wrap above: same specificity, declared after. */
.wrap:has(.composer-dock) { padding-bottom: calc(var(--composer-h, 140px) + 16px + env(safe-area-inset-bottom)); }
h1 { font-size: 30px; line-height: 1.2; margin: 14px 0 8px; overflow-wrap: anywhere; }
h2 { font-size: 19px; margin: 25px 0 12px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
p { margin: 8px 0; }
small, .muted, .sub, .hint { color: var(--m); }
.sub { font-size: 13px; margin-top: 4px; display: block; }
.hint { font-size: 13px; margin: 4px 0 0; display: block; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.arrow { color: var(--m); font-size: 23px; line-height: 1; }
.empty { padding: 22px; color: var(--m); text-align: center; margin: 0; }

/* Panels, rows and cards. */
.panel, .card { background: var(--surface); border: 1px solid var(--b); border-radius: 14px; overflow: hidden; margin: 14px 0; }
.pad, .panel.pad { padding: 17px; }
.row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 17px; color: var(--text);
  text-decoration: none; background: none; border: 0; border-bottom: 1px solid var(--b); }
.row:last-child { border-bottom: 0; }
.row .ui-icon { color: var(--a); }
.row .sub { margin-top: 2px; }
.case-list { list-style: none; padding: 0; margin: 0; }
.patient-card { padding: 0; }
.case-link { display: flex; flex-direction: column; gap: 3px; padding: 17px; color: var(--text); text-decoration: none; }
.case-name { font-size: 23px; font-weight: 700; overflow-wrap: anywhere; }
.case-meta { color: var(--m); font-size: 14px; overflow-wrap: anywhere; }
.reason { margin: 6px 0 2px; overflow-wrap: anywhere; }
.case-id { color: var(--m); font-size: 12px; overflow-wrap: anywhere; }
.patient-card > .link { display: block; padding: 0 17px 14px; }
.next { display: block; font-size: 13px; border-radius: 8px; padding: 10px; background: var(--surface-2); margin-top: 13px; }
.next.green, .green { color: var(--green); }
.next.green { background: var(--green-bg); }
.list-head { margin: 6px 0 4px; }
.count-chip { padding: 4px 10px; border: 1px solid var(--b); border-radius: 22px; color: var(--m); font-size: 12px; }
.list-note { margin-top: 16px; }
.clinical-note { display: flex; gap: 12px; align-items: flex-start; color: var(--m); padding-top: 14px; margin-top: 18px;
  border-top: 1px solid var(--b); }
.clinical-note .ui-icon { color: var(--a); }
.clinical-note p { font-size: 12px; margin: 0; }
.clinical-note strong { display: block; color: var(--text); font-size: 13px; }

/* Buttons and links. */
button, .button { display: inline-block; font-weight: 750; border: 0; border-radius: 11px; padding: 14px 18px;
  min-height: 44px; cursor: pointer; text-decoration: none; text-align: center; background: var(--btn); color: var(--a-text); }
.button.primary, button.primary, .actions button[type="submit"]:first-child { display: block; width: 100%; margin: 16px 0 0; }
.button.secondary, button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--b); }
.button.small, button.small { padding: 8px 12px; min-height: 40px; font-size: 14px; }
button:disabled { opacity: .55; cursor: not-allowed; }
.link, .back { display: inline-block; background: none; border: 0; color: var(--a); padding: 9px 0; min-height: 44px;
  text-decoration: none; }
.link.small { font-size: 14px; min-height: 36px; }
.back { color: var(--m); }
.pill-button { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 22px;
  border: 1px solid var(--a); color: var(--a); background: var(--a-soft); font-size: 14px; font-weight: 650;
  text-decoration: none; white-space: nowrap; }
.actions { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 24px; }
.actions .hint { text-align: center; }

/* Forms (demo). */
label { display: block; font-size: 13px; color: var(--m); margin: 16px 0 6px; }
.field { min-width: 0; }
.field > label { margin-top: 16px; }
input, textarea, select { display: block; width: 100%; background: var(--app); border: 1px solid var(--field-border);
  color: inherit; border-radius: 10px; padding: 12px; min-height: 44px; }
input[type="file"] { padding: 10px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
textarea { min-height: 100px; resize: vertical; }
input[type="radio"], input[type="checkbox"] { width: auto; min-height: 0; display: inline-block; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid > * { min-width: 0; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
legend { font-size: 13px; color: var(--m); padding: 0; margin-bottom: 6px; }
.req { color: var(--red); }
[aria-invalid="true"] { border-color: var(--red); outline: 1px solid var(--red); }
.field-error { color: var(--red); font-size: 13px; margin: 4px 0 0; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); margin: 8px 0; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; }
.attest { background: var(--surface); border: 1px solid var(--b); border-radius: 12px; padding: 12px 14px; margin-top: 22px; }
.attest legend { padding: 0 4px; }
.neuter-options { margin: 16px 0 0; }
.neuter-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.neuter-options label { margin: 0; position: relative; cursor: pointer; flex: 1; min-width: 140px; color: var(--text); }
.neuter-options input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; border: 0; }
.neuter-options span { display: block; text-align: center; border: 1px solid var(--field-border); background: var(--app);
  border-radius: 10px; padding: 12px; }
.neuter-options input:checked + span { border-color: var(--a); background: var(--a-soft); color: var(--a); }
.neuter-options input:focus-visible + span { outline: 2px solid var(--a); outline-offset: 3px; }
.species-other { display: none; }
.intake-form:has(#species option[value="Diğer"]:checked) .species-other,
.species-other:has([aria-invalid="true"]), .species-other:has(input:not([value=""])) { display: block; }
@supports not selector(:has(*)) { .species-other { display: block; } }
.arrival-time { color: var(--m); font-size: 14px; margin: 12px 0; }
.arrival-time strong { color: var(--text); }
.ocr-panel h2 { margin-top: 0; }
.ocr-panel button { width: 100%; margin-top: 10px; }
.ocr-mark { color: var(--amber); font-size: 12px; margin: 4px 0 0; }
.ocr-check { color: var(--red); font-size: 12px; font-weight: 600; margin: 4px 0 0; }

/* Notices. */
.notice { background: var(--amber-bg); border: 1px solid var(--amber-border); padding: 14px; border-radius: 12px; color: var(--amber-text);
  margin: 16px 0; font-size: 14px; }
.notice.error { background: var(--red-bg); border-color: var(--red-border); color: var(--red-text); font-weight: 600; }
.notice.success { background: var(--green-bg); border-color: var(--green-border); color: var(--green-text); font-weight: 600; }
.notice.info { background: var(--a-soft); border-color: var(--info-border); color: var(--info-text); }
.notice a { color: inherit; }
.error-summary { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red-text); border-radius: 12px;
  padding: 8px 16px; margin: 12px 0; }
.error-summary a { color: var(--red-text); font-weight: 600; }
.error-summary ul { margin: 4px 0; padding-left: 20px; }

/* Bottom menu (demo layout, the application's own SVG icons). */
.workspace-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 20; max-width: 720px;
  width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--nav-bg);
  border-top: 1px solid var(--b); padding: 10px 4px max(12px, env(safe-area-inset-bottom)); backdrop-filter: blur(12px); }
.workspace-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--m);
  text-decoration: none; padding: 6px 0; min-height: 48px; }
.workspace-nav .ui-icon { width: 24px; height: 24px; }
.workspace-nav a[aria-current="page"] { color: var(--a); }
.ui-icon { width: 22px; height: 22px; flex: none; vertical-align: middle; }

/* Search. */
.search { margin: 20px 0 14px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.search-row button { flex: none; padding: 10px 16px; }
.empty-state { padding: 32px 18px; text-align: center; border: 1px dashed var(--b); border-radius: 14px; }
.empty-state > .ui-icon { width: 32px; height: 32px; color: var(--m); }
.empty-state h3 { margin: 12px 0 5px; }
.empty-state p { color: var(--m); font-size: 13px; margin: 0; }

/* Patient card header, chips and dialog. */
/* Patient header (VCIS-PATIENT-UI-002, approved demo "Öneri"): compact head,
   one meta line, identity details on demand. */
.case-header { margin: 4px 0 0; }
.ph-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.ph-identity { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 22rem; }
.ph-avatar { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 16px;
  background: var(--a-soft); border: 1px solid var(--b); color: var(--a); font: italic 30px/1 Georgia, serif; }
.ph-name { min-width: 0; }
.case-header h1 { margin: 0; font-size: var(--fs-title); line-height: 1.15; overflow-wrap: break-word; }
.ph-signalment { margin: 4px 0 0; color: var(--m); font-size: var(--fs-small); line-height: 1.6; }
.ph-signalment strong { color: var(--text); font-weight: 600; }
.ph-when { color: var(--m); font-size: var(--fs-meta); }
.sep { color: var(--placeholder); padding: 0 6px; }
.ph-action { flex: none; padding-top: 2px; }
.ph-action form button { padding: 8px 12px; min-height: 40px; font-size: 14px; }
.ph-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 14px 0 0; padding-bottom: 4px;
  font-size: var(--fs-meta); color: var(--m); }
.ph-meta > span { overflow-wrap: anywhere; }
.ph-id { font-family: ui-monospace, Consolas, monospace; color: var(--text); letter-spacing: .02em; }
.ph-details { margin-left: auto; }
.ph-details > summary { min-height: 44px; font-size: var(--fs-meta); font-weight: 600; }
.ph-details[open] { flex-basis: 100%; margin-left: 0; }
.ph-details-body { background: var(--surface); border: 1px solid var(--b); border-radius: 10px; padding: 4px 14px 10px; }
.ph-details-body .link.small { display: inline-flex; align-items: center; min-height: 44px; margin-right: 16px; }
.ph-note { margin: 2px 0 0; font-size: var(--fs-meta); color: var(--m); }
.clinical-link { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; }
.clinical-link .hint { flex-basis: 100%; margin: 0; padding-left: 28px; font-size: 11px; }
.admission-state { color: var(--green); font-weight: 600; font-size: var(--fs-meta); margin: 0; padding: 6px 9px;
  border: 1px solid var(--green-border); border-radius: 6px; background: var(--green-bg); }
.pill-button { border-radius: 8px; }
/* Section tabs: a plain underline bar (demo). */
.case-tabs { display: flex; gap: 28px; overflow-x: auto; margin: 6px 0 22px; border-bottom: 1px solid var(--b); }
.case-tabs a { position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 0 2px;
  color: var(--m); text-decoration: none; white-space: nowrap; font-size: 15px; }
.case-tabs a[aria-current="page"] { color: var(--text); font-weight: 650; }
.case-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--a); }
.overlay { display: none; position: fixed; inset: 0; background: #000a; place-items: center; padding: 20px; z-index: 30; }
.overlay:target { display: grid; }
.dialog { width: 100%; max-width: 420px; max-height: 85dvh; overflow: auto; background: var(--surface);
  border: 1px solid var(--b); border-radius: 18px; padding: 23px; }
.dialog h2 { margin-top: 0; }
.dialog form button { width: 100%; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; color: var(--a);
  overflow-wrap: anywhere; }
details.more { margin: 10px 0 0; }
details.panel > summary { color: var(--text); }
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--b); vertical-align: top;
  overflow-wrap: anywhere; font-size: 14px; }
.kv th { width: 45%; font-weight: 500; color: var(--m); }
.kv caption { text-align: left; color: var(--m); font-size: 13px; padding: 8px 0 2px; }
.measures td.not-done { color: var(--amber); }

/* Özet (VCIS-PATIENT-UI-002): reason, the latest examination as one unit, side file. */
.patient-layout { display: block; }
.content-col, .context-col { min-width: 0; }
.visit-reason { margin: 0 0 24px; padding-left: 14px; border-left: 2px solid var(--a); }
.visit-reason .eyebrow { font-size: 11px; }
.visit-reason h2 { margin: 4px 0; font-size: 20px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.visit-reason p:last-child { margin: 0; font-size: var(--fs-meta); color: var(--m); }
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-top h2 { margin: 0; font-size: 17px; }
.text-action { display: inline-flex; align-items: center; min-height: 44px; color: var(--a); font-size: var(--fs-small);
  font-weight: 650; text-decoration: none; }
.record-meta { margin: 0 0 12px; font-size: var(--fs-meta); color: var(--m); }
.record-meta a { display: inline-block; padding: 4px 0; }
.measurements { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 6px; padding: 14px 0;
  border-top: 1px solid var(--b); border-bottom: 1px solid var(--b); }
.measurements > div { min-width: 0; padding: 0 10px; border-right: 1px solid var(--b); }
.measurements > div:first-child { padding-left: 0; }
.measurements > div:last-child { padding-right: 0; border-right: 0; }
.measurements dt { font-size: 12px; color: var(--m); }
.measurements dd { margin: 3px 0 0; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.measurements .unit { font-size: 12px; font-weight: 400; color: var(--m); }
.missing-value { color: var(--amber); font-size: var(--fs-meta); font-weight: 400; }
.measurements + .hint { margin: 0 0 16px; font-size: 12px; }
.note-block { padding: 0 0 14px; margin: 0 0 14px; border-bottom: 1px solid var(--b); }
.note-block h3 { margin: 0 0 6px; font-size: var(--fs-meta); color: var(--m); font-weight: 600; }
.note-block p { margin: 0; font-size: 15px; line-height: 1.65; }
.exam-details { border-bottom: 1px solid var(--b); padding-bottom: 6px; margin-bottom: 18px; }
.exam-details > summary { font-size: var(--fs-small); }
.empty-inline { margin: 8px 0 18px; padding: 16px 0; color: var(--m); font-size: var(--fs-small);
  border-top: 1px solid var(--b); }
.context-col { margin-top: 26px; }
.context-panel { background: var(--surface); border: 1px solid var(--b); border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; }
.context-panel h2 { margin: 0 0 6px; font-size: 15px; }
.context-item { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 0; color: var(--text);
  text-decoration: none; border-bottom: 1px solid var(--b); }
.context-item:last-child { border-bottom: 0; }
.context-item strong { display: block; font-size: var(--fs-small); font-weight: 600; }
.context-item small { display: block; font-size: 12px; }
.context-item .ui-icon { color: var(--m); width: 18px; height: 18px; }
.activity-panel { background: none; border: 0; padding: 4px 0 0; }
.activity-list { list-style: none; margin: 12px 0 8px; padding: 0; }
.activity-list li { position: relative; padding: 0 0 16px 16px; border-left: 1px solid var(--b); font-size: var(--fs-small);
  overflow-wrap: anywhere; }
.activity-list li::before { content: ""; position: absolute; left: -3px; top: 6px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--m); }
.activity-list li:first-child::before { background: var(--a); }
.activity-list li:last-child { padding-bottom: 0; border-left-color: transparent; }
.activity-list time { display: block; font-size: 12px; color: var(--m); }
/* Wide screens: the case pages use the demo's wider workbench; Özet gets its side column. */
@supports selector(:has(*)) {
  @media (min-width: 1000px) {
    .app:has(.case-shell) { max-width: 1120px; }
    .patient-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; }
    .context-col { margin-top: 0; }
    .tab-body { max-width: 680px; }
  }
}

/* Patient card, visits and stays (VCIS-PATIENT-VISITS-001). */
.open-file { margin: 10px 0 0; padding: 8px 12px; border-left: 2px solid var(--a); background: var(--surface);
  border-radius: 0 8px 8px 0; font-size: var(--fs-meta); color: var(--m); overflow-wrap: anywhere; }
.open-file strong { color: var(--text); }
.open-file .eyebrow { display: block; font-size: 11px; }
.open-file a { display: inline-block; padding: 4px 0; }
.legacy-stay { font-size: var(--fs-meta); margin: 10px 0 0; }
.status-pill { display: inline-flex; align-items: center; font-size: 12px; border: 1px solid var(--b); color: var(--m);
  padding: 2px 8px; border-radius: 6px; background: var(--surface-2); }
.status-pill.ward { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.status-pill.unknown { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.arrival-actions { margin: 18px 0 8px; }
.arrival-actions h2 { margin: 0 0 10px; font-size: 17px; }
.arrival-actions > .button { display: block; width: 100%; margin: 10px 0 0; }
.visit-choice > summary { color: var(--text); }
.visit-choice .check span { overflow-wrap: anywhere; }
.visit-choice .check .sub { margin: 0; font-size: 12px; }
.visit-list { list-style: none; margin: 0; padding: 0; }
.visit-row { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--b);
  color: var(--text); text-decoration: none; }
.visit-row strong { display: block; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.visit-date { display: block; font-size: var(--fs-meta); color: var(--m); }
.visit-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 6px 0 4px; }
.visit-status .sub { margin: 0; }
.stay-history { margin: 6px 0 0; padding-left: 18px; }
.stay-history li { margin: 4px 0; overflow-wrap: anywhere; }

/* Records. */
.record h2 { margin: 0; font-size: 18px; }
.record-time { margin: 14px 0 6px; font-size: 14px; }
.kv-block { margin: 10px 0; }
.kv-block .sub { margin: 0; }
.verbatim { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.doc-list { list-style: none; padding: 0; margin: 6px 0 0; }
.doc-list li { padding: 8px 0; border-bottom: 1px solid var(--b); overflow-wrap: anywhere; }
.doc-list li:last-child { border-bottom: 0; }
.doc-list .sub { font-size: 12px; }
.statements, .history { list-style: none; padding: 0; margin: 0; }
.statement { padding: 12px 14px; margin: 0 0 8px; }
.st-head { font-weight: 650; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.missing { font-style: italic; margin: 8px 0; }
.st-meta { color: var(--m); font-size: 12px; margin: 0; }
.badge { background: var(--green-bg); color: var(--green); font-size: 12px; border-radius: 999px; padding: 2px 8px; }
.versions { margin: 10px 0 16px; overflow-wrap: anywhere; }
.history li { padding: 4px 0; overflow-wrap: anywhere; }
.history li.current { font-weight: 700; }
.digest { color: var(--m); font-family: ui-monospace, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.next-note { margin: 14px 0 4px; }
details.more.added { margin: 12px 0 0; }
details.group > summary.needs-action { color: var(--red); }
details.entry { padding: 8px 16px 4px; }
details.entry > summary h2 { margin: 0; color: var(--text); }

/* Clinical-loop assessment area (development, synthetic). */
.evaluation { padding: 17px; border-left: 3px solid var(--amber); }
.evaluation h2 { margin-top: 0; }
.evaluation h3 { margin: 20px 0 8px; }
.assessment { border-left: 3px solid var(--a); padding: 4px 0 4px 12px; margin: 12px 0; }
.assessment.historical { border-left-color: var(--m); }
.needs, .elements ul { padding-left: 20px; margin: 4px 0; }
.needs li, .elements li { margin: 4px 0; overflow-wrap: anywhere; }
.elements li.withheld { color: var(--red); font-style: italic; }
.evaluation .badge { background: var(--amber-bg); color: var(--amber); }

/* Clinical chat screen (development, synthetic; VCIS-CL-CHAT-001). No script. */
.chat-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.chat-link .button { width: auto; margin: 0; padding: 10px 16px; }
body.chat-app { background: var(--app); }
.chat-screen { display: flex; flex-direction: column; min-height: calc(100dvh - 26px); }
.chat-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px max(12px, env(safe-area-inset-left)); background: var(--app); border-bottom: 1px solid var(--b); }
.chat-bar .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-bar .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-bar .who small { display: block; color: var(--m); font-size: var(--fs-meta); overflow-wrap: anywhere; }
.chat-bar .back { font-size: 26px; line-height: 1; text-decoration: none; padding: 4px 6px; }
.chat-bar .bar-links { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: var(--fs-small); }
.compact-nav { display: flex; gap: 2px; }
.compact-nav a { display: inline-flex; padding: 6px; border-radius: 8px; color: var(--m); }
.compact-nav a:hover { color: var(--a); background: var(--surface); }
.compact-nav .ui-icon { width: 20px; height: 20px; }
.chat-column { flex: 1; width: 100%; max-width: 800px; margin: 0 auto; padding: 12px 16px 8px; box-sizing: border-box; }
.chat-note, .chat-empty { color: var(--m); font-size: var(--fs-meta); margin: 4px 0 16px; }
.chat-empty { font-size: var(--fs-base); text-align: center; margin-top: 18vh; }
.chat-log { list-style: none; padding: 0; margin: 0; }
.chat-log .turn { margin: 0 0 28px; }
.chat-log .bubble { margin: 0 0 14px auto; width: fit-content; max-width: min(85%, 560px); padding: 10px 14px;
  background: var(--surface-2); border-radius: 18px 18px 4px 18px; overflow-wrap: anywhere; }
.chat-log .bubble p { margin: 0; white-space: pre-wrap; }
.chat-log .meta, .reply .meta { color: var(--m); font-size: var(--fs-meta); margin: 4px 0 0; white-space: normal; }
.reply { overflow-wrap: anywhere; line-height: 1.6; }
.reply-head { margin: 0 0 6px; }
.reply .tag { font-size: var(--fs-meta); border: 1px solid var(--amber); color: var(--amber); border-radius: 999px;
  padding: 1px 8px; font-weight: 600; }
.reply .limit { margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--amber); color: var(--text);
  font-size: var(--fs-small); }
.answer p { margin: 0 0 12px; }
.answer h4 { margin: 16px 0 6px; font-size: var(--fs-base); }
.answer ul { margin: 0 0 12px; padding-left: 22px; }
.answer li { margin: 4px 0; }
.answer sup.cite { font-size: 0.7em; color: var(--m); margin-left: 2px; }
.answer .unverified { font-size: 0.8em; color: var(--m); white-space: nowrap; }
.reply .follow-up { margin: 4px 0 12px; }
details.sources { margin: 2px 0 0; font-size: var(--fs-small); }
details.sources > summary { cursor: pointer; color: var(--a); display: inline; list-style: none; }
details.sources > summary::-webkit-details-marker { display: none; }
details.sources[open] { padding: 8px 12px; margin-top: 6px; background: var(--surface); border-radius: 10px; }
details.sources p { margin: 6px 0; }
details.sources .label { margin: 12px 0 4px; color: var(--m); font-weight: 650; }
details.sources ol, details.sources ul { margin: 0; padding-left: 20px; }
details.sources li { margin: 4px 0; }
/* Reviewed-flow history: a full-height tap target per conversation on a phone. */
details.history > summary { padding: 10px 0; }
details.history li a { display: inline-block; padding: 12px 0; }
.reply blockquote { margin: 6px 0; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.reply mark { background: var(--a-soft); color: var(--text); }
/* Development chat (VCIS-CL-DEV-CHAT-001): Sonnet's answer and Haiku's review, kept apart. */
.dev-block { margin: 8px 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.dev-review { border-left: 3px solid var(--amber); }
.dev-block .label { margin: 0 0 6px; font-weight: 600; }
/* Reviewed development chat: in-page send (VCIS-CL-DEV-FLOW-001). */
.dev-status:empty, #flow-state:empty { display: none; }
.dev-warning { padding: 10px 12px; font-size: var(--fs-small); line-height: 1.45; }
.dev-turn { margin: 0 0 24px; }
.dev-turn .reply ul { margin: 0 0 12px; padding-left: 22px; }
.dev-turn .reply li { margin: 4px 0; }
#flow-log details.sources > summary, #flow-state details.sources > summary { display: inline-flex; align-items: center;
  min-height: 44px; }
#flow-form .actions { flex-direction: row; align-items: stretch; }
/* VCIS-UI-025 (owner, 15 November 2026): one line until the message needs more; it grows with the text up to 40dvh
   (field-sizing where the browser has it, dev-flow.js otherwise). */
#flow-form textarea { min-height: 44px; resize: none; field-sizing: content; overflow-y: auto; }
#flow-form .actions button { flex: 1; width: auto; margin: 0; }
#flow-form .actions .button { width: auto; margin: 0; white-space: nowrap; }
/* The pilot's shell: a menu beside the page on a desktop, behind a top-left button on a phone (no script). */
.nav-open, .nav-backdrop { display: none; }
.side { padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--b); }
.side-new { display: block; text-align: center; margin: 0 0 12px; }
.side-link { display: flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--text); font-weight: 650;
  text-decoration: none; border-radius: 10px; }
.side-link:hover, .side-chats a:hover { background: var(--a-soft); }
.side-chats { list-style: none; margin: 0 0 8px; padding: 0; }
.side-chats a { display: block; padding: 10px; font-size: var(--fs-small); color: var(--m); text-decoration: none;
  border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.has-shell { display: block; }
body.has-shell .app { max-width: none; }
body.has-shell .wrap { max-width: 860px; margin: 0 auto; }
body.has-shell .top { padding-top: 12px; }
@media (min-width: 900px) {
  body.has-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100dvh; }
  body.has-shell > .skip-link, body.has-shell > .nav-toggle { position: absolute; }
  .side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
}
@media (max-width: 899px) {
  .nav-open { display: flex; position: fixed; top: 6px; left: 6px; z-index: 30; width: 44px; height: 44px; margin: 0;
    align-items: center; justify-content: center; font-size: 22px; color: var(--text); background: var(--surface);
    border: 1px solid var(--b); border-radius: 10px; cursor: pointer; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 25; width: min(82vw, 300px); padding-top: 58px; overflow-y: auto;
    transform: translateX(-100%); visibility: hidden; }
  .nav-toggle:checked ~ .side { transform: none; visibility: visible; }
  .nav-toggle:checked ~ .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 20; margin: 0;
    background: rgba(8, 14, 26, .6); }
  .nav-toggle:focus-visible ~ .nav-open { outline: 2px solid var(--a); outline-offset: 2px; }
  body.has-shell .top { padding-left: 62px; }
  body.has-shell .top { padding-top: 6px; }
}
/* The conversation: a greeting when empty, the clinician on the right, VCIS on the left at a reading width. */
.greeting { padding: 12dvh 0 16px; text-align: center; }
.greeting h1 { margin: 0 0 6px; }
.greeting p { margin: 0; color: var(--m); }
.conv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.conv-head h1 { font-size: 22px; margin: 6px 0; }
.conv-menu { flex: none; }
.conv-menu[open] { position: absolute; right: 22px; z-index: 10; width: min(86vw, 320px); }
.bound-note { margin: 0 0 12px; }
.dev-turn .reply { max-width: 72ch; }
/* VCIS-CL-FLOW-COMPOSER-PIN-001: this page, unlike the plain chat composer, has the dose-calculator and footer
   links rendered after the composer in the DOM (so the clinician sees them below the message box); that trailing
   content is far shorter than one screen, so ``position: sticky`` runs out of room to stay pinned almost at once
   and the composer drifts into the middle of the page while scrolling a long response. Pinned to the viewport
   instead, as the bottom tab bar (.workspace-nav) already is; .wrap's existing bottom padding clears it. */
.composer-dock { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 5; width: 100%;
  max-width: 720px; margin: 0; padding: 8px 22px calc(8px + env(safe-area-inset-bottom)); background: var(--app); }
#flow-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: end; }
#flow-form > * { grid-column: 1 / -1; }
#flow-form > textarea { grid-column: 1; margin: 0; max-height: 40dvh; }
#flow-form > .actions { grid-column: 2; grid-row: 1 / span 1; margin: 0; }
#flow-form > #flow-source-note, #flow-form > .check { margin: 0; font-size: var(--fs-meta); }
#flow-newer { display: block; margin: 0 auto 8px; }
/* UI-022A: the "+" menu left of the message box, and the one staged file above it. */
.composer-row { display: flex; align-items: flex-start; gap: 6px; }
.composer-row > #flow-form { flex: 1 1 auto; min-width: 0; }
.attach-menu { position: relative; flex: none; }
.attach-menu > summary { list-style: none; display: flex; align-items: center; justify-content: center; width: 44px;
  height: 44px; font-size: 24px; line-height: 1; color: var(--text); background: var(--surface);
  border: 1px solid var(--b); border-radius: 12px; cursor: pointer; }
.attach-menu > summary::-webkit-details-marker { display: none; }
.attach-menu > summary:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.attach-menu[open] > .attach-form { position: absolute; bottom: 52px; left: 0; z-index: 12; width: min(80vw, 280px);
  padding: 8px; background: var(--surface); border: 1px solid var(--b); border-radius: 12px; }
.attach-form p { margin: 6px 4px 0; }
.attach-item { display: flex; flex-direction: column-reverse; gap: 2px; margin: 0 0 4px; }
.attach-pick { display: block; padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.attach-pick:hover { background: var(--app); }
.attach-form.scripted input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; }
.attach-form.scripted input[type="file"]:focus-visible + .attach-pick { outline: 2px solid var(--a); }
.attach-form.scripted .attach-upload { display: none; }
.attach-staged { display: flex; flex-direction: column; gap: 8px; margin: 0 0 8px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--b); border-radius: 12px; }
.attach-staged[hidden] { display: none; }
.attach-item-staged { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.attach-thumb, .attach-icon { flex: none; width: 56px; height: 56px; border-radius: 8px; }
.attach-thumb { object-fit: cover; }
.attach-icon { display: flex; align-items: center; justify-content: center; font-size: var(--fs-meta); font-weight: 600;
  border: 1px solid var(--b); }
.attach-body { flex: 1 1 12rem; min-width: 0; }
.attach-name { margin: 0; overflow-wrap: anywhere; }
.attach-note { margin: 2px 0 0; }
.attach-staged > .notice { flex-basis: 100%; margin: 0; }
.attach-choice { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--b); border-radius: 12px; }
.measure-form { margin: 0 0 8px; }
.card-offer { margin: 0 0 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--a);
  border-radius: 12px; }
.card-offer p { margin: 0 0 8px; }
.card-offer-actions, .card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-offer > .button { margin-top: 8px; }
.card-actions { margin: 14px 0; }
.inline-form { display: inline-block; margin: 0; }
.card-section { margin: 22px 0; }
/* UI-022B: laboratory result tables */
.lab-group { margin: 0 0 18px; }
.lab-group h3 { font-size: 15px; margin: 0 0 4px; }
.lab-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.lab-table th, .lab-table td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--b);
  vertical-align: top; overflow-wrap: anywhere; font-size: 14px; }
.lab-table th { font-weight: 500; color: var(--m); }
.lab-entry input { width: 100%; }
/* The current table at a glance (owner, 11 November 2026): each value on its own reference interval; the middle
   half of the bar is the interval, a high value sits right of it and a low one left. */
.lab-scaled { table-layout: fixed; }
.lab-scaled thead th:nth-child(1) { width: 30%; }
.lab-scaled thead th:nth-child(2) { width: 22%; }
.lab-scaled thead th:nth-child(3) { width: 8%; }
.lab-scaled td, .lab-scaled th { vertical-align: middle; }
.lab-result { font-weight: 600; font-variant-numeric: tabular-nums; }
.lab-unit { font-weight: 400; color: var(--m); font-size: 12px; }
.lab-flag { font-weight: 700; text-align: center; color: var(--red); }
.lab-out th, .lab-out .lab-result { color: var(--red); }
.lab-bar { display: block; width: 100%; height: 14px; }
.lab-bar-out { fill: var(--surface-2); stroke: var(--field-border); stroke-width: 0.4; }
.lab-bar-mid { fill: var(--green-bg); stroke: var(--field-border); stroke-width: 0.4; }
.lab-bar-mark { fill: var(--text); }
.lab-out .lab-bar-mark { fill: var(--red); }
.lab-ref { display: block; margin-top: 3px; font-size: 12px; color: var(--m); font-variant-numeric: tabular-nums; }
.lab-nobar { display: block; font-size: 12px; color: var(--m); font-style: italic; }
.lab-section th { padding-top: 14px; font-size: 13px; font-weight: 700; color: var(--a); border-bottom: 2px solid var(--b); }
@media (max-width: 480px) {
  .lab-scaled thead th:nth-child(1) { width: 32%; }
  .lab-scaled thead th:nth-child(2) { width: 24%; }
  .lab-unit { display: block; }
}
/* UI-022-LAB-READ: a locally read draft; fields to compare with the original */
.lab-entry input.needs-check { border-color: var(--amber); }
.field-check { color: var(--amber); font-size: 12px; margin: 4px 0 0; }
.lab-prepare { margin: 8px 0 12px; }
/* UI-022 imaging: one imaging record as label | value rows */
.imaging-table th { width: 38%; }
/* UI-022 imaging context: verbatim report text, and the visit's originals opened large inside the conversation */
.report-text { margin: 6px 0; padding: 8px 10px; border-left: 3px solid var(--b); white-space: normal;
  overflow-wrap: anywhere; font-size: 14px; }
.report-text-box { margin: 10px 0; }
.flow-imaging { margin: 8px 0; }
.imaging-view { margin: 4px 0; border: 1px solid var(--b); border-radius: 8px; padding: 6px 10px; }
.imaging-view > summary { cursor: pointer; min-height: 32px; display: list-item; overflow-wrap: anywhere; }
.imaging-view > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.imaging-view figure { margin: 8px 0; }
.imaging-original { display: block; width: 100%; max-width: 100%; height: auto; max-height: 85vh;
  object-fit: contain; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list > li { margin: 0 0 8px; }
.patient-row .case-link { display: block; padding: 12px 14px; color: inherit; text-decoration: none; }
.patient-row .case-meta { display: block; }
.card.visit-row { display: block; padding: 12px 14px; }
.card.visit-row > * { display: block; }
/* The patient card by visit (owner, 15 November 2026): one date heading, the visit's items under it undated. */
.card.visit-block { display: block; padding: 12px 14px; }
.visit-block .visit-date { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.visit-block .visit-reason { margin: 0 0 6px; overflow-wrap: anywhere; }
.visit-block > .meta { margin: 0 0 6px; }
.visit-block > .label { margin: 10px 0 4px; font-size: 13px; color: var(--m); }
.visit-items { list-style: none; margin: 0 0 6px; padding: 0; }
.visit-items > li { margin: 0 0 4px; overflow-wrap: anywhere; }
.doc-thumbs { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.doc-thumbs > li { display: flex; flex-direction: column; gap: 2px; width: 88px; }
.doc-thumb { display: block; width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--b); background: var(--surface-2); }
.doc-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.doc-file { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 4px;
  text-decoration: none; color: inherit; text-align: center; }
.doc-kind { font-size: 12px; font-weight: 700; color: var(--a); }
.doc-name { font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; }
.doc-actions { display: flex; flex-direction: column; gap: 0; }
.doc-actions .link.small { font-size: 12px; }
#main > form.panel { padding: 4px 14px 14px; }
.filter-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 0 0 10px; }
.filter-form label { margin: 0; }
.filter-form input { width: auto; min-width: 140px; }
.reply > details.turn-menu { margin-top: 2px; }
.edit-identity > summary { display: inline-flex; align-items: center; min-height: 44px; }
/* The tools under the message box: one visible row each, opened on demand. */
.flow-tools { display: grid; gap: 8px; margin: 0 0 16px; }
.flow-tools > details.sources { margin: 0; padding: 0 14px; background: var(--surface); border: 1px solid var(--b);
  border-radius: 12px; }
.flow-tools > details.sources[open] { margin: 0; padding: 0 14px 12px; }
.flow-tools > details.sources > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; color: var(--text); }
.flow-tools > details.sources > summary::after { content: "▾"; color: var(--m); }
.flow-tools > details.sources[open] > summary::after { content: "▴"; }
.dev-wait { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; color: var(--m); }
.dev-spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--surface-2);
  border-top-color: var(--amber); animation: dev-spin 0.9s linear infinite; }
@keyframes dev-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dev-spinner { animation: none; border-color: var(--amber); } }
/* VCIS-UI-026: the time already waited, on its own line under the waiting sentence. */
.dev-wait { flex-wrap: wrap; row-gap: 2px; }
.dev-elapsed { flex-basis: 100%; padding-left: 26px; font-size: 13px; font-variant-numeric: tabular-nums; }
form[aria-busy="true"] button[type="submit"] { opacity: 0.6; cursor: progress; }
details.technical { font-size: var(--fs-meta); color: var(--m); margin-top: 4px; }
details.technical > summary { cursor: pointer; }
details.technical table { font-size: var(--fs-meta); }
.composer { position: sticky; bottom: 0; z-index: 10; background: var(--app); border-top: 1px solid var(--b);
  padding: 10px 16px max(10px, env(safe-area-inset-bottom)); }
.composer-box { display: flex; align-items: flex-end; gap: 8px; max-width: 800px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--field-border); border-radius: 24px; padding: 6px 6px 6px 16px; }
.composer-box:focus-within { border-color: var(--a); }
.composer textarea { flex: 1; width: auto; min-width: 0; min-height: 3.2em; min-height: calc(2lh + 4px); max-height: 40dvh; margin: 0; padding: 6px 0;
  border: 0; background: transparent; color: var(--text); resize: vertical; field-sizing: content; box-shadow: none;
  line-height: 1.45; }
.composer textarea:focus { outline: none; }
.composer .send { flex-shrink: 0; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; }
.composer .send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }
.composer-hint, .composer-note, .composer-alert { max-width: 800px; margin: 6px auto 0; font-size: var(--fs-meta); color: var(--m); }
.composer-alert { margin: 0 auto 8px; color: var(--red); font-weight: 600; }
@supports (field-sizing: content) { .composer textarea { resize: none; } }
/* A conversation without a record (UI-022): save offer, draft list, draft documents. */
.chat-bound { color: var(--m); font-size: var(--fs-meta); margin: 0 0 16px; padding-left: 10px;
  border-left: 3px solid var(--a); }
.save-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 20px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--b); border-radius: 12px; }
.save-offer p { flex: 1 1 100%; margin: 0; font-weight: 650; }
.save-offer form { margin: 0; }
.save-offer .button, .save-offer button { width: auto; margin: 0; padding: 10px 16px; }
details.drafts, details.draft-panel { margin: 0 0 16px; font-size: var(--fs-small); }
details.drafts > summary, details.draft-panel > summary { cursor: pointer; color: var(--a); }
details.drafts ul, .draft-documents { margin: 8px 0; padding-left: 20px; }
details.drafts li, .draft-documents li { margin: 4px 0; overflow-wrap: anywhere; }
details.draft-panel[open] { padding: 8px 12px; background: var(--surface); border-radius: 10px; }
.draft-upload, .draft-delete { display: grid; gap: 6px; margin: 10px 0; }
.draft-upload button, .draft-delete button { width: auto; justify-self: start; }
.save-kind { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--b); border-radius: 10px; }
.save-kind .field { margin-top: 8px; }
@media (max-width: 520px) {
  .chat-bar .bar-links > a { display: none; }
  .chat-bar .bar-links > a.keep { display: inline; }
  .chat-log .bubble { max-width: 90%; }
  .composer { padding-left: 10px; padding-right: 10px; }
}

/* Workspaces not yet connected. */
.module-empty { text-align: center; padding: 34px 20px; margin-top: 22px; border: 1px solid var(--b); border-radius: 14px;
  background: var(--surface); }
.module-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px;
  background: var(--surface-2); color: var(--m); border-radius: 12px; }
.availability { display: inline-block; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); color: var(--m); font-size: 12px; }
.module-empty p { color: var(--m); font-size: 14px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--m); margin: 0; }
.back-link { display: inline-flex; gap: 5px; align-items: center; min-height: 44px; text-decoration: none; color: var(--m); }

/* Treatment (S2e): orders, actual administrations, home prescriptions. */
.treatment { padding: 17px; }
.treatment h2 { margin-top: 0; }
.treatment h3 { margin-top: 22px; }
.treatment-list, .tr-history, .rx-items { list-style: none; margin: 0; padding: 0; }
.tr-card { margin: 0 0 10px; padding: 14px; overflow-wrap: anywhere; }
.tr-card p, .tr-reference p { margin: 4px 0; }
.tr-title { font-size: 16px; }
.tr-state { font-weight: 700; color: var(--a); }
.tr-state.cancelled { color: var(--red); }
.tr-history > li { border-top: 1px solid var(--b); padding: 8px 0; color: var(--m); }
.tr-reference { border-left: 3px solid var(--a); padding: 4px 12px; margin: 0 0 14px; }
.tr-form textarea { min-height: 64px; }
.actions.quick { flex-direction: row; flex-wrap: wrap; margin: 8px 0; }
.actions.quick .button { width: auto; margin: 0; }
.rx-print { overflow-wrap: anywhere; }
.rx-items > li { border-top: 1px solid var(--b); padding: 10px 0; }
.rx-items p { margin: 3px 0; }
.rx-sign { margin-top: 36px; }

/* VCIS-UI-023: redesign layer. Type, surfaces and the menu; no rule here changes what a page says. */
body { -webkit-font-smoothing: antialiased; }
h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
button, .button { font-weight: 600; border-radius: 10px; }
.button.secondary, button.secondary { background: var(--surface); }
.panel, .card { box-shadow: var(--shadow); }
input, textarea, select { background: var(--surface); }
.brand-mark { color: var(--btn); }
/* The menu, in the page's own scheme. */
.side { background: var(--side-bg); border-right-color: var(--side-border); color: var(--side-text); }
.side-link { color: var(--side-text); }
.side-chats a { color: var(--side-muted); }
.side-link:hover, .side-chats a:hover { background: var(--side-hover); color: var(--side-text); }
.side a[aria-current="page"] { background: var(--side-hover); color: var(--side-text);
  box-shadow: inset 3px 0 0 var(--side-accent); }
.side a:focus-visible { outline-color: var(--side-accent); }
/* The conversation: the answer reads as a page of text; the clinician's message stays a bubble. */
.greeting { text-align: left; }
.greeting h1 { font-size: 40px; line-height: 1.1; }
.dev-turn .reply .answer { font-family: var(--serif); font-size: 18px; line-height: 1.68; max-width: 66ch; }
/* Owner, 16 November 2026 (the answer read as one block): headings of their own, space between paragraphs. */
.dev-turn .reply .answer p { margin: 0 0 14px; }
.dev-turn .reply .answer h4 { margin: 22px 0 6px; font-size: 18px; font-weight: 700; line-height: 1.3;
  letter-spacing: -.01em; }
.dev-turn .reply .answer h4:first-child { margin-top: 2px; }
.chat-log .bubble { border-radius: 16px 16px 4px 16px; }
#flow-form > textarea { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.attach-menu > summary { border-radius: 10px; }
.attach-menu[open] > .attach-form, .conv-menu[open] { box-shadow: var(--shadow); }
.composer-dock { background: linear-gradient(to top, var(--app) 80%, transparent); }
/* The menu's foot: one switch for the night scheme. Both directions are in the page; the scheme in use shows one,
   so the switch is right for a system set to dark before any choice was made. */
.side { display: flex; flex-direction: column; }
.theme-choice { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--side-border); }
.theme-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 44px; padding: 6px 10px; background: transparent; color: var(--side-text); font-size: 14px;
  font-weight: 500; text-align: left; border: 0; border-radius: 10px; }
.theme-switch:hover { background: var(--side-hover); }
.theme-switch .track { position: relative; flex: none; width: 38px; height: 22px; border-radius: 11px;
  background: var(--field-border); }
.theme-switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.theme-switch.to-light .track { background: var(--btn); }
.theme-switch.to-light .track::after { transform: translateX(16px); }
.theme-switch.to-light { display: none; }
:root[data-theme="dark"] .theme-switch.to-light { display: flex; }
:root[data-theme="dark"] .theme-switch.to-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-switch.to-light { display: flex; }
  :root:not([data-theme]) .theme-switch.to-dark { display: none; }
}
/* The account under the switch: its name; choosing it opens the sign-out below it. */
.side-account { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--side-border); }
.side-account > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 6px 10px; color: var(--side-text); font-size: 14px; font-weight: 600; border-radius: 10px; cursor: pointer; }
.side-account > summary::-webkit-details-marker { display: none; }
.side-account > summary:hover, .side-account[open] > summary { background: var(--side-hover); }
.side-account > summary:focus-visible { outline: 2px solid var(--side-accent); outline-offset: 2px; }
.side-account .avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px;
  height: 28px; border-radius: 50%; background: var(--btn); color: #fff; font-size: 13px; font-weight: 700; }
.side-account .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-account > .logout { display: block; margin-top: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--b); border-radius: 12px; box-shadow: var(--shadow); }
.side-account .side-logout { width: 100%; min-height: 44px; padding: 6px 10px; text-align: left; background: transparent;
  color: var(--text); font-size: 14px; font-weight: 500; border: 0; border-radius: 8px; }
.side-account .side-logout:hover { background: var(--app); }
/* The date and time keep to the top right, also where the brand gives way to the menu button. */
.top-side { margin-left: auto; }
/* Above an answer: a failed review first, then what the turn used. */
.reply > div.notice.error { max-width: 66ch; margin: 0 0 12px; font-weight: 400; }
.reply > div.notice.error strong { display: block; }
.caution-detail { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--red-border);
  font-size: var(--fs-small); }
/* VCIS-UI-026: the red box's own action; the quick replies under the latest answer; the owner's step times. */
.reply > div.notice.error .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-replies { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; max-width: 66ch; }
.quick-replies .chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--b);
  background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; }
.quick-replies .chip:hover { border-color: var(--a); color: var(--a); }
.quick-replies .quick-note { flex-basis: 100%; margin: 0; font-size: 12.5px; }
#flow-log > li.dev-turn:not(:last-child) .quick-replies { display: none; }
.step-times { max-width: 66ch; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--b); border-radius: 10px;
  background: var(--surface); }
.step-times .label { margin: 0 0 4px; }
.step-times ul { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 4px; padding: 0; list-style: none; }
.dev-turn .reply .step-times li { margin: 0; font-variant-numeric: tabular-nums; }
.step-times .step-name { color: var(--m); }
.step-times .meta { margin: 0; }
.readout { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); max-width: 440px;
  margin: 0 0 16px; background: var(--surface); border: 1px solid var(--b); border-radius: 12px; overflow: hidden; }
.readout > div { padding: 9px 14px 10px; border-left: 1px solid var(--b); }
.readout > div:first-child { border-left: 0; }
.readout dt { font-size: 12.5px; color: var(--m); }
.readout dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
.readout .ok dd { color: var(--green); }
/* Sign-in and the other pages outside the menu: one narrow column. */
body.sign-in:not(.has-shell) .app { max-width: 460px; }
@media (max-width: 899px) {
  .greeting h1 { font-size: 32px; }
  .dev-turn .reply .answer { font-size: 17.5px; }
}

@media (min-width: 700px) {
  .wrap { padding: 20px 38px calc(115px + env(safe-area-inset-bottom)); }
  .top { padding: 24px 38px 0; }
  .composer-dock { padding-left: 38px; padding-right: 38px; }
}
body.has-shell .composer-dock { max-width: 860px; }
@media (max-width: 359px) {
  .grid { grid-template-columns: 1fr; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top { padding-left: 16px; padding-right: 16px; }
  .composer-dock { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 26px; }
  .case-tabs { gap: 18px; }
  .ph-avatar { display: none; }
  .measurements > div { padding: 0 6px; }
  .measurements dd { font-size: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, button, .workspace-nav a, .case-tabs a { transition: background-color 150ms ease, color 150ms ease; }
}
@media print {
  .workspace-nav, header.top, .skip-link, .no-print, .account-area { display: none !important; }
  body, .app, .wrap, .rx-print { background: #fff !important; color: #000 !important; }
  .wrap { padding: 0 !important; max-width: none !important; }
  a { color: #000 !important; }
}

/* VCIS-UI-024 (owner, 13 November 2026): the approved dark chat mockup. Neutral greys with one teal accent instead
   of the petrol palette; the same token names, so no rule above changes what a page says. The hosted application
   now starts in the dark scheme; the account menu offers "Koyu" and "Açık". */
:root[data-theme="dark"] {
  --a: #7cc9b8; --btn: #e4e6e8; --a-text: #1a1c1e; --a-soft: #22302d;
  --m: #9aa1a8; --b: #33373b; --bg: #1a1c1e; --app: #1a1c1e; --surface: #24272a; --surface-2: #2c3034;
  --text: #e4e6e8; --field-border: #3a3f44; --placeholder: #7d858d;
  --green: #5fb8a5; --green-bg: #213a35; --green-border: #2f5a51; --green-text: #bfe6dc;
  --info-border: #3a4a5c; --info-text: #cfdcea;
  --nav-bg: #1a1c1ef2; --side-bg: #131517; --side-text: #e4e6e8; --side-muted: #9aa1a8; --side-border: #26292c;
  --side-hover: #24272a; --side-accent: #5fb8a5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .3);
  --card: #2b2f33;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --a: #7cc9b8; --btn: #e4e6e8; --a-text: #1a1c1e; --a-soft: #22302d;
    --m: #9aa1a8; --b: #33373b; --bg: #1a1c1e; --app: #1a1c1e; --surface: #24272a; --surface-2: #2c3034;
    --text: #e4e6e8; --field-border: #3a3f44; --placeholder: #7d858d;
    --green: #5fb8a5; --green-bg: #213a35; --green-border: #2f5a51; --green-text: #bfe6dc;
    --nav-bg: #1a1c1ef2; --side-bg: #131517; --side-text: #e4e6e8; --side-muted: #9aa1a8; --side-border: #26292c;
    --side-hover: #24272a; --side-accent: #5fb8a5; --card: #2b2f33;
  }
}
:root[data-theme="light"] {
  --a: #1d7f6d; --btn: #1b1e21; --a-text: #ffffff; --a-soft: #e2f0ec;
  --m: #545d66; --b: #d9dde1; --bg: #f7f8f9; --app: #f7f8f9; --surface: #ffffff; --surface-2: #e7eaed;
  --text: #1b1e21; --field-border: #c9ced3; --placeholder: #6b747d;
  --green: #1d7f6d; --green-bg: #dcefe9; --green-border: #a9d3c7; --green-text: #145a4d;
  --side-bg: #eef0f2; --side-text: #1b1e21; --side-muted: #545d66; --side-border: #dde1e5; --side-hover: #e2e5e8;
  --side-accent: #1d7f6d; --card: #ffffff;
}
/* One sans face for the whole page, as in the mockup (the UI-023 serif answer is replaced). */
:root { --serif: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
h1 { font-weight: 600; letter-spacing: 0; }
.greeting h1 { font-size: 32px; }
.dev-turn .reply .answer { font-size: 16px; line-height: 1.65; max-width: 72ch; }
.chat-log .bubble { border-radius: 20px; background: var(--surface); border: 0; }
.composer-box { border-radius: 24px; }
.side-account .avatar { background: var(--surface-2); color: var(--side-text); }

/* The account menu: name at the foot of the menu; it opens the scheme choice, the account and the sign-out. */
.theme-choice { margin-top: 0; padding-top: 0; border-top: 0; }
.side-account { margin-top: auto; }
.side-account > .account-panel { margin-top: 6px; padding: 8px; display: grid; gap: 4px; background: var(--surface);
  border: 1px solid var(--b); border-radius: 14px; box-shadow: var(--shadow); }
.account-panel .k { padding: 2px 8px 0; font-size: 12px; color: var(--m); }
.scheme { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--app); border-radius: 10px; }
.scheme button { min-height: 36px; margin: 0; padding: 4px 8px; background: transparent; color: var(--m); border: 0;
  border-radius: 8px; font-size: 14px; font-weight: 500; }
.scheme button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.account-panel hr { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--b); }
.account-panel .logout { margin: 0; }
.account-panel .side-logout { width: 100%; min-height: 40px; padding: 6px 8px; text-align: left; background: transparent;
  color: var(--red); font-size: 14px; font-weight: 500; border: 0; border-radius: 8px; }
.account-panel .side-logout:hover { background: var(--surface-2); }

/* What the turn used: one quiet line above the answer. */
.used { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 12px; font-size: 13px; color: var(--m); }
.used span + span::before { content: "·"; margin-right: 8px; color: var(--m); }

/* VCIS-CL-DOSE-BOX-001: a verified formulary dose line, laid out as a box (the model's words; no figure changed). */
.reply .dosebox { max-width: 66ch; margin: 8px 0 12px; padding: 10px 14px; border: 1px solid var(--b);
  border-left: 3px solid var(--green); border-radius: 10px; background: var(--surface); }
.dosebox .k { font-size: 12px; color: var(--m); }
.dosebox .v { font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--text); }
.dosebox .s { margin-top: 2px; font-size: 13px; color: var(--m); }
.reply .dose-mismatch { max-width: 66ch; margin: 2px 0 12px; padding: 6px 10px; border-left: 3px solid var(--red);
  font-size: 13px; }
/* VCIS-CL-MISSING-DOSE-001: the book's dose the answer left out, as printed; amber, never the green dose box. */
.reply .bookdose { max-width: 66ch; margin: 8px 0 12px; padding: 10px 14px; border: 1px solid var(--amber-border);
  border-left: 3px solid var(--amber); border-radius: 10px; background: var(--amber-bg); color: var(--amber-text); }
.bookdose .t { margin: 0 0 4px; font-weight: 600; }
.bookdose .k { margin: 0 0 4px; font-size: 13px; }
.bookdose blockquote { margin: 4px 0; padding-left: 10px; border-left: 2px solid var(--amber-border);
  white-space: normal; font-size: 14px; }

/* A citation: a small number; tapping it (focus) opens the source card. No script. */
.ref { position: relative; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 3px; border-radius: 9px; background: var(--surface-2); color: var(--m); font: 600 11px/1 system-ui, sans-serif;
  vertical-align: 2px; cursor: pointer; }
.ref.dose { background: var(--green-bg); color: var(--green-text); }
.ref:hover, .ref:focus { background: var(--green); color: var(--a-text); outline: none; }
.ref .card { display: none; position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: 260px; padding: 10px 12px; border-radius: 12px; background: var(--card, var(--surface)); border: 1px solid var(--b);
  box-shadow: var(--shadow); color: var(--text); font: 400 13px/1.45 system-ui, sans-serif; text-align: left; cursor: default; }
.ref .card b { display: block; font-weight: 600; }
.ref .card span { display: block; color: var(--m); }
.ref .card .tag { display: inline-block; margin-bottom: 4px; padding: 1px 6px; border-radius: 6px; background: var(--green-bg);
  color: var(--green-text); font-size: 11px; }
.ref:hover .card, .ref:focus .card { display: block; }
@media (max-width: 899px) {
  .ref .card { position: fixed; left: 12px; right: 12px; bottom: 160px; width: auto; transform: none; }
  .ref:hover .card { display: none; }
  .ref:focus .card { display: block; }
}
.ref .card .pid { margin-top: 4px; font-size: 11px; opacity: .65; }

/* VCIS-UI-025 (owner, 15 November 2026): with the menu beside the page, one message bar as in the mockup's chat: the
   "+" small at its left and the send arrow, in the button colours of the scheme in use, at its right, both inside the
   box. The "+" sits outside the message form (it posts its own form), so dev-flow.js keeps it on the bar's last line
   through --field-h, the box's own height; 52px is the one-line box before the script runs. */
body.has-shell .composer-row { position: relative; display: block; }
body.has-shell #flow-form { grid-template-columns: minmax(0, 1fr); }
body.has-shell #flow-form > textarea { grid-column: 1; grid-row: 1; min-height: 52px; padding: 13px 54px 13px 52px;
  line-height: 24px; border: 1px solid var(--b); border-radius: 26px; }
body.has-shell #flow-form > .actions { grid-column: 1; grid-row: 1; align-self: end; justify-self: end; z-index: 1;
  margin: 0 8px 8px 0; }
body.has-shell #flow-form .actions button.send { display: inline-flex; flex: none; align-items: center;
  justify-content: center; width: 36px; height: 36px; min-height: 36px; margin: 0; padding: 0; border: 0;
  border-radius: 50%; background: var(--btn); color: var(--a-text); }
body.has-shell #flow-form .actions button.send:disabled { opacity: .45; cursor: default; }
body.has-shell #flow-form .actions button.send:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
body.has-shell .composer-row > .attach-menu { position: absolute; left: 8px; top: calc(var(--field-h, 52px) - 44px);
  z-index: 2; }
body.has-shell .attach-menu > summary { width: 36px; height: 36px; min-height: 36px; padding: 0; font-size: 24px; font-weight: 400; color: var(--m);
  background: transparent; border: 0; border-radius: 50%; }
body.has-shell .attach-menu > summary:hover, body.has-shell .attach-menu[open] > summary { background: var(--surface-2);
  color: var(--text); }
body.has-shell .attach-menu[open] > .attach-form { bottom: 46px; }
.rx-synthetic { margin: 0 0 12px; padding: 6px 10px; font-size: 12px; text-align: center; color: var(--demo-text);
  background: var(--demo-bg); border-radius: 8px; }
@media print { .rx-synthetic { color: #000 !important; background: #fff !important; border: 1px solid #000; } }
.doc-caption { font-size: 12px; color: var(--m); }
/* VCIS-CL-CHAT-MESSAGE-IMAGES-001 (owner, 15 November 2026): the staged files as small thumbnails in one row just above
   the message bar, each with its own small "×" (its hit area larger than it looks), and one short line of what happens
   to them; the photos a message sent, small on its bubble, each opening large. */
.attach-row { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.attach-row .attach-item-staged { position: relative; display: block; flex: none; }
.attach-open { display: block; border-radius: 10px; }
.attach-row .attach-thumb, .attach-row .attach-icon { display: flex; width: 52px; height: 52px; border-radius: 10px; }
.attach-row .attach-remove { position: absolute; top: -7px; right: -7px; margin: 0; }
.attach-x { position: relative; display: grid; place-items: center; width: 22px; height: 22px; min-height: 22px;
  margin: 0; padding: 0; border: 2px solid var(--surface); border-radius: 50%; background: var(--text); color: var(--app);
  font: 600 14px/1 system-ui, sans-serif; cursor: pointer; }
.attach-x::after { content: ""; position: absolute; inset: -9px; }
.attach-x:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.attach-staged .attach-note { margin: 0; font-size: 12px; }
body.has-shell .attach-staged { gap: 6px; margin: 0 0 6px; padding: 8px 12px 6px; border-radius: 18px; }
.bubble-images { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: 0 0 6px; }
.bubble-images a { display: block; border-radius: 10px; }
.bubble-thumb { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }

/* Petrol design (owner, 16 November 2026; mockup VCIS_Petrol_Tasarim.html): away from the neutral chat look to a dark
   petrol palette with teal accents (owner, 17 November 2026: fills #0d8082, text accents #74d1c6; our own
   shade, not a company's brand colour). Same token names as before, so no rule above changes what a page says; the dark
   scheme only. Font (owner, 17 November 2026): the standard system face stays for now; no typeface is added. */
:root[data-theme="dark"] {
  --a: #74d1c6; --btn: #0d8082; --a-text: #ffffff; --a-soft: #123a3c;
  --m: #93adb3; --b: #27434c; --bg: #0f1e24; --app: #0f1e24; --surface: #16292f; --surface-2: #1c3640;
  --text: #e3eef0; --field-border: #27434c; --placeholder: #93adb3;
  --amber: #f2c14e; --amber-bg: #2b2817; --amber-border: #6b5a22; --amber-text: #f0d9a0;
  --green: #0d8082; --green-bg: #123a3c; --green-border: #0d8082; --green-text: #c4ece6;
  --nav-bg: #0f1e24f2; --side-bg: #0b181d; --side-text: #e3eef0; --side-muted: #93adb3; --side-border: #1f363e;
  --side-hover: #16292f; --side-accent: #74d1c6; --card: #1c3640;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --a: #74d1c6; --btn: #0d8082; --a-text: #ffffff; --a-soft: #123a3c;
    --m: #93adb3; --b: #27434c; --bg: #0f1e24; --app: #0f1e24; --surface: #16292f; --surface-2: #1c3640;
    --text: #e3eef0; --field-border: #27434c; --placeholder: #93adb3;
    --amber: #f2c14e; --amber-bg: #2b2817; --amber-border: #6b5a22; --amber-text: #f0d9a0;
    --green: #0d8082; --green-bg: #123a3c; --green-border: #0d8082; --green-text: #c4ece6;
    --nav-bg: #0f1e24f2; --side-bg: #0b181d; --side-text: #e3eef0; --side-muted: #93adb3; --side-border: #1f363e;
    --side-hover: #16292f; --side-accent: #74d1c6; --card: #1c3640;
  }
}

/* The conversation: the clinician's message a petrol bubble; the reply one panel holding the answer and its notes. */
.dev-turn .bubble { background: var(--surface-2); border-radius: 12px 12px 4px 12px; }
.dev-turn .reply { padding: 12px 14px 14px; background: var(--surface); border: 1px solid var(--b); border-radius: 10px; }
.dev-turn .reply .answer { line-height: 1.65; }
/* Answer headings (rule 10's sections and their sub-headings): a short green rule before each. */
.dev-turn .reply .answer h4 { display: flex; align-items: center; gap: 8px; margin: 20px 0 6px;
  font-size: 18px; font-weight: 600; line-height: 1.25; letter-spacing: .01em; }
.dev-turn .reply .answer h4::before { content: ""; flex: none; width: 10px; height: 2px; background: var(--green); }
.dev-turn .reply .answer h4:first-child { margin-top: 2px; }
/* The "☐" test lines stay the answer's own lines; more room between them reads as a list. */
.dev-turn .reply .answer p { margin: 4px 0 12px; line-height: 1.7; }
/* "12–24 saatlik risk": the answer's own section in an alarm band (dev_flow_view._risk_band; styling only). */
.answer .risk-band { margin: 16px 0 12px; padding: 10px 12px; background: var(--amber-bg); border: 1px solid var(--amber-border);
  border-left: 3px solid var(--amber); border-radius: 8px; }
.dev-turn .reply .answer .risk-band h4 { margin-top: 0; color: var(--amber); }
.dev-turn .reply .answer .risk-band h4::before { background: var(--amber); }
.answer .risk-band > :last-child { margin-bottom: 0; }
/* A verified dose: a quiet panel with a green edge, its label in green. */
.reply .dosebox { border: 0; border-left: 3px solid var(--green); border-radius: 0 8px 8px 0; background: var(--app); }
.dosebox .k { color: var(--a); font-weight: 500; }
/* A citation: a small outlined number in the accent colour. */
.ref { border: 1px solid var(--green); border-radius: 4px; background: transparent; color: var(--a); }
.ref.dose { background: var(--green-bg); }
/* What the turn used: a green dot before the quiet line. */
.used { align-items: center; }
.used::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
/* The source note: plain and quiet when nothing is wrong; a problem (e.g. a value that did not match) keeps its words
   and its red, as a band instead of a box. */
.reply .source-state.meta { margin: 14px 0 8px; padding-top: 10px; border-top: 1px solid var(--b); }
.reply .source-state.notice.error { margin: 14px 0 8px; padding: 8px 10px; border: 0; border-left: 3px solid var(--red);
  border-radius: 0 6px 6px 0; font-weight: 500; font-size: var(--fs-small); line-height: 1.5; }

/* The message bar: squarer corners, outlined "+", the send button in green. */
body.has-shell #flow-form > textarea { border-radius: 10px; background: var(--surface); }
body.has-shell .attach-menu > summary { border: 1px solid var(--b); border-radius: 6px; }
body.has-shell #flow-form .actions button.send { border-radius: 6px; }
/* The book option as a small "Kitap" chip (the checkbox itself stays, visible and focusable) with an "i" that opens
   its sentence. In the hosted bar both sit inside the box, left of the send arrow. */
#flow-form > .book-option { display: flex; align-items: center; gap: 4px; margin: 0; font-size: var(--fs-meta); }
.book-chip.check { display: inline-flex; align-items: center; gap: 4px; margin: 0; height: 32px; padding: 0 7px;
  border: 1px solid var(--green); border-radius: 6px; color: var(--a); font-size: 13.5px; font-weight: 600;
  cursor: pointer; }
.book-chip.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.book-chip-face { display: inline-flex; align-items: center; gap: 4px; }
.book-chip:has(input:not(:checked)) { border-color: var(--b); color: var(--m); }
.book-chip:has(input:focus-visible) { outline: 2px solid var(--a); outline-offset: 2px; }
.book-info { position: relative; }
.book-info > summary { position: relative; list-style: none; display: grid; place-items: center; width: 26px; height: 26px; min-height: 0; padding: 0;
  border: 1px solid var(--b); border-radius: 50%; color: var(--m); font: italic 600 13px/1 Georgia, serif; cursor: pointer; }
.book-info > summary::-webkit-details-marker { display: none; }
.book-info > summary::after { content: ""; position: absolute; inset: -9px -4px; }
.book-info > summary:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.book-info > p { margin: 6px 0 0; font-size: var(--fs-meta); color: var(--m); }
body.has-shell #flow-form:has(> .book-option) > textarea { padding-right: 184px; }
/* Owner, 17 November 2026: the book option is in the "+" menu (a button beside "send" was pressed by mistake), under
   the upload choices; a small green dot on the "+" says it is on. */
.attach-menu .book-option.in-menu { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--b); }
.book-switch.check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; cursor: pointer; }
.book-switch.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.attach-menu .book-note { margin: 4px 0 0; font-size: var(--fs-meta); color: var(--m); line-height: 1.45; }
.attach-menu > summary { position: relative; }
.attach-menu:has(#flow-source:checked) > summary::before { content: ""; position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
body.has-shell #flow-form > .book-option { grid-column: 1; grid-row: 1; align-self: end; justify-self: end; z-index: 1;
  margin: 0 50px 10px 0; }
body.has-shell .book-info[open] > p { position: absolute; right: -50px; bottom: calc(100% + 12px); z-index: 12;
  width: min(80vw, 300px); margin: 0; padding: 10px 12px; background: var(--card, var(--surface)); color: var(--text);
  border: 1px solid var(--b); border-radius: 10px; box-shadow: var(--shadow); line-height: 1.45; }
/* A phone: the placeholder keeps to one line beside the chip, and the chip drops its book shape to leave the text room. */
body.has-shell #flow-form > textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
}

/* "Olası tanılar" (dev_flow_view._diagnosis_list; owner, 17-18 November 2026; styling only): each numbered line is a plain
   row with a modest rank number and the name in bold; a must-not-miss line has a red rank, a thin red rule and a quiet
   "Kaçırılmamalı" label. */
.answer .dx { display: flex; gap: 10px; align-items: baseline; margin: 0; padding: 10px 0; border-top: 1px solid var(--b);
  line-height: 1.55; }
.answer h4 + .dx { border-top: 0; }
.answer .dx-rank { flex: none; min-width: 1.5em; color: var(--a); font-size: 1.2em; font-weight: 600; opacity: .85; }
.answer .dx-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.answer .dx-name { font-weight: 700; }
.answer .dx-sep { margin-top: 3px; color: var(--m); font-size: var(--fs-meta); line-height: 1.5; }
.answer .dx-alert { padding-left: 10px; border-left: 2px solid var(--red); }
.answer .dx-alert .dx-rank { color: var(--red); opacity: 1; }
.answer .dx-badge { display: block; margin: 0 0 2px; color: var(--red); font-size: 12px; font-weight: 600; letter-spacing: .02em; }

/* VCIS-UI-027 (screen only): each verified dose line is its own card (K9): the line's own species and book words as
   small chips, the dose large, its note small. Colours come from the theme tokens, so light and dark both hold. */
.dosebox .k { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 4px; }
.dosebox .dose-word { font-size: 12px; color: var(--a); font-weight: 600; }
.dosebox .dose-chip { display: inline-block; padding: 0 8px; border: 1px solid var(--b); border-radius: 999px;
  color: var(--m); font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap; }
.dosebox .dose-chip.book { border-color: var(--green-border); background: var(--green-bg); color: var(--green-text); }
.dosebox .v { font-size: 17px; overflow-wrap: anywhere; }
.dosebox .s { margin-top: 4px; }
/* VCIS-UI-027: the application's brand mapping, a small box above the answer (dev_flow_view.brand_html). */
.reply .brand-box { max-width: 66ch; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--b); border-radius: 10px;
  background: var(--surface); font-size: 14px; }
.brand-box p { margin: 0; }
.brand-box .label { font-size: 12px; color: var(--m); }
.brand-box .brand-map { overflow-wrap: anywhere; }
.brand-box .meta { margin-top: 2px; font-size: 12px; color: var(--m); }
.brand-box .brand-pets { margin-top: 2px; font-size: 13px; color: var(--amber-text); }
/* Owner, 26 November 2026 (decision "A"): a contraindication warning written directly above a dose line sits inside
   that dose box, above the dose, in an amber frame; the box edge turns amber too. Theme tokens only (light and dark). */
.reply .dosebox.has-contra { border-left-color: var(--amber); }
.dosebox .dose-contra { margin: 2px 0 6px; padding: 6px 10px; border: 1px solid var(--amber-border);
  border-left: 3px solid var(--amber); border-radius: 6px; background: var(--amber-bg); color: var(--amber-text);
  font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.dosebox .dose-contra-head { font-weight: 700; color: var(--amber); }
/* A15 (roadmap 2.3): the dose calculator (dev_flow_view.dose_calculator_html), a quiet panel with a green edge like a
   dose box; the patient amount is the largest figure. Theme tokens only (light and dark); one column at phone width. */
.dosecalc { max-width: 66ch; margin: 8px 0 12px; padding: 10px 12px; border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0; background: var(--app); }
.dosecalc p { margin: 4px 0; }
.dosecalc .dc-weight { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 8px; }
.dosecalc .dc-weight label { font-size: 14px; color: var(--m); }
.dosecalc .dc-kg { width: 8em; min-height: 44px; padding: 6px 12px; font-size: 20px; color: var(--text);
  background: var(--surface); border: 1px solid var(--field-border); border-radius: 999px; }
.dosecalc .dc-kg:disabled { opacity: .6; }
.dosecalc .dc-lines { margin: 8px 0; padding: 0; border: 0; min-width: 0; }
.dosecalc .dc-lines legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--m); }
.dosecalc .dc-opt { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 6px; padding: 8px 10px;
  border: 1px solid var(--b); border-radius: 8px; background: var(--surface); cursor: pointer; }
.dosecalc .dc-opt:has(.dc-line:checked) { border-color: var(--green-border); }
.dosecalc .dc-line { flex: none; width: 18px; height: 18px; margin-top: 3px; accent-color: var(--green); }
.dosecalc .dc-text { min-width: 0; overflow-wrap: anywhere; }
.dosecalc .dc-dose { font-weight: 600; }
.dosecalc .dc-book { display: inline-block; margin-left: 4px; padding: 0 7px; border: 1px solid var(--green-border);
  border-radius: 999px; background: var(--green-bg); color: var(--green-text); font-size: 12px; line-height: 1.6; }
.dosecalc .dc-amt { display: block; font-size: 14px; color: var(--text); }
.dosecalc .dc-amt:empty { display: none; }
.dosecalc .dc-result { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--b); }
.dosecalc .dc-label { font-size: 13px; color: var(--m); }
.dosecalc .dc-main { font-size: 28px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.dosecalc .dc-conv { font-size: 14px; color: var(--m); }
.dosecalc .dc-conv:empty { display: none; }
.dosecalc .dc-foot { margin-top: 8px; font-size: 12px; }
.dosecalc .dc-locked[hidden] { display: none; }
/* The clinician's own dose in the "Hesap" section (A15): labelled apart from the source's dose. */
.calc-entry .stated-dose { margin: 4px 0; }
/* E4 (owner decision OD, 26 November 2026): the hosted chat's decision-support line, a quiet muted line under the
   message box inside the pinned dock (dev_flow_view.DECISION_SUPPORT_NOTE). Always visible; the dock's measured
   height (--composer-h) keeps the answer clear of it. Theme tokens only (light and dark). */
.composer-dock .decision-note { margin: 4px 0 0; font-size: 12px; line-height: 1.35; color: var(--m); text-align: center;
  overflow-wrap: anywhere; }
