:root {
  --ink: #172923;
  --muted: #6d7d77;
  --line: #dce5e1;
  --soft: #f2f6fa;
  --paper: #ffffff;
  --green: #145da0;
  --green-dark: #103c63;
  --green-soft: #e8f2fb;
  --gold: #ef8354;
  --red: #a73f3f;
  --red-soft: #fff1ef;
  --shadow: 0 18px 50px rgba(22, 53, 43, .10);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--soft); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.06; letter-spacing: -.045em; margin-bottom: .7rem; }
h2 { font-size: 1.25rem; letter-spacing: -.02em; margin-bottom: .35rem; }
h3 { letter-spacing: -.015em; }
p { color: var(--muted); line-height: 1.65; }

.brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font-size: 1rem; }
.brand small { color: var(--muted); font-size: .7rem; margin-top: .18rem; text-transform: uppercase; letter-spacing: .08em; }
.brand.light small { color: rgba(255,255,255,.65); }
.brand-mark { width: 37px; height: 37px; border-radius: 11px; display: inline-grid; place-items: center; color: white; background: var(--green); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.eyebrow { display: inline-block; color: rgba(255,255,255,.68); letter-spacing: .16em; font-size: .69rem; font-weight: 800; margin-bottom: 1rem; }
.eyebrow.dark { color: var(--green); }

.button { min-height: 43px; border-radius: 10px; padding: .72rem 1.1rem; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-weight: 750; font-size: .88rem; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.button.primary { color: white; background: var(--green); box-shadow: 0 8px 18px rgba(23,107,82,.19); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { color: var(--green); background: var(--green-soft); border-color: #d5e9e1; }
.button.ghost { background: white; color: var(--muted); border-color: var(--line); }
.button.wide { width: 100%; }
.large-button { min-height: 52px; font-size: .96rem; }
.text-button { border: 0; background: none; padding: .4rem; color: var(--muted); font-size: .84rem; }

.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: .7rem clamp(1.2rem, 4vw, 4rem); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; backdrop-filter: blur(16px); }
.staff-nav { margin-left: auto; padding: .3rem; display: flex; align-items: center; gap: .3rem; border: 1px solid #dce6ef; border-radius: 13px; background: #f3f7fb; }
.nav-button { min-height: 43px; padding: .62rem .82rem; display: inline-flex; align-items: center; justify-content: center; gap: .42rem; border-radius: 9px; color: #52687b; font-size: .75rem; font-weight: 750; white-space: nowrap; transition: color .15s, background .15s, box-shadow .15s, transform .15s; }
.nav-button i { font-size: 1.08rem; }
.nav-button:hover { color: #0b58ad; background: white; box-shadow: 0 4px 12px rgba(10,63,107,.08); transform: translateY(-1px); }
.nav-button.active { color: white; background: #0f5dc2; box-shadow: 0 7px 16px rgba(15,93,194,.2); }
.nav-button:focus-visible, .nav-signout:focus-visible { outline: 3px solid rgba(15,93,194,.25); outline-offset: 2px; }
.signout-form { flex: 0 0 auto; }
.nav-signout { min-height: 43px; padding: .62rem .72rem; display: inline-flex; align-items: center; justify-content: center; gap: .38rem; border: 1px solid transparent; border-radius: 9px; color: #6d7d77; background: transparent; font-size: .74rem; font-weight: 720; }
.nav-signout i { font-size: 1.05rem; }
.nav-signout:hover { color: #8b3232; border-color: #efd5d1; background: #fff3f1; }
.app-shell { width: min(1400px, calc(100% - 3rem)); margin: 0 auto; padding: 3.4rem 0 5rem; }
.narrow-shell { width: min(820px, calc(100% - 3rem)); margin: 0 auto; padding: 3rem 0 6rem; }
.page-heading { margin-bottom: 2rem; }
.page-heading.split { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-end; }
.page-heading h1 { margin-bottom: .4rem; }
.page-heading p { margin-bottom: 0; }
.back-link { display: inline-block; color: var(--green); font-weight: 750; font-size: .84rem; margin-bottom: 2rem; }
.site-footer { padding: 1.4rem clamp(1.2rem, 4vw, 4rem); border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; background: white; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 12px rgba(22,53,43,.025); padding: 1.35rem; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.card-heading h2, .card-heading p { margin-bottom: .2rem; }
.card-heading p { font-size: .82rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stats-grid article { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 1.25rem; position: relative; overflow: hidden; }
.stats-grid article::after { content: ''; position: absolute; width: 70px; height: 70px; right: -20px; top: -20px; border-radius: 50%; background: var(--green-soft); }
.stats-grid span, .stats-grid small { color: var(--muted); font-size: .75rem; display: block; }
.stats-grid strong { font-size: 2rem; display: block; margin: .5rem 0 .25rem; letter-spacing: -.04em; }
.content-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(260px, .8fr); gap: 1.25rem; align-items: start; }
.table-card { padding: 0; overflow: hidden; }
.table-card.documents-card { overflow: visible; }
.table-card > .card-heading { padding: 1.35rem 1.35rem 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f8faf9; color: var(--muted); text-align: left; font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; padding: .8rem 1.1rem; border-block: 1px solid var(--line); }
td { padding: 1rem 1.1rem; border-bottom: 1px solid #edf1ef; font-size: .83rem; color: #50605a; }
tr:last-child td { border-bottom: 0; }
.patient-name { display: flex; align-items: center; gap: .7rem; min-width: 200px; }
.patient-name > span:last-child { display: flex; flex-direction: column; }
.patient-name strong { color: var(--ink); }
.patient-name small, .document-meta small { color: var(--muted); margin-top: .2rem; }
.avatar { flex: 0 0 auto; width: 35px; height: 35px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--green); background: var(--green-soft); font-weight: 800; }
.avatar.large { width: 66px; height: 66px; font-size: 1.5rem; }
.contact-cell { white-space: nowrap; }
.arrow-link { color: var(--green); font-size: 1.3rem; }
.empty-state { padding: 4rem 1rem; text-align: center; }
.empty-state.compact { padding: 2.6rem 1rem 3.2rem; }
.empty-state p { max-width: 430px; margin-inline: auto; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 1rem; border-radius: 16px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); font-weight: 800; }
.timeline { display: grid; gap: 1.3rem; }
.timeline-item { display: grid; grid-template-columns: 12px 1fr; gap: .8rem; }
.timeline-dot { width: 9px; height: 9px; border: 2px solid var(--green); background: white; border-radius: 50%; margin-top: .3rem; box-shadow: 0 0 0 4px var(--green-soft); }
.timeline-item strong { text-transform: capitalize; font-size: .8rem; }
.timeline-item p, .timeline-item small { margin: .2rem 0 0; font-size: .72rem; color: var(--muted); line-height: 1.35; }
.muted { color: var(--muted); font-size: .84rem; }

.stack-form { display: grid; gap: 1.2rem; }
label { display: grid; gap: .45rem; font-size: .77rem; color: #40514b; font-weight: 750; }
input, select { width: 100%; min-height: 44px; border: 1px solid #cfdbd6; border-radius: 9px; background: white; color: var(--ink); padding: .7rem .8rem; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,82,.1); }
input::placeholder { color: #a5b0ac; }
.form-card { padding: 2rem; gap: 1.5rem; }
.form-section { border-bottom: 1px solid var(--line); padding-bottom: 1.2rem; }
.form-section p { margin: 0; font-size: .84rem; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.optional { color: var(--muted); font-weight: 500; float: right; }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; border-top: 1px solid var(--line); padding-top: 1.3rem; }
.alert { width: 100%; padding: .9rem 1rem; border: 1px solid; border-left-width: 4px; border-radius: 10px; margin-bottom: 1.2rem; font-size: .78rem; font-weight: 650; line-height: 1.55; overflow-wrap: anywhere; }
.alert.error { color: #7a2525; background: #fff2f0; border-color: #e8aaa4; border-left-color: #c43d36; }
.alert.success { color: #14543f; background: #eaf8f1; border-color: #a9d8c3; border-left-color: #24875f; }

.patient-banner { display: flex; justify-content: space-between; gap: 2rem; align-items: center; margin-bottom: 1.5rem; }
.patient-identity { display: flex; align-items: center; gap: 1rem; }
.patient-identity .eyebrow { margin-bottom: .35rem; }
.patient-identity h1 { font-size: 2.3rem; margin-bottom: .3rem; }
.patient-identity p { margin: 0; font-size: .86rem; }
.separator { margin: 0 .35rem; }
.status-pill { color: var(--green); background: var(--green-soft); border: 1px solid #d2e7df; border-radius: 99px; padding: .45rem .7rem; font-weight: 750; font-size: .72rem; white-space: nowrap; }
.status-pill.small { padding: .3rem .55rem; font-size: .65rem; }
.patient-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(285px, .75fr); gap: 1.25rem; align-items: start; }
.main-column, .side-column { display: grid; gap: 1.25rem; }
.upload-card { padding: 1.5rem; }
.lock-badge { color: var(--green); background: var(--green-soft); padding: .35rem .6rem; border-radius: 6px; font-size: .68rem; font-weight: 800; }
.upload-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.file-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-field > span { min-height: 52px; padding: .58rem .8rem; border: 1px dashed #9db4c8; border-radius: 9px; color: var(--green); background: #f8fbfe; font-weight: 650; display: flex; flex-direction: column; justify-content: center; cursor: pointer; overflow: hidden; }
.file-field > span strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-field > span small { color: var(--muted); font-weight: 500; margin-top: .15rem; }
.upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.selected-file { color: var(--muted); font-size: .72rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.35rem; border-top: 1px solid var(--line); }
.pdf-icon { width: 43px; height: 49px; border-radius: 6px 6px 9px 9px; background: #fff0ed; color: #bd4a3c; display: grid; place-items: center; font-weight: 900; font-size: .66rem; border: 1px solid #f2d4cf; flex: 0 0 auto; }
.pdf-icon.large { width: 52px; height: 59px; }
.document-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.document-meta strong { font-size: .88rem; }
.document-meta span { color: var(--muted); font-size: .73rem; margin-top: .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-menu { position: relative; z-index: 5; }
.send-menu summary { list-style: none; cursor: pointer; }
.send-menu summary::-webkit-details-marker { display: none; }
.send-menu[open] { z-index: 30; }
.send-menu[open] .send-form { display: grid; }
.send-form { position: absolute; z-index: 12; right: 0; top: calc(100% + .5rem); width: 240px; padding: 1rem; border-radius: 12px; border: 1px solid var(--line); background: white; box-shadow: var(--shadow); gap: .75rem; }
.send-form > strong { font-size: .8rem; }
.check { display: flex; align-items: center; gap: .55rem; font-size: .77rem; }
.check input { width: 17px; min-height: 17px; accent-color: var(--green); }
.safety-card { background: var(--green-dark); color: white; border-color: var(--green-dark); }
.safety-card h3 { margin-bottom: .8rem; }
.safety-card ul { color: rgba(255,255,255,.76); padding-left: 1.1rem; font-size: .77rem; line-height: 1.9; margin-bottom: 0; }
.shield { display: grid; place-items: center; width: 38px; height: 42px; color: var(--green-dark); background: #cfe9de; border-radius: 50% 50% 55% 55%; font-weight: 900; margin-bottom: 1rem; }
.link-list { display: grid; gap: .9rem; }
.link-item { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.link-item:last-child { border: 0; padding-bottom: 0; }
.link-item div { display: flex; flex-direction: column; gap: .2rem; }
.link-item strong { font-size: .78rem; }
.link-item span, .link-item small { color: var(--muted); font-size: .68rem; line-height: 1.4; }
.danger-text { color: var(--red) !important; }

.outbox-card { padding: 0; overflow: hidden; }
.message-row { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; border-bottom: 1px solid var(--line); }
.message-row:last-child { border: 0; }
.message-row.highlight { background: #f6fbf8; box-shadow: inset 4px 0 var(--green); }
.channel-icon { width: 39px; height: 39px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; font-weight: 900; }
.channel-icon.whatsapp { color: #087c4e; background: #dcf8e9; }
.channel-icon.sms { color: #416eaa; background: #e9f1fc; }
.channel-icon.email { color: #8b5b26; background: #fff1d9; }
.message-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.message-top { display: flex; align-items: center; gap: .5rem; }
.message-body > span, .message-body small { color: var(--muted); font-size: .7rem; }
.message-body p { margin: .55rem 0; color: #43534d; background: var(--soft); border-radius: 8px; padding: .7rem; font-size: .76rem; word-break: break-word; line-height: 1.5; }
.message-actions { display: grid; gap: .55rem; min-width: 176px; }
.whatsapp-button { color: white; background: #147a4f; border-color: #147a4f; }
.whatsapp-button:hover { background: #0e623e; }

.bulk-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(290px, .8fr); gap: 1.25rem; align-items: start; }
.bulk-table-card { overflow: hidden; }
.bulk-table-card .card-heading { align-items: center; }
.select-all { display: flex; }
.row-check { width: 18px; min-height: 18px; accent-color: var(--green); }
.table-sub { display: block; color: var(--muted); font-size: .68rem; margin-top: .2rem; }
.channel-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.channel-tags i { color: var(--green); background: var(--green-soft); border-radius: 99px; padding: .25rem .45rem; font-style: normal; font-size: .62rem; font-weight: 750; }
.bulk-controls { position: sticky; top: 88px; display: grid; gap: 1.25rem; }
.bulk-controls p { font-size: .78rem; margin-bottom: 0; }
.bulk-controls fieldset { display: grid; gap: .8rem; border: 0; padding: 0; margin: 0; }
.bulk-controls legend { margin-bottom: .7rem; font-size: .77rem; font-weight: 800; }
.bulk-controls .check { align-items: flex-start; }
.bulk-controls .check span { display: flex; flex-direction: column; gap: .1rem; }
.bulk-controls .check small { color: var(--muted); font-weight: 500; }
.consent-check { display: flex; align-items: flex-start; gap: .6rem; color: #53635d; font-weight: 600; line-height: 1.45; }
.consent-check input { width: 18px; min-height: 18px; flex: 0 0 auto; accent-color: var(--green); }
.bulk-note { padding: .85rem; color: #38515f; background: #eef5fa; border: 1px solid #d8e6f0; border-radius: 9px; }
.bulk-note strong { font-size: .74rem; }
.bulk-note p { margin-top: .25rem; font-size: .7rem; line-height: 1.5; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-intro { background: radial-gradient(circle at 20% 10%, #2879b9 0, transparent 30%), linear-gradient(145deg, #123f68 0%, #082a49 100%); color: white; padding: clamp(2rem, 5vw, 5rem); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-intro::after { content: ''; position: absolute; width: 480px; height: 480px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; right: -170px; bottom: -190px; box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 135px rgba(255,255,255,.018); }
.auth-intro h1 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -.04em; font-size: clamp(3rem, 6vw, 5.4rem); max-width: 740px; margin-bottom: 1.4rem; }
.auth-intro p { color: rgba(255,255,255,.68); max-width: 600px; font-size: 1.05rem; }
.trust-row { display: flex; gap: 2rem; color: rgba(255,255,255,.62); font-size: .73rem; position: relative; z-index: 1; }
.trust-row span::before { content: '✓'; color: #8ad1b6; margin-right: .45rem; }
.auth-panel { display: grid; place-items: center; padding: 2rem; background: #fbfdfc; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-size: 2rem; margin-bottom: .5rem; }
.auth-card > p { margin-bottom: 1.7rem; }
.mobile-logo { display: none; margin-bottom: 2rem; }
.local-note { margin-top: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; padding: .75rem; border-radius: 8px; background: #fff8e9; color: #755c2c; font-size: .68rem; }

/* Public landing page */
.home-page { background: #fbfcfe; }
.home-nav { min-height: 78px; padding: 0 clamp(1.2rem, 5vw, 5.5rem); display: flex; align-items: center; justify-content: space-between; gap: 2rem; background: rgba(255,255,255,.94); border-bottom: 1px solid #e5ebf0; position: relative; z-index: 10; }
.home-nav nav { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.3rem); color: #526575; font-size: .8rem; font-weight: 700; }
.home-nav nav > a:not(.login-tab):hover { color: var(--green); }
.login-tab { min-height: 42px; padding: .65rem 1rem; border: 1px solid #cbd9e4; border-radius: 9px; color: var(--green); background: white; box-shadow: 0 4px 15px rgba(16,60,99,.06); }
.login-tab span { margin-left: .4rem; }
.home-hero { min-height: 680px; padding: clamp(4rem, 8vw, 7.5rem) clamp(1.2rem, 7vw, 8rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .92fr); align-items: center; gap: clamp(3rem, 8vw, 8rem); overflow: hidden; background: radial-gradient(circle at 90% 20%, #eaf4fd 0, transparent 30%), linear-gradient(180deg,#fbfcfe,#f6f9fc); }
.home-eyebrow { color: #6f8190; font-size: .67rem; font-weight: 850; letter-spacing: .17em; display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1.2rem; }
.home-eyebrow i { width: 24px; height: 2px; display: inline-block; background: var(--gold); }
.home-eyebrow.light { color: rgba(255,255,255,.64); }
.hero-copy h1 { max-width: 750px; margin-bottom: 1.5rem; color: #15334a; font-family: Georgia, serif; font-size: clamp(3.3rem, 6.7vw, 6.3rem); font-weight: 500; line-height: .94; letter-spacing: -.055em; }
.hero-copy h1 em { color: var(--green); font-weight: 500; }
.hero-copy > p { max-width: 635px; color: #667988; font-size: 1.04rem; }
.hero-actions { display: flex; align-items: center; gap: 1.5rem; margin: 2rem 0 2.4rem; }
.quiet-link { color: var(--green); font-size: .82rem; font-weight: 750; border-bottom: 1px solid #b5cadd; padding-bottom: .2rem; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 1.3rem; color: #71818e; font-size: .72rem; font-weight: 650; }
.hero-trust b { color: var(--green); margin-right: .32rem; }
.hero-visual { min-height: 470px; position: relative; display: grid; place-items: center; }
.visual-orbit { position: absolute; border: 1px solid #dce8f1; border-radius: 50%; }
.orbit-one { width: 465px; height: 465px; }
.orbit-two { width: 350px; height: 350px; box-shadow: 0 0 0 62px rgba(228,239,247,.38); }
.report-card-demo { width: min(330px, 72vw); padding: 1.35rem; border: 1px solid #d4e0e8; border-radius: 20px; background: rgba(255,255,255,.97); box-shadow: 0 28px 70px rgba(16,60,99,.16); transform: rotate(-2deg); position: relative; z-index: 2; }
.demo-head { display: flex; align-items: center; gap: .7rem; border-bottom: 1px solid #e8edf1; padding-bottom: 1rem; }
.demo-head > span:nth-child(2), .demo-status > span:last-child { display: flex; flex: 1; flex-direction: column; }
.demo-head strong, .demo-status strong { font-size: .76rem; }
.demo-head small, .demo-status small { color: #83919b; font-size: .6rem; margin-top: .15rem; }
.mini-brand { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--green); font-family: Georgia,serif; font-weight: 800; }
.demo-head i { color: #b34d42; background: #fff0ed; border-radius: 5px; padding: .35rem .45rem; font-size: .55rem; font-style: normal; font-weight: 850; }
.demo-lines { display: grid; gap: .65rem; padding: 1.35rem 0; }
.demo-lines span { width: 100%; height: 7px; border-radius: 9px; background: #e8eef2; }
.demo-lines span:nth-child(2) { width: 78%; }.demo-lines span:nth-child(3) { width: 92%; }.demo-lines span:nth-child(4) { width: 55%; }
.demo-status { display: flex; align-items: center; gap: .7rem; padding: .8rem; border-radius: 10px; background: #edf6fd; }
.shield-check { width: 31px; height: 34px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50% 50% 55% 55%; font-weight: 900; }
.floating-note { min-width: 178px; position: absolute; z-index: 3; display: grid; grid-template-columns: 36px 1fr; column-gap: .6rem; align-items: center; padding: .8rem; border: 1px solid #d7e1e8; border-radius: 12px; background: white; box-shadow: 0 16px 40px rgba(16,60,99,.13); }
.floating-note > span { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: .62rem; font-weight: 900; }
.floating-note strong { font-size: .68rem; }.floating-note small { color: #86939c; font-size: .56rem; }
.note-sms { top: 17%; right: -2%; }.note-lock { bottom: 14%; left: -5%; }
.home-strip { min-height: 80px; padding: 1rem clamp(1.2rem,7vw,8rem); display: flex; align-items: center; justify-content: center; gap: clamp(1rem,4vw,3rem); color: #8b99a4; background: white; border-block: 1px solid #e3e9ed; font-size: .75rem; }
.home-strip span { text-transform: uppercase; letter-spacing: .13em; font-size: .62rem; font-weight: 800; }.home-strip b { color: #3e586b; }.home-strip i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.home-section { padding: clamp(5rem,9vw,8rem) clamp(1.2rem,7vw,8rem); }
.section-heading { max-width: 700px; margin-bottom: 3rem; }.section-heading h2, .privacy-copy h2 { color: #17374e; font-family: Georgia,serif; font-size: clamp(2.4rem,4.5vw,4.1rem); font-weight: 500; line-height: 1.04; letter-spacing: -.045em; }.section-heading p { max-width: 580px; }
.steps-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; }
.steps-grid article { min-height: 270px; padding: 1.7rem; position: relative; border: 1px solid #dfe6eb; border-radius: 16px; background: white; box-shadow: 0 8px 35px rgba(16,60,99,.045); }
.step-number { position: absolute; top: 1.4rem; right: 1.4rem; color: #a9b5bd; font-family: Georgia,serif; font-size: .8rem; }.step-icon { width: 48px; height: 48px; margin-bottom: 2.2rem; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 13px; font-size: 1.2rem; font-weight: 850; }.steps-grid h3 { color: #203e53; margin-bottom: .65rem; }.steps-grid p { font-size: .8rem; }
.privacy-section { margin: 0 clamp(1.2rem,4vw,4.5rem) 4.5rem; padding: clamp(3rem,7vw,6rem); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem,8vw,8rem); color: white; background: radial-gradient(circle at 20% 10%,#246ca6,transparent 32%),#0c3150; border-radius: 28px; overflow: hidden; }
.privacy-copy p { color: rgba(255,255,255,.66); max-width: 540px; }.privacy-copy h2 { color: white; }.privacy-copy > a { color: white; display: inline-block; margin-top: .7rem; border-bottom: 1px solid rgba(255,255,255,.35); padding-bottom: .25rem; font-size: .8rem; font-weight: 750; }
.privacy-points { display: grid; gap: 1.5rem; }.privacy-points article { display: grid; grid-template-columns: 40px 1fr; gap: 1rem; padding-bottom: 1.3rem; border-bottom: 1px solid rgba(255,255,255,.12); }.privacy-points article:last-child { border: 0; }.privacy-points article > span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; color: #aad1ef; font-size: .65rem; }.privacy-points strong { font-size: .85rem; }.privacy-points p { margin: .3rem 0 0; color: rgba(255,255,255,.55); font-size: .73rem; }
.home-footer { min-height: 110px; padding: 1.5rem clamp(1.2rem,7vw,8rem); display: flex; align-items: center; justify-content: space-between; gap: 2rem; border-top: 1px solid #e1e8ed; background: white; }.home-footer p { margin: 0; font-size: .72rem; }.home-footer > a:last-child { color: var(--green); font-size: .76rem; font-weight: 750; }

.recipient-page { background: radial-gradient(circle at top, #f5faff, #e8eff6 70%); }
.status-pill.failed { color: var(--red); background: var(--red-soft); border-color: #f2d1cd; }
.recipient-shell { width: min(540px, calc(100% - 2rem)); min-height: 100vh; margin: 0 auto; padding: 3rem 0; display: flex; flex-direction: column; justify-content: center; }
.recipient-brand { display: flex; align-items: center; justify-content: center; gap: .65rem; margin-bottom: 1.2rem; }
.recipient-card { background: white; border: 1px solid #d8e5df; border-radius: 22px; padding: clamp(1.7rem, 6vw, 3rem); text-align: center; box-shadow: var(--shadow); }
.recipient-card h1 { font-size: 2.1rem; }
.recipient-card > p { font-size: .9rem; }
.secure-emblem { width: 61px; height: 68px; margin: 0 auto 1.3rem; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50% 50% 54% 54%; font-size: 1.5rem; font-weight: 900; box-shadow: 0 10px 25px rgba(23,107,82,.22); }
.secure-emblem.code { border-radius: 18px; font-size: 1.1rem; letter-spacing: .2em; }
.secure-emblem.unavailable { background: #8d514b; border-radius: 50%; }
.document-preview { display: flex; align-items: center; gap: .9rem; text-align: left; padding: 1rem; margin: 1.6rem 0; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.document-preview div { display: flex; flex-direction: column; min-width: 0; }
.document-preview strong { font-size: .86rem; }
.document-preview span { color: var(--muted); font-size: .72rem; margin-top: .3rem; }
.recipient-help { font-size: .73rem !important; margin: 1rem 0 0; }
.recipient-trust { display: flex; justify-content: center; gap: 1rem; margin-top: 1.3rem; color: var(--muted); font-size: .66rem; }
.recipient-trust span::before { content: '✓'; color: var(--green); margin-right: .3rem; }
.recipient-page { width: 100%; height: 100vh; height: 100dvh; overflow: hidden; }
.report-viewer-shell { width: 100%; height: 100vh; height: 100dvh; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; background: #dfe7ee; }
.report-viewer-header { min-height: 76px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem; padding: .8rem clamp(1rem, 3vw, 2rem); background: white; border-bottom: 1px solid var(--line); box-shadow: 0 3px 15px rgba(16,60,99,.08); z-index: 2; }
.report-viewer-header .recipient-brand { justify-content: flex-start; margin: 0; }
.recipient-brand > span:last-child { display: flex; flex-direction: column; }
.recipient-brand small { color: var(--muted); font-size: .66rem; font-weight: 600; margin-top: .1rem; }
.report-heading { min-width: 0; display: flex; flex-direction: column; text-align: center; }
.report-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.report-heading span { color: var(--muted); font-size: .68rem; margin-top: .25rem; }
.report-frame-wrap { width: min(1100px, calc(100% - 2rem)); height: calc(100% - 2rem); min-height: 0; margin: 1rem auto; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(16,60,99,.14); }
.report-frame { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: white; }
.report-viewer-footer { min-height: 36px; padding: .55rem 1rem; display: flex; justify-content: center; gap: 2rem; color: #526877; background: #edf2f6; font-size: .66rem; }
.report-viewer-footer span::before { content: '✓'; color: var(--green); margin-right: .35rem; }

@media (max-width: 950px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content-grid, .patient-layout, .bulk-layout { grid-template-columns: 1fr; }
  .bulk-controls { position: static; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { display: none; }
  .mobile-logo { display: block; }
  .auth-panel { min-height: 100vh; }
  .home-hero { grid-template-columns: 1fr; padding-top: 5rem; text-align: center; }
  .hero-copy > p { margin-inline: auto; }.hero-actions, .hero-trust { justify-content: center; }.hero-visual { width: min(600px,100%); margin: 0 auto; }
  .privacy-section { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  input, select, textarea { min-height: 48px; font-size: 16px; }
  .button, .text-button { min-height: 46px; }
  .app-shell, .narrow-shell { width: min(100% - 1.5rem, 1000px); padding-top: 2rem; }
  .brand small { display: none; }
  .page-heading.split, .patient-banner { align-items: flex-start; flex-direction: column; }
  .stats-grid, .two-columns, .upload-grid { grid-template-columns: 1fr; }
  .patient-identity { align-items: flex-start; }
  .patient-identity h1 { font-size: 1.8rem; }
  .avatar.large { width: 52px; height: 52px; }
  .document-row { align-items: flex-start; flex-wrap: wrap; }
  .send-menu { width: 100%; }
  .send-menu summary { width: 100%; }
  .send-form { position: relative; left: auto; right: auto; top: auto; width: 100%; margin-top: .6rem; box-shadow: none; background: #f8fbfe; }
  .upload-actions { align-items: stretch; flex-direction: column; }
  .upload-actions .button { width: 100%; }
  .message-row { flex-wrap: wrap; }
  .message-row > .button { width: 100%; }
  .message-actions { width: 100%; }
  .site-footer { flex-direction: column; gap: .4rem; }
  .recipient-trust { flex-wrap: wrap; }
  .report-viewer-header { grid-template-columns: 1fr auto; gap: .7rem; }
  .report-heading { grid-column: 1 / -1; grid-row: 2; text-align: left; padding-top: .55rem; border-top: 1px solid var(--line); }
  .report-frame-wrap { width: 100%; height: 100%; margin: 0; border-radius: 0; box-shadow: none; }
  .report-frame { height: 100%; min-height: 0; }
  .report-viewer-footer { gap: .8rem; justify-content: space-between; }
  .home-nav { min-height: 68px; }.home-nav nav > a:not(.login-tab) { display: none; }.home-nav .brand small { display: block; }
  .home-hero { min-height: auto; padding-block: 4rem 3rem; }.hero-copy h1 { font-size: clamp(3rem,15vw,4.4rem); }.hero-actions { align-items: stretch; flex-direction: column; }.hero-trust { gap: .7rem 1rem; }
  .hero-visual { min-height: 360px; transform: scale(.88); }.orbit-one { width: 360px; height: 360px; }.orbit-two { width: 270px; height: 270px; }.note-sms { right: -8%; }.note-lock { left: -8%; }
  .home-strip { flex-wrap: wrap; gap: .8rem 1.2rem; }.home-strip span { width: 100%; text-align: center; }
  .steps-grid { grid-template-columns: 1fr; }.steps-grid article { min-height: 230px; }
  .privacy-section { margin-inline: .7rem; border-radius: 20px; }.home-footer { align-items: flex-start; flex-direction: column; }.home-footer p { order: 3; }
}

/* Selected landing redesign: staff access first */
.home-page {
  --landing-navy: #06345e;
  --landing-blue: #0f5dc2;
  --landing-orange: #f47b35;
  color: #092f57;
  background: #f4f8fc;
  font-family: "Sora Variable", ui-sans-serif, sans-serif;
}
.home-page .brand strong { font-size: clamp(1.05rem, 2vw, 1.5rem); letter-spacing: -.035em; }
.home-page .brand small { color: #73849a; font-size: .66rem; letter-spacing: .13em; }
.home-page .brand-mark { width: 48px; height: 48px; border-radius: 13px; background: #0d61c6; font-size: 1.7rem; }
.landing-shell { min-height: 100vh; padding: 1.6rem 1.25rem; display: grid; place-items: center; }
.staff-gateway {
  width: min(1280px, 100%);
  min-height: 650px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(360px, .86fr) minmax(480px, 1.14fr);
  overflow: hidden;
  background: white;
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(5, 43, 78, .14);
}
.gateway-intro {
  min-height: 650px;
  padding: clamp(2rem, 4.5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background: var(--landing-navy);
}
.gateway-brand { align-self: flex-start; }
.gateway-brand strong { color: white; }
.gateway-brand small { color: rgba(255,255,255,.72) !important; }
.gateway-copy { max-width: 500px; padding-bottom: clamp(1rem, 5vw, 4rem); }
.gateway-accent { display: block; width: 42px; height: 4px; margin-bottom: 2rem; background: var(--landing-orange); }
.gateway-copy h1 { margin: 0 0 1.1rem; color: white; font-size: clamp(2.7rem, 5vw, 5.1rem); font-weight: 760; letter-spacing: -.065em; line-height: .98; }
.gateway-copy h2 { margin: 0 0 1rem; color: #dceaff; font-size: clamp(1.45rem, 2.5vw, 2.2rem); font-weight: 540; }
.gateway-copy p { max-width: 470px; margin: 0; color: rgba(234,243,255,.78); font-size: clamp(.92rem, 1.5vw, 1.1rem); line-height: 1.65; }
.gateway-form-panel {
  position: relative;
  padding: clamp(3rem, 6vw, 6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}
.gateway-form-panel::before {
  content: "";
  position: absolute;
  width: 82px;
  height: 5px;
  top: 0;
  left: 0;
  background: var(--landing-orange);
}
.gateway-form { display: grid; gap: 1.35rem; }
.gateway-form label { gap: .6rem; color: #0b3763; font-size: .82rem; font-weight: 720; }
.gateway-input {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .85rem;
  padding: 0 1rem;
  border: 1px solid #bdc9d7;
  border-radius: 11px;
  background: white;
  color: #73839a;
  transition: border-color .15s, box-shadow .15s;
}
.gateway-input:focus-within { border-color: var(--landing-blue); box-shadow: 0 0 0 4px rgba(15,93,194,.1); }
.gateway-input > i { font-size: 1.45rem; }
.gateway-input input { min-height: 60px; padding: 0; border: 0; border-radius: 0; box-shadow: none; color: #0b3158; font-size: .96rem; }
.gateway-input input:focus { border: 0; box-shadow: none; }
.gateway-input input::placeholder { color: #9ca8b7; }
.password-toggle { width: 42px; height: 42px; padding: 0; border: 0; display: grid; place-items: center; color: #6d7f97; background: transparent; font-size: 1.45rem; }
.password-toggle:focus-visible { outline: 3px solid rgba(15,93,194,.24); border-radius: 8px; }
.forgot-link { margin-top: -.45rem; justify-self: end; color: #0759b7; font-size: .78rem; font-weight: 650; text-decoration: underline; text-underline-offset: .2rem; }
.gateway-submit {
  width: 100%;
  min-height: 62px;
  padding: .9rem 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--landing-blue);
  box-shadow: 0 12px 25px rgba(15,93,194,.2);
  font-weight: 720;
  font-size: 1rem;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.gateway-submit:hover { background: #094fa8; transform: translateY(-1px); box-shadow: 0 15px 30px rgba(15,93,194,.24); }
.gateway-submit:focus-visible { outline: 3px solid rgba(15,93,194,.28); outline-offset: 3px; }
.gateway-alert { margin-bottom: 1.3rem; }
.gateway-trust { margin-top: 2.2rem; padding-top: 1.4rem; display: grid; grid-template-columns: repeat(3,1fr); gap: .9rem; border-top: 1px solid #dce5ef; color: #194b7d; font-size: .67rem; font-weight: 620; }
.gateway-trust span { display: flex; align-items: center; justify-content: center; gap: .45rem; text-align: center; white-space: nowrap; }
.gateway-trust i { color: #0961c4; font-size: 1.1rem; }
.signed-in-panel { text-align: center; }
.signed-in-panel h2 { margin: 1rem 0 .7rem; color: #0c3156; font-size: 2rem; }
.signed-in-panel p { max-width: 440px; margin: 0 auto 1.7rem; }
.signed-in-icon { width: 62px; height: 62px; margin: 0 auto; display: grid; place-items: center; border-radius: 18px; color: #0e5fbd; background: #eaf3fd; font-size: 2rem; }
.landing-story {
  width: min(1280px, 100%);
  min-height: 480px;
  margin: 1.8rem auto 0;
  padding: clamp(3rem, 7vw, 6.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  align-items: center;
  gap: clamp(2rem, 8vw, 7rem);
  border-radius: 26px;
  background: #eaf3fc;
}
.story-eyebrow { margin-bottom: 1.3rem; display: inline-flex; align-items: center; gap: .7rem; color: #2364aa; font-size: .68rem; font-weight: 720; letter-spacing: .17em; }
.story-eyebrow i { width: 28px; height: 3px; display: inline-block; background: var(--landing-orange); }
.story-eyebrow.light { color: rgba(255,255,255,.66); }
.story-copy h2, .home-page .section-heading h2, .home-page .privacy-copy h2 { color: #092f57; font-family: "Sora Variable", sans-serif; font-size: clamp(2.1rem, 4vw, 4.2rem); font-weight: 720; line-height: 1.13; letter-spacing: -.055em; }
.story-copy p { max-width: 660px; color: #526b85; font-size: .95rem; }
.story-copy > a { display: inline-flex; align-items: center; gap: .5rem; color: #0c5bb7; font-size: .82rem; font-weight: 720; }
.story-visual { min-height: 280px; display: grid; place-items: center; }
.story-visual img { display: block; width: min(430px, 100%); max-height: 430px; object-fit: contain; border-radius: 28px; box-shadow: 0 18px 48px rgba(7,48,84,.08); }
.home-page .home-section { width: min(1280px, 100%); margin: 0 auto; padding: clamp(5rem, 8vw, 8rem) clamp(1rem, 5vw, 4rem); }
.home-page .section-heading { max-width: 760px; }
.home-page .section-heading p { color: #61778d; }
.home-page .steps-grid article { border-color: #d9e4ef; box-shadow: 0 10px 30px rgba(7,48,84,.05); }
.home-page .step-number { color: #7e91a4; font-family: "Sora Variable", sans-serif; }
.home-page .step-icon { color: #0e5fbd; background: #e9f3fd; font-size: 1.4rem; }
.home-page .privacy-section { width: min(1280px, calc(100% - 2.5rem)); margin: 0 auto 4.5rem; background: var(--landing-navy); }
.home-page .privacy-copy h2 { color: white; }
.home-page .privacy-copy > a { display: inline-flex; align-items: center; gap: .4rem; }
.home-page .home-footer { font-family: "Sora Variable", sans-serif; }

@media (max-width: 900px) {
  .staff-gateway { grid-template-columns: 1fr; }
  .gateway-intro { min-height: 340px; }
  .gateway-copy { padding: 3rem 0 0; }
  .gateway-form-panel::before { width: 100%; }
  .landing-story { grid-template-columns: 1fr; }
  .story-visual { min-height: 230px; font-size: 6rem; }
}

@media (max-width: 680px) {
  .landing-shell { min-height: 100vh; padding: 0; display: block; }
  .staff-gateway { width: 100%; min-height: 100vh; border-radius: 0; box-shadow: none; }
  .gateway-intro { min-height: 252px; padding: 1.55rem 1.35rem 2.5rem; }
  .home-page .brand-mark { width: 43px; height: 43px; border-radius: 12px; font-size: 1.55rem; }
  .home-page .brand strong { font-size: 1.13rem; }
  .home-page .brand small { display: block; font-size: .58rem; }
  .gateway-copy { padding: 2.05rem 0 0; }
  .gateway-accent { width: 38px; height: 3px; margin-bottom: 1.25rem; }
  .gateway-copy h1 { margin-bottom: .65rem; font-size: 2.15rem; }
  .gateway-copy h2 { margin-bottom: .55rem; font-size: 1.2rem; }
  .gateway-copy p { font-size: .84rem; line-height: 1.55; }
  .gateway-form-panel { min-height: 0; padding: 1.8rem 1.35rem 1.4rem; justify-content: flex-start; }
  .gateway-form-panel::before { width: 78px; height: 4px; left: auto; right: 54px; transform: skewX(38deg); transform-origin: right; }
  .gateway-form { gap: 1.05rem; }
  .gateway-input { min-height: 52px; border-radius: 10px; }
  .gateway-input input { min-height: 50px; font-size: 16px; }
  .gateway-submit { min-height: 52px; font-size: .92rem; }
  .gateway-trust { margin-top: 1.55rem; padding-top: 1.15rem; gap: .4rem; }
  .gateway-trust span { gap: .25rem; font-size: .56rem; white-space: normal; }
  .gateway-trust i { font-size: .95rem; }
  .landing-story { margin: 0; padding: 4.5rem 1.35rem; border-radius: 0; }
  .story-copy h2 { font-size: 2.25rem; }
  .story-visual { min-height: 210px; margin: 1rem .8rem 0; }
  .home-page .home-section { padding-inline: 1.35rem; }
  .home-page .privacy-section { width: calc(100% - 1.4rem); }
}

/* Staff access management */
.staff-admin-shell { max-width: 1500px; }
.staff-admin-grid { display: grid; grid-template-columns: minmax(310px, .72fr) minmax(0, 1.7fr); gap: 1.25rem; align-items: start; }
.staff-create-form { position: sticky; top: 90px; }
.staff-create-form .card-heading { margin-bottom: .5rem; }
.staff-create-form .button i { font-size: 1.1rem; }
.staff-invite-note { display: grid; grid-template-columns: auto 1fr; gap: .7rem; padding: .8rem; border: 1px solid #d8e6f0; border-radius: 10px; color: #1a5d98; background: #eef6fd; }
.staff-invite-note i { margin-top: .1rem; font-size: 1.25rem; }
.staff-invite-note p { margin: 0; color: #526c82; font-size: .7rem; line-height: 1.55; }
.temporary-password { margin-bottom: 1.2rem; padding: 1rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid #f0cf99; border-radius: 12px; background: #fff8e8; color: #684c1d; }
.temporary-password div { display: flex; flex-direction: column; gap: .2rem; }
.temporary-password span { font-size: .7rem; }
.temporary-password code { padding: .55rem .75rem; border-radius: 8px; color: #073a68; background: white; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; font-weight: 800; letter-spacing: .16em; }
.staff-owner-row { margin: 0 1.35rem 1rem; padding: 1rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; border: 1px solid #dce7f1; border-radius: 12px; background: #f6faff; }
.staff-owner-row > div { display: flex; flex-direction: column; gap: .15rem; }
.staff-owner-row strong { font-size: .8rem; }
.staff-owner-row small { color: var(--muted); font-size: .66rem; }
.invite-state { display: inline-flex; padding: .28rem .5rem; border-radius: 99px; color: #566a7a; background: #edf2f6; font-size: .62rem; font-weight: 750; text-transform: capitalize; }
.invite-state.sent { color: #145f47; background: #e2f5ed; }
.invite-state.failed { color: #8d3737; background: #fff0ee; }
.invite-state.simulated { color: #79591e; background: #fff5d8; }
.password-change-shell { min-height: 100vh; padding: 2rem 1rem; display: grid; place-items: center; background: #eef5fb; }
.password-change-card { width: min(470px, 100%); padding: clamp(1.6rem, 5vw, 2.6rem); border: 1px solid #d7e2ec; border-radius: 22px; background: white; box-shadow: 0 24px 60px rgba(8,51,89,.12); }
.password-change-card > .brand { margin-bottom: 2.5rem; }
.password-change-icon { width: 56px; height: 56px; margin-bottom: 1.2rem; display: grid; place-items: center; border-radius: 16px; color: #0d5fbf; background: #eaf3fd; font-size: 1.7rem; }
.password-change-card h1 { color: #123b5e; font-size: clamp(2rem, 7vw, 2.8rem); }
.password-change-card > p { margin-bottom: 1.6rem; font-size: .82rem; }
.recovery-card .brand { margin-bottom: 2rem; }
.recovery-card .eyebrow { display: block; margin-bottom: .55rem; }
.recovery-card .stack-form { margin-top: 1.2rem; }
.recovery-back { width: 100%; min-height: 48px; margin-top: .75rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid #bdd0e2; color: #0759b7; background: #f7fbff; font-size: .76rem; font-weight: 750; text-decoration: none; }
.recovery-back:hover { border-color: #8eb1d1; background: #edf6ff; }
.recovery-back:focus-visible { outline: 3px solid rgba(15,93,194,.24); outline-offset: 2px; }
.recovery-code-input { font-size: 1.25rem !important; font-weight: 750; letter-spacing: .32em; text-align: center; }

@media (max-width: 950px) {
  .staff-admin-grid { grid-template-columns: 1fr; }
  .staff-create-form { position: static; }
}

@media (max-width: 680px) {
  .topbar { width: 100%; min-height: 64px; padding: .55rem .8rem; gap: .6rem; backdrop-filter: none; }
  .topbar .brand > span:last-child { display: flex; }
  .topbar .brand strong { font-size: .82rem; }
  .topbar .brand small { display: none; }
  .topbar .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 1.2rem; }
  .staff-nav { height: calc(66px + env(safe-area-inset-bottom)); margin: 0; padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .25rem; border: 0; border-top: 1px solid #d8e3ec; border-radius: 0; background: rgba(255,255,255,.98); box-shadow: 0 -8px 24px rgba(7,48,84,.1); backdrop-filter: blur(16px); }
  .nav-button { min-width: 0; min-height: 52px; padding: .35rem .2rem; flex-direction: column; gap: .14rem; border-radius: 10px; color: #637588; font-size: .62rem; line-height: 1.05; }
  .nav-button i { font-size: 1.25rem; }
  .nav-button:hover { transform: none; box-shadow: none; }
  .nav-button.active { color: #0b58ad; background: #eaf3fd; box-shadow: inset 0 0 0 1px #cfe1f4; }
  .nav-signout { min-height: 44px; padding: .5rem .65rem; border-color: #dce5ec; background: #f7fafc; }
  .nav-signout span { display: none; }
  .app-shell, .narrow-shell { width: calc(100% - 1.25rem); padding-top: 1.5rem; padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: calc(5.2rem + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 1.25rem; }
  .page-heading.split { gap: 1rem; }
  .page-heading.split > .button { width: 100%; }
  .card { padding: 1rem; border-radius: 13px; }
  .form-card { padding: 1.1rem; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .table-card > .card-heading { padding: 1rem 1rem 0; }
  .table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 640px; }
  .stats-grid { gap: .65rem; }
  .stats-grid article { padding: 1rem; }
  .stats-grid strong { font-size: 1.6rem; }
  .content-grid, .patient-layout, .bulk-layout { gap: .85rem; }
  .patient-banner { gap: 1rem; }
  .patient-identity { width: 100%; min-width: 0; }
  .patient-identity > div { min-width: 0; }
  .patient-identity p { overflow-wrap: anywhere; }
  .message-row { padding: 1rem; gap: .75rem; }
  .message-top { align-items: flex-start; justify-content: space-between; }
  .message-top strong { min-width: 0; overflow-wrap: anywhere; }
  .alert { padding: .85rem .9rem; font-size: .875rem; }
  .staff-admin-shell { width: calc(100% - 1.25rem); padding-top: 1.6rem; }
  .staff-admin-shell .page-heading h1 { font-size: 2rem; }
  .staff-create-form { padding: 1.15rem; }
  .temporary-password { align-items: flex-start; flex-direction: column; }
  .temporary-password code { width: 100%; text-align: center; }
  .staff-list-card { overflow: hidden; }
  .staff-owner-row { margin-inline: .9rem; }
  .staff-table thead { display: none; }
  .staff-table, .staff-table tbody, .staff-table tr, .staff-table td { display: block; width: 100%; }
  .staff-table tr { margin: .75rem; width: calc(100% - 1.5rem); padding: .85rem; border: 1px solid #dfe7ee; border-radius: 12px; }
  .staff-table td { padding: .45rem 0; border: 0; white-space: normal; }
  .staff-table td:not(:first-child)::before { display: block; margin-bottom: .18rem; color: #82909b; font-size: .57rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .staff-table td:nth-child(2)::before { content: "Phone"; }
  .staff-table td:nth-child(3)::before { content: "Invite"; }
  .staff-table td:nth-child(4)::before { content: "Last sign-in"; }
  .password-change-shell { width: 100%; min-height: 100dvh; align-items: start; padding: .75rem; }
  .password-change-card { width: 100%; max-width: none; padding: 1.35rem; border-radius: 16px; box-shadow: 0 12px 32px rgba(8,51,89,.1); }
  .password-change-card > .brand, .recovery-card .brand { margin-bottom: 1.4rem; }
  .recovery-card .brand small { display: block; font-size: .58rem; }
  .password-change-icon { width: 50px; height: 50px; margin-bottom: 1rem; border-radius: 14px; font-size: 1.45rem; }
  .password-change-card h1 { font-size: clamp(1.75rem, 8vw, 2.15rem); }
  .password-change-card > p { margin-bottom: 1.2rem; font-size: .88rem; }
  .recovery-card .stack-form { margin-top: 1rem; gap: 1rem; }
  .recovery-back { min-height: 50px; font-size: .84rem; }
  .recovery-code-input { font-size: 1.15rem !important; letter-spacing: .25em; }
}

@media (max-width: 380px) {
  .gateway-intro { min-height: 232px; padding-inline: 1rem; }
  .gateway-form-panel { padding-inline: 1rem; }
  .gateway-trust { grid-template-columns: 1fr; gap: .65rem; }
  .gateway-trust span { justify-content: flex-start; font-size: .7rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .password-change-shell { padding: .5rem; }
  .password-change-card { padding: 1.15rem; }
}

/* Patient import: areas, preview table, and inline area assignment. */
.area-code { display: inline-block; padding: .18rem .48rem; border-radius: 6px; background: var(--green-soft); color: var(--green-dark); font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.stats-grid.compact { margin-bottom: 1.1rem; }
.stats-grid.compact article { padding: .85rem 1rem; }
.stats-grid.compact strong { font-size: 1.5rem; }
.inline-assign { display: flex; align-items: center; gap: .45rem; }
.inline-assign select { min-height: 39px; max-width: 210px; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 9px; background: white; }
.inline-assign .button { min-height: 39px; padding: .5rem .8rem; font-size: .8rem; }
.form-card textarea { width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px; background: white; font: inherit; line-height: 1.55; resize: vertical; }
@media (max-width: 720px) {
  .inline-assign { flex-direction: column; align-items: stretch; }
  .inline-assign select { max-width: none; }
}

/* Import modal */
.modal { width: min(560px, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(16, 40, 60, .55); backdrop-filter: blur(3px); }
.modal-close-row { display: flex; justify-content: flex-end; padding: .6rem .7rem 0; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; }
.modal-close:hover { background: var(--soft); color: var(--ink); }
.modal-head { display: flex; align-items: flex-start; gap: .85rem; padding: 0 1.5rem 1rem; }
.modal-head h2 { margin-bottom: .2rem; }
.modal-head p { margin: 0; font-size: .86rem; }
.modal-icon { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 1.3rem; }
.modal-body { padding: 0 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; }
.modal-steps { margin: 0; padding: 0 0 0 1.1rem; display: flex; flex-direction: column; gap: .35rem; }
.modal-steps li { color: var(--muted); font-size: .82rem; }
.modal-steps strong { color: var(--ink); margin-right: .4rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }

/* Search + filter bar and pagination */
.heading-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.filter-search { flex: 1 1 260px; display: inline-flex; align-items: center; gap: .5rem; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.filter-search i { color: var(--muted); }
.filter-search input { flex: 1; min-height: 43px; border: 0; background: transparent; outline: none; }
.filter-bar select { min-height: 43px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: white; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.1rem; border-top: 1px solid var(--line); }
.pagination-count, .pagination-page { color: var(--muted); font-size: .82rem; }
.pagination-controls { display: flex; align-items: center; gap: .6rem; }
@media (max-width: 720px) {
  .filter-bar { flex-direction: column; }
  .pagination { flex-direction: column; align-items: stretch; text-align: center; }
}

/* Report batch review */
.reassign-menu { margin-top: .35rem; }
.reassign-menu summary { color: var(--green); font-size: .74rem; font-weight: 750; cursor: pointer; }
.reassign-menu .inline-assign { margin-top: .4rem; }
.reassign-menu input { min-height: 36px; max-width: 190px; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 8px; }
.inline-assign input[type="text"] { min-height: 39px; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 9px; background: white; }

/* Destructive actions */
.button.danger { color: white; background: var(--red); box-shadow: 0 8px 18px rgba(167,63,63,.2); }
.button.danger:hover { background: #8d3434; }
.danger-card { border: 1px solid #f0d4d0; background: var(--red-soft); }
.danger-card h3 { display: flex; align-items: center; gap: .4rem; color: var(--red); margin-bottom: .5rem; }
.danger-card p { font-size: .84rem; }
.modal-icon.danger { background: var(--red-soft); color: var(--red); }
.delete-summary { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; color: var(--muted); font-size: .85rem; }
.delete-summary strong { color: var(--ink); }
.modal-body code { padding: .1rem .35rem; border-radius: 5px; background: var(--soft); font-weight: 700; }
.modal-body input[type="text"] { width: 100%; min-height: 43px; margin-top: .35rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; }

/* Upload progress */
.upload-overlay { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(16,40,60,.55); backdrop-filter: blur(3px); }
.upload-overlay.visible { display: grid; }
.upload-card { width: min(380px, calc(100vw - 2rem)); padding: 1.6rem; border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); text-align: center; display: flex; flex-direction: column; align-items: center; gap: .7rem; }
.upload-card strong { font-size: 1.02rem; }
.upload-card small { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.upload-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--green-soft); border-top-color: var(--green); animation: upload-spin .8s linear infinite; }
@keyframes upload-spin { to { transform: rotate(360deg); } }
.upload-bar { width: 100%; height: 7px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0%; border-radius: 99px; background: var(--green); transition: width .2s ease; }
@media (prefers-reduced-motion: reduce) { .upload-spinner { animation: none; } .upload-bar span { transition: none; } }

/* Area aliases */
.alias-tags { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .3rem; }
.alias-tags i { padding: .12rem .42rem; border-radius: 5px; background: var(--soft); color: var(--muted); font-style: normal; font-size: .72rem; font-weight: 700; }
.alias-form { display: flex; flex-direction: column; gap: .45rem; min-width: 220px; }
.alias-form textarea { width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 9px; font: inherit; resize: vertical; }
.alias-form label { font-size: .78rem; color: var(--muted); }
.matched-typo { color: var(--gold); font-weight: 700; }

/* Unmatched name endings */
.alert.info { border: 1px solid #cfe0f2; background: #eef5fc; color: var(--ink); }
.ending-list { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0 1.1rem 1rem; }
.ending-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: .82rem; }
.ending-chip i { padding: .05rem .4rem; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-style: normal; font-size: .72rem; font-weight: 800; }
