@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    --c-bg: oklch(0.985 0.008 250);
    --c-surface: oklch(1 0 0);
    --c-border: oklch(0.9 0.018 250);
    --c-ink: oklch(0.27 0.035 250);
    --c-ink-strong: oklch(0.21 0.045 250);
    --c-muted: oklch(0.51 0.04 250);
    --c-brand: oklch(0.39 0.15 250);
    --c-brand-deep: oklch(0.29 0.11 250);
    --c-teal: #6b7cff;
    --c-teal-soft: #eef1ff;
    --c-success: #3652d9;
    --c-danger: oklch(0.52 0.15 25);
    --shadow: 0 10px 26px oklch(0.25 0.04 250 / .07);
    font-family: Roboto, "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--c-ink);
    background: var(--c-bg);
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--c-bg); }
body { margin: 0; min-width: 320px; background: var(--c-bg); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.app-shell { min-height: 100vh; display: flex; }
.side-rail { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; min-height: 100vh; padding: 18px 12px; background: var(--c-brand-deep); color: white; position: sticky; top: 0; height: 100vh; }
.rail-brand { display: flex; align-items: center; gap: 10px; padding: 7px 11px 23px; border-bottom: 1px solid oklch(1 0 0 / .12); text-decoration: none; font-size: 17px; font-weight: 760; letter-spacing: -.025em; }
.rail-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--c-teal); color: var(--c-brand-deep); font-weight: 850; }
.workspace-label { display: grid; gap: 2px; margin: 22px 8px 18px; }
.workspace-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.workspace-label small { color: oklch(.8 .03 250); font-size: 11px; }
.rail-nav { display: grid; gap: 4px; }
.rail-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 7px; color: oklch(.87 .025 250); text-decoration: none; transition: background .18s ease, color .18s ease; }
.rail-nav a:hover, .rail-nav a.is-active { background: oklch(1 0 0 / .11); color: white; }
.rail-nav a.is-active { box-shadow: inset 2px 0 0 var(--c-teal); }
.rail-nav span:first-child { width: 19px; color: var(--c-teal); font-size: 16px; text-align: center; }
.rail-bottom { display: grid; gap: 13px; margin-top: auto; padding: 16px 8px 4px; border-top: 1px solid oklch(1 0 0 / .12); }
.rail-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rail-user > span:last-child { display: grid; gap: 1px; min-width: 0; }
.rail-user strong, .rail-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user strong { font-size: 12px; }
.rail-user small { color: oklch(.8 .03 250); font-size: 10px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; background: var(--c-teal); color: var(--c-brand-deep); font-size: 11px; font-weight: 800; }
.avatar--large { width: 48px; height: 48px; font-size: 14px; }
.signout { color: oklch(.83 .025 250); font-size: 12px; text-decoration: none; }
.signout:hover { color: white; }
.main { width: min(100%, 1480px); min-width: 0; margin: 0 auto; padding: 34px clamp(20px, 4vw, 56px) 60px; }
.topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 30px; }
.page-kicker { margin: 0 0 6px; color: var(--c-teal); font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; color: var(--c-ink-strong); font-size: 28px; line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
h2 { margin-bottom: 6px; color: var(--c-ink-strong); font-size: 20px; letter-spacing: -.025em; text-wrap: balance; }
h3 { margin-bottom: 4px; color: var(--c-ink-strong); font-size: 15px; }
.lede { max-width: 62ch; margin-bottom: 0; color: var(--c-muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 730; text-decoration: none; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid oklch(.68 .15 190 / .35); outline-offset: 2px; }
.button-primary { background: var(--c-brand); color: white; }
.button-primary:hover { background: var(--c-brand-deep); }
.button-secondary { border-color: var(--c-border); background: var(--c-surface); color: var(--c-ink); }
.button-secondary:hover { border-color: var(--c-brand); color: var(--c-brand); }
.button-quiet { min-height: 32px; padding: 0 10px; border-color: transparent; background: transparent; color: var(--c-brand); font-size: 12px; }
.button-quiet:hover { border-color: var(--c-border); background: var(--c-bg); color: var(--c-brand-deep); }
.notice { margin: 0 0 22px; padding: 12px 14px; border: 1px solid var(--c-border); border-radius: 9px; background: var(--c-surface); }
.notice-success { border-color: oklch(.82 .08 155); background: oklch(.96 .035 155); color: var(--c-success); }
.notice-error { border-color: oklch(.83 .08 25); background: oklch(.97 .025 25); color: var(--c-danger); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 24px; }
.stat { padding: 19px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); box-shadow: var(--shadow); }
.stat small { display: block; margin-bottom: 8px; color: var(--c-muted); font-size: 12px; }
.stat strong { display: block; color: var(--c-ink-strong); font-size: 26px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr); gap: 22px; align-items: start; }
.panel { border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 19px 20px; border-bottom: 1px solid var(--c-border); }
.panel-head p { margin-bottom: 0; color: var(--c-muted); font-size: 12px; }
.panel-body { padding: 20px; }
.patient-row { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--c-border); text-decoration: none; }
.patient-row:first-child { padding-top: 0; }
.patient-row:last-child { padding-bottom: 0; border-bottom: 0; }
.patient-row:hover strong { color: var(--c-brand); }
.patient-row-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.patient-row-copy strong { color: var(--c-ink-strong); font-size: 14px; }
.patient-row-copy small { color: var(--c-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patient-row-meta { color: var(--c-muted); font-size: 12px; text-align: right; white-space: nowrap; }
.callout { padding: 18px; border-radius: 9px; background: var(--c-teal-soft); color: var(--c-ink); }
.callout strong { display: block; margin-bottom: 6px; color: var(--c-ink-strong); }
.callout p { margin-bottom: 0; color: var(--c-muted); font-size: 13px; line-height: 1.6; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 18px; }
.search-form { display: flex; flex: 1 1 420px; gap: 8px; }
.search-form input { flex: 1; }
.workspace-search { margin-bottom: 24px; padding: 20px; border: 1px solid oklch(.82 .06 190); border-radius: 10px; background: linear-gradient(115deg, oklch(.97 .025 190), var(--c-surface) 56%); box-shadow: var(--shadow); }
.workspace-search-copy h2 { margin-bottom: 4px; font-size: 19px; }
.workspace-search-copy > p:last-child { margin-bottom: 0; color: var(--c-muted); font-size: 13px; }
.workspace-search-form { display: flex; align-items: center; gap: 8px; margin-top: 17px; }
.workspace-search-input { position: relative; flex: 1; }
.workspace-search-input > span { position: absolute; top: 50%; left: 12px; color: var(--c-brand); font-size: 21px; line-height: 1; transform: translateY(-53%); pointer-events: none; }
.workspace-search-input input { padding-left: 35px; border-color: oklch(.78 .07 190); background: var(--c-surface); }
.workspace-search-form .button { flex: 0 0 auto; }
.workspace-search-results { margin-top: 18px; padding-top: 16px; border-top: 1px solid oklch(.84 .05 190); }
.workspace-search-results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.workspace-search-results-head > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.workspace-search-results-head strong { color: var(--c-ink-strong); }
.workspace-search-results-head span { color: var(--c-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-search-results-head a { flex: 0 0 auto; color: var(--c-brand); font-size: 12px; font-weight: 700; text-decoration: none; }
.workspace-search-results-head a:hover { color: var(--c-teal); }
.workspace-search-list { display: grid; gap: 7px; }
.workspace-search-result { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); text-decoration: none; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.workspace-search-result:hover { border-color: oklch(.72 .1 190); background: oklch(.985 .012 190); transform: translateY(-1px); }
.workspace-search-result-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.workspace-search-result-copy strong { color: var(--c-ink-strong); font-size: 14px; }
.workspace-search-result-copy small { overflow: hidden; color: var(--c-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-search-result-copy .workspace-search-match { color: var(--c-brand); }
.workspace-search-arrow { flex: 0 0 auto; color: var(--c-brand); font-size: 18px; }
.search-empty { display: grid; gap: 3px; padding: 18px 4px 4px; color: var(--c-muted); }
.search-empty strong { color: var(--c-ink-strong); }
.search-empty span { font-size: 12px; }
.filter-link { color: var(--c-muted); font-size: 12px; text-decoration: none; }
.filter-link.is-active { color: var(--c-brand); font-weight: 700; }
.field { display: grid; gap: 6px; }
.field label { color: var(--c-ink); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--c-border); border-radius: 7px; background: var(--c-surface); color: var(--c-ink); }
textarea { min-height: 92px; resize: vertical; }
select { padding-right: 30px; }
.form-section { margin-bottom: 22px; padding: 20px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); box-shadow: var(--shadow); }
.form-section:last-child { margin-bottom: 0; }
.form-section-head { margin-bottom: 18px; }
.form-section-head h2 { margin-bottom: 3px; }
.form-section-head p { margin-bottom: 0; color: var(--c-muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--wide { grid-column: 1 / -1; }
.choice-list { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 5px; }
.choice { display: inline-flex; align-items: center; gap: 7px; color: var(--c-muted); font-size: 13px; }
.choice input { width: 15px; min-height: 15px; accent-color: var(--c-brand); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.patient-table { width: 100%; border-collapse: collapse; }
.patient-table th { padding: 12px 14px; border-bottom: 1px solid var(--c-border); color: var(--c-muted); font-size: 11px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: .055em; }
.patient-table td { padding: 13px 14px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.patient-table tbody tr:last-child td { border-bottom: 0; }
.patient-table tbody tr:hover { background: oklch(.98 .012 250); }
.table-person { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.patient-gender-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid; border-radius: 50%; }
.patient-gender-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.patient-gender-icon--male { border-color: oklch(.78 .09 250); background: oklch(.93 .05 250); color: oklch(.4 .14 250); }
.patient-gender-icon--female { border-color: oklch(.82 .1 345); background: oklch(.95 .035 345); color: oklch(.48 .14 345); }
.patient-gender-icon--unknown { border-color: var(--c-border); background: oklch(.97 .008 250); color: var(--c-muted); }
.patient-gender-icon--large { width: 48px; height: 48px; }
.patient-gender-icon--large svg { width: 25px; height: 25px; }
.table-person a { color: var(--c-ink-strong); font-weight: 720; text-decoration: none; }
.table-person a:hover { color: var(--c-brand); }
.table-person small, .table-muted { display: block; color: var(--c-muted); font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 99px; background: var(--c-teal-soft); color: oklch(.43 .1 190); font-size: 11px; font-weight: 700; }
.status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status--archived { background: oklch(.95 .01 250); color: var(--c-muted); }
.inline-action { padding: 0; border: 0; background: transparent; color: var(--c-muted); font-size: 12px; }
.inline-action:hover { color: var(--c-brand); }
.inline-action:focus-visible { outline: 3px solid oklch(.64 .15 190 / .32); outline-offset: 3px; border-radius: 3px; }
.inline-action--danger { color: var(--c-danger); font-weight: 700; }
.inline-action--danger:hover { color: oklch(.42 .16 25); }
.table-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.inline-action--brief { color: var(--c-brand); font-weight: 700; text-decoration: none; }
.inline-action--brief:hover { color: var(--c-teal); }
.empty { padding: 50px 24px; color: var(--c-muted); text-align: center; }
.empty h2 { color: var(--c-ink-strong); }
.empty p { max-width: 42ch; margin: 0 auto 18px; }
.breadcrumb { margin-bottom: 16px; color: var(--c-muted); font-size: 12px; }
.breadcrumb a { color: var(--c-brand); text-decoration: none; }
.record-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 23px; }
.record-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.record-identity h1 { margin-bottom: 4px; }
.record-identity p { margin-bottom: 0; color: var(--c-muted); font-size: 12px; }
.record-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.record-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .8fr); gap: 22px; align-items: start; }
.data-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin: 0; }
.data-list div { min-width: 0; }
.data-list dt { margin-bottom: 3px; color: var(--c-muted); font-size: 11px; }
.data-list dd { margin: 0; color: var(--c-ink-strong); font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.section-block { margin-bottom: 22px; }
.section-block:last-child { margin-bottom: 0; }
.case { padding: 19px 20px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); box-shadow: var(--shadow); }
.case + .case { margin-top: 14px; }
.case-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.case-head p { margin-bottom: 0; color: var(--c-muted); font-size: 12px; }
.case-head h2 { margin-bottom: 3px; }
.case-label { color: var(--c-teal); font-size: 15px; font-weight: 800; letter-spacing: -.015em; line-height: 1.2; text-align: left; }
.surgery { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--c-border); }
.surgery-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 14px; }
.surgery-head .case-label { order: -1; }
.surgery-head strong { color: var(--c-ink-strong); }
.surgery-head small { display: block; margin-top: 3px; color: var(--c-muted); }
.clinical-events { position: relative; display: grid; gap: 11px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--c-border); }
.clinical-event { position: relative; padding: 15px 16px; border: 1px solid var(--c-border); border-radius: 8px; background: oklch(.99 .006 250); }
.clinical-event-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.clinical-event-label { display: block; margin-bottom: 4px; color: var(--c-teal); font-size: 15px; font-weight: 800; line-height: 1.2; }
.clinical-event h3 { margin: 0 0 3px; color: var(--c-ink-strong); font-size: 16px; text-wrap: balance; }
.clinical-event-head p { margin: 0; color: var(--c-muted); font-size: 12px; }
.subform { padding: 15px; border: 1px solid var(--c-border); border-radius: 8px; background: oklch(.99 .006 250); }
.subform + .subform { margin-top: 12px; }
.subform h3 { margin-bottom: 13px; font-size: 13px; }
.followup-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-border); }
.followup-row:last-child { border-bottom: 0; }
.followup-date { min-width: 80px; color: var(--c-brand); font-size: 12px; font-weight: 730; }
.followup-copy { min-width: 0; }
.followup-copy strong { display: block; color: var(--c-ink-strong); font-size: 13px; }
.followup-copy p { margin: 3px 0 0; color: var(--c-muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.brief-header { margin-bottom: 17px; }
.brief-header .page-kicker { margin-bottom: 4px; }
.brief-actions .button { min-height: 38px; font-size: 12px; }
.brief-note { display: flex; align-items: center; gap: 9px; margin: 0 0 22px; padding: 11px 13px; border: 1px solid oklch(.86 .045 190); border-radius: 8px; background: var(--c-teal-soft); color: var(--c-ink); font-size: 12px; }
.brief-note-mark { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 auto; border-radius: 50%; background: var(--c-teal); color: var(--c-brand-deep); font-size: 11px; font-weight: 800; }
.brief-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .8fr); gap: 22px; align-items: start; }
.brief-main, .brief-aside { display: grid; gap: 22px; min-width: 0; }
.brief-panel { overflow: hidden; }
.brief-snapshot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.brief-snapshot-item { min-width: 0; padding: 14px; border: 1px solid var(--c-border); border-radius: 8px; background: oklch(.99 .006 250); }
.brief-snapshot-item span, .brief-snapshot-item small { display: block; color: var(--c-muted); font-size: 11px; }
.brief-snapshot-item strong { display: block; margin: 7px 0 4px; color: var(--c-ink-strong); font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.brief-case { padding: 18px 19px; border: 1px solid var(--c-border); border-radius: 9px; background: var(--c-surface); }
.brief-case + .brief-case { margin-top: 13px; }
.brief-case-head, .brief-procedure-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.brief-case-head h3 { margin: 4px 0 3px; font-size: 16px; }
.brief-case-head p { margin: 0; color: var(--c-muted); font-size: 12px; }
.brief-case-date { color: var(--c-muted); font-size: 11px; white-space: nowrap; }
.brief-procedure { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--c-border); }
.brief-procedure-head strong { display: block; color: var(--c-ink-strong); font-size: 13px; }
.brief-procedure-head small { display: block; margin-top: 3px; color: var(--c-muted); font-size: 11px; }
.brief-data-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 17px; margin: 14px 0 0; }
.brief-data-list div { min-width: 0; }
.brief-data-list dt { margin-bottom: 3px; color: var(--c-muted); font-size: 11px; }
.brief-data-list dd { margin: 0; color: var(--c-ink-strong); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.brief-data-list--details { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.brief-muted { margin: 0; color: var(--c-muted); font-size: 12px; }
.brief-followups { display: grid; }
.brief-followup { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--c-border); }
.brief-followup:first-child { padding-top: 0; }
.brief-followup:last-child { padding-bottom: 0; border-bottom: 0; }
.brief-followup time { color: var(--c-brand); font-size: 12px; font-weight: 730; }
.brief-followup strong { color: var(--c-ink-strong); font-size: 13px; }
.brief-followup p { margin: 3px 0 0; color: var(--c-muted); font-size: 12px; overflow-wrap: anywhere; }
.brief-followup small { display: block; margin-top: 5px; color: var(--c-muted); font-size: 11px; }
.brief-guidance { display: flex; gap: 11px; padding: 16px; border: 1px solid var(--c-border); border-radius: 9px; background: var(--c-teal-soft); }
.brief-guidance-mark { display: grid; place-items: center; width: 21px; height: 21px; flex: 0 0 auto; border: 1px solid oklch(.65 .1 190); border-radius: 50%; color: var(--c-brand); font-size: 12px; font-weight: 800; }
.brief-guidance strong { display: block; margin-bottom: 4px; color: var(--c-ink-strong); font-size: 12px; }
.brief-guidance p { margin: 0; color: var(--c-muted); font-size: 12px; line-height: 1.55; }
.brief-footer { margin: 18px 0 0; color: var(--c-muted); font-size: 11px; text-align: right; }
@media (max-width: 1050px) { .brief-grid { grid-template-columns: 1fr; } .brief-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .brief-aside { grid-template-columns: 1fr; } .brief-snapshot-grid { grid-template-columns: 1fr; } .brief-case-head, .brief-procedure-head { flex-direction: column; gap: 7px; } .brief-case-date { white-space: normal; } .brief-data-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .table-actions { justify-content: flex-start; } }
@media (max-width: 430px) { .brief-data-list, .brief-data-list--details { grid-template-columns: 1fr; } .brief-followup { grid-template-columns: 1fr; gap: 4px; } }
@media print {
    @page { size: A4 portrait; margin: 14mm; }
    body.brief-page { background: white; color: #12233b; font-size: 11px; }
    .brief-page .side-rail, .brief-page .brief-actions, .brief-page .brief-note, .brief-page .brief-guidance, .brief-page .breadcrumb, .brief-page .brief-footer { display: none !important; }
    .brief-page .app-shell { display: block; }
    .brief-page .main { width: 100%; max-width: none; padding: 0; }
    .brief-page .record-header { margin-bottom: 18px; }
    .brief-page .brief-grid { display: block; }
    .brief-page .brief-main, .brief-page .brief-aside { display: block; }
    .brief-page .brief-panel { margin-bottom: 14px; border-color: #d7e1eb; box-shadow: none; }
    .brief-page .panel-head { padding: 12px 14px; }
    .brief-page .panel-body { padding: 14px; }
    .brief-page .brief-snapshot-grid { gap: 8px; }
    .brief-page .brief-snapshot-item { padding: 10px; }
    .brief-page .brief-case { break-inside: avoid; box-shadow: none; }
    .brief-page .brief-aside { margin-top: 0; }
    .brief-page a { color: inherit; text-decoration: none; }
}
@media (max-width: 1050px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .content-grid, .record-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .side-rail { position: sticky; top: 0; z-index: 20; width: 100%; min-height: auto; height: auto; padding: 12px; } .app-shell { display: block; } .rail-brand { padding-bottom: 13px; } .workspace-label { margin: 15px 8px 11px; } .rail-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; } .rail-nav a { justify-content: flex-start; padding: 9px 8px; font-size: 12px; } .rail-nav span:first-child { width: 19px; } .rail-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding: 12px 8px 0; } .main { padding: 26px 16px 44px; } .topline, .record-header { align-items: flex-start; flex-direction: column; } .record-actions { justify-content: flex-start; } .patient-table { display: block; } .patient-table thead { display: none; } .patient-table tbody, .patient-table tr, .patient-table td { display: block; } .patient-table tr { padding: 13px 14px; border-bottom: 1px solid var(--c-border); } .patient-table td { padding: 3px 0; border: 0; } .patient-table td[data-label]::before { display: inline-block; width: 88px; color: var(--c-muted); content: attr(data-label); font-size: 11px; } .table-person { min-width: 0; } .form-grid, .form-grid--three { grid-template-columns: 1fr; } .field--wide { grid-column: auto; } .data-list { grid-template-columns: 1fr; } .case-completion-panel { padding: 14px; } .case-completion-action { min-height: 64px; } }
@media (max-width: 430px) { .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; } .stat { padding: 14px; } .stat strong { font-size: 22px; } .search-form { flex-basis: 100%; } .panel-head { align-items: flex-start; flex-direction: column; } .button { width: 100%; } .form-actions { flex-direction: column-reverse; } .form-actions .button { width: 100%; } .side-rail { padding: 10px; } .rail-nav a { min-height: 38px; padding: 8px 7px; font-size: 11px; } .rail-bottom { align-items: flex-start; flex-direction: column; gap: 10px; } .case-completion-head h3 { font-size: 16px; } .case-completion-head p { font-size: 11px; } .case-completion-action { align-items: flex-start; padding: 11px; } .case-completion-action strong { font-size: 12px; } .case-completion-action small { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

.recorded-marker { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 17px 0 9px; padding-bottom: 7px; border-bottom: 1px solid var(--c-border); }
.recorded-marker span { color: var(--c-ink-strong); font-size: 11px; font-weight: 760; letter-spacing: .02em; }
.recorded-marker small { color: var(--c-muted); font-size: 10px; }
.record-editor { margin-top: 15px; border: 1px dashed oklch(.76 .07 190); border-radius: 8px; background: oklch(.98 .012 190); }
.record-editor summary { list-style: none; cursor: pointer; }
.record-editor summary::-webkit-details-marker { display: none; }
.record-editor-summary { display: flex; align-items: center; gap: 10px; min-height: 57px; padding: 10px 13px; }
.record-editor-summary:focus-visible { outline: 3px solid oklch(.68 .15 190 / .35); outline-offset: 2px; }
.record-editor-icon { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 auto; border: 1px solid oklch(.72 .08 190); border-radius: 50%; color: var(--c-brand); font-size: 17px; font-weight: 450; line-height: 1; }
.record-editor-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.record-editor-copy strong { color: var(--c-ink-strong); font-size: 12px; }
.record-editor-copy small { color: var(--c-muted); font-size: 11px; overflow-wrap: anywhere; }
.record-editor-chevron { color: var(--c-brand); font-size: 18px; line-height: 1; transform: rotate(0deg); transition: transform .18s ease; }
.record-editor[open] .record-editor-chevron { transform: rotate(180deg); }
.record-editor[open] .record-editor-summary { border-bottom: 1px solid oklch(.88 .04 190); background: oklch(.965 .02 190); }
.record-editor .subform { margin: 0; padding: 16px; border: 0; border-radius: 0 0 8px 8px; background: transparent; box-shadow: none; }
.case-completion-panel { margin-top: 18px; padding: 16px; border: 2px dashed oklch(.62 .13 155); border-radius: 9px; background: oklch(.975 .025 155); }
.case-completion-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.case-completion-kicker { display: block; margin-bottom: 4px; color: oklch(.42 .1 155); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.case-completion-head h3 { margin: 0 0 3px; color: var(--c-ink-strong); font-size: 17px; }
.case-completion-head p { margin: 0; color: var(--c-muted); font-size: 12px; line-height: 1.45; }
.case-completion-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 8px; }
.case-completion-action { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border: 1px solid oklch(.78 .08 155); border-radius: 8px; background: var(--c-surface); color: inherit; text-decoration: none; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.case-completion-action:hover { border-color: oklch(.55 .12 155); background: oklch(.995 .01 155); transform: translateY(-1px); }
.case-completion-action:focus-visible { outline: 3px solid oklch(.68 .15 155 / .32); outline-offset: 2px; }
.case-completion-action > span:nth-child(2) { display: grid; flex: 1; gap: 2px; min-width: 0; }
.case-completion-action strong { color: oklch(.35 .08 155); font-size: 12px; }
.case-completion-action small { color: var(--c-muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.case-completion-icon { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border: 1px solid oklch(.62 .13 155); border-radius: 50%; color: oklch(.42 .1 155); font-size: 17px; line-height: 1; }
.case-completion-arrow { color: oklch(.42 .1 155); font-size: 17px; line-height: 1; }
.case-completion-action.is-disabled { border-color: var(--c-border); background: oklch(.965 .006 250); cursor: default; opacity: .72; }
.case-completion-action.is-disabled strong, .case-completion-action.is-disabled small, .case-completion-action.is-disabled .case-completion-icon, .case-completion-action.is-disabled .case-completion-arrow { color: var(--c-muted); }
.case-completion-action.is-disabled .case-completion-icon { border-color: var(--c-border); }
.case-completion-action.is-disabled:hover { border-color: var(--c-border); background: oklch(.965 .006 250); transform: none; }
.actions-menu { position: relative; z-index: 2; }
.actions-trigger { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 14px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-ink-strong); cursor: pointer; font: inherit; font-size: 12px; font-weight: 730; }
.actions-trigger .actions-chevron { width: 7px; height: 7px; margin: -3px 1px 0 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; color: var(--c-brand); transform: rotate(45deg); transition: transform .18s ease; }
.actions-trigger:hover, .actions-menu.is-open .actions-trigger { border-color: var(--c-brand); color: var(--c-brand); }
.actions-trigger:focus-visible { outline: 3px solid oklch(.68 .15 190 / .35); outline-offset: 2px; }
.actions-menu.is-open .actions-trigger .actions-chevron { transform: rotate(225deg); }
.actions-menu-panel { position: absolute; top: calc(100% + 7px); right: 0; display: grid; min-width: 220px; padding: 5px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); box-shadow: 0 14px 30px oklch(.25 .04 250 / .13); opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .16s ease, transform .16s ease, visibility .16s ease; visibility: hidden; }
.actions-menu.is-open .actions-menu-panel { opacity: 1; pointer-events: auto; transform: translateY(0); visibility: visible; }
.actions-menu-panel a { padding: 10px 11px; border-radius: 5px; color: var(--c-ink); font-size: 12px; font-weight: 650; line-height: 1.35; text-decoration: none; }
.actions-menu-panel a:hover, .actions-menu-panel a:focus-visible { background: var(--c-teal-soft); color: var(--c-brand); outline: 0; }
.card-edit-action, .clinical-event-edit, .followup-edit { flex: 0 0 auto; padding: 7px 10px; font-size: 11px; line-height: 1; white-space: nowrap; text-decoration: none; }
.clinical-event-edit { margin-top: 1px; }
.followup-row { align-items: flex-start; }
.followup-edit { margin-left: auto; }
.action-form-panel { border: 2px dashed oklch(.62 .13 155); background: oklch(.985 .012 155); }
.action-form-panel .panel-head { background: oklch(.97 .025 155); border-bottom-color: oklch(.84 .07 155); }
.action-form-panel .panel-body { background: var(--c-surface); }
.action-form-tag { padding: 4px 8px; border-radius: 99px; background: oklch(.91 .06 155); color: oklch(.35 .08 155); font-size: 11px; font-weight: 750; white-space: nowrap; }
.action-form .field-help { display: block; margin-top: 2px; color: var(--c-muted); font-size: 11px; }
.additional-case > .panel { border-color: oklch(.78 .08 190); }
@media (max-width: 760px) { .recorded-marker { align-items: flex-start; flex-direction: column; gap: 2px; } .case-completion-actions { grid-template-columns: 1fr; } .actions-menu { width: 100%; } .actions-trigger { width: 100%; justify-content: space-between; } }
@media (max-width: 430px) { .actions-menu-panel { right: auto; left: 0; min-width: 100%; } }
@media (max-width: 430px) { .card-edit-action, .clinical-event-edit, .followup-edit { width: auto; } }

.team-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr); gap: 22px; align-items: start; }
.team-primary, .team-aside { display: grid; gap: 22px; min-width: 0; }
.seat-badge, .permission-note { color: var(--c-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.member-row { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 15px 0; border-bottom: 1px solid var(--c-border); }
.member-row:last-child { border-bottom: 0; }
.member-row--owner { padding-top: 0; }
.member-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.member-copy strong { color: var(--c-ink-strong); font-size: 14px; overflow-wrap: anywhere; }
.member-copy small { color: var(--c-muted); font-size: 12px; overflow-wrap: anywhere; }
.member-status { color: var(--c-muted); font-size: 12px; white-space: nowrap; }
.member-action { margin-left: auto; }
.inline-action--danger:hover { color: var(--c-danger); }
.avatar--mint { background: oklch(.91 .06 165); color: oklch(.32 .08 165); }
.avatar--small { width: 30px; height: 30px; font-size: 10px; }
.team-empty { display: flex; align-items: center; gap: 16px; padding: 19px 0 3px; }
.empty-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border: 1px dashed oklch(.76 .08 190); border-radius: 50%; color: var(--c-teal); font-size: 24px; font-weight: 400; }
.team-empty h3 { margin-bottom: 4px; }
.team-empty p { margin-bottom: 13px; color: var(--c-muted); font-size: 13px; }
.team-empty .button { width: auto; min-height: 36px; padding: 0 12px; font-size: 12px; }
.permissions-panel .panel-body { padding-top: 8px; }
.permissions-form { display: grid; }
.permission-row { display: flex; align-items: center; gap: 13px; min-height: 62px; padding: 10px 0; border-bottom: 1px solid var(--c-border); cursor: pointer; }
.permission-row:last-of-type { border-bottom: 0; }
.permission-copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.permission-copy strong { color: var(--c-ink-strong); font-size: 13px; }
.permission-copy small { color: var(--c-muted); font-size: 12px; }
.permission-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 99px; background: oklch(.87 .018 250); transition: background .18s ease; }
.toggle::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px oklch(.25 .04 250 / .2); content: ""; transition: transform .18s ease; }
.permission-row input:checked + .toggle { background: var(--c-teal); }
.permission-row input:checked + .toggle::after { transform: translateX(16px); }
.permission-row input:focus-visible + .toggle { outline: 3px solid oklch(.68 .15 190 / .35); outline-offset: 2px; }
.access-note .panel-body { padding: 22px; }
.note-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 15px; border-radius: 8px; background: var(--c-teal-soft); color: var(--c-teal); font-size: 20px; }
.access-note h2 { margin-bottom: 8px; }
.access-note p { margin-bottom: 18px; color: var(--c-muted); font-size: 13px; line-height: 1.65; }
.access-rule { display: flex; gap: 9px; align-items: flex-start; padding-top: 14px; border-top: 1px solid var(--c-border); color: var(--c-ink); font-size: 12px; line-height: 1.45; }
.access-rule-dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: var(--c-teal); }
.pending-row { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; }
.pending-row > span:last-child { display: grid; gap: 3px; min-width: 0; }
.pending-row > form { margin-left: auto; flex: 0 0 auto; }
.pending-row strong { color: var(--c-ink-strong); font-size: 12px; overflow-wrap: anywhere; }
.pending-row small { color: var(--c-muted); font-size: 11px; }
.pending-help { margin: 0; padding-top: 13px; border-top: 1px solid var(--c-border); color: var(--c-muted); font-size: 11px; line-height: 1.55; }
.recommended-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.recommended-list li { display: flex; align-items: center; gap: 9px; color: var(--c-ink); font-size: 12px; }
.check { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--c-teal-soft); color: oklch(.43 .1 190); font-size: 12px; font-weight: 800; }
.check--off { background: oklch(.95 .01 250); color: var(--c-muted); }
.invite-link { display: grid; gap: 14px; margin-bottom: 22px; border-color: oklch(.82 .08 190); background: var(--c-teal-soft); color: var(--c-ink); }
.invite-link strong { color: var(--c-ink-strong); }
.invite-link p { margin: 4px 0 0; color: var(--c-muted); font-size: 12px; }
.invite-link-row { display: flex; gap: 8px; }
.invite-link-row input { min-width: 0; flex: 1; background: var(--c-surface); font-size: 12px; }
.invite-link-row .button { min-width: 100px; }
.invite-form { display: flex; align-items: end; gap: 12px; }
.invite-form .field { flex: 1; }
.invite-open-copy { flex: 1; margin: 0; color: var(--c-muted); font-size: 12px; line-height: 1.55; }
.invite-form .button { flex: 0 0 auto; }

.followup-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 22px; }
.followup-stat { display: grid; gap: 4px; padding: 15px; border: 1px solid var(--c-border); border-radius: 9px; background: var(--c-surface); color: inherit; text-decoration: none; transition: border-color .18s ease, transform .18s ease; }
.followup-stat:hover { border-color: oklch(.74 .07 190); transform: translateY(-1px); }
.followup-stat.is-active { border-color: var(--c-teal); box-shadow: 0 0 0 2px oklch(.74 .12 190 / .14); }
.followup-stat small { color: var(--c-muted); font-size: 11px; font-weight: 700; }
.followup-stat strong { color: var(--c-ink-strong); font-size: 25px; font-weight: 760; line-height: 1; }
.followup-stat span { color: var(--c-muted); font-size: 11px; line-height: 1.4; }
.followup-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .72fr); gap: 22px; align-items: start; }
.followup-layout > .panel { min-width: 0; }
.filter-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 10px; }
.followup-list { display: grid; }
.followup-card { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--c-border); }
.followup-card:last-child { border-bottom: 0; }
.followup-card-date { display: grid; align-content: start; gap: 4px; padding-left: 13px; border-left: 2px solid var(--c-teal); }
.followup-card-date strong { color: var(--c-ink-strong); font-size: 13px; }
.followup-card-date small { color: var(--c-muted); font-size: 11px; line-height: 1.45; }
.followup-card-copy { min-width: 0; }
.followup-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.followup-patient { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.followup-patient > span { display: block; }
.followup-card-head > div { min-width: 0; }
.followup-card-head a { display: block; color: var(--c-ink-strong); font-size: 14px; font-weight: 750; text-decoration: none; }
.followup-card-head a:hover { color: var(--c-brand); }
.followup-card-head small { display: block; margin-top: 4px; color: var(--c-muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.followup-card-copy p { margin: 11px 0 7px; color: var(--c-ink); font-size: 12px; line-height: 1.6; }
.followup-recorded { color: var(--c-muted); font-size: 10px; }
.status--disease_free { background: var(--c-teal-soft); color: oklch(.43 .1 190); }
.status--recurrence { background: oklch(.96 .055 75); color: oklch(.45 .11 75); }
.status--lost_to_follow_up { background: oklch(.95 .025 25); color: var(--c-danger); }
.followup-add .panel-body { padding: 20px; }
.followup-add .form-grid { grid-template-columns: 1fr; }
.field-help { display: block; margin-top: 6px; color: var(--c-muted); font-size: 11px; line-height: 1.45; }
@media (max-width: 1050px) { .followup-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .followup-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .filter-links { justify-content: flex-start; } .followup-card { grid-template-columns: 1fr; gap: 11px; } .followup-card-date { padding: 0 0 0 10px; } }
@media (max-width: 430px) { .followup-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .followup-stat { padding: 12px; } .followup-stat strong { font-size: 22px; } }

.coming-soon-badge { display: inline-flex; align-items: center; min-height: 31px; padding: 0 11px; border: 1px solid oklch(.82 .08 190); border-radius: 99px; background: var(--c-teal-soft); color: oklch(.43 .1 190); font-size: 11px; font-weight: 750; white-space: nowrap; }
.documents-coming { display: grid; grid-template-columns: minmax(190px, .55fr) minmax(0, 1fr); gap: 42px; align-items: center; min-height: 370px; padding: 42px; }
.documents-coming-visual { position: relative; display: grid; place-items: center; min-height: 230px; border: 1px solid var(--c-border); border-radius: 12px; background: oklch(.98 .012 250); }
.document-sheet { display: grid; gap: 13px; width: 116px; height: 148px; padding: 31px 22px 20px; border: 1px solid oklch(.82 .04 250); border-radius: 7px; background: var(--c-surface); box-shadow: 0 11px 25px oklch(.26 .04 250 / .08); transform: rotate(-4deg); }
.document-sheet i { display: block; height: 5px; border-radius: 99px; background: oklch(.83 .025 250); }
.document-sheet i:first-child { width: 58%; background: oklch(.72 .09 190); }
.document-plus { position: absolute; right: calc(50% - 71px); bottom: 38px; display: grid; place-items: center; width: 39px; height: 39px; border: 4px solid var(--c-surface); border-radius: 50%; background: var(--c-brand); color: white; font-size: 22px; line-height: 1; }
.documents-coming-copy { max-width: 610px; }
.documents-coming-copy h2 { max-width: 15ch; margin-bottom: 12px; font-size: 27px; line-height: 1.15; }
.documents-coming-copy > p:not(.page-kicker) { max-width: 58ch; margin-bottom: 24px; color: var(--c-muted); font-size: 14px; line-height: 1.7; }
.documents-coming-list { display: grid; gap: 11px; margin-bottom: 25px; }
.documents-coming-list span { display: flex; align-items: center; gap: 10px; color: var(--c-ink); font-size: 12px; }
.documents-coming-list b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c-teal-soft); color: oklch(.43 .1 190); font-size: 10px; }
.documents-notice { display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 18px; color: var(--c-muted); font-size: 12px; }
.documents-notice strong { color: var(--c-ink); }
@media (max-width: 760px) { .documents-coming { grid-template-columns: 1fr; gap: 27px; padding: 24px; } .documents-coming-visual { min-height: 190px; } .documents-coming-copy h2 { font-size: 24px; } }
@media (max-width: 430px) { .documents-coming { padding: 18px; } .documents-coming .button { width: 100%; } }

.report-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr); gap: 22px; align-items: start; }

.rail-brand > span:last-child { display: none; }
.rail-logo { display: block; width: 148px; height: 40px; object-fit: contain; object-position: left center; filter: brightness(0) invert(1); }
.rail-menu-toggle { display: none; }
.rail-menu-label { font-size: 12px; font-weight: 730; }
.rail-menu-lines { display: grid; gap: 4px; }
.rail-menu-lines i { display: block; width: 17px; height: 1.5px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
.rail-menu-toggle.is-open .rail-menu-lines i:first-child { transform: translateY(5.5px) rotate(45deg); }
.rail-menu-toggle.is-open .rail-menu-lines i:nth-child(2) { opacity: 0; }
.rail-menu-toggle.is-open .rail-menu-lines i:last-child { transform: translateY(-5.5px) rotate(-45deg); }
.report-primary, .report-aside { display: grid; gap: 22px; min-width: 0; }
.panel-meta { color: var(--c-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.report-form { display: grid; gap: 0; }
.report-divider { display: flex; align-items: center; gap: 12px; margin: 23px 0 13px; color: var(--c-muted); font-size: 11px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.report-divider::after { height: 1px; flex: 1; background: var(--c-border); content: ""; }
.report-section-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.report-option { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--c-border); border-radius: 8px; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.report-option:hover { border-color: oklch(.74 .07 190); background: oklch(.985 .012 190); }
.report-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.report-option input:focus-visible + .report-check { outline: 3px solid oklch(.68 .15 190 / .35); outline-offset: 2px; }
.report-check { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 auto; border: 1px solid var(--c-border); border-radius: 5px; color: transparent; font-size: 12px; font-weight: 800; }
.report-option input:checked + .report-check { border-color: var(--c-teal); background: var(--c-teal); color: white; }
.report-option > span:last-child { display: grid; gap: 3px; min-width: 0; }
.report-option strong { color: var(--c-ink-strong); font-size: 12px; }
.report-option small { color: var(--c-muted); font-size: 11px; line-height: 1.45; }
.report-preview .panel-head { align-items: flex-start; }
.report-export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.report-export-actions .button { min-height: 35px; padding: 0 12px; font-size: 12px; }
.report-context { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 17px; border-bottom: 1px solid var(--c-border); color: var(--c-muted); font-size: 11px; line-height: 1.5; }
.report-context span:last-child { text-align: right; }
.report-summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 17px 0; }
.report-summary-item { min-width: 0; padding: 11px; border: 1px solid var(--c-border); border-radius: 7px; background: oklch(.995 .003 250); }
.report-summary-item small { display: block; min-height: 27px; color: var(--c-muted); font-size: 10px; line-height: 1.35; }
.report-summary-item strong { display: block; margin-top: 4px; color: var(--c-ink-strong); font-size: 22px; font-weight: 760; }
.report-breakdown { display: flex; justify-content: space-between; gap: 14px; padding: 11px 13px; border: 1px solid var(--c-border); border-radius: 7px; background: oklch(.98 .008 250); color: var(--c-muted); font-size: 11px; line-height: 1.5; }
.report-breakdown strong { color: var(--c-ink); }
.report-table-wrap { overflow-x: auto; margin-top: 18px; }
.report-table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 12px; }
.report-table th { padding: 10px 9px; border-bottom: 1px solid var(--c-border); color: var(--c-muted); font-size: 10px; font-weight: 750; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.report-table td { padding: 12px 9px; border-bottom: 1px solid var(--c-border); color: var(--c-ink); vertical-align: top; }
.report-table tr:last-child td { border-bottom: 0; }
.report-table td strong { display: block; color: var(--c-ink-strong); font-size: 12px; }
.report-table td small { display: block; margin-top: 4px; color: var(--c-muted); font-size: 11px; line-height: 1.45; }
.report-list { padding-top: 7px; }
.report-list-item-wrap { display: flex; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--c-border); }
.report-list-item-wrap:last-child { border-bottom: 0; }
.report-list-item-wrap .report-list-item { flex: 1; border-bottom: 0; }
.report-list-item-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; padding-top: 13px; }
.report-list-item-actions .inline-action { min-height: 30px; padding: 6px 9px; border: 1px solid var(--c-border); border-radius: 7px; background: var(--c-surface); font-size: 11px; }
.report-list-item-actions .inline-action--download { color: var(--c-brand); font-weight: 700; text-decoration: none; }
.report-list-item-actions .inline-action--download:hover { border-color: var(--c-brand); background: var(--c-bg); color: var(--c-brand-deep); }
.report-list-item-actions .report-delete-form { display: flex; margin: 0; }
.report-list-item-actions .inline-action--danger { border-color: transparent; background: transparent; }
.report-list-item { display: flex; align-items: flex-start; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--c-border); color: inherit; text-decoration: none; }
.report-list-item:last-child { border-bottom: 0; }
.report-list-item:hover, .report-list-item.is-active { color: var(--c-brand); }
.report-list-item > span:last-child { display: grid; gap: 3px; min-width: 0; }
.report-list-item strong { color: var(--c-ink-strong); font-size: 13px; overflow-wrap: anywhere; }
.report-list-item small { color: var(--c-muted); font-size: 11px; }
.report-list-mark { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 8px; background: var(--c-teal-soft); color: var(--c-teal); font-size: 16px; }
.report-list-item.is-active .report-list-mark { background: var(--c-brand); color: white; }
.empty--compact { padding: 20px 0 8px; }
.report-help .panel-body { padding: 22px; }
.report-help h2 { margin-bottom: 8px; }
.report-help p { margin-bottom: 18px; color: var(--c-muted); font-size: 13px; line-height: 1.65; }
@media (max-width: 1050px) { .report-layout { grid-template-columns: 1fr; } .report-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); } .report-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .report-aside { grid-template-columns: 1fr; } .report-section-list { grid-template-columns: 1fr; } .report-preview .panel-head { gap: 15px; } .report-export-actions { justify-content: flex-start; width: 100%; } .report-export-actions .button { flex: 1; } .report-context, .report-breakdown { align-items: flex-start; flex-direction: column; } .report-context span:last-child { text-align: left; } .report-list-item-actions { width: 100%; justify-content: flex-start; padding-top: 0; padding-bottom: 13px; } }

.multiple-comorbidity-field { display: grid; }
.patient-edit-page .patient-edit-form,
.patient-edit-page .patient-edit-form .form-section,
.patient-edit-page .patient-edit-form .form-grid,
.patient-edit-page .patient-edit-form .field { display: block; height: auto; max-height: none; overflow: visible; visibility: visible; }
.patient-edit-page .patient-edit-form .form-grid { display: grid; }
.patient-edit-page .patient-edit-form .field { display: grid; }
.patient-edit-page .patient-edit-form input,
.patient-edit-page .patient-edit-form select,
.patient-edit-page .patient-edit-form textarea { display: block; visibility: visible; opacity: 1; }
.additional-case { margin-top: 20px; }
.additional-case > .panel { margin-top: 0; }
@media (max-width: 430px) { .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .report-export-actions { align-items: flex-start; flex-direction: column; } .report-export-actions .button { width: 100%; } .report-list-item-wrap > form { padding-top: 16px; } }
@media (max-width: 760px) { .workspace-search { padding: 17px; } .workspace-search-form { align-items: stretch; flex-direction: column; } .workspace-search-form .button { width: 100%; } }
@media (max-width: 430px) { .workspace-search-results-head { align-items: flex-start; flex-direction: column; gap: 6px; } .workspace-search-results-head > div { align-items: flex-start; flex-direction: column; gap: 1px; } .workspace-search-result { align-items: flex-start; } .workspace-search-result-copy small { white-space: normal; } .workspace-search-arrow { margin-top: 2px; } }
@media (max-width: 1050px) { .team-layout { grid-template-columns: 1fr; } .team-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .team-aside { grid-template-columns: 1fr; } .invite-form { align-items: stretch; flex-direction: column; } .invite-form .button { width: 100%; } .member-row { flex-wrap: wrap; } .member-action { width: 100%; margin-left: 61px; } .member-action .inline-action { width: auto; } .permission-note { white-space: normal; text-align: right; } }
@media (max-width: 430px) { .invite-link-row { align-items: stretch; flex-direction: column; } .invite-link-row .button { width: 100%; } .team-empty { align-items: flex-start; flex-direction: column; } }

@media (max-width: 760px) {
    .side-rail { position: sticky; top: 0; z-index: 20; padding: 10px 12px; box-shadow: 0 8px 18px oklch(.25 .04 250 / .12); }
    .rail-brand { padding: 4px 58px 10px 8px; }
    .rail-menu-toggle { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 38px; padding: 0 11px; border: 1px solid oklch(.75 .05 250); border-radius: 7px; background: oklch(1 0 0 / .08); color: white; font: inherit; cursor: pointer; }
    .rail-menu-toggle:hover, .rail-menu-toggle.is-open { border-color: var(--c-teal); background: oklch(1 0 0 / .14); }
    .rail-menu-toggle:focus-visible { outline: 3px solid oklch(.78 .12 190 / .5); outline-offset: 2px; }
    .side-rail.clinical-menu-ready:not(.is-menu-open) .workspace-label, .side-rail.clinical-menu-ready:not(.is-menu-open) .rail-nav, .side-rail.clinical-menu-ready:not(.is-menu-open) .rail-bottom { display: none; }
    .side-rail.is-menu-open .workspace-label { display: grid; }
    .side-rail.is-menu-open .rail-nav { display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 2px; }
    .side-rail.is-menu-open .rail-bottom { display: flex; }
}
@media (max-width: 430px) {
    .rail-menu-toggle { top: 10px; right: 10px; min-height: 36px; padding: 0 10px; }
    .rail-brand { padding-right: 54px; }
}

/* Dashboard shell: permanent desktop rail and real mobile drawer. */
body { overflow-x: hidden; }
.app-shell { min-width: 0; }
.mobile-app-header, .mobile-sidebar-backdrop, .rail-close { display: none; }
.workspace-label {
    margin: 16px 4px;
    padding: 12px;
    border: 1px solid oklch(1 0 0 / .1);
    border-radius: 8px;
    background: oklch(1 0 0 / .05);
}
.rail-group { display: grid; gap: 4px; }
.rail-divider { margin: 12px 4px; border-top: 1px solid oklch(1 0 0 / .1); }
.rail-nav a { min-width: 0; padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.rail-nav a.is-active { padding-left: 12px; border-left: 4px solid var(--c-teal); background: oklch(1 0 0 / .1); box-shadow: none; }
.rail-nav a:not(.is-active) { color: oklch(.75 .025 250); transition: background .18s ease, color .18s ease, transform .18s ease; }
.rail-nav a:not(.is-active):hover { background: oklch(1 0 0 / .05); color: white; transform: translateX(1px); }
.rail-bottom { padding: 16px 8px 4px; }
.rail-user { flex: 1; padding: 10px; border: 1px solid oklch(1 0 0 / .1); border-radius: 8px; background: oklch(1 0 0 / .05); }
.rail-settings { margin-left: auto; color: oklch(.75 .025 250); font-size: 16px; line-height: 1; }
.callout { position: relative; }
.callout-dismiss {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--c-muted);
    font-size: 22px;
    line-height: 1;
    transition: background .18s ease, color .18s ease;
}
.callout-dismiss:hover { background: var(--c-bg); color: var(--c-ink); }
[data-onboarding-card][hidden] { display: none; }
.recent-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.empty { display: grid; justify-items: center; padding: 32px 12px; text-align: center; }
.empty p { max-width: 42ch; }

@media (min-width: 1024px) {
    .app-shell { display: block; min-height: 100vh; }
    .side-rail {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: 256px;
        height: 100vh;
        min-height: 100vh;
        padding: 16px;
        overflow-y: auto;
    }
    .main {
        width: calc(100% - 256px);
        max-width: none;
        margin: 0 0 0 256px;
    }
    .content-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
    .content-grid > section:first-child { grid-column: span 8; }
    .content-grid > aside:last-child { grid-column: span 4; }
    .content-grid > .panel { min-width: 0; }
    .panel { min-width: 0; }
}

@media (max-width: 1023px) {
    .app-shell { display: block; min-height: 100vh; }
    .mobile-app-header {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 62px;
        padding: 12px 16px;
        background: var(--c-brand-deep);
        color: white;
    }
    .mobile-app-brand { display: inline-flex; align-items: center; text-decoration: none; }
    .mobile-app-brand img { display: block; width: 132px; height: 36px; object-fit: contain; object-position: left center; filter: brightness(0) invert(1); }
    .mobile-menu-toggle {
        display: inline-grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border: 1px solid oklch(1 0 0 / .2);
        border-radius: 10px;
        background: oklch(1 0 0 / .08);
        color: white;
        transition: background .18s ease, border-color .18s ease, transform .18s ease;
    }
    .mobile-menu-toggle:hover { border-color: var(--c-teal); background: oklch(1 0 0 / .14); }
    .mobile-menu-toggle:active { transform: scale(.95); }
    .mobile-menu-toggle:focus-visible, .rail-close:focus-visible, .mobile-sidebar-backdrop:focus-visible { outline: 3px solid oklch(.78 .12 190 / .55); outline-offset: 2px; }
    .mobile-menu-icon { display: grid; gap: 5px; width: 20px; }
    .mobile-menu-icon i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s ease, opacity .2s ease; }
    .mobile-menu-toggle.is-open .mobile-menu-icon i:first-child { transform: translateY(7px) rotate(45deg); }
    .mobile-menu-toggle.is-open .mobile-menu-icon i:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.is-open .mobile-menu-icon i:last-child { transform: translateY(-7px) rotate(-45deg); }
    .side-rail {
        position: fixed !important;
        inset: 0 auto 0 0;
        z-index: 50;
        display: flex;
        width: 256px !important;
        height: 100vh;
        min-height: 100vh;
        padding: 16px;
        overflow-y: auto;
        box-shadow: 14px 0 36px oklch(.2 .04 250 / .22);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .3s ease, visibility .3s ease;
    }
    .app-shell.menu-open .side-rail { transform: translateX(0); visibility: visible; }
    .mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: oklch(.2 .04 250 / .5);
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s ease;
    }
    .app-shell.menu-open .mobile-sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .rail-close {
        display: inline-grid;
        place-items: center;
        position: absolute;
        top: 18px;
        right: 16px;
        width: 34px;
        height: 34px;
        border: 1px solid oklch(1 0 0 / .18);
        border-radius: 8px;
        background: oklch(1 0 0 / .07);
        color: white;
        font-size: 24px;
        line-height: 1;
        transition: background .18s ease, border-color .18s ease, transform .18s ease;
    }
    .rail-close:hover { border-color: var(--c-teal); background: oklch(1 0 0 / .14); transform: rotate(4deg); }
    .rail-brand { padding-right: 48px; }
    .rail-nav { grid-template-columns: 1fr; }
    .main { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 24px 16px 48px; }
    .topline { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 24px; }
    .topline > .button { width: 100%; }
    .workspace-search { padding: 16px; background: var(--c-surface); }
    .workspace-search-form { align-items: stretch; flex-direction: column; gap: 10px; }
    .workspace-search-form .button { width: 100%; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat { min-width: 0; padding: 16px; }
    .stat small { font-size: 11px; }
    .stat strong { font-size: 26px; }
    .content-grid { grid-template-columns: 1fr; gap: 16px; }
    .content-grid > * { min-width: 0; }
    .panel-head { align-items: flex-start; }
}

@media (max-width: 430px) {
    .mobile-app-header { padding: 10px 12px; }
    .mobile-app-brand img { width: 124px; height: 34px; }
    .main { padding: 20px 12px 40px; }
    .stat-grid { gap: 9px; }
    .stat { padding: 14px 12px; }
    .stat strong { font-size: 22px; }
    .panel-body { padding: 16px; }
    .panel-head { padding: 16px; }
}

/* Patients registry and drawer refinements. */
.rail-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    justify-content: stretch;
    margin-top: auto;
    padding: 12px;
    border: 1px solid oklch(1 0 0 / .1);
    border-radius: 12px;
    background: oklch(1 0 0 / .05);
}
.rail-user { width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; }
.rail-user > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 1px; }
.rail-user > span:nth-child(2) strong, .rail-user > span:nth-child(2) small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user > span:nth-child(2) strong { font-size: 12px; }
.rail-user > span:nth-child(2) small { color: oklch(.8 .03 250); font-size: 10px; }
.rail-user-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 1px; }
.rail-user-copy strong, .rail-user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user-copy strong { font-size: 12px; }
.rail-user-copy small { color: oklch(.8 .03 250); font-size: 10px; }
.rail-bottom .signout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0;
    padding-top: 8px;
    border-top: 1px solid oklch(1 0 0 / .1);
    color: oklch(.75 .025 250);
    font-size: 12px;
    transition: color .18s ease;
}
.rail-bottom .signout:hover { color: oklch(.7 .16 25); }
.patients-registry { overflow: hidden; border-radius: 12px; }
.patients-registry-head { align-items: flex-start; flex-wrap: wrap; }
.patients-registry-head h2 { margin-bottom: 4px; font-size: 20px; letter-spacing: -.02em; }
.patient-count { font-variant-numeric: tabular-nums; }
.registry-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 8px;
    background: oklch(.96 .01 250);
    color: var(--c-ink);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.filter-toggle:hover { background: oklch(.92 .015 250); color: var(--c-ink-strong); }
.filter-toggle.is-active { background: var(--c-brand); color: white; box-shadow: 0 2px 8px oklch(.39 .15 250 / .16); }
.registry-toolbar { margin: 0 0 20px; }
.registry-toolbar .search-form { width: 100%; flex: 1 1 auto; align-items: stretch; }
.search-field { position: relative; display: block; min-width: 0; flex: 1 1 auto; }
.search-field input { min-height: 44px; padding-left: 38px; border-radius: 9px; }
.search-field-icon { position: absolute; top: 50%; left: 13px; z-index: 1; color: var(--c-brand); font-size: 22px; line-height: 1; pointer-events: none; transform: translateY(-53%); }
.registry-toolbar .button { min-height: 44px; }
.button-search-icon { font-size: 18px; line-height: 1; }
.patient-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.patient-table { min-width: 820px; border-collapse: collapse; }
.patient-table th { padding: 12px 16px; border-bottom: 2px solid var(--c-border); background: oklch(.975 .008 250); color: var(--c-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.patient-table td { padding: 14px 16px; border-bottom: 1px solid var(--c-border); }
.patient-table th:nth-child(1) { width: 24%; }
.patient-table th:nth-child(2) { width: 15%; }
.patient-table th:nth-child(3) { width: 23%; }
.patient-table th:nth-child(4) { width: 9%; text-align: right; }
.patient-table th:nth-child(5) { width: 13%; }
.patient-table th:nth-child(6) { width: 16%; }
.patient-table td:nth-child(4) { text-align: right; }
.patient-table tbody tr { transition: background .18s ease; }
.patient-table tbody tr:hover { background: oklch(.98 .012 250); }
.patient-cell-copy { display: grid; min-width: 0; gap: 3px; }
.patient-name { overflow: hidden; color: var(--c-ink-strong); font-weight: 720; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.patient-name:hover { color: var(--c-brand); }
.patient-cell-copy small { color: var(--c-muted); font-size: 12px; }
.table-actions { gap: 6px; }
.table-actions form { display: inline-flex; margin: 0; }
.inline-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.inline-action--brief { background: oklch(.96 .01 250); color: var(--c-ink); font-weight: 500; }
.inline-action--brief:hover { background: oklch(.92 .015 250); color: var(--c-ink-strong); }
.inline-action--archive { color: var(--c-muted); }
.inline-action--archive:hover { background: oklch(.96 .03 25); color: oklch(.48 .16 25); }
.inline-action--danger { background: oklch(.97 .025 25); color: var(--c-danger); }
.inline-action--danger:hover { background: oklch(.93 .06 25); color: oklch(.42 .16 25); }
.empty { display: grid; justify-items: center; padding: 48px 24px; text-align: center; }

@media (max-width: 1023px) {
    .side-rail { width: 288px !important; }
    .rail-bottom { margin-top: auto; }
    .patient-table { display: table; }
    .patient-table thead { display: table-header-group; }
    .patient-table tbody { display: table-row-group; }
    .patient-table tr { display: table-row; padding: 0; }
    .patient-table th, .patient-table td { display: table-cell; }
    .patient-table td[data-label]::before { display: none; }
    .patient-table-wrap { margin-right: -1px; }
}

@media (max-width: 600px) {
    .patients-registry-head { gap: 12px; }
    .registry-filters { width: 100%; margin-left: 0; }
    .filter-toggle { flex: 1 1 0; }
    .registry-toolbar .search-form { flex-direction: column; }
    .registry-toolbar .button { width: 100%; }
}

/* Patient brief: clinical scanability and action hierarchy. */
.brief-header { align-items: flex-start; gap: 24px; margin-bottom: 20px; }
.brief-identity-copy { min-width: 0; }
.brief-patient-name { margin-bottom: 9px; font-size: 28px; line-height: 1.15; letter-spacing: -.025em; }
.brief-demographics { display: flex; flex-wrap: wrap; gap: 6px; }
.brief-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 10px; border-radius: 6px; background: oklch(.96 .01 250); color: var(--c-ink); font-size: 12px; font-weight: 500; }
.brief-actions { align-items: center; }
.brief-actions .button { min-height: 38px; font-size: 12px; }
.brief-primary-action { background: var(--c-teal); color: var(--c-brand-deep); font-weight: 750; box-shadow: var(--shadow); }
.brief-primary-action:hover { background: oklch(.58 .15 190); color: var(--c-brand-deep); }
.brief-secondary-action { background: oklch(.96 .01 250); color: var(--c-ink); font-weight: 500; }
.brief-secondary-action:hover { border-color: oklch(.84 .015 250); background: oklch(.92 .015 250); color: var(--c-ink-strong); }
.brief-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; }
.brief-main { grid-column: span 8; gap: 20px; }
.brief-aside { grid-column: span 4; gap: 20px; }
.brief-panel { border-radius: 12px; }
.brief-snapshot-grid { gap: 12px; }
.brief-snapshot-item { padding: 16px; border-radius: 12px; background: oklch(.975 .008 250); }
.brief-snapshot-item span { color: var(--c-muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.brief-snapshot-item strong { margin: 5px 0 4px; font-size: 14px; font-weight: 700; }
.brief-snapshot-item small { color: var(--c-muted); font-size: 12px; }
.brief-empty-state { display: grid; justify-items: center; padding: 32px; border: 1px solid var(--c-border); border-radius: 12px; background: var(--c-surface); text-align: center; }
.brief-empty-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px; border: 1px solid var(--c-border); border-radius: 50%; color: var(--c-muted); font-size: 18px; }
.brief-empty-state h3 { margin-bottom: 5px; color: var(--c-ink-strong); font-size: 15px; }
.brief-empty-state p { margin: 0; color: var(--c-muted); font-size: 12px; }
.brief-aside > .brief-panel { background: var(--c-surface); box-shadow: var(--shadow); }
.brief-aside .brief-data-list--details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.brief-aside .brief-data-list dt { margin-bottom: 2px; color: var(--c-muted); font-size: 11px; font-weight: 500; }
.brief-aside .brief-data-list dd { color: var(--c-ink-strong); font-size: 12px; font-weight: 650; }
.brief-data-muted { color: var(--c-muted); font-weight: 500; }
.comorbidity-list { display: flex; flex-wrap: wrap; gap: 5px; }
.comorbidity-chip { display: inline-block; padding: 3px 8px; border: 1px solid var(--c-border); border-radius: 6px; background: oklch(.96 .01 250); color: var(--c-ink-strong); font-size: 11px; font-weight: 650; }
.brief-guidance { align-items: flex-start; border-color: oklch(.85 .08 155 / .6); background: oklch(.96 .035 155 / .6); color: oklch(.35 .08 155); }
.brief-guidance strong { color: oklch(.32 .08 155); }
.brief-guidance p { color: oklch(.4 .07 155); }

@media (min-width: 600px) {
    .brief-snapshot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
    .brief-main, .brief-aside { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .brief-header { gap: 16px; }
    .brief-actions { width: 100%; align-items: stretch; justify-content: flex-start; }
    .brief-actions .button { width: 100%; }
    .brief-patient-name { font-size: 24px; }
}

@media (max-width: 599px) {
    .brief-snapshot-grid { grid-template-columns: 1fr; }
    .brief-empty-state { padding: 28px 18px; }
}

/* Patient timeline workspace: scoped visual polish only. */
.patient-workspace-page .breadcrumb {
    margin-bottom: 16px;
    color: var(--c-muted);
    font-size: 12px;
    font-weight: 500;
}
.patient-workspace-page .breadcrumb a {
    color: var(--c-muted);
    transition: color 180ms cubic-bezier(.25, 1, .5, 1);
}
.patient-workspace-page .breadcrumb a:hover { color: var(--c-ink-strong); }

.patient-workspace-page .record-actions .button-secondary {
    min-height: 36px;
    padding: 0 14px;
    border-color: transparent;
    border-radius: 8px;
    background: oklch(.96 .01 250);
    color: var(--c-ink);
    font-size: 12px;
    font-weight: 650;
}
.patient-workspace-page .record-actions .button-secondary:hover {
    border-color: transparent;
    background: oklch(.92 .015 250);
    color: var(--c-ink-strong);
}

.patient-workspace-page .clinical-timeline-section > .panel,
.patient-workspace-page .patient-context-rail > .panel {
    border-color: oklch(.9 .018 250 / .8);
    border-radius: 12px;
    background: var(--c-surface);
    box-shadow: 0 8px 24px oklch(.25 .04 250 / .055);
}
.patient-workspace-page .clinical-timeline-section > .panel > .panel-body { padding: 20px; }
.patient-workspace-page .patient-context-rail { min-width: 0; }

.patient-workspace-page .case {
    padding: 24px;
    border-color: oklch(.9 .018 250 / .8);
    border-radius: 12px;
    box-shadow: 0 3px 12px oklch(.25 .04 250 / .045);
}
.patient-workspace-page .case-head { margin-bottom: 18px; }
.patient-workspace-page .case-head h2,
.patient-workspace-page .clinical-event h3 {
    color: var(--c-ink-strong);
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.015em;
    line-height: 1.25;
    text-transform: capitalize;
}
.patient-workspace-page .case-label,
.patient-workspace-page .clinical-event-label {
    margin-bottom: 5px;
    color: var(--c-teal);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .02em;
}
.patient-workspace-page .case-head-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 7px 0 0;
}
.patient-workspace-page .case-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 3px 10px;
    border-radius: 999px;
    background: oklch(.95 .02 250);
    color: var(--c-muted);
    font-size: 12px;
    font-weight: 750;
}
.patient-workspace-page .case-status-badge--disease_free {
    background: oklch(.94 .06 155);
    color: oklch(.34 .09 155);
}
.patient-workspace-page .case-status-badge--recurrence {
    background: oklch(.95 .04 25);
    color: oklch(.42 .14 25);
}
.patient-workspace-page .case-status-badge--lost_to_follow_up {
    background: oklch(.95 .025 75);
    color: oklch(.42 .08 75);
}

.patient-workspace-page .card-edit-action,
.patient-workspace-page .clinical-event-edit,
.patient-workspace-page .patient-details-card .button-quiet,
.patient-workspace-page .followup-edit {
    min-height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: oklch(.96 .01 250);
    color: var(--c-ink);
    font-size: 12px;
    font-weight: 650;
    transition: background 180ms cubic-bezier(.25, 1, .5, 1), color 180ms cubic-bezier(.25, 1, .5, 1), transform 180ms cubic-bezier(.25, 1, .5, 1);
}
.patient-workspace-page .card-edit-action:hover,
.patient-workspace-page .clinical-event-edit:hover,
.patient-workspace-page .patient-details-card .button-quiet:hover,
.patient-workspace-page .followup-edit:hover {
    background: oklch(.92 .015 250);
    color: var(--c-ink-strong);
}
.patient-workspace-page .card-edit-action:active,
.patient-workspace-page .clinical-event-edit:active,
.patient-workspace-page .patient-details-card .button-quiet:active,
.patient-workspace-page .followup-edit:active { transform: scale(.97); }

.patient-workspace-page .case > .data-list,
.patient-workspace-page .clinical-event .data-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 0;
}
.patient-workspace-page .case > .data-list > div,
.patient-workspace-page .clinical-event .data-list > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid oklch(.94 .012 250);
    border-radius: 8px;
    background: oklch(.975 .008 250);
}
.patient-workspace-page .case > .data-list .field--wide,
.patient-workspace-page .clinical-event .data-list .field--wide { grid-column: 1 / -1; }
.patient-workspace-page .case > .data-list dt,
.patient-workspace-page .clinical-event .data-list dt {
    margin-bottom: 4px;
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .055em;
    line-height: 1.35;
    text-transform: uppercase;
}
.patient-workspace-page .case > .data-list dd,
.patient-workspace-page .clinical-event .data-list dd {
    color: var(--c-ink-strong);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.patient-workspace-page .clinical-events {
    gap: 12px;
    margin-top: 20px;
}
.patient-workspace-page .clinical-event {
    padding: 18px;
    border-color: oklch(.9 .018 250 / .8);
    border-radius: 12px;
    background: var(--c-surface);
}
.patient-workspace-page .clinical-event-head { align-items: flex-start; }
.patient-workspace-page .clinical-event-head > div:first-child { min-width: 0; }
.patient-workspace-page .clinical-event-meta { margin-top: 5px; }
.patient-workspace-page .clinical-value--warning,
.patient-workspace-page .clinical-value--clear {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 750;
}
.patient-workspace-page .clinical-value--warning {
    border: 1px solid oklch(.84 .09 75);
    background: oklch(.96 .045 75);
    color: oklch(.42 .11 65);
}
.patient-workspace-page .clinical-value--clear {
    border: 1px solid oklch(.84 .08 185);
    background: oklch(.96 .035 185);
    color: oklch(.36 .09 185);
}

.patient-workspace-page .case-completion-panel {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid oklch(.85 .08 155 / .8);
    border-radius: 12px;
    background: oklch(.97 .025 155 / .55);
}
.patient-workspace-page .case-completion-kicker {
    margin-bottom: 6px;
    color: oklch(.36 .1 155);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}
.patient-workspace-page .case-completion-copy h3 {
    color: oklch(.31 .07 155);
    font-size: 17px;
}
.patient-workspace-page .case-completion-copy p { margin-top: 5px; }
.patient-workspace-page .case-completion-actions { gap: 9px; }
.patient-workspace-page .case-completion-action:not(.is-disabled) {
    min-height: 70px;
    padding: 14px;
    border: 2px solid var(--c-teal);
    border-radius: 12px;
    background: var(--c-surface);
    color: var(--c-ink-strong);
    box-shadow: 0 6px 18px oklch(.25 .04 250 / .1);
    cursor: pointer;
    transition: border-color 180ms cubic-bezier(.25, 1, .5, 1), box-shadow 180ms cubic-bezier(.25, 1, .5, 1), transform 180ms cubic-bezier(.25, 1, .5, 1);
}
.patient-workspace-page .case-completion-action:not(.is-disabled):hover {
    border-color: oklch(.56 .14 190);
    background: var(--c-surface);
    box-shadow: 0 9px 22px oklch(.25 .04 250 / .14);
    transform: translateY(-1px);
}
.patient-workspace-page .case-completion-action:not(.is-disabled):active { transform: translateY(0) scale(.99); }
.patient-workspace-page .case-completion-action:not(.is-disabled) strong,
.patient-workspace-page .case-completion-action:not(.is-disabled) small { color: var(--c-ink-strong); }
.patient-workspace-page .case-completion-action:not(.is-disabled) strong {
    font-size: 12px;
    font-weight: 750;
    transition: color 180ms cubic-bezier(.25, 1, .5, 1);
}
.patient-workspace-page .case-completion-action:not(.is-disabled):hover strong { color: oklch(.4 .12 190); }
.patient-workspace-page .case-completion-action:not(.is-disabled) small {
    color: oklch(.43 .04 250);
    font-size: 12px;
    opacity: 1;
}
.patient-workspace-page .case-completion-action:not(.is-disabled) .case-completion-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: var(--c-teal);
    color: white;
    font-size: 17px;
    font-weight: 750;
}
.patient-workspace-page .case-completion-action:not(.is-disabled) .case-completion-arrow {
    color: oklch(.45 .12 190);
    transition: color 180ms cubic-bezier(.25, 1, .5, 1), transform 180ms cubic-bezier(.25, 1, .5, 1);
}
.patient-workspace-page .case-completion-action:not(.is-disabled):hover .case-completion-arrow {
    color: oklch(.38 .12 190);
    transform: translateX(4px);
}
.patient-workspace-page .case-completion-action.is-disabled {
    border-color: oklch(.9 .015 250 / .7);
    background: oklch(.96 .01 250 / .75);
    color: oklch(.62 .02 250);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.patient-workspace-page .case-completion-action.is-disabled strong,
.patient-workspace-page .case-completion-action.is-disabled small,
.patient-workspace-page .case-completion-action.is-disabled .case-completion-icon,
.patient-workspace-page .case-completion-action.is-disabled .case-completion-arrow { color: oklch(.62 .02 250); }

.patient-workspace-page .patient-details-card { margin-bottom: 24px; }
.patient-workspace-page .patient-details-card .panel-head,
.patient-workspace-page .patient-followup-card .panel-head { padding: 18px 20px; }
.patient-workspace-page .patient-details-card .panel-head h2,
.patient-workspace-page .patient-followup-card .panel-head h2 {
    color: var(--c-ink-strong);
    font-size: 14px;
    font-weight: 750;
}
.patient-workspace-page .patient-details-card .panel-body,
.patient-workspace-page .patient-followup-card .panel-body { padding: 20px; }
.patient-workspace-page .patient-details-card .data-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    margin: 0;
}
.patient-workspace-page .patient-details-card .data-list > div { min-width: 0; }
.patient-workspace-page .patient-details-card .data-list .field--wide { grid-column: 1 / -1; }
.patient-workspace-page .patient-details-card .data-list dt {
    margin-bottom: 3px;
    color: var(--c-muted);
    font-size: 11px;
    font-weight: 500;
}
.patient-workspace-page .patient-details-card .data-list dd {
    color: var(--c-ink-strong);
    font-size: 12px;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.patient-workspace-page .patient-details-card .comorbidity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.patient-workspace-page .patient-details-card .comorbidity-chip {
    padding: 3px 8px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    background: oklch(.96 .01 250);
    color: var(--c-ink-strong);
    font-size: 12px;
    font-weight: 650;
}

.patient-workspace-page .patient-followup-card .record-editor {
    margin-top: 12px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: oklch(.975 .008 250);
}
.patient-workspace-page .patient-followup-card .record-editor-summary {
    min-height: 58px;
    padding: 13px 14px;
    transition: background 180ms cubic-bezier(.25, 1, .5, 1);
}
.patient-workspace-page .patient-followup-card .record-editor-summary:hover { background: oklch(.95 .012 250); }
.patient-workspace-page .patient-followup-card .record-editor-copy strong {
    color: var(--c-ink);
    font-size: 12px;
    font-weight: 650;
}
.patient-workspace-page .patient-followup-card .record-editor-copy small { color: var(--c-muted); }
.patient-workspace-page .patient-followup-card .record-editor-icon {
    border-color: oklch(.76 .08 190);
    background: oklch(.96 .035 190);
    color: var(--c-teal);
}
.patient-workspace-page .patient-followup-card .record-editor-form {
    border-color: var(--c-border);
    background: var(--c-surface);
}

@media (min-width: 600px) {
    .patient-workspace-page .case > .data-list,
    .patient-workspace-page .clinical-event .data-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .patient-workspace-page .case-completion-action:not(.is-disabled) strong { font-size: 14px; }
}

@media (max-width: 760px) {
    .patient-workspace-page .case { padding: 18px; }
    .patient-workspace-page .clinical-event { padding: 16px; }
    .patient-workspace-page .clinical-timeline-section > .panel > .panel-body { padding: 14px; }
    .patient-workspace-page .case-completion-panel { padding: 16px; }
    .patient-workspace-page .record-actions,
    .patient-workspace-page .record-actions .button-secondary { width: 100%; }
}

/* Keep shell controls vector-based as well, including dynamically-created icons. */
.rail-settings {
    display: inline-block;
    width: 17px;
    height: 17px;
    margin-left: 0;
    justify-self: end;
    line-height: 0;
}
.rail-settings svg {
    display: block;
    width: 17px;
    height: 17px;
}
.rail-user {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
}
.rail-close span {
    display: block;
    width: 16px;
    height: 16px;
    font-size: 0;
    line-height: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m5 5 14 14M19 5 5 19'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m5 5 14 14M19 5 5 19'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 1023px) {
    .app-shell.menu-open .mobile-menu-toggle {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: scale(.92);
    }
}

/* Other repeated icon slots use the same device-stable treatment. */
.patient-workspace-page .brief-empty-icon,
.brief-empty-icon { font-size: 0; }
.patient-workspace-page .brief-empty-icon::before,
.brief-empty-icon::before {
    display: block;
    width: 18px;
    height: 18px;
    background: var(--c-muted);
    content: "";
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.report-list-mark { font-size: 0; }
.report-list-mark::before {
    display: block;
    width: 19px;
    height: 19px;
    background: currentColor;
    content: "";
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h10l4 4v14H5z'/%3E%3Cpath d='M15 3v5h4M8 16v-3M12 16v-6M16 16v-2'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h10l4 4v14H5z'/%3E%3Cpath d='M15 3v5h4M8 16v-3M12 16v-6M16 16v-2'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Medcio rebrand: preserve the clinical layout while applying the new identity,
   bilingual typography, and predictable RTL shell geometry. */
:root {
    --c-brand: #1733ff;
    --c-brand-deep: #0b1a72;
    --c-teal: #6b7cff;
    --c-teal-soft: #eef1ff;
    --c-bg: #f7f9ff;
    --c-surface: #ffffff;
    --c-border: #dfe5f2;
    --c-ink: #334155;
    --c-ink-strong: #0f172a;
    --c-muted: #64748b;
    --c-success: #3652d9;
    --c-danger: #c2414d;
}
html[dir="rtl"] body,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    font-family: "IBM Plex Sans Arabic", Roboto, ui-sans-serif, system-ui, sans-serif;
}
html[dir="rtl"] body { direction: rtl; text-align: right; }
html[dir="rtl"] .app-shell { direction: rtl; }
html[dir="rtl"] .main { margin-left: 0; margin-right: 256px; }
html[dir="rtl"] .side-rail { left: auto; right: 0; }
html[dir="rtl"] .rail-brand,
html[dir="rtl"] .workspace-label,
html[dir="rtl"] .rail-nav,
html[dir="rtl"] .rail-bottom,
html[dir="rtl"] .topline,
html[dir="rtl"] .panel,
html[dir="rtl"] .form-section,
html[dir="rtl"] .record-grid,
html[dir="rtl"] .brief-grid,
html[dir="rtl"] .report-layout,
html[dir="rtl"] .team-layout { direction: rtl; }
html[dir="rtl"] .rail-nav a.is-active { border-left: 0; border-right: 4px solid var(--c-teal); padding-left: 16px; padding-right: 12px; }
html[dir="rtl"] .rail-nav a:not(.is-active):hover { transform: translateX(-1px); }
html[dir="rtl"] .rail-settings { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .patient-row-meta { text-align: left; }
html[dir="rtl"] .table-actions { justify-content: flex-start; }
html[dir="rtl"] .form-actions { justify-content: flex-start; }
html[dir="rtl"] .workspace-search-input > span,
html[dir="rtl"] .search-field-icon { left: auto; right: 12px; }
html[dir="rtl"] .workspace-search-input input,
html[dir="rtl"] .search-field input { padding-left: 11px; padding-right: 38px; }
html[dir="rtl"] .patient-table th { text-align: right; }
html[dir="rtl"] .patient-table td:nth-child(4),
html[dir="rtl"] .patient-table th:nth-child(4) { text-align: left; }
html[dir="rtl"] .mobile-app-brand img { object-position: right center; }
.rail-brand .rail-logo { display: block; width: 132px; height: 36px; object-fit: contain; object-position: left center; filter: brightness(0) invert(1); }
.rail-language-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.86);
    font-size: 11px;
    font-weight: 700;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.rail-language-toggle:hover { border-color: var(--c-teal); background: rgb(23 51 255 / .18); color: #fff; }
.rail-bottom { gap: 10px; }
html[dir="rtl"] .rail-language-toggle { align-self: flex-start; }
html[dir="rtl"] .main h1,
html[dir="rtl"] .main h2,
html[dir="rtl"] .main h3,
html[dir="rtl"] .main p,
html[dir="rtl"] .main label { letter-spacing: 0; }
html[dir="rtl"] .main h1,
html[dir="rtl"] .main h2 { font-weight: 700; }

@media (min-width: 1024px) {
    html[dir="rtl"] .main { margin-left: 0; margin-right: 256px; }
}
@media (max-width: 1023px) {
    html[dir="rtl"] .main { margin: 0 !important; }
    html[dir="rtl"] .side-rail { right: 0; left: auto; transform: translateX(100%); }
    html[dir="rtl"] .app-shell.menu-open .side-rail { transform: translateX(0); }
    html[dir="rtl"] .rail-close { right: auto; left: 16px; }
    html[dir="rtl"] .rail-brand { padding-right: 0; padding-left: 48px; }
    html[dir="rtl"] .mobile-app-header { direction: rtl; }
    html[dir="rtl"] .mobile-app-brand img { filter: brightness(0) invert(1); }
    .rail-brand .rail-logo { object-position: left center; }
}
@media (max-width: 430px) {
    html[dir="rtl"] .rail-close { left: 10px; }
    html[dir="rtl"] .rail-brand { padding-left: 44px; }
}

/* Medcio navigation polish: blue-only identity, vector icons, and a clearer language control. */
:root {
    --c-teal: #6b7cff;
    --c-teal-soft: #eef1ff;
    --c-success: #3652d9;
}
.rail-section-title {
    margin: 4px 8px 8px;
    color: oklch(.72 .025 250);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.rail-group-label {
    display: block;
    margin: 4px 8px 5px;
    color: oklch(.64 .025 250);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.rail-language-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin: 14px 0 12px;
    padding: 3px;
    border: 1px solid oklch(1 0 0 / .12);
    border-radius: 9px;
    background: oklch(1 0 0 / .06);
}
.rail-language-switch button {
    min-height: 32px;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: oklch(.78 .025 250);
    font-size: 11px;
    font-weight: 700;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.rail-language-switch button:hover { color: white; background: oklch(1 0 0 / .1); }
.rail-language-switch button.is-active { background: #6b7cff; color: white; box-shadow: 0 3px 10px rgb(23 51 255 / .22); }
.rail-language-switch button:active { transform: scale(.97); }
.rail-settings svg { display: block; width: 17px; height: 17px; }
.workspace-search-input > .search-field-icon,
.workspace-search-arrow {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background: currentColor;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}
.workspace-search-input > .search-field-icon { position: absolute; top: 50%; left: 12px; color: var(--c-muted); transform: translateY(-50%); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); }
.workspace-search-arrow { color: var(--c-brand); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
html[dir="rtl"] .workspace-search-input > .search-field-icon { left: auto; right: 12px; }
html[dir="rtl"] .workspace-search-arrow { transform: scaleX(-1); }

/* Keep status and success surfaces in the brand blue family. */
.notice-success { border-color: #c7d2fe; background: #eef1ff; color: #3652d9; }
.status, .status--disease_free { background: #eef1ff; color: #3652d9; }
.brief-note, .brief-guidance, .invite-link { background: #eef1ff; }
.owner-status--active { background: #eef1ff; color: #3652d9; }
@media (prefers-reduced-motion: reduce) {
    .rail-language-switch button { transition-duration: .01ms; }
}
.button-arrow { display: inline-block; width: 15px; height: 15px; font-size: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19 19 5M9 5h10v10'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19 19 5M9 5h10v10'/%3E%3C/svg%3E") center/contain no-repeat; }
.case-completion-action:not(.is-disabled) .case-completion-arrow { width: 16px; height: 16px; font-size: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
html[dir="rtl"] .case-completion-action:not(.is-disabled) .case-completion-arrow { transform: scaleX(-1); }
.invite-form .button > span { display: inline-block; width: 15px; height: 15px; font-size: 0; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19 19 5M9 5h10v10'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19 19 5M9 5h10v10'/%3E%3C/svg%3E") center/contain no-repeat; }
html[dir="rtl"] .invite-form .button > span { transform: scaleX(-1); }

/* Replace legacy green surfaces with restrained blue equivalents. */
.workspace-search { border-color: #d9def8; background: linear-gradient(115deg, #f1f3ff, var(--c-surface) 56%); }
.workspace-search-input input { border-color: #c7d2fe; }
.workspace-search-results { border-top-color: #d9def8; }
.workspace-search-result:hover { border-color: #aebaff; background: #f7f8ff; }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.actions-trigger:focus-visible, .permission-row input:focus-visible + .toggle { outline-color: rgb(107 124 255 / .4); }
.case-completion-kicker, .case-completion-action strong { color: #3652d9; }
.case-completion-action { border-color: #c7d2fe; }
.case-completion-action:hover { border-color: #6b7cff; background: #f7f8ff; }
.case-completion-icon { border-color: #aebaff; color: #5267ee; }
.case-completion-action:not(.is-disabled) .case-completion-arrow { color: #5267ee; }
.action-form-panel { border-color: #aebaff; background: #f7f8ff; }
.action-form-panel .panel-head { background: #f1f3ff; border-bottom-color: #d9def8; }
.action-form-tag { background: #e5e9ff; color: #3652d9; }
.brief-guidance { border-color: #c7d2fe; background: #f1f3ff; color: #3652d9; }
.brief-guidance-mark { border-color: #aebaff; color: #5267ee; }
.record-editor { border-color: #aebaff; background: #f7f8ff; }
.record-editor-summary:focus-visible { outline-color: rgb(107 124 255 / .4); }
.record-editor-icon { border-color: #c7d2fe; color: #5267ee; }
.record-editor[open] .record-editor-summary { border-bottom-color: #d9def8; background: #f1f3ff; }
.followup-stat:hover, .followup-stat.is-active { border-color: #aebaff; }
.followup-stat.is-active { box-shadow: 0 0 0 2px rgb(107 124 255 / .14); }
.coming-soon-badge, .documents-coming-list b { border-color: #c7d2fe; background: #eef1ff; color: #3652d9; }
.report-option:hover { border-color: #aebaff; background: #f7f8ff; }
.report-option input:focus-visible + .report-check { outline-color: rgb(107 124 255 / .4); }
.brief-primary-action:hover { background: #5267ee; }
.patient-workspace-page .case-completion-action:not(.is-disabled):hover strong { color: #3652d9; }
.additional-case > .panel { border-color: #c7d2fe; }
.document-sheet i:first-child { background: #aebaff; }

/* Language-aware rail geometry and readable group headings. */
.rail-group-label { width: max-content; max-width: 100%; white-space: nowrap; }
@media (min-width: 1024px) {
    html[dir="ltr"] .side-rail { right: auto; left: 0; }
    html[dir="ltr"] .main { margin-left: 256px; margin-right: 0; }
    html[dir="rtl"] .side-rail { right: 0; left: auto; }
    html[dir="rtl"] .main { margin-left: 0; margin-right: 256px; }
}
@media (max-width: 1023px) {
    html[dir="ltr"] .side-rail { right: auto; left: 0; }
    html[dir="rtl"] .side-rail { right: 0; left: auto; }
    html[dir="rtl"] .main,
    html[dir="ltr"] .main { margin: 0 !important; }
}

/* Active workflow steps intentionally retain the clinical green accent. */
.case-completion-action:not(.is-disabled) {
    border-color: #0f9f94;
    background: #fff;
    color: #0f172a;
}
.case-completion-action:not(.is-disabled):hover {
    border-color: #08766f;
    background: #f8fffd;
}
.case-completion-action:not(.is-disabled) .case-completion-icon {
    border-color: #0f9f94;
    background: #0f9f94;
    color: #fff;
}
.case-completion-action:not(.is-disabled) strong,
.case-completion-action:not(.is-disabled) .case-completion-arrow,
.patient-workspace-page .case-completion-action:not(.is-disabled):hover strong { color: #0f9f94; }
.case-completion-action:not(.is-disabled):hover strong { color: #08766f; }

/* Device-stable controls: keep text glyphs out of icon slots on mobile browsers. */
.search-field-icon,
.button-search-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    font-size: 0;
    line-height: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.search-field-icon { position: absolute; top: 50%; left: 13px; pointer-events: none; transform: translateY(-53%); }
.button-search-icon { vertical-align: middle; }
html[dir="rtl"] .search-field-icon { left: auto; right: 13px; }
.record-editor-chevron {
    width: 14px;
    height: 14px;
    font-size: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Remove legacy green/yellow accents from any clinical surface that predates the rebrand. */
.brief-note,
.brief-guidance,
.invite-link,
.record-editor,
.case-completion-panel,
.action-form-panel,
.brief-primary-action,
.followup-stat.is-active,
.status--disease_free,
.status--recurrence,
.coming-soon-badge,
.documents-coming-list b,
.check,
.avatar--mint,
.empty-mark {
    border-color: #c7d2fe;
    background-color: #eef1ff;
    color: #3652d9;
}
.case-completion-panel { border-color: #86efac; background-color: #f0fdf4; }
.action-form-panel { background-color: #f1f3ff; }

.record-editor { border-color: #c7d2fe; }
.record-editor[open] .record-editor-summary { background-color: #f7f8ff; border-color: #aebaff; }
.brief-guidance strong,
.coming-soon-badge,
.documents-coming-list b { color: #3652d9; }
.brief-guidance p { color: #5267ee; }
.status--recurrence { background-color: #eef1ff; color: #3652d9; }
.brief-primary-action:hover { background-color: #5267ee; }

/* Final checklist cascade: preserve the dotted green panel and green active step. */
.patient-workspace-page .case-completion-panel {
    border: 2px dotted #0f9f94;
    background: #f0fdf4;
}

.patient-workspace-page .case-completion-action.is-disabled .case-completion-icon {
    border-color: var(--c-border);
    background: transparent;
    color: var(--c-muted);
}

.patient-workspace-page .case-completion-action:not(.is-disabled) {
    border: .5px solid #0f9f94;
    background: #fff;
    color: #0f172a;
}

.patient-workspace-page .case-completion-action:not(.is-disabled):hover {
    border-color: #08766f;
    background: #f8fffd;
}

.patient-workspace-page .case-completion-action:not(.is-disabled) .case-completion-icon {
    border-color: #0f9f94;
    background: #0f9f94;
    color: #fff;
}

.patient-workspace-page .case-completion-action:not(.is-disabled) strong,
.patient-workspace-page .case-completion-action:not(.is-disabled) .case-completion-arrow {
    color: #0f9f94;
}

.patient-workspace-page .case-completion-action:not(.is-disabled):hover strong {
    color: #08766f;
}

/* Patient workflow: keep the quick-action surface unmistakably green. */
body.patient-workspace-page .patient-quick-actions {
    border: 2px dotted #0f9f94 !important;
    background: #ecfdf3 !important;
}

/* White action selector, adapted from the familiar theme-selector pattern. */
.patient-workspace-page .actions-menu { z-index: 30; }
.patient-workspace-page .actions-trigger {
    display: inline-grid;
    grid-template-columns: 18px auto 12px;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #d7dee9;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    box-shadow: 0 1px 2px rgb(15 23 42 / .04);
    font-size: 13px;
    font-weight: 700;
}
.patient-workspace-page .actions-trigger:hover,
.patient-workspace-page .actions-menu.is-open .actions-trigger {
    border-color: #0f9f94;
    background: #fff;
    color: #08766f;
}
.patient-workspace-page .actions-trigger:focus-visible {
    outline: 3px solid rgb(15 159 148 / .18);
    outline-offset: 2px;
}
.patient-workspace-page .actions-trigger-icon {
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E") center/contain no-repeat;
}
.patient-workspace-page .actions-trigger .actions-chevron {
    width: 8px;
    height: 8px;
    margin: -4px 0 0;
    color: #667085;
}
.patient-workspace-page .actions-menu-panel {
    inset-block-start: calc(100% + 8px);
    inset-inline-end: 0;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: max-content;
    min-width: min(300px, calc(100vw - 32px));
    max-width: min(360px, calc(100vw - 32px));
    max-height: min(70vh, 480px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 44px rgb(15 23 42 / .14), 0 4px 12px rgb(15 23 42 / .06);
    z-index: 60;
}
html[dir="ltr"] .patient-workspace-page .actions-menu-panel { right: auto; inset-inline-end: auto; left: 0; }
.patient-workspace-page .actions-menu-label {
    padding: 8px 10px 6px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}
.patient-workspace-page .actions-menu-panel button {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    height: auto;
    padding: 10px;
    border: 0;
    border-radius: 9px;
    background: #fff;
    color: #172033;
    cursor: pointer;
    font: inherit;
    text-align: start;
}
.patient-workspace-page .actions-menu-panel button:hover,
.patient-workspace-page .actions-menu-panel button:focus-visible {
    background: #f3faf8;
    color: #08766f;
    outline: 0;
}
.patient-workspace-page .actions-menu-panel button:focus-visible {
    box-shadow: inset 0 0 0 1px rgb(15 159 148 / .32);
}
.patient-workspace-page .actions-menu-copy { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; align-content: start; }
.patient-workspace-page .actions-menu-copy strong,
.patient-workspace-page .actions-menu-copy small { display: block; white-space: normal; overflow-wrap: anywhere; }
.patient-workspace-page .actions-menu-copy strong {
    color: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.6;
}
.patient-workspace-page .actions-menu-copy small {
    margin-top: 2px;
    color: #667085;
    font-size: 12px;
    font-weight: 450;
    line-height: 1.6;
}
.patient-workspace-page .actions-menu-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 1px;
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #475467;
    overflow: hidden;
    min-width: 34px;
    max-width: 34px;
    min-height: 34px;
    max-height: 34px;
}
.patient-workspace-page .actions-menu-arrow {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 5px;
    width: 16px;
    height: 16px;
    background: currentColor;
}
.patient-workspace-page .actions-menu-icon svg { display: block; width: 18px !important; height: 18px !important; min-width: 18px; max-width: 18px; min-height: 18px; max-height: 18px; flex: 0 0 18px; }
.patient-workspace-page .actions-menu-arrow {
    color: #98a2b3;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center/contain no-repeat;
}
html[dir="rtl"] .patient-workspace-page .actions-menu-arrow { transform: scaleX(-1); }
.patient-workspace-page .actions-menu-panel button:hover .actions-menu-icon,
.patient-workspace-page .actions-menu-panel button:focus-visible .actions-menu-icon {
    border-color: rgb(15 159 148 / .3);
    background: #eaf9f4;
    color: #0f9f94;
}
.patient-workspace-page .actions-menu-panel button.is-disabled,
.patient-workspace-page .actions-menu-panel button:disabled {
    background: #fff;
    color: #98a2b3;
    opacity: .62;
}
.patient-workspace-page .actions-menu-panel button.is-disabled .actions-menu-icon,
.patient-workspace-page .actions-menu-panel button:disabled .actions-menu-icon {
    background: #f8fafc;
    color: #98a2b3;
}
.patient-workspace-page .case-completion-icon svg { width: 14px; height: 14px; }
.patient-workspace-page .action-form .field:has(input[required], select[required], textarea[required]) > label::after { color: #dc2626; content: " *"; }
.patient-workspace-page .custom-clinical-events { display: grid; gap: 12px; margin-bottom: 18px; }
.patient-workspace-page .clinical-event--custom { border-color: #b7e4d2; background: #fbfffd; }
.patient-workspace-page .custom-event-title { display: flex; align-items: flex-start; gap: 11px; }
.patient-workspace-page .custom-event-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid #b7e4d2; border-radius: 9px; background: #ecfdf3; color: #08766f; }
.patient-workspace-page .custom-event-icon svg { width: 18px; height: 18px; }
.patient-workspace-page .action-form-empty { grid-column: 1 / -1; margin: 0; padding: 12px; border: 1px solid var(--c-border); border-radius: 8px; color: var(--c-muted); }

@media (max-width: 430px) {
    .patient-workspace-page .actions-menu-panel {
        inset-inline-end: 0;
        right: 0;
        width: min(100%, calc(100vw - 32px));
        min-width: 0;
        max-width: calc(100vw - 32px);
    }
    html[dir="ltr"] .patient-workspace-page .actions-menu-panel { right: auto; inset-inline-end: auto; left: 0; }
}

/* Shared patient actions: the menu and Quick action cards open one responsive dialog. */
.patient-workspace-page .case-completion-action[type="button"] {
    width: 100%;
    font: inherit;
    text-align: start;
}
.patient-workspace-page .case-completion-action:disabled {
    pointer-events: none;
}

.patient-action-dialog {
    width: min(760px, calc(100vw - 24px));
    max-width: 760px;
    max-height: calc(100vh - 24px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--c-ink);
    overflow: visible;
}
.patient-action-dialog::backdrop {
    background: rgb(15 23 42 / .52);
    backdrop-filter: blur(2px);
}
.patient-action-dialog-surface {
    display: flex;
    max-height: calc(100vh - 24px);
    flex-direction: column;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    background: var(--c-surface);
    box-shadow: 0 24px 70px rgb(15 23 42 / .22);
    overflow: hidden;
}
.patient-action-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--c-border);
    background: #f8fffd;
}
.patient-action-dialog-head h2 {
    margin: 0 0 5px;
    color: var(--c-ink-strong);
    font-size: 20px;
    line-height: 1.2;
    text-wrap: balance;
}
.patient-action-dialog-head p {
    max-width: 62ch;
    margin: 0;
    color: var(--c-muted);
    font-size: 12px;
    line-height: 1.5;
}
.patient-action-dialog-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 1px solid var(--c-border);
    border-radius: 9px;
    background: var(--c-surface);
    color: var(--c-muted);
    cursor: pointer;
    font: inherit;
    font-size: 22px;
    line-height: 1;
}
.patient-action-dialog-close:hover,
.patient-action-dialog-close:focus-visible {
    border-color: var(--c-brand);
    color: var(--c-brand);
    outline: 0;
}
.patient-action-dialog-body {
    max-height: calc(100vh - 150px);
    padding: 22px 24px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.patient-action-dialog-body .action-form {
    margin: 0;
}
.patient-action-dialog-body .form-actions {
    margin-top: 20px;
}

@media (max-width: 760px) {
    .patient-action-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }
    .patient-action-dialog-surface { max-height: calc(100vh - 20px); border-radius: 14px; }
    .patient-action-dialog-head { padding: 18px 18px 15px; }
    .patient-action-dialog-head h2 { font-size: 18px; }
    .patient-action-dialog-body { max-height: calc(100vh - 126px); padding: 18px; }
}
@media (max-width: 430px) {
    .patient-action-dialog { width: calc(100vw - 12px); max-height: calc(100vh - 12px); }
    .patient-action-dialog-surface { max-height: calc(100vh - 12px); border-radius: 12px; }
    .patient-action-dialog-head { gap: 10px; padding: 15px 14px 13px; }
    .patient-action-dialog-head h2 { font-size: 16px; }
    .patient-action-dialog-body { max-height: calc(100vh - 112px); padding: 14px; }
    .patient-action-dialog-body .form-actions { flex-direction: column-reverse; }
    .patient-action-dialog-body .form-actions .button { width: 100%; }
}

/* ---------- Research data model: coded fields, specialty picker ---------- */
.choice-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-fieldset legend { margin-bottom: 8px; color: var(--c-ink-strong); font-size: 13px; font-weight: 600; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; padding: 12px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-bg); }
.choice-grid .choice { color: var(--c-ink); line-height: 1.35; }
.choice-grid .choice input { flex: 0 0 auto; }
.form-section-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--c-muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }
.code-chip { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; background: var(--c-teal-soft); color: var(--c-brand); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.case-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.vital-notice { margin-bottom: 12px; }
.specialty-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.specialty-option { position: relative; display: block; cursor: pointer; }
.specialty-option input { position: absolute; opacity: 0; pointer-events: none; }
.specialty-option-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); transition: border-color .15s ease-out, box-shadow .15s ease-out; }
.specialty-option-body strong { color: var(--c-ink-strong); font-size: 14px; }
.specialty-option-body small { color: var(--c-muted); font-size: 12px; line-height: 1.4; }
.specialty-option input:checked + .specialty-option-body { border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-teal-soft); }
.specialty-option input:focus-visible + .specialty-option-body { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.specialty-option.is-locked { cursor: default; }
.specialty-option.is-locked .specialty-option-body { border-color: var(--c-brand); background: var(--c-teal-soft); }
