:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #142033;
  --muted: #66748a;
  --line: #e3e9f1;
  --brand: #176b87;
  --brand-strong: #0d536b;
  --brand-soft: #e7f4f7;
  --success: #217a4d;
  --success-soft: #eaf7ef;
  --warning: #9a6210;
  --warning-soft: #fff6df;
  --timeline-gold: #b47a2c;
  --timeline-gold-dark: #8f5f21;
  --timeline-gold-outline: #d5ad70;
  --timeline-gold-soft: #f7ecd9;
  --danger: #a63b3b;
  --danger-soft: #fff0f0;
  --purple: #6c5aa8;
  --shadow: 0 12px 38px rgba(30, 55, 90, 0.09);
  --shadow-sm: 0 5px 18px rgba(30, 55, 90, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 250px;
  --topbar: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.auth-shell { min-height: 100vh; padding: 48px 24px; display: grid; place-items: center; background: radial-gradient(circle at 15% 10%, #e6f5f7 0, transparent 38%), var(--bg); }
.auth-main { width: min(1080px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 470px); gap: 72px; align-items: center; }
.auth-intro { padding: 18px 0; }
.auth-intro h1 { max-width: 570px; margin: 15px 0 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -.045em; }
.auth-intro > p { max-width: 520px; color: var(--muted); font-size: 15px; line-height: 1.65; }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 42px; color: var(--text); }
.auth-brand .brand-mark { color: #fff; }
.auth-brand .brand-sub { color: var(--muted); }
.auth-benefits { display: grid; gap: 13px; margin-top: 30px; }
.auth-benefits > div { display: flex; align-items: center; gap: 11px; color: #385368; font-size: 12px; font-weight: 700; }
.auth-benefits svg { width: 18px; height: 18px; color: var(--brand); }
.auth-card { width: 100%; box-shadow: 0 24px 70px rgba(30,55,90,.12); }
.auth-card-head { margin: 24px 0 18px; }
.auth-card-head h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel-soft); }
.auth-tab { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.auth-tab:hover, .auth-tab:focus-visible { color: var(--brand-strong); outline: none; }
.auth-tab.active { background: #fff; color: var(--brand-strong); box-shadow: 0 2px 8px rgba(30,60,90,.1); }
.auth-secondary-action { width: 100%; margin-top: 10px; }
.passkey-signin-panel { margin: 18px 0 14px; padding: 16px; border: 1px solid #b9dfe5; border-radius: 14px; background: linear-gradient(135deg, #f1fbfc, #f8fcfd); }
.passkey-signin-panel h3 { margin: 5px 0 5px; font-size: 17px; letter-spacing: -.025em; }
.passkey-signin-panel p { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.passkey-signin-panel .btn { width: 100%; }
.auth-password-fallback[hidden] { display: none; }
.passkey-security-card { border-color: #b9dfe5; background: linear-gradient(135deg, #fbffff, #f7fcfd); }
.passkey-security-card .card-head { align-items: flex-start; }
.passkey-security-card .list-row .btn { flex: 0 0 auto; }
.mfa-setup-qr { display: flex; justify-content: center; margin: 14px auto 12px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.mfa-setup-qr svg { display: block; width: min(220px, 100%); height: auto; }
.mfa-setup-guidance { display: grid; gap: 7px; margin-top: 8px; }
.mfa-setup-guidance p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.mfa-setup-guidance strong { color: var(--text); }
.mfa-same-device { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mfa-same-device > span { color: var(--muted); font-size: 11px; }
.mfa-same-device .btn { flex: 0 0 auto; padding: 8px 10px; font-size: 10px; }
.mfa-manual-key { margin-top: 12px; }
.mfa-manual-key summary { color: var(--brand-strong); font-size: 11px; font-weight: 800; cursor: pointer; }
.mfa-manual-key .review-value { margin-top: 8px; overflow-wrap: anywhere; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; }
.mfa-manual-key .btn { margin-top: 10px; }
.mfa-copy-status { display: block; min-height: 1.3em; margin-top: 8px; color: var(--brand-strong); font-size: 11px; font-weight: 700; }
.auth-link-button { width: 100%; margin-top: 12px; border: 0; background: transparent; color: var(--brand-strong); font-size: 11px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.auth-link-button:hover, .auth-link-button:focus-visible { color: var(--brand); outline: none; }
.password-input-wrap { position: relative; display: flex; align-items: center; }
.password-input-wrap .input { padding-right: 62px; }
.password-visibility { position: absolute; right: 10px; border: 0; background: transparent; color: var(--brand-strong); font-size: 11px; font-weight: 800; cursor: pointer; }
.password-visibility:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.auth-notice { margin-top: 16px; }
.auth-notice[hidden] { display: none; }
.workspace-context { display: grid; gap: 2px; margin-bottom: 11px; }
.workspace-context span { color: #8fb0bf; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.workspace-context strong { color: #fff; font-size: 14px; }
.workspace-context small { color: #8fb0bf; font-size: 10px; }
.workspace-link { width: 100%; display: flex; align-items: center; gap: 8px; margin: 0 0 11px; padding: 8px 9px; border: 1px solid rgba(99,199,215,.28); border-radius: 9px; background: rgba(99,199,215,.08); color: #bcecf3; text-align: left; font-size: 11px; font-weight: 750; }
.workspace-link:hover, .workspace-link:focus-visible { background: rgba(99,199,215,.16); color: #fff; outline: none; }
.workspace-link svg { width: 15px; height: 15px; }

.app-shell { min-height: 100vh; }
.demo-banner {
  position: fixed;
  inset: 0 0 auto 0;
  height: 30px;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: #102f3f;
  color: #eaf8fb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.demo-banner svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
.offline-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid #e6d49e;
  border-radius: 12px;
  background: #fff8e6;
  color: #73500d;
  font-size: 10px;
  line-height: 1.5;
}
.offline-banner svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.demo-mode-switch {
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 10px;
  font-weight: 750;
}
.demo-mode-switch:hover { background: rgba(255,255,255,.2); }
.sidebar {
  position: fixed;
  top: 30px;
  left: 0;
  bottom: 0;
  width: var(--sidebar);
  padding: 24px 16px 18px;
  background: #0f2533;
  color: #d9e5eb;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 22px;
  color: #fff;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #45aec4, #1c718a);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 8px 20px rgba(0,0,0,.18);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.brand-sub { color: #8fb0bf; font-size: 11px; margin-top: 2px; }

.profile-switcher {
  margin: 0 2px 20px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px;
}
.profile-switcher label { display: block; color: #8fb0bf; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px; }
.profile-row { display: flex; gap: 9px; align-items: center; }
.avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d9eef3;
  color: #195a70;
  font-weight: 800;
  font-size: 12px;
}
.profile-name { color: #fff; font-size: 13px; font-weight: 700; }
.profile-label { color: #8fb0bf; font-size: 10px; margin-top: 1px; }
.workspace-select { width: 100%; height: 34px; margin-bottom: 10px; padding: 0 9px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(255,255,255,.08); color: #fff; font-size: 11px; font-weight: 750; outline: none; }
.workspace-select:focus { border-color: #63c7d7; box-shadow: 0 0 0 3px rgba(99,199,215,.16); }
.workspace-select option { color: #142033; background: #fff; }

.nav-section { margin-bottom: 15px; }
.nav-label { padding: 0 12px 7px; color: #6f93a3; text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 800; }
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #bed0d9;
  border-radius: 11px;
  padding: 10px 12px;
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  transition: .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: #1c4a5d; color: #fff; box-shadow: inset 3px 0 0 #63c7d7; }
.nav-item .icon { width: 18px; height: 18px; opacity: .9; }
.nav-item .nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.09); color: #cfe2e9; font-size: 10px; }
.sidebar-footer { margin-top: auto; padding: 12px 8px 2px; color: #779baa; font-size: 10px; line-height: 1.45; }

.topbar {
  position: fixed;
  top: 30px;
  left: var(--sidebar);
  right: 0;
  height: var(--topbar);
  z-index: 40;
  background: rgba(244, 247, 251, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(221, 229, 239, .9);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 34px;
}
.mobile-menu { display: grid; }
.search-wrap { flex: 1; max-width: 660px; position: relative; }
.search-wrap svg { position: absolute; width: 17px; height: 17px; left: 14px; top: 50%; transform: translateY(-50%); color: #8090a3; }
.global-search {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px 0 42px;
  background: #fff;
  color: var(--text);
  outline: none;
  box-shadow: 0 2px 8px rgba(40, 70, 100, .03);
}
.global-search:focus { border-color: #8dc6d3; box-shadow: 0 0 0 3px rgba(42,130,153,.10); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: #53667a;
}
.icon-btn:hover { border-color: #c3d4df; color: var(--brand); }
.profile-menu-wrap { position: relative; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 2px 4px; border: 0; background: transparent; color: inherit; text-align: left; }
.user-chip:hover .user-meta strong, .user-chip:focus-visible .user-meta strong { color: var(--brand); }
.user-chip .avatar { width: 36px; height: 36px; }
.user-meta strong { display: block; font-size: 12px; }
.user-meta span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.profile-caret { width: 14px; height: 14px; color: var(--muted); transition: transform .16s ease; }
.profile-trigger[aria-expanded="true"] .profile-caret { transform: rotate(180deg); }
.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 80; width: 210px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 16px 34px rgba(30,55,90,.16); }
.profile-menu-header { padding: 8px 9px 10px; border-bottom: 1px solid var(--line); }
.profile-menu-header strong, .profile-menu-header span { display: block; }
.profile-menu-header strong { font-size: 12px; }
.profile-menu-header span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.profile-menu-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px; border: 0; border-radius: 9px; background: transparent; color: #34465a; text-align: left; font-size: 11px; font-weight: 700; }
.profile-menu-item:hover, .profile-menu-item:focus-visible { background: var(--panel-soft); color: var(--brand-strong); outline: none; }
.profile-menu-item svg { width: 15px; height: 15px; }
.profile-menu-danger { color: var(--danger); }
.profile-menu-danger:hover, .profile-menu-danger:focus-visible { color: var(--danger); background: var(--danger-soft); }

.main {
  padding: calc(30px + var(--topbar) + 28px) 34px 48px calc(var(--sidebar) + 34px);
  min-height: 100vh;
}
.sidebar, .topbar, .main { transition: transform .2s ease, left .2s ease, padding-left .2s ease; }
.app-shell.sidebar-collapsed { --sidebar: 0px; }
.app-shell.sidebar-collapsed .sidebar { width: 250px; transform: translateX(-100%); }
.container { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.home-page-head { align-items: center; margin-bottom: 18px; }
.home-page-head h1 { font-size: 24px; }
.home-page-head .page-subtitle { margin-top: 4px; }
.home-page-head .head-actions { gap: 8px; }
.home-action { min-height: 38px; padding: 8px 12px; }
.home-attention { margin-bottom: 18px; border-color: #ecd7a5; }
.home-requests { margin-bottom: 18px; }
.home-attention .card-head { margin-bottom: 10px; }
.home-attention-list { display: grid; gap: 0; }
.home-attention-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); }
.home-attention-row:first-child { border-top: 0; }
.home-attention-dismiss-bubble, .home-attention-dismiss-spacer { flex: 0 0 auto; width: 24px; height: 24px; }
.home-attention-dismiss-bubble { display: grid; place-items: center; padding: 0; border: 1px solid #cfd8e3; border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.home-attention-dismiss-bubble svg { width: 13px; height: 13px; }
.home-attention-dismiss-bubble:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); transform: scale(1.05); }
.home-attention-dismiss-bubble:focus-visible { outline: 3px solid rgba(15, 118, 110, .24); outline-offset: 2px; border-color: var(--brand); }
.home-attention-icon { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--warning-soft); color: var(--warning); }
.home-attention-icon svg { width: 16px; height: 16px; }
.home-attention-main { min-width: 0; flex: 1; }
.home-attention-main strong, .home-attention-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-attention-main strong { font-size: 11px; }
.home-attention-main span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.home-attention-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.home-attention-actions .btn { white-space: nowrap; }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 850; margin-bottom: 7px; }
h1 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -.035em; }
h2 { font-size: 18px; line-height: 1.3; margin: 0; letter-spacing: -.02em; }
h3 { font-size: 14px; margin: 0; line-height: 1.35; }
p { color: var(--muted); line-height: 1.55; }
.page-subtitle { margin: 7px 0 0; font-size: 13px; max-width: 720px; }
.head-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  font-size: 12px;
  transition: .16s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 7px 16px rgba(23, 107, 135, .18); }
.btn-primary:hover { background: var(--brand-strong); transform: translateY(-1px); }
.btn-secondary { background: #fff; border-color: var(--line); color: #34465a; }
.btn-secondary:hover { border-color: #bfd0db; background: #fbfdfe; }
.btn-soft { background: var(--brand-soft); color: var(--brand-strong); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f1cece; }
.btn-ghost { background: transparent; color: var(--brand); padding-left: 6px; padding-right: 6px; }
.btn:disabled { cursor: not-allowed; opacity: .48; transform: none; }

.grid { display: grid; gap: 18px; min-width: 0; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.layout-main-side { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head p { margin: 3px 0 0; font-size: 11px; }
.archive-bubble { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 6px 10px; border: 1px solid #d5e2e8; border-radius: 999px; background: #f7fbfc; color: var(--brand-strong); font-size: 10px; font-weight: 800; cursor: pointer; transition: .16s ease; }
.archive-bubble svg { width: 14px; height: 14px; }
.archive-bubble:hover, .archive-bubble.is-open { border-color: #9bcbd5; background: var(--brand-soft); }
.archive-bubble-count { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #e7c77a; color: #624c18; font-size: 9px; }
.archive-panel { margin-top: 16px; padding: 16px; border: 1px solid #e1e9ed; border-radius: 14px; background: #fbfdfe; }
.archive-panel .card-head { margin-bottom: 12px; }
.archive-panel .card-head p { max-width: 600px; }
.record-controls { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.record-icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #6d8390; cursor: pointer; transition: .16s ease; }
.record-icon-btn svg { width: 14px; height: 14px; }
.record-icon-btn:hover, .record-icon-btn:focus-visible { border-color: var(--line); background: #f5fafb; color: var(--brand); outline: none; }
.record-icon-btn.has-notes { background: #eef8fa; color: var(--brand); }
.source-count { display: inline-block; margin-left: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.personal-note-preview { color: var(--brand-strong); background: #f7fbfc; white-space: pre-wrap; }
.card-title-row { display: flex; align-items: center; gap: 10px; }
.card-title-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.card-title-icon svg { width: 17px; height: 17px; }

.metric-card { padding: 18px; position: relative; overflow: hidden; }
.metric-card:after { content: ''; position: absolute; width: 90px; height: 90px; right: -25px; top: -30px; border-radius: 50%; background: var(--brand-soft); opacity: .7; }
.metric-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 14px; position: relative; z-index: 1; }
.metric-icon svg { width: 18px; height: 18px; }
.metric-value { font-size: 25px; font-weight: 850; letter-spacing: -.04em; line-height: 1; position: relative; z-index: 1; }
.metric-label { color: var(--muted); font-size: 11px; margin-top: 6px; position: relative; z-index: 1; }

.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.quick-action { border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 14px; text-align: left; transition: .16s ease; }
.quick-action:hover { border-color: #b9d3dc; box-shadow: 0 8px 20px rgba(30, 75, 100, .08); transform: translateY(-1px); }
.quick-action .qa-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.quick-action strong { display: block; font-size: 12px; }
.quick-action span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; line-height: 1.4; }

.home-record-list, .home-lab-list { gap: 0; }
.home-record-row, .home-lab-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.home-record-row:first-child, .home-lab-row:first-child { border-top: 0; padding-top: 0; }
.home-record-row:last-child, .home-lab-row:last-child { padding-bottom: 0; }
.home-record-main { min-width: 0; flex: 1; }
.home-record-details, .home-lab-details { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex: 0 0 auto; }
.home-record-details > span, .home-lab-details > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.home-record-open { white-space: nowrap; }
.home-lab-details strong { color: var(--text); font-size: 11px; white-space: nowrap; }
.home-snapshot { margin-bottom: 18px; min-width: 0; overflow-wrap: anywhere; }
.home-snapshot .card-head, .snapshot-section-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.home-snapshot .btn { min-height: 44px; max-width: 100%; white-space: normal; text-align: left; }
.home-snapshot .btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.snapshot-patient { padding: 16px; background: var(--panel-soft); border-radius: var(--radius-sm); }
.snapshot-patient h3 { margin: 0 0 12px; font-size: 21px; }
.snapshot-demographics { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0; }
.snapshot-demographics > div { min-width: 0; }
.snapshot-demographics dt, .snapshot-date, .snapshot-source, .snapshot-profile-source, .snapshot-overflow { color: var(--muted); font-size: 11px; line-height: 1.5; }
.snapshot-demographics dd { margin: 3px 0 0; font-size: 13px; font-weight: 700; }
.snapshot-blood-type-source, .snapshot-missing-data { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.snapshot-profile-source { margin: 12px 0 0; }
.snapshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; margin-top: 20px; }
.snapshot-section, .snapshot-item, .snapshot-section-head > * { min-width: 0; }
.snapshot-section-head { align-items: center; gap: 8px; }
.snapshot-section h3 { margin: 0; font-size: 14px; }
.snapshot-list { list-style: none; margin: 0; padding: 0; }
.snapshot-item { border-top: 1px solid var(--line); padding: 12px 0; }
.snapshot-item:last-child { padding-bottom: 0; }
.snapshot-item-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 13px; }
.snapshot-item p { margin: 5px 0; font-size: 12px; line-height: 1.5; }
.snapshot-source { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; }
.snapshot-source > * { min-width: 0; }
.snapshot-source .btn { padding: 4px 0; font-size: 11px; overflow-wrap: anywhere; }
.snapshot-critical { grid-column: 1 / -1; padding: 14px; border: 1px solid var(--danger); border-radius: var(--radius-sm); background: var(--danger-soft); }
.snapshot-critical h3 { color: var(--danger); }
.snapshot-review, .snapshot-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.home-snapshot-profile { overflow: hidden; }
.snapshot-profile-hero { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 18px; margin-top: 4px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-soft); }
.snapshot-photo { width: 92px; height: 92px; border-radius: 22px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.snapshot-photo-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.snapshot-photo-placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 28px; font-weight: 800; letter-spacing: .02em; color: var(--brand); background: var(--brand-soft); }
.snapshot-profile-identity { min-width: 0; }
.snapshot-profile-identity h3 { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.12; letter-spacing: -.02em; }
.snapshot-identity-line { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.snapshot-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 34px; margin: 18px 0 0; }
.snapshot-facts-column { min-width: 0; margin: 0; }
.snapshot-fact { display: grid; grid-template-columns: minmax(132px, .75fr) minmax(0, 1.6fr); gap: 12px; align-items: baseline; min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.snapshot-facts-column .snapshot-fact:last-child { border-bottom-color: transparent; }
.snapshot-fact dt { color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.45; }
.snapshot-fact dd { margin: 0; min-width: 0; color: var(--text); font-size: 13px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.snapshot-fact-missing dd { color: var(--muted); font-weight: 500; }
.snapshot-profile-note { margin-top: 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.home-lab-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; padding-top: 2px; }
.home-lab-summary strong, .home-lab-summary span { display: block; grid-column: 1; }
.home-lab-summary strong { font-size: 13px; }
.home-lab-summary span { color: var(--muted); font-size: 10px; }
.home-lab-summary .btn { grid-column: 2; grid-row: 1 / span 2; }
.home-sharing-list { display: grid; gap: 0; }
.home-sharing-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); }
.home-sharing-row:first-child { border-top: 0; padding-top: 0; }
.home-sharing-row:last-child { padding-bottom: 0; }
.home-sharing-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.home-sharing-icon svg { width: 15px; height: 15px; }
.home-sharing-main { min-width: 0; }
.home-sharing-main strong, .home-sharing-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-sharing-main strong { font-size: 11px; }
.home-sharing-main span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.home-sharing-details { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.home-sharing-details .btn { white-space: nowrap; font-size: 10px; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-row:last-child { padding-bottom: 0; }
.document-list-row { padding-left: 6px; padding-right: 6px; }
.document-list-row-selected { background: #f7fcfd; border-radius: 11px; }
.document-select { flex: 0 0 22px; display: grid; place-items: center; }
.document-select input { width: 17px; height: 17px; accent-color: var(--brand); }
.row-icon { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-soft); color: var(--brand); }
.row-icon svg { width: 17px; height: 17px; }
.row-main { min-width: 0; flex: 1; }
.row-title { font-size: 12px; font-weight: 780; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: 10px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 10px; text-align: right; flex: 0 0 auto; }

.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-brand { background: var(--brand-soft); color: var(--brand-strong); }
.badge-neutral { background: #eef2f6; color: #5b6a7d; }
.import-status-badge { min-height: 24px; padding: 4px 8px; font-size: 9px; background: #fff; border: 2px solid currentColor; box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset; }
.import-status-complete { color: #2d8a58; border-color: #a6dcb8; background: #f7fff9; }
.import-status-review { color: #9a6700; border-color: #edc96e; background: #fffdf4; }
.import-status-neutral { color: #647486; border-color: #cbd7df; background: #fff; }
.import-new-visit-fields { grid-column: 1 / -1; padding: 12px; border: 2px solid #edc96e; border-radius: 10px; background: #fffdf4; }
.import-new-visit-fields[hidden] { display: none; }
.import-new-visit-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.import-new-visit-heading span { color: var(--muted); font-size: 10px; }
.import-new-visit-fields > .form-label { margin-bottom: 8px; }

.timeline { position: relative; padding-left: 28px; }
.timeline:before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: #dce8ee; }
.timeline-item { position: relative; padding: 0 0 22px 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -26px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--timeline-gold); border: 3px solid var(--timeline-gold-soft); box-shadow: 0 0 0 1px var(--timeline-gold-outline); }
.timeline-date { color: var(--brand); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.timeline-card { border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; background: #fff; }
.encounter-card-selected { border-color: var(--brand); box-shadow: 0 0 0 3px #dff3f6; }
.timeline-item-selected .timeline-date { color: var(--brand-strong); }
.timeline-item-selected .timeline-dot { background: var(--timeline-gold-dark); box-shadow: 0 0 0 3px var(--timeline-gold-soft); }
.timeline-card h3 { font-size: 12px; }
.timeline-card p { font-size: 10px; margin: 4px 0 0; }

.health-timeline-toolbar { margin-bottom: 14px; }
.health-timeline-unassigned { margin-top: 14px; }
.health-timeline-unassigned .btn { margin-left: 6px; }
.health-timeline-toolbar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.health-timeline-toolbar-head h2 { margin-top: 4px; }
.health-timeline-toolbar-head p { margin-top: 4px; color: var(--muted); }
.health-timeline-view-switch { display: flex; flex: 0 0 auto; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #f5f8fa; }
.health-timeline-view-switch button, .health-timeline-filter-list button { border: 0; border-radius: 7px; padding: 7px 9px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 800; cursor: pointer; }
.health-timeline-view-switch button:hover, .health-timeline-filter-list button:hover, .health-timeline-view-switch button:focus-visible, .health-timeline-filter-list button:focus-visible { color: var(--brand-strong); background: var(--brand-soft); }
.health-timeline-view-switch button.active, .health-timeline-filter-list button.active { background: var(--brand); color: #fff; }
.health-timeline-filter-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.health-timeline-filter-list { display: flex; flex-wrap: wrap; gap: 5px; }
.health-timeline-filter-list button { padding: 6px 8px; border: 1px solid var(--line); background: #fff; }
.health-timeline-range { min-width: 170px; }
.health-timeline-range .form-label { display: block; margin-bottom: 5px; }
.health-timeline-custom-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.health-timeline-custom-range label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; }
.health-timeline-custom-range .input { width: 100%; }
.health-timeline-horizontal, .health-timeline-vertical { margin-top: 14px; }
.health-timeline-horizontal .card-head { align-items: flex-end; }
.health-timeline-horizontal .card-head > .form-hint { max-width: 260px; text-align: right; }
.health-timeline-track-scroll { overflow-x: auto; padding: 12px 2px 4px; }
.health-timeline-track { position: relative; display: grid; width: max(100%, calc(var(--health-timeline-points) * 120px + 94px)); min-width: 840px; box-sizing: border-box; grid-template-columns: repeat(var(--health-timeline-points), minmax(120px, 1fr)) minmax(78px, auto); padding: 10px 8px 0; }
.health-timeline-track::before { content: ''; position: absolute; top: 21px; right: 8px; left: 8px; height: 1px; background: #c7dfe5; }
.health-timeline-point { position: relative; z-index: 1; display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 3px; padding: 0 10px 7px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.health-timeline-point-dot { width: 11px; height: 11px; margin: 0 0 11px; border: 3px solid #fff; border-radius: 50%; background: var(--timeline-gold); box-shadow: 0 0 0 1px var(--timeline-gold-outline); }
.health-timeline-point.active .health-timeline-point-dot { background: var(--timeline-gold-dark); box-shadow: 0 0 0 4px var(--timeline-gold-soft); }
.health-timeline-point.timeline-category-imaging .health-timeline-point-dot, .health-timeline-point.timeline-category-procedures .health-timeline-point-dot { background: var(--timeline-gold); box-shadow: 0 0 0 1px var(--timeline-gold-outline); }
.health-timeline-point-date { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.health-timeline-point strong { font-size: 11px; line-height: 1.25; }
.health-timeline-point small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.health-timeline-today { position: relative; z-index: 1; display: flex; min-width: 78px; flex-direction: column; align-items: flex-start; gap: 3px; padding: 0 0 7px 12px; border-left: 1px dashed var(--brand-strong); color: var(--brand-strong); }
.health-timeline-today-dot { width: 11px; height: 11px; margin: 0 0 11px -18px; border: 3px solid #fff; border-radius: 50%; background: var(--timeline-gold-dark); box-shadow: 0 0 0 1px var(--timeline-gold-dark); }
.health-timeline-today strong { font-size: 11px; line-height: 1.25; }
.health-timeline-today small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.health-timeline-lower { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 14px; margin-top: 14px; align-items: start; }
.health-timeline-recent, .health-timeline-selected { height: 100%; }
.health-timeline-recent-list { display: grid; gap: 0; }
.health-timeline-recent-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 18px; gap: 12px; align-items: start; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.health-timeline-recent-row:last-child { border-bottom: 0; }
.health-timeline-recent-row:hover, .health-timeline-recent-row.active { background: #f7fbfc; }
.health-timeline-recent-date { color: var(--muted); font-size: 10px; }
.health-timeline-recent-main strong, .health-timeline-recent-main small { display: block; }
.health-timeline-recent-main strong { font-size: 11px; }
.health-timeline-recent-main small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.health-timeline-recent-chevron { color: var(--brand); }
.health-timeline-recent-chevron svg { width: 14px; height: 14px; }
.health-timeline-detail-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 12px; margin: 14px 0 0; }
.health-timeline-detail-list dt { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.health-timeline-detail-list dd { margin: 0; font-size: 10px; line-height: 1.4; }
.health-timeline-related { margin-top: 16px; }
.health-timeline-related .form-label { display: block; margin-bottom: 7px; }
.health-timeline-notes p { margin: 8px 0; white-space: pre-wrap; }
.health-timeline-documents { display: flex; flex-wrap: wrap; gap: 7px; }
.health-timeline-no-document { color: var(--muted); font-size: 9px; }
.health-timeline-selected-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.health-timeline-selected-events { margin-top: 16px; }
.health-timeline-selected-events .form-label { display: block; margin-bottom: 7px; }
.health-timeline-sub-event { display: grid; grid-template-columns: 72px minmax(0, 1fr) 14px; gap: 8px; align-items: center; width: 100%; padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.health-timeline-sub-event span, .health-timeline-sub-event small { color: var(--muted); font-size: 9px; }
.health-timeline-sub-event strong { font-size: 10px; }
.health-timeline-sub-event svg { width: 13px; height: 13px; color: var(--brand); }
.health-timeline-vertical-item .timeline-card { min-width: 0; }
.health-timeline-vertical-item .encounter-head { align-items: flex-start; }
.health-timeline-vertical-item .head-actions { justify-content: flex-end; }
.health-timeline-vertical .timeline { margin-top: 4px; }
.visit-note-preview { display: grid; gap: 4px; margin-top: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); }
.visit-note-preview strong { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.visit-note-preview span { white-space: pre-wrap; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 5px; background: #eaf0f5; border-radius: 12px; margin-bottom: 18px; width: fit-content; }
.tab { border: 0; border-radius: 9px; padding: 8px 12px; background: transparent; color: #607184; font-size: 10px; font-weight: 800; }
.tab.active { background: #fff; color: var(--brand-strong); box-shadow: 0 2px 8px rgba(30,60,90,.09); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: #f8fafc; color: #6a788b; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; font-weight: 850; }
td { font-size: 11px; color: #344559; }
tr:last-child td { border-bottom: 0; }
.cell-title { font-weight: 780; color: var(--text); }
.cell-sub { color: var(--muted); font-size: 9px; margin-top: 2px; }

.filter-bar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.document-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.document-filter-fields { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; flex: 1 1 360px; }
.document-filter-fields .search-field { min-width: 220px; }
.document-sort-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.document-sort-control .select { min-width: 190px; }
.document-filter-fields .search-field,
.document-filter-fields .select,
.document-sort-control,
.document-sort-control .select { font-family: inherit; font-size: 12px; font-weight: 750; }
.document-list-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex: 0 1 auto; flex-wrap: wrap; margin-left: auto; }
.document-list-actions .btn { white-space: nowrap; }
.input, .select, .textarea {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: .15s ease;
}
.input, .select { height: 40px; padding: 0 12px; }
.textarea { min-height: 88px; resize: vertical; padding: 11px 12px; }
.input:focus, .select:focus, .textarea:focus { border-color: #8dc6d3; box-shadow: 0 0 0 3px rgba(42,130,153,.10); }
.input.search-field { min-width: 260px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { color: #526174; font-size: 10px; font-weight: 800; }
.form-hint { color: var(--muted); font-size: 9px; line-height: 1.4; }
.secure-link-email-field { min-width: 0; }
.secure-link-email-field .form-hint { margin-top: 1px; }
.secure-link-email-field .secure-link-email-error { color: var(--danger); font-weight: 750; }
.secure-link-email-field .input[aria-invalid="true"] { border-color: #d88a8a; box-shadow: 0 0 0 3px rgba(166, 59, 59, .1); }
.share-contact-picker { padding: 16px; border: 1px solid #c8e6ed; border-radius: 14px; background: #f4fbfc; }
.share-directory-picker { background: #f7fcfd; }
.share-directory-results { display: grid; gap: 6px; margin-top: 8px; }
.share-directory-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid #d8e8ec; border-radius: 10px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.share-directory-result:hover, .share-directory-result:focus-visible, .share-directory-result.selected { border-color: var(--brand); background: #f0fbfc; }
.share-directory-result .row-icon { flex: 0 0 28px; width: 28px; height: 28px; margin: 0; }
.share-directory-result .row-main { min-width: 0; }
.share-directory-result .row-main strong, .share-directory-result .row-main span { display: block; }
.share-directory-result .row-main span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.share-directory-result .badge { margin-left: auto; flex: 0 0 auto; }
.share-directory-status { margin-top: 10px; color: #526174; font-size: 9px; line-height: 1.45; }
.share-directory-status .badge { margin-right: 5px; vertical-align: middle; }
.share-directory-no-match { padding: 10px; border-radius: 9px; background: #fff8e8; color: #765518; font-size: 9px; line-height: 1.45; }
.share-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.share-section-heading > div { min-width: 0; }
.share-section-heading h3 { margin-top: 4px; }
.share-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; max-width: 620px; }
.share-contact-fields { margin-top: 14px; gap: 10px; }
.share-contact-fields > .form-group { min-width: 0; }
.share-contact-fields .input, .share-contact-fields .select { width: 100%; min-width: 0; }
.share-contact-summary { margin-top: 10px; padding: 9px 10px; border-radius: 9px; background: #fff; color: #526174; font-size: 9px; line-height: 1.4; }
.share-manual-heading { padding-top: 2px; }

.dropzone { border: 2px dashed #b8ced8; border-radius: 18px; padding: 28px 20px; text-align: center; background: #f8fcfd; transition: .16s ease; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .drop-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: #fff; margin: 0 auto 12px; color: var(--brand); box-shadow: var(--shadow-sm); }
.dropzone .drop-icon svg { width: 23px; height: 23px; }
.dropzone h3 { font-size: 13px; }
.dropzone p { font-size: 10px; margin: 5px 0 12px; }
.upload-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.upload-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: left; }
.upload-item .file-meta { flex: 1; min-width: 0; }
.upload-item strong { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item span { color: var(--muted); font-size: 9px; }

.provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.provider-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.provider-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.provider-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 850; }
.provider-card strong { font-size: 11px; }
.provider-card p { font-size: 9px; margin: 2px 0 0; }
.provider-metrics { margin-bottom: 18px; }
.provider-queue { overflow: hidden; }
.provider-filters { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-soft); }
.provider-filters .search-field { flex: 1 1 260px; }
.compact-select { min-width: 128px; height: 34px; padding: 0 9px; font-size: 10px; }
.provider-status-control { min-width: 128px; }
.patient-workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; margin-bottom: 18px; border: 1px solid #cfe3e9; border-radius: var(--radius); background: linear-gradient(135deg, #f7fcfd, #eaf6f8); }
.patient-workspace-head h2 { margin-top: 3px; }
.patient-workspace-head p { margin: 4px 0 0; font-size: 10px; }
.provider-workspace-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; }
.provider-summary-grid, .admin-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.provider-summary-grid > div, .admin-profile-grid > div { padding: 12px; border-radius: 11px; background: var(--panel-soft); }
.provider-summary-grid span, .provider-summary-grid strong, .admin-profile-grid span, .admin-profile-grid strong { display: block; }
.provider-summary-grid span, .admin-profile-grid span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }
.provider-summary-grid strong, .admin-profile-grid strong { margin-top: 4px; font-size: 11px; line-height: 1.4; }
.provider-facts { display: grid; gap: 8px; }
.provider-fact { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.provider-fact strong, .provider-fact span, .provider-fact small { display: block; }
.provider-fact .eyebrow { margin: 0 0 3px; font-size: 8px; }
.provider-fact strong { font-size: 11px; }
.provider-fact > div:first-child > span:last-child { color: var(--muted); margin-top: 3px; font-size: 9px; }
.provider-fact-source { display: flex; align-items: flex-end; flex-direction: column; gap: 3px; text-align: right; }
.provider-fact-source small { color: var(--muted); font-size: 8px; }
.provider-guidance { display: grid; gap: 9px; }
.provider-guidance > div { padding: 11px 12px; border-left: 3px solid #53a9b6; border-radius: 8px; background: var(--panel-soft); }
.provider-guidance strong, .provider-guidance span { display: block; }
.provider-guidance strong { font-size: 10px; }
.provider-guidance span { color: var(--muted); margin-top: 3px; font-size: 9px; }
.access-denied { text-align: center; }
.request-create-card { margin-bottom: 18px; }
.request-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 9px; }
.request-card { min-height: 0; }
.access-model-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }

.stepper { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 18px; }
.step { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 11px; color: #8290a0; background: #eef2f6; font-size: 9px; font-weight: 800; }
.step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #dce4ec; color: #647487; }
.step.active { color: var(--brand-strong); background: var(--brand-soft); }
.step.active .step-num { background: var(--brand); color: #fff; }
.step.complete { color: var(--success); background: var(--success-soft); }
.step.complete .step-num { background: var(--success); color: #fff; }

.record-picker { display: flex; flex-direction: column; gap: 8px; max-height: 430px; overflow: auto; padding-right: 3px; }
.record-check { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.record-check.selected { border-color: #a9cdd7; background: #f7fcfd; }
.record-check input { width: 16px; height: 16px; accent-color: var(--brand); }
.record-check strong { display: block; font-size: 10px; }
.record-check span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.share-disclosure-step { max-width: 920px; }
.disclosure-group { margin-top: 18px; }
.disclosure-group h3 { margin: 0; font-size: 13px; }
.disclosure-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.disclosure-option { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.disclosure-option.selected { border-color: #a9cdd7; background: #f7fcfd; }
.disclosure-option input { width: 16px; height: 16px; accent-color: var(--brand); margin-top: 1px; }
.disclosure-option strong { display: block; font-size: 10px; }
.disclosure-option small { display: block; color: var(--muted); font-size: 9px; line-height: 1.4; margin-top: 3px; }
.disclosure-count { margin-top: 12px; }
.disclosure-warning { margin-top: 18px; }
.share-timeline-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.share-timeline-toggle { margin-top: 10px; }
.share-timeline-panel { margin-top: 10px; padding: 14px; border: 1px solid #cfe5eb; border-radius: 14px; background: #f8fcfd; }
.share-timeline-panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.share-timeline-panel-head strong, .share-timeline-panel-head span { display: block; }
.share-timeline-panel-head strong { font-size: 12px; }
.share-timeline-panel-head span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.timeline-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.timeline-control-section { margin-top: 15px; }
.timeline-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.timeline-filter-option, .timeline-filter-chip, .timeline-event-option { display: flex; align-items: flex-start; gap: 8px; min-width: 0; cursor: pointer; }
.timeline-filter-option { padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.timeline-filter-option.selected { border-color: #a9cdd7; background: #f2fafb; }
.timeline-filter-option.disabled { opacity: .58; cursor: not-allowed; }
.timeline-filter-option input, .timeline-filter-chip input, .timeline-event-option input { width: 15px; height: 15px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--brand); }
.timeline-filter-option strong, .timeline-filter-option small, .timeline-event-option strong, .timeline-event-option small { display: block; }
.timeline-filter-option strong, .timeline-event-option strong { font-size: 10px; }
.timeline-filter-option small, .timeline-event-option small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.timeline-scope-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.timeline-scope-option { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.timeline-scope-option.selected { border-color: #a9cdd7; background: #f2fafb; }
.timeline-scope-option.disabled { opacity: .58; cursor: not-allowed; }
.timeline-scope-option input { width: 15px; height: 15px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--brand); }
.timeline-scope-option strong, .timeline-scope-option small { display: block; }
.timeline-scope-option strong { font-size: 10px; }
.timeline-scope-option small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.timeline-filter-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.timeline-filter-chip { align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 9px; }
.timeline-event-groups { display: grid; gap: 7px; margin-top: 8px; }
.timeline-event-group { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.timeline-event-group summary { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; color: var(--text); font-size: 10px; font-weight: 750; cursor: pointer; }
.timeline-event-options { display: grid; gap: 1px; padding: 0 10px 8px; border-top: 1px solid var(--line); }
.timeline-event-option { padding: 8px 0; border-bottom: 1px solid #edf1f4; }
.timeline-event-option:last-child { border-bottom: 0; }
.share-timeline-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.share-timeline-step { max-width: 1040px; }
.share-timeline-step-toggle { margin-top: 14px; }
.share-timeline-controls { margin-top: 16px; }
.share-timeline-collapsed { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); color: var(--muted); font-size: 10px; font-weight: 700; }
.share-timeline-step .health-timeline-view-switch { width: fit-content; margin: 14px 0 0 auto; }
.share-timeline-privacy-note { margin-top: 14px; }
.share-step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.share-timeline-vertical-list { position: relative; display: grid; gap: 0; margin-top: 4px; }
.share-timeline-vertical-list::before { content: ''; position: absolute; top: 12px; bottom: 12px; left: 91px; width: 1px; background: #c9e1e7; }
.share-timeline-vertical-event { position: relative; z-index: 1; display: grid; grid-template-columns: 80px 22px minmax(0, 1fr) 16px; gap: 10px; align-items: start; width: 100%; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.share-timeline-vertical-event:last-child { border-bottom: 0; }
.share-timeline-vertical-event:hover, .share-timeline-vertical-event.active { background: #f7fbfc; }
.share-timeline-vertical-date { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; line-height: 1.4; }
.share-timeline-vertical-dot { width: 11px; height: 11px; margin: 2px 0 0 2px; border: 3px solid #fff; border-radius: 50%; background: var(--timeline-gold); box-shadow: 0 0 0 1px var(--timeline-gold-outline); }
.share-timeline-vertical-dot.timeline-category-imaging, .share-timeline-vertical-dot.timeline-category-procedures { background: var(--timeline-gold); box-shadow: 0 0 0 1px var(--timeline-gold-outline); }
.share-timeline-vertical-event.active .share-timeline-vertical-dot { background: var(--timeline-gold-dark); box-shadow: 0 0 0 4px var(--timeline-gold-soft); }
.share-timeline-vertical-main { min-width: 0; }
.share-timeline-vertical-main strong, .share-timeline-vertical-main small, .share-timeline-vertical-main > span { display: block; }
.share-timeline-vertical-main strong { font-size: 11px; line-height: 1.3; }
.share-timeline-vertical-main small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.share-timeline-vertical-main > span { margin-top: 5px; color: var(--text); font-size: 9px; line-height: 1.4; }
.share-timeline-vertical-event > .health-timeline-recent-chevron { padding-top: 1px; }
.share-timeline-vertical-lower { margin-top: 14px; }
.share-timeline-visual { position: relative; display: grid; gap: 0; margin-top: 10px; }
.share-timeline-visual:before { content: ''; position: absolute; top: 9px; bottom: 9px; left: 8px; width: 1px; background: #c9e1e7; }
.share-timeline-event, .share-timeline-group { position: relative; display: grid; grid-template-columns: 17px minmax(0,1fr); gap: 10px; padding: 0 0 14px; }
.share-timeline-event:last-child, .share-timeline-group:last-child { padding-bottom: 0; }
.share-timeline-marker { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 4px; border: 2px solid #fff; border-radius: 50%; background: var(--timeline-gold); box-shadow: 0 0 0 1px var(--timeline-gold-outline); }
.share-timeline-event.major .share-timeline-marker { background: var(--timeline-gold-dark); box-shadow: 0 0 0 1px var(--timeline-gold-outline); }
.share-timeline-content { min-width: 0; padding: 1px 0 9px; border-bottom: 1px solid var(--line); }
.share-timeline-event:last-child .share-timeline-content, .share-timeline-group:last-child .share-timeline-content { border-bottom: 0; }
.share-timeline-kicker { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.share-timeline-content > strong { display: block; margin-top: 3px; font-size: 11px; }
.share-timeline-content p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.share-timeline-content small { display: block; margin-top: 5px; color: var(--text); font-size: 9px; line-height: 1.4; }
.share-timeline-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.timeline-source-count { color: var(--muted); font-size: 9px; }
.timeline-group-details { margin-top: 8px; }
.timeline-group-details summary { color: var(--brand-strong); font-size: 9px; font-weight: 750; cursor: pointer; }
.timeline-group-events { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.timeline-group-events .share-timeline-event { padding-bottom: 9px; }
.timeline-group-events .share-timeline-event:last-child { padding-bottom: 0; }
.timeline-group-events .share-timeline-marker { width: 7px; height: 7px; }
.receive-nav { display: flex; align-items: center; gap: 4px; margin: 0 0 18px; padding: 4px; border: 1px solid #d5e5ea; border-radius: 12px; background: #fff; overflow-x: auto; }
.receive-nav a { padding: 8px 11px; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.receive-nav a:hover, .receive-nav a:focus-visible { color: var(--brand-strong); background: var(--brand-soft); }
.recipient-timeline { scroll-margin-top: 18px; }
.share-timeline-preview-modal { width: min(760px, 100%); }
.timeline-detail-modal { width: min(620px, 100%); }
.timeline-detail-records { margin-top: 16px; }
.timeline-detail-records > .form-label { display: block; margin-bottom: 8px; }

.review-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.review-box + .review-box { margin-top: 10px; }
.portable-export-options { border: 0; padding: 0; min-width: 0; }
.portable-export-options legend { padding: 0; }
.portable-export-choice, .portable-export-originals { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; }
.portable-export-choice + .portable-export-choice { margin-top: 8px; }
.portable-export-choice:has(input:checked), .portable-export-originals:has(input:checked) { border-color: #a9cdd7; background: #f7fcfd; }
.portable-export-choice input, .portable-export-originals input { width: 17px; height: 17px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--brand); }
.portable-export-choice strong, .portable-export-choice small, .portable-export-originals strong, .portable-export-originals small { display: block; }
.portable-export-choice strong, .portable-export-originals strong { font-size: 11px; }
.portable-export-choice small, .portable-export-originals small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.portable-export-originals:has(input:disabled) { cursor: not-allowed; }
.portable-export-originals input:disabled { opacity: .7; }
.consent-confirmation { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 13px; border: 1px solid #cfe5eb; border-radius: 13px; background: #f5fbfc; cursor: pointer; }
.consent-confirmation input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--brand); }
.consent-confirmation strong, .consent-confirmation small { display: block; }
.consent-confirmation strong { font-size: 11px; }
.consent-confirmation small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.review-label { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.review-value { font-size: 11px; font-weight: 750; margin-top: 4px; }
.clarification-facts { display: grid; gap: 12px; margin-top: 16px; }
.clarification-fact h3 { margin: 5px 0 0; font-size: 14px; }
.clarification-fact .row-sub { margin: 6px 0 14px; }
.clarification-comparison { margin: 0 0 14px; font-size: 10px; }
.conflict-review-panel { margin-top: 16px; padding: 16px; border: 1px solid #e7c77a; border-radius: 14px; background: #fffaf0; color: #5f430e; }
.conflict-review-heading { display: flex; align-items: flex-start; gap: 11px; }
.conflict-review-heading .empty-icon { width: 28px; height: 28px; margin: 0; color: #9a6814; background: #fff1cb; }
.conflict-review-panel h3 { margin: 4px 0 0; font-size: 15px; color: #4f3509; }
.conflict-review-panel p { margin: 6px 0 0; line-height: 1.5; }
.conflict-review-panel .row-sub { color: #765a20; }
.conflict-review-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #eed8a1; }
.conflict-review-row > div { min-width: 0; padding: 11px 12px; border: 1px solid #eed8a1; border-radius: 10px; background: rgba(255,255,255,.58); }
.conflict-review-row strong { display: block; color: #4f3509; font-size: 11px; }
.conflict-review-row p { overflow-wrap: anywhere; font-size: 10px; }
.clarification-resolution { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.clarification-resolution .consent-confirmation { margin-top: 9px; }

.share-link { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 11px; border: 1px solid var(--line); background: #fff; }
.share-link code { flex: 1; min-width: 0; font-size: 9px; color: #526174; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-verification-code { display: inline-block; margin-top: 8px; padding: 8px 12px; border-radius: 9px; background: #fff; color: #4f3509; font-size: 18px; font-weight: 800; letter-spacing: .14em; line-height: 1.1; }

.notice { display: flex; align-items: flex-start; gap: 10px; border-radius: 13px; padding: 12px 13px; border: 1px solid; font-size: 10px; line-height: 1.5; }
.notice svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; }
.notice-info { background: #edf8fb; border-color: #c8e6ed; color: #27596a; }
.notice-warning { background: var(--warning-soft); border-color: #f0dca8; color: #795011; }
.notice-danger { background: var(--danger-soft); border-color: #efcece; color: #823838; }
.notice-success { background: var(--success-soft); border-color: #ccebd9; color: #286343; }

.source-chip { display: inline-flex; align-items: center; gap: 5px; color: #53677a; font-size: 9px; }
.provenance { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }

.empty { text-align: center; padding: 36px 18px; }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 15px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty h3 { font-size: 13px; }
.empty p { margin: 5px auto 14px; font-size: 10px; max-width: 360px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(10,24,35,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(720px, 100%); max-height: 90vh; overflow-y: auto; background: #fff; border-radius: 20px; box-shadow: 0 30px 70px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 19px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head p { font-size: 10px; margin: 4px 0 0; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 20px; }
.profile-modal { width: min(820px, 100%); }
.profile-form-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.profile-form-section:first-child { padding-top: 0; }
.profile-form-section:last-of-type { border-bottom: 0; }
.profile-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.profile-section-heading h3 { margin: 0; font-size: 13px; }
.profile-section-heading-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 5px; }
.profile-section-heading p { margin: 0; color: var(--muted); font-size: 10px; text-align: right; }
.profile-field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-field-requirement, .profile-section-required { flex: 0 0 auto; color: var(--brand-strong); font-size: 9px; font-weight: 750; }
.profile-section-required { color: #9a6700; }
.profile-checkbox { display: flex; align-items: flex-start; gap: 9px; padding-top: 5px; cursor: pointer; }
.profile-checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.profile-checkbox strong, .profile-checkbox small { display: block; }
.profile-checkbox strong { font-size: 11px; }
.profile-checkbox small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.profile-onboarding { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; padding: 13px 15px; border: 1.5px solid #c9dfe5; border-radius: 14px; background: #f6fbfc; color: var(--text); box-shadow: 0 4px 14px rgba(22, 91, 111, .05); }
.profile-onboarding-required { border-color: #c9dfe5; }
.profile-onboarding-optional { border-color: #d6e2e7; background: #fff; }
.profile-onboarding-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--brand); background: var(--brand-soft); }
.profile-onboarding-icon svg { width: 18px; height: 18px; }
.profile-onboarding-copy { min-width: 0; flex: 1 1 auto; }
.profile-onboarding-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-onboarding h2 { margin: 0; color: var(--text); font-size: 14px; }
.profile-onboarding p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.profile-onboarding .btn { flex: 0 0 auto; white-space: nowrap; }
.profile-share-reminder { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 10px 12px; }
.profile-share-reminder > svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--brand); }
.profile-share-reminder > div { min-width: 0; flex: 1 1 auto; }
.profile-share-reminder strong, .profile-share-reminder span { display: block; }
.profile-share-reminder strong { color: var(--text); font-size: 11px; }
.profile-share-reminder span { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.profile-share-reminder .btn { flex: 0 0 auto; white-space: nowrap; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 1400; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 390px; padding: 12px 14px; border-radius: 12px; background: #102f3f; color: #fff; box-shadow: 0 16px 34px rgba(0,0,0,.22); font-size: 10px; font-weight: 650; animation: toastIn .2s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.status-ring { width: 90px; height: 90px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: conic-gradient(var(--brand) 0 100%, #e8eef3 100% 100%); position: relative; }
.status-ring:after { content: ''; width: 70px; height: 70px; position: absolute; border-radius: 50%; background: #fff; }
.status-ring strong { position: relative; z-index: 1; font-size: 18px; }

.receive-shell { min-height: 100vh; background: #f3f7fa; }
.receive-top { background: #0f2533; color: #fff; padding: 18px 26px; }
.receive-brand { display: flex; align-items: center; gap: 10px; max-width: 1040px; margin: 0 auto; }
.recipient-exit { margin-left: auto; }
.receive-main { max-width: 1040px; margin: 0 auto; padding: 28px 22px 50px; }
.receive-hero { background: linear-gradient(135deg, #153a4a, #176b87); color: #fff; border-radius: 22px; padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.receive-hero p { color: #cde1e8; font-size: 11px; }
.receive-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px,.75fr); gap: 18px; }
.receive-summary dt { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-top: 12px; }
.receive-summary dd { margin: 3px 0 0; font-size: 11px; font-weight: 650; }

.security-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.security-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; }
.security-item .row-icon { width: 32px; height: 32px; }
.security-item strong { display: block; font-size: 10px; }
.security-item span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; line-height: 1.4; }

.footer-note { margin-top: 24px; color: #8996a6; font-size: 9px; text-align: center; }

.health-tabs { width: 100%; }
.facility-summary, .facility-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 22px;
  border: 1px solid #cfe3e9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f7fcfd, #eaf6f8);
}
.facility-summary p, .facility-hero p { margin: 5px 0 0; font-size: 11px; max-width: 680px; }
.facility-summary-metrics { display: grid; grid-template-columns: auto auto; gap: 2px 10px; align-items: baseline; white-space: nowrap; }
.facility-summary-metrics strong { color: var(--brand-strong); font-size: 24px; line-height: 1; }
.facility-summary-metrics span { color: var(--muted); font-size: 10px; }
.facility-grid, .study-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.facility-card { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.facility-card-top { display: flex; align-items: center; gap: 12px; }
.facility-card-top p { margin: 3px 0 0; font-size: 10px; }
.facility-logo, .study-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
}
.facility-logo.large { width: 54px; height: 54px; border-radius: 16px; }
.facility-logo svg, .study-icon svg { width: 21px; height: 21px; }
.facility-logo.large svg { width: 26px; height: 26px; }
.facility-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.facility-stats div { padding: 10px; border-radius: 11px; background: var(--panel-soft); min-width: 0; }
.facility-stats strong, .facility-stats span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facility-stats strong { font-size: 12px; }
.facility-stats span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.facility-actions, .package-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.facility-hero .head-actions { margin-left: auto; }
.facility-card-contact { display: grid; gap: 6px; min-height: 34px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.facility-card-contact span { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.facility-card-contact svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--brand); }
.facility-card-contact .muted { color: var(--muted); }
.facility-overview { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(270px,.75fr); gap: 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.facility-overview h3 { margin-top: 5px; }
.facility-info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 14px; margin-top: 14px; }
.facility-info-item { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.facility-info-icon { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.facility-info-icon svg { width: 14px; height: 14px; }
.facility-info-item span, .facility-info-item strong { display: block; }
.facility-info-item span { color: var(--muted); font-size: 9px; margin-bottom: 2px; }
.facility-info-item strong { color: var(--text); font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.facility-info-item a { color: var(--brand-strong); text-decoration: none; }
.facility-info-item a:hover { text-decoration: underline; }
.facility-notes { display: flex; gap: 7px; align-items: flex-start; margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--panel-soft); color: var(--muted); font-size: 10px; line-height: 1.45; }
.facility-notes svg { flex: 0 0 auto; width: 15px; height: 15px; color: var(--brand); }
.provider-list { display: grid; gap: 8px; margin-top: 14px; }
.provider-item { display: flex; gap: 9px; align-items: flex-start; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.provider-item .row-icon { width: 28px; height: 28px; border-radius: 8px; }
.provider-item .row-icon svg { width: 14px; height: 14px; }
.provider-item strong, .provider-item span { display: block; }
.provider-item strong { font-size: 10px; line-height: 1.3; }
.provider-item span { color: var(--muted); font-size: 9px; margin-top: 2px; }
.facility-detail-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.facility-detail-stats div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); }
.facility-detail-stats strong, .facility-detail-stats span { display: block; }
.facility-detail-stats strong { color: var(--brand-strong); font-size: 20px; line-height: 1; }
.facility-detail-stats span { color: var(--muted); font-size: 9px; margin-top: 5px; }
.encounter-list { display: grid; gap: 14px; }
.encounter-detail { display: grid; grid-template-columns: 76px minmax(0,1fr); overflow: hidden; }
.encounter-date { background: #f0f8fa; border-right: 1px solid #dcebef; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 8px; color: var(--brand-strong); }
.encounter-date span { font-size: 10px; font-weight: 800; text-transform: uppercase; }
.encounter-date strong { font-size: 27px; line-height: 1.1; }
.encounter-date small { color: var(--muted); font-size: 9px; }
.encounter-content { padding: 18px; min-width: 0; }
.encounter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.encounter-head h2, .encounter-head h3 { margin-top: 6px; }
.encounter-head p { margin: 4px 0 0; font-size: 10px; }
.event-tags, .visit-documents { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.visit-section { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.visit-section > strong { display: block; margin-bottom: 8px; font-size: 10px; }
.source-chip { padding: 6px 8px; border-radius: 9px; background: var(--panel-soft); }
.source-chip svg, .source-summary svg, .document-chip svg { width: 14px; height: 14px; flex: 0 0 auto; }
.source-summary { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 9px; margin-top: 10px; }
.manual-record-note { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.manual-record-note svg { width: 14px; height: 14px; flex: 0 0 auto; }
.document-chip { border: 1px solid var(--line); background: #fff; color: #43576a; border-radius: 9px; padding: 7px 9px; display: inline-flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 700; }
.document-chip:hover { border-color: #a9ccd5; color: var(--brand); }
.attach-doc-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.attach-doc-option { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; cursor: pointer; }
.attach-doc-option:hover { border-color: #a9ccd5; background: #f7fcfd; }
.attach-doc-option input { width: 16px; height: 16px; margin-top: 1px; accent-color: var(--brand); }
.attach-doc-option strong, .attach-doc-option small { display: block; }
.attach-doc-option strong { font-size: 10px; }
.attach-doc-option small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.attach-doc-option-conflict { border-color: #e7c77a; background: #fffaf0; }
.attach-doc-warning { color: #9a6814 !important; font-weight: 700; }
.study-card { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 13px; padding: 17px; align-items: start; }
.study-main h3 { margin-top: 8px; }
.study-main p { margin: 4px 0 0; font-size: 10px; }
.study-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.package-presets { padding: 2px 0; }

.dropzone.compact { padding: 18px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; grid-template-rows: auto auto; grid-template-areas: 'icon heading action' 'icon copy action'; align-items: center; gap: 4px 14px; text-align: left; }
.dropzone.compact .drop-icon { grid-area: icon; margin: 0; width: 42px; height: 42px; }
.dropzone.compact h3 { grid-area: heading; margin: 0; min-width: 0; overflow-wrap: normal; word-break: normal; }
.dropzone.compact p { grid-area: copy; margin: 0; min-width: 0; }
.dropzone.compact .btn { grid-area: action; white-space: nowrap; }
.import-review { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; }
.import-upload-panel { margin-bottom: 18px; }
.import-safety-note { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.import-safety-note svg { width: 15px; height: 15px; flex: 0 0 auto; }
.import-review-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--accent); background: #f4fafb; font-size: 12px; }
.import-complete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; padding: 16px 20px; border: 1px solid #b9d8e2; border-radius: 12px; background: #f4fafb; }
.import-complete h2 { font-size: 19px; margin: 3px 0; }
.import-complete p { margin: 0; color: var(--muted); font-size: 12px; }
.import-complete-details { flex-basis: 100%; border-top: 1px solid var(--line); padding-top: 6px; }
.import-complete-details summary, .import-history-row summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 12px; }
.import-details { border-top: 1px solid var(--line); }
.import-details-toggle { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.import-details-toggle:focus-visible, .import-history-row summary:focus-visible, .import-complete-details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.import-details-body { padding-top: 8px; }
.import-dense-list { border-top: 1px solid var(--line); }
.import-dense-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.import-dense-row > span, .import-dense-row label span { display: grid; gap: 3px; min-width: 0; }
.import-dense-row label { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.import-dense-row label input { width: 18px; height: 18px; flex: 0 0 auto; }
.import-dense-row strong { font-size: 12px; overflow-wrap: anywhere; }
.import-dense-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.import-dense-row .btn { min-height: 40px; flex: 0 0 auto; }
.import-details-pages { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 0; }
.import-exceptions h3 { margin: 0 0 10px; font-size: 16px; }

/* Compact record review and visit-first organization. Never hide errors. */
.import-attention-head { margin-bottom: 12px; }
.import-attention-head h3 { margin: 3px 0; font-size: 17px; }
.import-attention-head p { margin: 0; color: var(--muted); font-size: 12px; }
.import-exception-list { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.import-exception-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 78px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.import-exception-row:last-child { border-bottom: 0; }
.import-exception-row:hover { background: #f8fbfc; }
.import-exception-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: var(--brand); background: #f0f6f8; }
.import-exception-icon svg { width: 18px; height: 18px; }
.import-exception-main { min-width: 0; }
.import-exception-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.import-exception-title strong { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.import-exception-file { margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.import-exception-issue { margin: 5px 0; font-size: 12px; line-height: 1.5; }
.import-exception-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.import-visit-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border: 1px solid #cde3e8; border-radius: 999px; background: #f5fbfc; color: #275f70; font-weight: 600; }
.import-exception-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.import-exception-actions .btn { min-height: 42px; }
.import-exception-editor { padding: 13px; border: 2px solid #b9d8e2; background: #f7fbfd; }
.import-exception-editor + .import-exception-row { border-top: 1px solid var(--line); }
.import-exception-editor-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.import-exception-editor-head strong, .import-exception-editor-head span { display: block; }
.import-exception-editor-head strong { font-size: 14px; overflow-wrap: anywhere; }
.import-exception-editor-head span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.import-exception-editor > .import-item { margin: 0; box-shadow: none; }
.import-exception-footer { display: flex; justify-content: flex-end; margin-top: 14px; }
.import-exception-footer .btn { min-height: 44px; }
.import-inline-error { padding: 10px 13px; margin: 10px 0; border: 1px solid #d69a97; border-radius: 10px; background: #fff3f1; color: #812724; font-size: 13px; line-height: 1.5; }
.import-group-summary { padding: 16px; }
.import-group-summary p { font-size: 12px; line-height: 1.5; }
.import-group-list { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.import-group-row { flex-wrap: wrap; }
.import-group-main { flex: 1 1 175px; min-width: 0; max-width: 100%; }
.import-group-row strong { font-size: 12px; overflow-wrap: anywhere; }
.import-group-row span, .import-group-row small { font-size: 12px; line-height: 1.5; }
.import-group-row small { white-space: normal; overflow-wrap: anywhere; }
.import-group-action { min-height: 40px; margin-left: auto; }
.import-groups-toggle { min-height: 44px; margin-top: 10px; }
.import-group-action:focus-visible, .import-groups-toggle:focus-visible, .import-exception-list .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  .import-exception-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .import-exception-actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 50px; }
  .import-exception-actions .btn { min-height: 44px; flex: 1 1 145px; }
  .import-exception-editor-head { flex-direction: column; }
  .import-exception-footer .btn { width: 100%; white-space: normal; }
  .import-group-row { flex-direction: column; }
  .import-group-action { align-self: flex-start; margin-left: 0; }
  .import-group-summary-head { flex-wrap: wrap; }
}
.import-duplicate-line { margin: 0; color: var(--muted); font-size: 12px; }
.import-history-row { border-bottom: 1px solid var(--line); }
.import-history-row summary { justify-content: space-between; }
.import-history-row summary span, .import-history-row p { color: var(--muted); font-size: 12px; }
.import-history-row ul { margin: 0 0 12px; padding-left: 22px; font-size: 12px; }
@media (max-width: 640px) {
  .import-review-bar { align-items: flex-start; flex-direction: column; }
  .import-complete { align-items: stretch; }
  .import-complete .head-actions { width: 100%; }
  .import-complete .btn { flex: 1 1 auto; }
  .import-dense-row { align-items: flex-start; }
  .import-history-row summary { align-items: flex-start; flex-direction: column; justify-content: center; gap: 2px; }
}
.import-review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #123646, #176b87);
  color: #fff;
  box-shadow: var(--shadow);
}
.import-review-head h2 { font-size: 21px; }
.import-review-head p { color: #cde4ea; font-size: 11px; margin: 5px 0 0; max-width: 720px; }
.import-review-head .eyebrow { color: #86d5e2; }
.import-review-head > div:first-child { min-width: 0; flex: 1 1 auto; }
.import-review-summary { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; }
.import-review-summary > div { min-width: 92px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.1); }
.import-review-summary strong, .import-review-summary span { display: block; }
.import-review-summary strong { font-size: 20px; line-height: 1; }
.import-review-summary span { color: #cde4ea; font-size: 9px; margin-top: 4px; }
.import-review-summary > .badge { display: inline-flex; align-items: center; flex: 0 0 auto; white-space: nowrap; color: #0b5263; background: #e8f6f8; border: 1px solid rgba(255,255,255,.55); }
.import-review-summary > .badge-success { color: #075f3b; background: #e6f6ec; }
.import-review-summary > .badge-warning { color: #754c00; background: #fff3d6; }
.import-review-summary > .badge svg { width: 12px; height: 12px; flex: 0 0 auto; }
.import-compact-notice { display: flex; align-items: center; gap: 10px; margin-top: 0; padding: 10px 12px; font-size: 11px; }
.import-compact-notice > div { min-width: 0; flex: 1 1 auto; }
.import-compact-notice span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.import-scan-progress { display: grid; gap: 6px; width: 100%; min-width: 0; margin-top: 10px; }
.import-scan-progress progress { display: block; width: 100%; height: 12px; border: 0; accent-color: var(--brand); }
.import-scan-progress span { margin-top: 0; }
.import-scan-notice > div { min-width: 0; width: 100%; }
.import-support-notice { background: #f2f8fa; }
.import-processing { margin-top: 14px; }
.import-processing svg { animation: import-spin 1.1s linear infinite; }
.import-processing strong, .import-processing span { display: block; }
.import-processing span { color: var(--muted); font-size: 10px; margin-top: 3px; }
@keyframes import-spin { to { transform: rotate(360deg); } }
.import-item-list { display: grid; gap: 13px; }
.import-group-summary { padding: 16px 18px; border: 1px solid #cfe5eb; border-radius: 14px; background: #f5fbfc; }
.import-group-summary-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.import-group-summary h3 { margin-top: 3px; font-size: 15px; }
.import-group-summary p { margin: 4px 0 0; color: var(--muted); font-size: 10px; max-width: 720px; }
.import-group-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.import-group-row { display: flex; gap: 9px; align-items: flex-start; min-width: 0; padding: 10px; border: 1px solid #dbe9ed; border-left: 3px solid #53a9b6; border-radius: 10px; background: #fff; }
.import-group-row strong, .import-group-row span, .import-group-row small { display: block; }
.import-group-row strong { font-size: 11px; }
.import-group-row span { margin-top: 2px; color: var(--text); font-size: 10px; line-height: 1.35; }
.import-group-row small { margin-top: 4px; color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-group-marker { width: 8px; height: 8px; margin-top: 3px; flex: 0 0 auto; border-radius: 50%; background: #53a9b6; }
.import-group-color-1 { border-left-color: #8b78c8; }
.import-group-color-1 .import-group-marker { background: #8b78c8; }
.import-group-color-2 { border-left-color: #d59a42; }
.import-group-color-2 .import-group-marker { background: #d59a42; }
.import-group-color-3 { border-left-color: #6a9d70; }
.import-group-color-3 .import-group-marker { background: #6a9d70; }
.import-group-color-4 { border-left-color: #d47777; }
.import-group-color-4 .import-group-marker { background: #d47777; }
.import-visit-routing { grid-column: 1 / -1; padding: 11px 12px; border: 1px solid #b6dfc7; border-radius: 10px; background: #f7fff9; }
.import-visit-routing .form-hint { margin-top: 5px; }
.import-new-visit-fields { grid-column: 1 / -1; padding: 10px 12px; border: 1px solid #dbe9ed; border-radius: 10px; background: #fbfdfe; }
.import-new-visit-fields summary { cursor: pointer; color: var(--text); font-size: 11px; font-weight: 700; }
.import-new-visit-fields .form-grid { margin-top: 10px; }
.import-item { padding: 18px; }
.import-item.duplicate { background: #fbfcfd; border-style: dashed; }
.import-item-ready { padding: 14px 18px; }
.import-item-ready .import-item-title { margin-bottom: 0; }
.import-ready-details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.import-ready-details > summary { cursor: pointer; color: var(--brand); font-weight: 700; font-size: 10px; }
.import-ready-details[open] > summary { margin-bottom: 12px; }
.import-duplicate-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.import-duplicate-actions label, .import-unknown-date { display: inline-flex; gap: 6px; align-items: center; font-size: 10px; color: var(--text); }
.import-unknown-date { margin-top: 7px; color: var(--muted); }

.import-item-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.import-include { display: flex; align-items: center; gap: 11px; min-width: 0; }
.import-include > input { width: 17px; height: 17px; accent-color: var(--brand); }
.import-include > span:last-child { min-width: 0; }
.import-include strong, .import-include small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-include strong { font-size: 12px; }
.import-include small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.import-status-badges { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.import-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.import-fields .full { grid-column: 1 / -1; }
.import-review-field { min-width: 0; padding: 10px; border: 2px solid #cbd7df; border-radius: 10px; background: #fff; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.import-review-field.needs-input { border-color: #e8c35e; background: #fffaf0; box-shadow: 0 0 0 1px rgba(232,195,94,.12); }
.import-review-field.is-complete { border-color: #8fd0a8; background: #f7fff9; }
.import-review-field .form-hint { font-size: 10px; }
.import-review-field > .input, .import-review-field > .select, .import-review-field > .textarea { background: rgba(255,255,255,.88); }
.import-lab-preview { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.import-lab-preview-row { display: grid; grid-template-columns: minmax(0,1.5fr) auto minmax(120px,1fr); gap: 8px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 10px; }
.import-lab-preview-row:last-child { border-bottom: 0; }
.import-lab-preview-row strong { color: var(--text); font-size: 10px; white-space: nowrap; }
.import-lab-preview-row small { color: var(--muted); font-size: 9px; text-align: right; }
.import-lab-preview-editable .import-lab-preview-row { grid-template-columns: minmax(130px,1.35fr) minmax(90px,1fr) minmax(70px,.7fr) minmax(120px,1fr) minmax(100px,.8fr) minmax(150px,1.2fr); }
.import-lab-preview-editable .input { min-width: 0; padding: 7px 8px; font-size: 11px; }
.import-lab-preview-original { color: var(--muted); font-size: 9px; line-height: 1.35; }
.import-duplicate { margin-bottom: 12px; }
.import-identity-review { padding: 11px 13px; font-size: 15px; line-height: 1.35; }
.identity-review-main { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.identity-review-content { min-width: 0; padding-left: 13px; border-left: 2px solid #efd27d; }
.identity-review-content > strong { display: block; }
.identity-review-differences { margin: 5px 0 0 17px; padding: 0; }
.identity-review-differences li { margin: 2px 0; }
.identity-review-checkbox { display: flex; align-items: flex-start; gap: 9px; margin: 0; font-weight: 700; }
.identity-review-checkbox span { display: grid; gap: 2px; }
.identity-review-checkbox small { color: var(--muted); font-size: 10px; font-weight: 500; }
.identity-review-checkbox input { width: 17px; height: 17px; flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--brand); }
.import-identity-review:has(.identity-review-checkbox input:checked) { border-color: #8fd0a8; background: #f7fff9; }
.import-identity-review:has(.identity-review-checkbox input:checked) .identity-review-content { border-left-color: #8fd0a8; }
.import-item-status { padding: 9px 11px; font-size: 11px; }
.import-item-status svg { flex: 0 0 auto; }
.import-actions { position: sticky; bottom: 12px; z-index: 20; display: flex; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); box-shadow: 0 12px 30px rgba(25,55,75,.13); }
.input:disabled, .select:disabled { background: #f2f4f6; color: #8c98a5; cursor: not-allowed; }

@media (max-width: 1050px) {
  :root { --sidebar: 220px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-main-side, .receive-grid, .provider-workspace-grid, .admin-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .facility-grid, .study-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --topbar: 64px; }
  .auth-shell { padding: 28px 14px; place-items: start center; }
  .mfa-same-device { align-items: stretch; flex-direction: column; }
  .mfa-same-device .btn { width: 100%; }
  .auth-main { grid-template-columns: 1fr; gap: 18px; }
  .auth-intro { padding: 4px 2px; }
  .auth-brand { margin-bottom: 28px; }
  .auth-intro h1 { font-size: 32px; }
  .auth-intro > p { font-size: 13px; }
  .auth-benefits { margin-top: 20px; }
  .auth-card { max-width: none; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: 250px; box-shadow: 20px 0 50px rgba(0,0,0,.22); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; padding: 0 14px; gap: 10px; }
  .user-meta { display: none; }
  .main { padding: calc(30px + var(--topbar) + 18px) 14px 36px; }
  .page-head, .facility-summary, .facility-hero, .encounter-head { flex-direction: column; }
  .home-page-head { align-items: stretch; }
  .home-page-head .head-actions { justify-content: flex-start; }
  .facility-hero { align-items: flex-start; }
  .facility-hero .head-actions { margin-left: 0; }
  .encounter-detail { grid-template-columns: 58px minmax(0,1fr); }
  .import-review-head, .import-item-title { flex-direction: column; align-items: stretch; }
  .form-group.full, .share-contact-picker { min-width: 0; }
  .import-review-summary { justify-content: flex-start; }
  .import-fields { grid-template-columns: 1fr; }
  .conflict-review-row { grid-template-columns: 1fr; }
  .import-fields .full { grid-column: auto; }
  .import-group-summary-head { flex-direction: column; }
  .import-group-list { grid-template-columns: 1fr; }
  .identity-review-main { grid-template-columns: 1fr; gap: 10px; }
  .identity-review-content { padding-left: 0; border-left: 0; }
  .import-lab-preview-row { grid-template-columns: minmax(0,1fr) auto; }
  .import-lab-preview-row small { grid-column: 1 / -1; text-align: left; }
  .import-lab-preview-editable .import-lab-preview-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .import-lab-preview-editable .import-lab-preview-original { grid-column: 1 / -1; }
  .dropzone.compact { grid-template-columns: auto minmax(0,1fr); grid-template-rows: auto auto auto; grid-template-areas: 'icon heading' 'icon copy' 'action action'; gap: 4px 12px; }
  .dropzone.compact .btn { grid-area: action; justify-self: start; margin-top: 10px; }
  h1 { font-size: 24px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .form-grid, .provider-grid, .security-grid, .facility-overview, .access-model-options { grid-template-columns: 1fr; }
  .facility-info-grid, .facility-detail-stats { grid-template-columns: 1fr 1fr; }
  .stepper { grid-template-columns: repeat(2,1fr); }
  .disclosure-options { grid-template-columns: 1fr; }
  .share-section-heading, .share-step-actions, .share-timeline-collapsed { flex-wrap: wrap; }
  .share-section-heading > .badge { margin-left: 0; }
  .share-step-actions .btn { flex: 1 1 140px; min-width: 0; }
  .share-timeline-collapsed { align-items: flex-start; }
  .share-timeline-collapsed .btn { margin-left: 0; }
  .timeline-filter-grid, .timeline-control-grid, .timeline-scope-grid { grid-template-columns: 1fr; }
  .share-timeline-panel-head { flex-direction: column; }
  .share-timeline-step .health-timeline-view-switch { margin-left: 0; }
  .health-timeline-toolbar-head, .health-timeline-filter-controls { flex-direction: column; align-items: stretch; }
  .health-timeline-view-switch { align-self: flex-start; }
  .health-timeline-range { min-width: 0; }
  .health-timeline-custom-range { grid-template-columns: 1fr; }
  .health-timeline-lower { grid-template-columns: 1fr; }
  .health-timeline-horizontal .card-head { align-items: flex-start; }
  .health-timeline-horizontal .card-head > .form-hint { max-width: none; text-align: left; }
  .share-timeline-vertical-list::before { left: 65px; }
  .share-timeline-vertical-event { grid-template-columns: 58px 18px minmax(0, 1fr) 14px; gap: 7px; }
  .share-timeline-vertical-date { font-size: 8px; }
  .record-check { min-width: 0; }
  .record-check strong, .record-check span, .share-section-heading p, .share-timeline-panel-head span { overflow-wrap: anywhere; }
  .health-timeline-recent-row { grid-template-columns: 70px minmax(0, 1fr) 14px; }
  .search-wrap { max-width: none; }
  .document-toolbar { align-items: stretch; }
  .document-filter-fields, .document-list-actions { width: 100%; }
  .document-list-actions { justify-content: flex-start; }
  .global-search::placeholder { color: transparent; }
  .top-actions .icon-btn:not(.mobile-menu) { display: none; }
  .profile-menu { right: -4px; }
  .profile-onboarding, .profile-share-reminder { align-items: flex-start; flex-wrap: wrap; }
  .profile-onboarding .btn, .profile-share-reminder .btn { margin-left: 28px; }
  .home-attention-row { align-items: flex-start; flex-wrap: wrap; }
  .home-attention-row .home-attention-actions { margin-left: 76px; width: calc(100% - 76px); justify-content: flex-start; flex-wrap: wrap; }
  .home-record-row, .home-lab-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .home-record-details, .home-lab-details { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .snapshot-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .snapshot-patient { padding: 12px; }
  .snapshot-profile-hero { grid-template-columns: 72px minmax(0, 1fr); gap: 13px; padding: 14px; }
  .snapshot-photo { width: 72px; height: 72px; border-radius: 18px; }
  .snapshot-photo-placeholder { font-size: 22px; }
  .snapshot-profile-identity h3 { font-size: 22px; }
  .snapshot-facts { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
  .snapshot-fact { grid-template-columns: minmax(118px, .8fr) minmax(0, 1.5fr); }
  .snapshot-facts-column:first-child .snapshot-fact:last-child { border-bottom-color: var(--line); }
  .home-lab-summary { grid-template-columns: 1fr; }
  .home-lab-summary .btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 4px; }
  .home-sharing-row { grid-template-columns: 30px minmax(0, 1fr); align-items: start; }
  .home-sharing-details { grid-column: 2; justify-content: flex-start; flex-wrap: wrap; }
  .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tab { white-space: nowrap; }
  .receive-main { padding: 18px 12px 36px; }
  .receive-hero { padding: 18px; }
}


/* Patient-controlled document storage */
.vault-settings-card { overflow: hidden; }
.vault-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.vault-choice {
  width: 100%;
  min-height: 150px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  gap: 11px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
}
.vault-choice:hover:not(:disabled),
.vault-choice:focus-visible:not(:disabled) {
  border-color: #9fcbd5;
  background: #f5fbfc;
  outline: none;
}
.vault-choice.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.vault-choice:disabled { opacity: .5; cursor: not-allowed; }
.vault-choice-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
  color: var(--brand-strong);
  border: 1px solid var(--line);
}
.vault-choice-icon svg { width: 19px; height: 19px; }
.vault-choice-copy { display: grid; gap: 5px; min-width: 0; }
.vault-choice-copy strong { font-size: 14px; }
.vault-choice-copy small { color: var(--brand-strong); font-size: 10px; font-weight: 800; }
.vault-choice-copy > span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.vault-choice-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
}
.vault-choice-check svg { width: 15px; height: 15px; }
.vault-folder-status { margin-top: 14px; }
.vault-document-status {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.vault-document-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vault-document-badge svg { width: 11px; height: 11px; }
.vault-import-location { margin-bottom: 16px; }
.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-strong);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-button:hover,
.link-button:focus-visible { color: var(--brand); outline: none; }

@media (max-width: 900px) {
  .vault-choice-grid { grid-template-columns: 1fr; }
  .vault-choice { min-height: 0; }
}


/* Guided account setup */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: auto;
  padding: 32px 20px;
  background: rgba(15,37,51,.74);
  backdrop-filter: blur(8px);
}
.onboarding-shell {
  width: min(820px, 100%);
  min-height: min(720px, calc(100vh - 64px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 32px 90px rgba(15,37,51,.3);
}
.onboarding-header { padding: 20px 28px 16px; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
.onboarding-header-top { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.onboarding-header-top .head-actions { justify-content:flex-end; }
.onboarding-brand { padding: 0; margin: 0 0 16px; color: var(--text); }
.onboarding-brand strong { display:block; font-size: 14px; }
.onboarding-brand small { display:block; margin-top:2px; color:var(--muted); font-size:10px; }
.onboarding-progress-copy { display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:11px; }
.onboarding-progress-copy strong { color:var(--text); }
.onboarding-progress-track { height:7px; margin-top:9px; overflow:hidden; border-radius:999px; background:#dfe8ee; }
.onboarding-progress-track > span { display:block; height:100%; border-radius:inherit; background:var(--brand); transition:width .2s ease; }
.onboarding-content { padding: 34px 34px 28px; }
.onboarding-step { max-width: 690px; margin: 0 auto; }
.onboarding-step h1 { margin:8px 0 10px; font-size:clamp(26px,4vw,38px); letter-spacing:-.04em; }
.onboarding-step > p { margin:0 0 24px; color:var(--muted); line-height:1.65; font-size:13px; }
.onboarding-welcome { max-width:600px; padding-top:50px; text-align:center; }
.onboarding-hero-icon { width:54px; height:54px; display:grid; place-items:center; margin:0 auto 16px; border-radius:16px; background:var(--brand-soft); color:var(--brand-strong); }
.onboarding-hero-icon svg { width:26px; height:26px; }
.onboarding-actions { display:flex; justify-content:flex-end; align-items:center; gap:10px; flex-wrap:wrap; margin-top:28px; padding-top:18px; border-top:1px solid var(--line); }
.onboarding-profile-error { margin-top:18px; }
.onboarding-profile-error[hidden] { display:none; }
.onboarding-skip-hint { margin:10px 0 0; text-align:right; }
.onboarding-welcome .onboarding-actions { justify-content:center; }
.onboarding-health-list { display:grid; gap:10px; }
.onboarding-health-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 15px; border:1px solid var(--line); border-radius:13px; background:var(--panel-soft); }
.onboarding-health-row > div:first-child { display:grid; gap:4px; }
.onboarding-health-row span { color:var(--muted); font-size:10px; }
.onboarding-inline-actions { margin:18px 0; }
.onboarding-ai-status { display:flex; align-items:center; gap:15px; padding:18px; border:1px solid #b9dfe5; border-radius:14px; background:linear-gradient(135deg,#f1fbfc,#fbffff); }
.onboarding-ai-status .onboarding-hero-icon { width:44px; height:44px; margin:0; flex:0 0 auto; }
.onboarding-ai-status > div:last-child { display:grid; gap:5px; }
.onboarding-ai-status span { color:var(--muted); font-size:11px; }
.onboarding-summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.onboarding-summary-card { display:grid; gap:4px; padding:18px; border:1px solid var(--line); border-radius:14px; background:var(--panel-soft); }
.onboarding-summary-card strong { font-size:24px; color:var(--brand-strong); }
.onboarding-summary-card span { color:var(--muted); font-size:11px; }
.onboarding-finish-list { display:grid; margin-top:22px; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.onboarding-finish-list > div { display:flex; justify-content:space-between; gap:20px; padding:13px 15px; border-bottom:1px solid var(--line); }
.onboarding-finish-list > div:last-child { border-bottom:0; }
.onboarding-finish-list span { color:var(--muted); font-size:11px; }


/* My Health Visits reuse the vertical timeline's visual hierarchy. */
.visit-timeline { margin-top:8px; padding-left:28px; }
.visit-timeline .timeline-item { padding-bottom:20px; }
.visit-timeline-card .visit-folder-toggle { grid-template-columns:minmax(0,1fr) auto 18px; min-height:88px; }
.visit-timeline-card .visit-folder-main { gap:6px; }
.visit-timeline-card .visit-folder-main .event-tags { display:flex; flex-wrap:wrap; gap:5px; overflow:visible; }
.visit-timeline-card .visit-folder-main .badge { font-size:9px; overflow:visible; }
.visit-timeline-card .visit-folder-main strong { font-size:13px; }
.visit-timeline-card .visit-chevron { justify-self:end; }
.visit-timeline-card .visit-folder-body { padding:2px 15px 15px; }
.visit-document-main { flex:1; min-width:0; display:grid; gap:3px; }
.visit-review-status { display:flex; gap:6px; margin-top:4px; }
.visit-review-chip { border:0; cursor:pointer; font-family:inherit; line-height:1.4; }
.visit-review-chip:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.visit-move-sources { display:grid; gap:7px; margin:10px 0 18px; }
.visit-move-source { display:grid; gap:4px; padding:10px; border:1px solid var(--line); border-radius:10px; background:var(--panel-soft); }
.visit-move-source strong { font-size:11px; overflow-wrap:anywhere; }
.visit-move-source span { color:var(--muted); font-size:10px; overflow-wrap:anywhere; }
.health-timeline-event-more { margin-top:10px; border-top:1px solid var(--line); padding-top:9px; }
.health-timeline-event-more summary { width:max-content; max-width:100%; color:var(--brand); font-size:11px; font-weight:700; cursor:pointer; }
.health-timeline-event-more .visit-folder-actions { margin-top:9px; }
@media (max-width:720px) {
 .visit-timeline { padding-left:24px; }
 .visit-timeline .timeline-item { padding-left:10px; }
 .visit-timeline-card .visit-folder-toggle { grid-template-columns:minmax(0,1fr) 18px; }
 .visit-timeline-card .visit-folder-meta { grid-column:1; grid-row:2; justify-items:start; }
 .visit-timeline-card .visit-chevron { grid-column:2; grid-row:1 / 3; }
 .visit-document-row { flex-wrap:wrap; }
 .visit-document-row .head-actions { width:100%; justify-content:flex-end; }
}

/* A single typographic system, including a full-width editor for Visit notes. */
.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; }
.visit-notes-modal { width:min(860px,100%); }
.visit-notes-modal .modal-body { width:100%; }
.visit-notes-editor { display:block; width:100%; }
.visit-notes-editor .textarea { display:block; width:100%; max-width:100%; min-height:290px; font-family:inherit; font-size:14px; font-weight:400; line-height:1.6; }
.visit-notes-modal .modal-actions { padding:18px 0 0; }

/* Medications show current, historical and uncertain courses without hiding history. */
.medication-history { display:grid; gap:14px; }
.medication-history-section .card-head { margin-bottom:14px; }
.medication-record-list { display:grid; gap:8px; }
.medication-entry { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; padding:13px 14px; border:1px solid var(--line); border-radius:12px; background:#fff; align-items:center; }
.medication-entry-main { min-width:0; }
.medication-entry-heading { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.medication-entry-heading h3 { margin:0; font-size:13px; font-weight:750; line-height:1.35; }
.medication-dose { font-size:12px; margin:4px 0 0; color:var(--text); }
.medication-dates { display:flex; flex-wrap:wrap; gap:5px 16px; margin-top:7px; font-size:10px; color:var(--muted); }
.medication-dates strong { color:var(--text); font-weight:650; }
.medication-entry-actions { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:8px; }
.medication-empty { color:var(--muted); font-size:11px; margin:0; padding:8px 0; }
@media (max-width:720px) {
  .medication-entry { grid-template-columns:minmax(0,1fr); gap:10px; }
  .medication-entry-actions { justify-content:flex-start; }
  .visit-notes-editor .textarea { min-height:240px; }
}

/* Visits are the canonical organizational container for documents. */
.visit-folders-card .card-head { margin-bottom:14px; }
.visit-folder-list { display:grid; gap:10px; }
.visit-folder { overflow:hidden; border:1px solid var(--line); border-radius:14px; background:#fff; }
.visit-folder.is-expanded { border-color:#b9d8e2; box-shadow:var(--shadow-sm); }
.visit-folder-toggle { width:100%; min-height:68px; display:grid; grid-template-columns:24px minmax(0,1fr) auto; align-items:center; gap:12px; padding:13px 15px; border:0; background:transparent; color:var(--text); text-align:left; }
.visit-folder-toggle:hover, .visit-folder-toggle:focus-visible { background:var(--panel-soft); outline:none; }
.visit-chevron { color:var(--brand); transition:transform .15s ease; }
.visit-chevron svg { width:16px; height:16px; }
.visit-folder.is-expanded .visit-chevron { transform:rotate(90deg); }
.visit-folder-main { min-width:0; display:grid; gap:4px; }
.visit-folder-main strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.visit-folder-main span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:10px; }
.visit-folder-meta { display:grid; gap:4px; justify-items:end; color:var(--muted); font-size:10px; white-space:nowrap; }
.visit-folder-meta strong { color:var(--text); font-size:11px; }
.visit-folder-body { padding:0 15px 15px 51px; border-top:1px solid var(--line); }
.visit-summary { padding:14px 0 4px; }
.visit-summary p { margin:5px 0 0; color:var(--muted); font-size:11px; line-height:1.5; }
.visit-detail-section { padding:13px 0; border-bottom:1px solid var(--line); }
.visit-detail-section h4 { margin:0 0 8px; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); }
.visit-detail-list { display:grid; gap:7px; }
.visit-detail-list > div { display:grid; gap:2px; }
.visit-detail-list strong { font-size:11px; }
.visit-detail-list span { color:var(--muted); font-size:10px; }
.visit-document-list { display:grid; gap:7px; }
.visit-document-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 11px; border:1px solid var(--line); border-radius:11px; background:var(--panel-soft); }
.visit-document-row > div:first-child { min-width:0; display:grid; gap:3px; }
.visit-document-row strong, .visit-document-row span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.visit-document-row strong { font-size:11px; }
.visit-document-row span { color:var(--muted); font-size:10px; }
.visit-folder-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:15px; }
.visit-delete-button { margin-left:auto; color:var(--danger); }
.visit-empty-docs { padding:14px 0 4px; color:var(--muted); font-size:11px; }
.document-unassigned-folder { border-style:dashed; }
.document-visit-groups .visit-folder-body { padding-top:12px; }
.document-visit-groups .visit-detail-section:not(:last-child), .document-visit-groups .visit-summary { display:none; }

@media (max-width: 720px) {
  .onboarding-overlay { padding:0; background:var(--panel); }
  .onboarding-shell { min-height:100vh; border:0; border-radius:0; box-shadow:none; }
  .onboarding-header { padding:16px 18px 13px; position:sticky; top:0; z-index:2; }
  .onboarding-header-top { align-items:stretch; flex-direction:column; }
  .onboarding-header-top .head-actions { justify-content:flex-start; }
  .onboarding-brand { margin-bottom:4px; }
  .onboarding-content { padding:24px 18px 28px; }
  .onboarding-health-row { align-items:flex-start; flex-direction:column; }
  .onboarding-health-row .head-actions { width:100%; }
  .onboarding-health-row .btn { flex:1 1 auto; }
  .onboarding-actions { align-items:stretch; flex-direction:column-reverse; }
  .onboarding-actions .btn { width:100%; }
  .visit-folder-toggle { grid-template-columns:20px minmax(0,1fr); }
  .visit-folder-meta { grid-column:2; grid-row:2; justify-items:start; display:flex; gap:8px; }
  .visit-folder-body { padding:0 12px 12px; }
  .visit-document-row { align-items:flex-start; flex-direction:column; }
  .visit-document-row .head-actions { width:100%; }
  .visit-delete-button { margin-left:0; }
}

/* Patient workspace: compact defaults, details on demand. */
.home-snapshot .card-head { align-items:center; margin-bottom:10px; }
.home-snapshot .card-head h2 { font-size:16px; }
.home-layout > .grid { min-width:0; }
.home-layout .home-attention-row { flex-wrap:wrap; }
.home-layout .home-attention-actions { flex-basis:100%; justify-content:flex-start; margin-left:0; flex-wrap:wrap; }
.home-layout .home-attention-actions .btn { white-space:normal; }
.snapshot-secondary:not([open]) summary { min-height:24px; }
.home-snapshot .snapshot-review { margin-top:8px; padding-top:8px; }
.snapshot-profile-hero { grid-template-columns:52px minmax(0,1fr); padding:0; gap:12px; border:0; background:transparent; }
.snapshot-photo { width:52px; height:52px; border-radius:14px; box-shadow:none; }
.snapshot-profile-identity h3 { font-size:19px; margin-bottom:3px; }
.snapshot-identity-line { font-size:11px; }
.snapshot-primary-facts { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); margin:14px 0 0; gap:12px; }
.snapshot-primary-facts .snapshot-fact { display:block; padding:0; border:0; }
.snapshot-primary-facts .snapshot-fact dd { margin-top:4px; font-size:12px; }
.snapshot-secondary { margin-top:12px; padding-top:8px; border-top:1px solid var(--line); }
.snapshot-secondary summary, .snapshot-share-options summary { cursor:pointer; min-height:36px; display:list-item; font-size:11px; color:var(--brand); }
.snapshot-secondary-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:8px 0; }
.snapshot-secondary-facts .snapshot-fact { display:block; padding:4px 0; border:0; min-width:0; overflow-wrap:anywhere; }
.snapshot-edit-modal .form-grid { gap:12px; }
.snapshot-edit-identity, .snapshot-edit-category { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); }
.snapshot-edit-identity { margin-bottom:14px; justify-content:space-between; }
.snapshot-edit-category > div { flex:1; min-width:130px; }
.snapshot-edit-category span { display:block; color:var(--muted); font-size:11px; }
.snapshot-none-choice { display:flex; align-items:center; gap:7px; font-size:11px; min-height:40px; }
.snapshot-share-options, .shared-snapshot { border:1px solid var(--line); background:var(--panel-soft); padding:16px; border-radius:var(--radius-sm); margin-bottom:18px; }
.snapshot-share-toggle { display:flex; align-items:center; gap:12px; margin-bottom:12px; cursor:pointer; }
.snapshot-share-toggle small { display:block; font-size:11px; color:var(--muted); margin-top:4px; }
.snapshot-field-picker { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:8px 0 12px; }
.snapshot-field-picker label { display:flex; align-items:center; gap:7px; min-height:38px; font-size:11px; }
.share-visit-picker { border:1px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; }
.share-visit-picker summary { display:flex; align-items:center; justify-content:space-between; cursor:pointer; padding:14px; gap:12px; min-height:52px; }
.share-visit-picker summary span { color:var(--muted); font-size:11px; white-space:nowrap; }
.share-visit-picker .record-check { border:0; border-top:1px solid var(--line); border-radius:0; margin:0; padding:10px 14px; }
.share-visit-actions { padding:0 12px; }
.share-picker-summary { display:flex; flex-wrap:wrap; gap:18px; align-items:center; padding:16px 0; }
.share-picker-summary label { display:flex; gap:7px; align-items:center; font-size:11px; }
.visit-folder-toggle { min-height:62px; padding:10px 12px; }
.visit-folder-toggle:focus-visible, summary:focus-visible { outline:2px solid var(--brand); outline-offset:-2px; }
.visit-document-row > .visit-document-select { min-height:44px; display:flex; align-items:center; padding-right:8px; }
.visit-document-row > .visit-document-main { flex:1; min-width:0; }
.visit-pagination { display:flex; justify-content:space-between; align-items:center; padding-top:12px; gap:12px; }
.import-upload-panel .dropzone.compact { padding:16px; }
.import-upload-panel .dropzone.compact .drop-icon { display:none; }
@media (max-width:1000px) {
  .snapshot-primary-facts { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .snapshot-primary-facts, .snapshot-secondary-facts, .snapshot-field-picker { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .snapshot-profile-hero { grid-template-columns:44px minmax(0,1fr); }
  .snapshot-photo { width:44px; height:44px; border-radius:12px; }
  .snapshot-profile-identity h3 { font-size:17px; }
  .snapshot-edit-category { gap:5px; }
  .snapshot-none-choice { flex-basis:100%; }
  .share-visit-picker summary { align-items:flex-start; }
  .visit-document-row { flex-direction:row; flex-wrap:wrap; }
  .visit-document-row .head-actions { padding-left:25px; }
}


/* Full-viewport source viewer: original first, compact collapsible metadata. */
.modal.document-viewer-modal { width: calc(100vw - 48px); max-width: none; max-height: calc(100dvh - 48px);
  height: calc(100dvh - 48px); display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; }
.document-viewer-modal .modal-head { flex: 0 0 auto; align-items: center; padding: 10px 14px; }
.document-viewer-modal .modal-head h2 { font-size: 16px; line-height: 1.25; }
.document-viewer-modal .modal-head p { font-size: 11px; }
.document-viewer-modal .document-viewer-body { flex: 1 1 auto; min-height: 0;
  overflow: auto; display: flex; flex-direction: column; gap: 9px; padding: 8px 11px; }
.document-original-preview { width: 100%; min-width: 0; min-height: min(73dvh, 950px);
  background: #f5f8fa; }
.document-original-pdf { display: block; border: 0; width: 100%; height: min(73dvh, 950px); }
.document-original-image { display: block; width: 100%; max-height: 74dvh; object-fit: contain; }
.document-viewer-details { padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: #fafcfd; font-size: 12px; }
.document-viewer-details > summary { cursor: pointer; font-weight: 600; }
.document-viewer-details > summary:focus-visible { outline: 2px solid var(--accent); }
.document-viewer-details .grid { margin-top: 12px; }
.document-viewer-modal .document-viewer-actions { flex: 0 0 auto;
  padding: 8px 12px; gap: 6px; flex-wrap: wrap; max-height: 22dvh; overflow-y: auto; }
.document-viewer-actions .btn { padding: 6px 10px; min-height: 34px; font-size: 11px; }
@media (max-width: 640px) {
  .modal.document-viewer-modal { height: calc(100dvh - 48px); max-height: calc(100dvh - 48px);
    width: calc(100vw - 48px); border-radius: 8px; }
  .document-viewer-modal .modal-head { padding: 7px 10px; }
  .document-viewer-modal .document-viewer-actions { max-height: 28dvh; }
  .document-original-pdf, .document-original-preview { min-height: min(68dvh, 850px); height: min(68dvh, 850px); }
}


/* Compact expandable source links under each suggested Visit. */
.import-group-files { width: 100%; min-width: 0; margin-top: 7px; border-top: 1px solid var(--line); padding-top: 7px; }
.import-group-files summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 12px; }
.import-group-files summary:focus-visible, .import-file-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.import-group-files ul { padding: 2px 0; margin: 0; list-style: none; }
.import-group-file { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.import-group-file > span { min-width: 0; flex: 1 1 170px; overflow-wrap: anywhere; }
.import-group-file small { color: var(--muted); }
.import-file-link { background: none; border: 0; cursor: pointer; text-decoration: underline;
  font: inherit; color: var(--brand); padding: 5px; }
.document-viewer-heading { flex: 1 1 170px; min-width: 0; }
.document-viewer-heading h2 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-viewer-nav { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--muted); }
.document-viewer-nav > span { min-width: 48px; text-align: center; }
.document-viewer-nav .btn { min-height: 34px; padding: 5px 8px; }
@media (max-width: 690px) {
  .document-viewer-modal .modal-head { flex-wrap: wrap; gap: 7px; }
  .document-viewer-nav { flex: 1 1 100%; justify-content: space-between; order: 3; }
}


/* One explicit bulk attestation for safe, completely identified import fields. */
.import-bulk-review { display: flex; align-items: flex-start; gap: 9px; margin-top: 11px;
  padding: 10px 12px; background: #f3faff; border: 1px solid #b9dbe4;
  border-radius: 9px; cursor: pointer; }
.import-bulk-review > input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.import-bulk-review strong, .import-bulk-review small { display: block; }
.import-bulk-review small { margin-top: 3px; font-size: 11px;
  color: var(--muted); line-height: 1.45; }
.import-bulk-review > input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Compact clinical hierarchy shared by the owner's and recipient's Snapshot. */
.topbar .profile-trigger .user-meta, .topbar .profile-caret { display:none; }
.topbar .profile-trigger { padding:4px; border-radius:50%; min-width:40px; min-height:40px; }
.avatar { overflow:hidden; }
.avatar .snapshot-photo-placeholder { font:inherit; }
.avatar img { width:100%; height:100%; object-fit:cover; }
.profile-menu-header .avatar { width:40px; height:40px; float:left; margin-right:10px; }
.snapshot-profile-hero { gap:14px; }
.snapshot-photo { width:64px; height:64px; border-radius:50%; flex-shrink:0; }
.snapshot-primary-facts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 24px; margin-top:12px; }
.snapshot-primary-facts .snapshot-fact { display:grid; grid-template-columns:110px minmax(0,1fr); padding:8px 0; border-bottom:1px solid var(--line); }
.snapshot-primary-facts .snapshot-fact:nth-child(3) { grid-column:1/-1; }
.snapshot-fact dt { font-size:12px; }
.snapshot-fact dd { font-size:14px; font-weight:550; }
.snapshot-source-note { margin:8px 0 0; color:var(--muted); font-size:12px; }
.profile-photo-editor { display:flex; align-items:center; gap:16px; margin:0 24px; padding:16px 0; border-bottom:1px solid var(--line); }
.profile-photo-editor h3 { font-size:14px; margin-bottom:8px; }
.profile-photo-upload { position:relative; cursor:pointer; overflow:hidden; }
.profile-photo-upload input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; }
.profile-photo-upload:focus-within { outline:3px solid var(--brand); outline-offset:2px; }
[data-profile-photo-error], [data-preview-error] { color:var(--danger); font-size:13px; }
.shared-patient-photo { width:64px; height:64px; border-radius:50%; object-fit:cover; margin:8px 0; }
.shared-snapshot { background:var(--panel); }
.shared-snapshot .snapshot-secondary-facts { grid-template-columns:repeat(2,minmax(0,1fr)); }
.recipient-preview-modal { width:min(1100px,100%); min-width:0; max-height:94vh; }
.recipient-preview-modal .modal-body { overflow:auto; }
.document-viewer-body > iframe { width:100%; height:78vh; border:0; }
@media (max-width:760px) {
  .snapshot-primary-facts, .shared-snapshot .snapshot-secondary-facts { grid-template-columns:minmax(0,1fr); }
  .snapshot-primary-facts .snapshot-fact:nth-child(3) { grid-column:auto; }
  .profile-photo-editor { margin:0 16px; align-items:flex-start; gap:12px; }
  .snapshot-primary-facts .snapshot-fact { grid-template-columns:100px minmax(0,1fr); }
}
@media print {
  .receive-top,.receive-nav,.topbar,.sidebar,.demo-banner,.head-actions,.profile-photo-editor { display:none !important; }
  .receive-grid,.receive-main,.snapshot-secondary-facts { display:block; width:100%; }
  .shared-snapshot,.card { break-inside:avoid; box-shadow:none; }
}

.profile-modal { display:flex; flex-direction:column; overflow:hidden; }
.profile-modal > .modal-head,.profile-photo-editor { flex:0 0 auto; }
.profile-modal > form { overflow:auto; min-height:0; }

.shared-record-card .notice > div { min-width:0; }
.shared-record-card .notice .row-sub { white-space:normal; overflow-wrap:anywhere; }
