:root {
    --navy-950: #0a1f3d;
    --navy-900: #0b2545;
    --navy-800: #12365d;
    --navy-700: #1e4c78;
    --brand: #0b2545;
    --brand-dark: #0a1f3d;
    --blue-50: #eff6ff;
    --blue-100: #e7f0f7;
    --blue-200: #cfdfeb;
    --ink: #132238;
    --muted: #4b5563;
    --quiet: #9ca3af;
    --surface: #ffffff;
    --page: #f9fafb;
    --border: #e5e7eb;
    --control: #d1d5db;
    --success: #16a34a;
    --warning: #9a6700;
    --error: #dc2626;
    --violet: #6d5bd0;
    --shadow-sm: 0 3px 14px rgb(15 35 58 / 6%);
    --shadow-md: 0 16px 36px rgb(15 35 58 / 10%);
    --radius-sm: 10px;
    --radius: 10px;
    --radius-lg: 16px;
    --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--page); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--page); font-family: var(--sans); }
body.nav-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { overflow-wrap: anywhere; }
.web-surface { min-height: 100vh; }
.eyebrow { margin: 0 0 7px; color: var(--navy-700); font-size: .7rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted-copy { color: var(--muted); font-size: .82rem; }

.button { display: inline-flex; min-height: 42px; padding: 10px 17px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; font-weight: 750; line-height: 1.1; cursor: pointer; transition: background .16s, border-color .16s, box-shadow .16s, transform .16s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgb(30 76 120 / 24%); outline-offset: 2px; }
.button--primary { color: #fff; background: var(--navy-900); box-shadow: 0 6px 14px rgb(11 37 69 / 16%); }
.button--primary:hover { background: var(--navy-800); }
.button--secondary { color: var(--navy-900); background: var(--blue-50); border-color: var(--blue-200); }
.button--secondary:hover { background: var(--blue-100); }
.button--link { width: max-content; text-decoration: none; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon-button, .menu-button { display: inline-flex; min-height: 36px; padding: 7px 10px; align-items: center; justify-content: center; color: inherit; background: transparent; border: 0; border-radius: 9px; font-weight: 750; text-decoration: none; cursor: pointer; }
.icon-button--light { color: var(--navy-900); background: var(--blue-50); border: 1px solid var(--blue-200); }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 256px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 30; display: flex; height: 100vh; flex-direction: column; color: #fff; background: linear-gradient(180deg, var(--navy-950), var(--navy-900) 58%, #0d2b4d); box-shadow: 8px 0 28px rgb(11 37 69 / 11%); }
.sidebar__brand { display: flex; min-height: 88px; padding: 20px 21px; align-items: center; gap: 13px; color: #fff; border-bottom: 1px solid rgb(255 255 255 / 9%); text-decoration: none; }
.sidebar__brand > span:last-child { display: grid; gap: 3px; }
.sidebar__brand strong { font-size: 1.05rem; letter-spacing: .12em; }
.sidebar__brand small { color: #a9bfd3; font-size: .7rem; }
.sidebar__mark { display: grid; width: 43px; height: 43px; place-items: center; background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 12%); border-radius: 13px; }
.sidebar__mark img { width: 31px; height: 31px; filter: brightness(0) invert(1); }
.sidebar__nav { display: grid; padding: 25px 13px; gap: 6px; overflow: auto; }
.sidebar__label { margin: 0 12px 9px; color: #8faac2; font-size: .64rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-item { display: flex; min-height: 46px; padding: 8px 11px; align-items: center; gap: 11px; color: #d8e4ee; border-radius: 11px; font-size: .88rem; font-weight: 680; text-decoration: none; transition: color .16s, background .16s; }
.nav-item:hover { color: #fff; background: rgb(255 255 255 / 8%); }
.nav-item--active { color: var(--navy-950); background: #fff; box-shadow: 0 7px 18px rgb(0 0 0 / 17%); }
.nav-item--active:hover { color: var(--navy-950); background: #fff; }
.nav-item__icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; }
.nav-item__icon img { width: 18px; height: 18px; filter: brightness(0) invert(1); opacity: .9; }
.nav-item--active .nav-item__icon { background: var(--blue-50); }
.nav-item--active .nav-item__icon img { filter: none; }
.sidebar__account { display: grid; margin-top: auto; padding: 17px; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-top: 1px solid rgb(255 255 255 / 9%); }
.sidebar__identity { display: grid; min-width: 0; gap: 3px; }
.sidebar__identity strong, .sidebar__identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__identity strong { font-size: .77rem; }
.sidebar__identity small { color: #9eb4c8; font-size: .65rem; }
.avatar { display: grid; width: 40px; height: 40px; place-items: center; color: var(--navy-900); background: #fff; border-radius: 12px; font-weight: 850; }
.sidebar__account .icon-button { color: #c8d7e4; font-size: .68rem; }

.workspace { min-width: 0; background: var(--page); }
.workspace__header { display: grid; padding: 32px 32px 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; }
.workspace__heading h1 { margin: 0 0 7px; color: var(--navy-950); font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 780; letter-spacing: -.035em; line-height: 1.05; }
.workspace__heading > p:last-child { margin: 0; color: var(--muted); line-height: 1.5; }
.workspace__content { display: grid; padding: 32px; gap: 24px; }
.menu-button { display: none; color: var(--navy-900); background: var(--blue-50); border: 1px solid var(--blue-200); }
.status-pill, .badge { display: inline-flex; min-height: 27px; padding: 5px 10px; align-items: center; justify-content: center; gap: 7px; color: #455b70; background: #eef3f7; border-radius: 999px; font-size: .69rem; font-weight: 780; white-space: nowrap; }
.status-pill i { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgb(21 135 90 / 10%); }
.badge--success { color: #0f6846; background: #e0f4ea; }
.badge--warning { color: #875b00; background: #fff2cc; }
.badge--neutral { color: #5f6f80; background: #edf1f4; }

.surface-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin: 0; color: var(--navy-950); font-size: 1.35rem; letter-spacing: -.02em; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 24px; }
.welcome-card { display: flex; min-height: 280px; padding: clamp(30px, 5vw, 56px); grid-row: span 2; flex-direction: column; align-items: flex-start; justify-content: space-between; color: #fff; background: linear-gradient(135deg, var(--navy-950), var(--navy-800)); border: 0; box-shadow: var(--shadow-md); overflow: hidden; }
.welcome-card h2 { max-width: 660px; margin: 0 0 15px; font-size: clamp(1.8rem, 3vw, 2.65rem); letter-spacing: -.04em; }
.welcome-card p:not(.eyebrow) { max-width: 650px; margin: 0; color: #c9d9e7; line-height: 1.7; }
.welcome-card .eyebrow { color: #9bc2df; }
.welcome-card .button { color: var(--navy-950); background: #fff; box-shadow: none; }
.assurance-card { display: flex; min-height: 130px; padding: 23px; align-items: center; gap: 17px; }
.assurance-card__icon { display: grid; width: 47px; height: 47px; flex: 0 0 47px; place-items: center; color: var(--success); background: #e3f4ec; border-radius: 14px; font-size: 1.2rem; font-weight: 850; }
.assurance-card__icon--violet { color: var(--violet); background: #efecff; }
.assurance-card div { display: grid; gap: 4px; }
.assurance-card p, .assurance-card small { margin: 0; color: var(--muted); }
.assurance-card p { font-size: .67rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.assurance-card strong { font-size: 1.03rem; }
.assurance-card small { font-size: .75rem; line-height: 1.4; }
.modules-card { padding: 27px; grid-column: 1 / -1; }
.module-grid { display: grid; margin-top: 21px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.module-card { display: grid; min-height: 76px; padding: 13px; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; background: #f9fbfc; border: 1px solid var(--border); border-radius: 13px; text-decoration: none; transition: transform .16s, border-color .16s, box-shadow .16s; }
.module-card:hover { border-color: #b7cad9; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.module-card__icon { display: grid; width: 42px; height: 42px; place-items: center; background: var(--blue-100); border-radius: 12px; }
.module-card img { width: 21px; height: 21px; }
.module-card > span:nth-child(2) { display: grid; gap: 3px; }
.module-card small { color: var(--muted); font-size: .7rem; }
.module-card b { color: var(--quiet); }

.toolbar, .agenda-toolbar { display: flex; padding: 17px 19px; align-items: end; justify-content: space-between; gap: 18px; }
.filter-bar, .agenda-controls { display: flex; flex: 1; align-items: end; gap: 12px; }
.filter-bar label, .agenda-controls label, .field { display: grid; gap: 7px; color: #42576b; font-size: .75rem; font-weight: 730; }
.filter-bar input, .filter-bar select, .agenda-controls input, .agenda-controls select, .field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink); background: #fff; border: 1px solid var(--control); border-radius: 9px; outline: none; }
.filter-bar input:focus, .filter-bar select:focus, .agenda-controls select:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgb(30 76 120 / 11%); }
.search-field { min-width: 230px; flex: 1; }
.toolbar__actions { display: flex; align-items: center; gap: 13px; }
.result-count { color: var(--muted); font-size: .75rem; font-weight: 760; white-space: nowrap; }
.patient-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.patient-card { display: grid; min-height: 230px; padding: 20px; align-content: space-between; gap: 20px; }
.patient-card header { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.patient-card header > span:nth-child(2) { display: grid; min-width: 0; gap: 4px; }
.patient-card header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patient-card header small, .record-card small { color: var(--muted); font-size: .72rem; }
.patient-card footer { display: flex; align-items: center; justify-content: flex-end; }
.compact-details { display: grid; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.compact-details div, .detail-grid div { padding: 13px; background: #f7f9fb; border-radius: 11px; }
.compact-details dt, .detail-grid dt { color: var(--muted); font-size: .65rem; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; }
.compact-details dd, .detail-grid dd { margin: 6px 0 0; font-size: .88rem; font-weight: 760; }
.record-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; color: var(--navy-900); background: var(--blue-100); border-radius: 12px; font-weight: 850; }
.record-avatar--large { width: 62px; height: 62px; flex-basis: 62px; border-radius: 18px; font-size: 1.35rem; }
.pagination { display: flex; padding: 22px 0 0; justify-content: flex-end; }

.form-workspace { display: grid; width: min(100%, 1080px); gap: 20px; }
.context-banner { display: flex; padding: 23px 25px; align-items: center; justify-content: space-between; gap: 20px; }
.context-banner h2 { margin: 0 0 7px; font-size: 1.35rem; }
.context-banner p:last-child { margin: 0; color: var(--muted); }
.form-card { display: grid; padding: clamp(24px, 4vw, 38px); gap: 25px; }
.form-section-heading { display: flex; align-items: flex-start; gap: 13px; }
.form-section-heading > span { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; color: #fff; background: var(--navy-900); border-radius: 10px; font-size: .7rem; font-weight: 800; }
.form-section-heading h2 { margin: 0 0 5px; font-size: 1.18rem; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: .83rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field small { color: var(--muted); font-weight: 500; line-height: 1.45; }
.field textarea { resize: vertical; line-height: 1.6; }
.field input[readonly] { color: #53677a; background: #f6f8fa; }
.field--full { width: 100%; }
.session-notes { min-height: 260px; }
.form-note { margin: 0; padding: 13px 15px; color: #4e657a; background: var(--blue-50); border-radius: 10px; font-size: .82rem; line-height: 1.55; }
.form-actions { display: flex; padding-top: 20px; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--border); }
.session-picker { padding: 18px 21px; }
.session-picker__form { display: grid; grid-template-columns: minmax(170px, .5fr) minmax(300px, 1fr) auto; align-items: end; gap: 14px; }

.records-layout { display: grid; grid-template-columns: minmax(290px, .76fr) minmax(430px, 1.24fr); gap: 24px; }
.record-card-list, .history-records { display: grid; align-content: start; gap: 10px; }
.record-card-list > .section-heading, .history-records > .section-heading { margin: 2px 2px 5px; }
.record-card { display: grid; min-height: 70px; padding: 13px 15px; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; text-decoration: none; }
.record-card > span:nth-child(2) { display: grid; min-width: 0; gap: 4px; }
.record-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-card:hover, .record-card--active { border-color: #aac0d1; box-shadow: 0 7px 20px rgb(15 35 58 / 9%); }
.record-card--active { box-shadow: inset 4px 0 var(--navy-700), 0 7px 20px rgb(15 35 58 / 9%); }
.record-detail { min-height: 430px; padding: 29px; }
.record-detail__header { display: flex; align-items: center; gap: 16px; }
.record-detail__header h2 { margin: 0 0 8px; font-size: 1.6rem; }
.detail-grid { display: grid; margin: 28px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.record-detail__actions { display: flex; justify-content: flex-end; }

.date-navigation { display: flex; align-items: center; gap: 9px; }
.date-navigation strong { margin-left: 5px; font-size: .86rem; }
.segmented { display: flex; padding: 3px; background: #edf2f6; border-radius: 10px; }
.segmented button { min-height: 35px; padding: 7px 12px; color: #5a6f82; background: transparent; border: 0; border-radius: 8px; font-size: .75rem; font-weight: 770; cursor: pointer; }
.segmented button.is-active { color: var(--navy-950); background: #fff; box-shadow: 0 2px 8px rgb(11 37 69 / 13%); }
.calendar-card { min-width: 0; padding: 24px; overflow: hidden; }
.calendar-card > .section-heading { margin-bottom: 20px; }
.day-calendar { max-height: 800px; overflow: auto; border: 1px solid var(--border); border-radius: 13px; }
.hour-row { display: grid; min-height: 74px; grid-template-columns: 72px minmax(0, 1fr); border-bottom: 1px solid var(--border); }
.hour-row:last-child { border-bottom: 0; }
.hour-row > time { padding: 12px 13px; color: var(--muted); background: #fafbfd; border-right: 1px solid var(--border); font-size: .72rem; font-weight: 730; }
.hour-row__lane { display: grid; padding: 7px; align-content: start; gap: 6px; }
.calendar-event { display: grid; min-width: 0; padding: 10px 12px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; color: var(--navy-950); background: #e8f2f8; border-left: 4px solid var(--navy-700); border-radius: 9px; }
.calendar-event time { color: var(--navy-700); font-size: .72rem; font-weight: 800; }
.calendar-event strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event small { grid-column: 2 / -1; color: var(--muted); font-size: .68rem; }
.calendar-event--compact { display: grid; padding: 5px 6px; grid-template-columns: auto minmax(0, 1fr); gap: 4px; border-left-width: 3px; border-radius: 6px; }
.calendar-event--compact time, .calendar-event--compact strong { font-size: .64rem; }
.calendar-event--compact .badge { display: none; }
.week-calendar { min-width: 860px; border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.calendar-card:has(.week-calendar) { overflow-x: auto; }
.week-calendar__header, .week-calendar__row { display: grid; grid-template-columns: 62px repeat(7, minmax(110px, 1fr)); }
.week-calendar__header { min-height: 59px; background: #f7f9fb; border-bottom: 1px solid var(--border); }
.week-calendar__header > * { display: grid; padding: 10px; place-content: center; text-align: center; border-right: 1px solid var(--border); }
.week-calendar__header strong small { color: var(--muted); font-size: .63rem; font-weight: 750; text-transform: uppercase; }
.week-calendar__row { min-height: 70px; border-bottom: 1px solid var(--border); }
.week-calendar__row:last-child { border-bottom: 0; }
.week-calendar__row > time { padding: 9px; color: var(--muted); background: #fafbfd; font-size: .67rem; font-weight: 730; }
.week-calendar__cell { display: grid; padding: 4px; align-content: start; gap: 4px; border-left: 1px solid var(--border); }
.month-calendar { min-width: 760px; border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.calendar-card:has(.month-calendar) { overflow-x: auto; }
.month-calendar__weekdays, .month-calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(105px, 1fr)); }
.month-calendar__weekdays { background: #f7f9fb; }
.month-calendar__weekdays span { padding: 12px; color: var(--muted); border-right: 1px solid var(--border); font-size: .67rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.month-day { min-height: 122px; padding: 8px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); }
.month-day > time { display: block; margin-bottom: 7px; font-size: .73rem; font-weight: 780; }
.month-day > div { display: grid; gap: 4px; }
.month-day--outside { color: var(--quiet); background: #fafbfd; }
.month-day--outside .calendar-event { opacity: .58; }
.calendar-empty { display: flex; margin-top: 17px; padding: 19px; align-items: center; justify-content: center; gap: 13px; color: var(--muted); background: #fafbfd; border: 1px dashed var(--control); border-radius: 12px; }
.calendar-empty strong { color: var(--ink); }
.calendar-empty p { margin: 3px 0 0; font-size: .78rem; }

.history-layout { display: grid; grid-template-columns: minmax(275px, .65fr) minmax(460px, 1.35fr); gap: 24px; }
.history-panel { min-height: 500px; padding: 0; overflow: hidden; }
.history-header { display: flex; padding: 25px 27px; align-items: center; justify-content: space-between; gap: 17px; border-bottom: 1px solid var(--border); }
.history-header h2 { margin: 0; font-size: 1.55rem; }
.history-header__actions { display: flex; align-items: center; gap: 11px; }
.timeline { margin: 0; padding: 28px 30px 30px 55px; list-style: none; }
.timeline li { position: relative; padding: 0 0 27px 28px; border-left: 1px solid #c7d6e2; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline__marker { position: absolute; top: 3px; left: -7px; width: 13px; height: 13px; background: var(--navy-700); border: 3px solid #e5eff6; border-radius: 50%; box-shadow: 0 0 0 2px #bcd0df; }
.timeline article { padding: 0 0 3px; }
.timeline time { color: var(--muted); font-size: .7rem; font-weight: 730; }
.timeline h3 { margin: 5px 0; font-size: .93rem; }
.timeline p { margin: 0 0 8px; color: var(--muted); font-size: .78rem; }
.text-link { color: var(--navy-700); font-size: .76rem; font-weight: 780; text-decoration: none; }
.clinical-detail { margin: 0 25px 25px; padding: 22px; background: #f8fafc; border: 1px solid var(--blue-200); border-radius: 13px; }
.clinical-copy { color: #31495e; line-height: 1.72; }
.detail-note { padding: 12px; color: #4c6377; background: var(--blue-50); border-radius: 9px; font-size: .8rem; }

.empty-state { display: grid; min-height: 260px; padding: 45px 24px; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: auto; padding: 27px 20px; }
.empty-state__icon { display: grid; width: 54px; height: 54px; place-items: center; background: var(--blue-100); border-radius: 16px; }
.empty-state__icon img { width: 26px; height: 26px; opacity: .7; }
.empty-state h2 { margin: 15px 0 6px; color: var(--ink); font-size: 1.25rem; }
.empty-state p { margin: 0; line-height: 1.55; }
.state-panel { padding: 24px; color: #36566f; background: #f1f7fb; border: 1px solid #cddfea; border-radius: var(--radius); }
.state-panel strong { font-size: 1.1rem; }
.state-panel p { margin: 7px 0 0; line-height: 1.55; }
.state-panel--error { color: #8f2529; background: #fff5f5; border-color: #f3c8ca; }
.alert { padding: 13px 15px; border-radius: 10px; font-size: .84rem; line-height: 1.45; }
.alert--error { color: #982d32; background: #fff2f2; border: 1px solid #f3c5c7; }
.alert--warning { color: #7b5505; background: #fff9e9; border: 1px solid #f1dfaa; }
.success-banner { padding: 13px 15px; color: #116542; background: #edf9f3; border: 1px solid #b9e5d0; border-radius: 10px; font-size: .84rem; font-weight: 700; }

.clean-public { display: grid; min-height: 100vh; padding: 30px; place-items: center; background: radial-gradient(circle at 50% 0, #fff 0, transparent 28rem), var(--page); }
.clean-public__card { width: min(100%, 650px); padding: clamp(34px, 7vw, 64px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); text-align: center; }
.clean-public__brand { display: inline-flex; margin-bottom: 32px; align-items: center; gap: 11px; text-align: left; text-decoration: none; }
.clean-public__brand img { width: 47px; height: 47px; }
.clean-public__brand span { display: grid; }
.clean-public__brand small, .clean-public__card > p:not(.eyebrow):not(.clean-public__code) { color: var(--muted); }
.clean-public h1 { margin: 8px 0 15px; color: var(--navy-950); font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.04em; }
.clean-public__card > p:not(.eyebrow):not(.clean-public__code) { line-height: 1.7; }
.clean-public__code { margin: 0; color: #d5e0e9; font-size: clamp(4rem, 15vw, 8rem); font-weight: 850; line-height: .9; }
.clean-public__actions { display: flex; margin-top: 26px; justify-content: center; }

@media (max-width: 1160px) {
    .patient-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .records-layout, .history-layout { grid-template-columns: 1fr; }
    .record-card-list, .history-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .record-card-list > .section-heading, .history-records > .section-heading { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; width: min(310px, 88vw); transform: translateX(-105%); transition: transform .22s; }
    .sidebar--open { transform: translateX(0); }
    .workspace__header { grid-template-columns: auto minmax(0, 1fr); }
    .menu-button { display: inline-flex; }
    .status-pill { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .welcome-card { grid-row: auto; }
    .modules-card { grid-column: auto; }
    .agenda-toolbar { align-items: stretch; flex-direction: column; }
    .agenda-controls { justify-content: space-between; }
}

@media (max-width: 680px) {
    .workspace__header { padding: 22px 17px 0; align-items: flex-start; gap: 12px; }
    .workspace__heading h1 { font-size: 1.7rem; }
    .workspace__content { padding: 22px 16px 40px; }
    .toolbar, .agenda-toolbar, .context-banner, .history-header { align-items: stretch; flex-direction: column; }
    .filter-bar, .agenda-controls { align-items: stretch; flex-direction: column; }
    .search-field { min-width: 0; }
    .toolbar__actions { justify-content: space-between; }
    .patient-card-grid, .module-grid, .record-card-list, .history-records, .form-grid, .form-grid--four { grid-template-columns: 1fr; }
    .compact-details, .detail-grid { grid-template-columns: 1fr; }
    .record-card-list > .section-heading, .history-records > .section-heading { grid-column: auto; }
    .record-detail { min-height: 350px; padding: 22px; }
    .date-navigation { flex-wrap: wrap; }
    .date-navigation strong { width: 100%; margin: 4px 0 0; }
    .segmented { width: 100%; }
    .segmented button { flex: 1; }
    .calendar-card { padding: 16px; }
    .calendar-event { grid-template-columns: 1fr auto; }
    .calendar-event time { grid-column: 1; }
    .calendar-event strong { grid-column: 1 / -1; }
    .calendar-event .badge { grid-column: 2; grid-row: 1; }
    .session-picker__form { grid-template-columns: 1fr; }
    .form-actions, .history-header__actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions .button, .history-header__actions .button { width: 100%; }
    .timeline { padding: 24px 18px 27px 42px; }
    .clinical-detail { margin: 0 16px 16px; }
    .clean-public { padding: 16px; }
}
