:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --surface: #fff;
  --surface-soft: #f2f4fb;
  --navy: #101d3f;
  --muted: #6f7890;
  --line: #e6e9f2;
  --blue: #4269e1;
  --blue-soft: #edf1ff;
  --violet: #8068e8;
  --violet-soft: #f1edff;
  --green: #37aa69;
  --green-soft: #e8f8ef;
  --orange: #e99a2f;
  --orange-soft: #fff4e2;
  --red: #d94e5d;
  --red-soft: #feeaed;
  --shadow: 0 7px 24px rgba(27, 43, 86, .07);
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--navy); }
body { min-height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.app { display: grid; grid-template-columns: 232px 350px minmax(0, 1fr); height: 100dvh; }
.sidebar { border-right: 1px solid var(--line); background: rgba(250,251,255,.96); padding: 28px 20px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 8px 40px; font-size: 21px; }
.brand img { width: 42px; height: 42px; }
.brand span, .mobile-header strong span { color: var(--blue); font-size: 12px; }
.sidebar nav { display: grid; gap: 8px; }
.nav { min-height: 48px; padding: 0 14px; border: 0; border-radius: 13px; background: transparent; display: flex; align-items: center; gap: 12px; color: var(--muted); cursor: pointer; text-align: left; }
.nav:hover { background: #f2f4fb; color: var(--navy); }
.nav.active { background: linear-gradient(100deg, #e9edff, #f0ecff); color: #345dd4; font-weight: 650; }
.nav .badge { margin-left: auto; }
.account { margin-top: auto; padding: 16px 6px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; min-width: 0; }
.account div:last-child { min-width: 0; display: grid; }
.account strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.account small { color: var(--muted); }
.patient-rail { overflow: hidden; background: #fbfcff; border-right: 1px solid var(--line); padding: 28px 16px; display: flex; flex-direction: column; }
.rail-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 18px; }
.rail-heading h2 { margin: 0; font-size: 21px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; position: relative; }
.icon-button:hover { border-color: #cbd3ea; }
.search-box { height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: flex; align-items: center; gap: 9px; padding: 0 12px; margin-bottom: 14px; }
.search-box input { border: 0; outline: 0; background: transparent; width: 100%; color: var(--navy); }
.search-box input::placeholder { color: #9aa2b5; }
.patient-list { overflow-y: auto; padding: 1px 4px 80px; scrollbar-width: thin; }
.patient-card { width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 3px 13px rgba(26,42,82,.035); margin-bottom: 11px; cursor: pointer; text-align: left; }
.patient-card:hover, .patient-card.active { border-color: #6e89ea; box-shadow: 0 7px 20px rgba(55,85,175,.1); }
.patient-card-head { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 11px; align-items: center; }
.patient-card h3 { margin: 0 0 4px; font-size: 15px; }
.meta { color: var(--muted); font-size: 12px; }
.patient-card .diagnosis { margin: 12px 0 9px; font-size: 13px; font-weight: 600; line-height: 1.4; min-height: 18px; }
.card-foot { display: flex; justify-content: space-between; gap: 6px; align-items: flex-end; }
.latest { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pill { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 650; line-height: 1.2; }
.pill::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; }
.pill.ready, .pill.active { color: var(--green); background: var(--green-soft); }
.pill.processing { color: var(--blue); background: var(--blue-soft); }
.pill.review { color: var(--orange); background: var(--orange-soft); }
.workspace { overflow-y: auto; min-width: 0; padding: 28px clamp(22px,3vw,52px) 70px; scroll-behavior: smooth; }
.welcome-state { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.welcome-state img { width: 92px; margin-bottom: 15px; }
.welcome-state h1 { color: var(--navy); margin: 0 0 8px; }
.welcome-state p { max-width: 430px; margin: 0; line-height: 1.55; }
.content { max-width: 920px; margin: 0 auto; }
.back-button { border: 0; background: transparent; color: var(--blue); padding: 5px 0 15px; cursor: pointer; }
.dossier-header { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 22px; overflow: hidden; }
.dossier-person { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 22px; }
.dossier-person h1 { font-size: clamp(22px,2.4vw,30px); margin: 0 0 7px; }
.person-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.header-status { align-self: start; }
.update-strip { display: flex; gap: 30px; flex-wrap: wrap; border-top: 1px solid var(--line); background: #fbfcff; padding: 12px 22px; color: var(--muted); font-size: 12px; }
.update-strip strong { color: var(--navy); margin-left: 5px; }
.action-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 16px 0; }
.action-card { min-height: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; font-weight: 650; cursor: pointer; }
.action-card:hover { border-color: #c3ccec; transform: translateY(-1px); }
.action-card .i { width: 35px; height: 35px; border-radius: 10px; background-color: var(--blue-soft); }
.action-card:nth-child(2) .i { background-color: var(--violet-soft); }
.action-card:nth-child(3) .i { background-color: var(--green-soft); }
.clinical-card { margin: 12px 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.clinical-card[open] > summary { border-bottom: 1px solid #eff1f7; }
.clinical-card summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: center; gap: 10px; font-weight: 700; color: #17316f; }
.clinical-card summary::-webkit-details-marker { display: none; }
.clinical-card summary::after { content: "⌃"; margin-left: auto; color: #8490aa; }
.clinical-card:not([open]) summary::after { content: "⌄"; }
.section-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.ai-card summary .section-icon { color: var(--violet); background: var(--violet-soft); }
.clinical-body { padding: 16px 18px 18px; line-height: 1.58; font-size: 14px; }
.clinical-body p { margin: 0 0 10px; }
.clinical-body p:last-child { margin-bottom: 0; }
.clinical-body .lead { font-size: 16px; font-weight: 700; line-height: 1.45; }
.event-row { border-bottom: 1px solid #eff1f7; padding: 11px 0; }
.event-row:last-child { border-bottom: 0; padding-bottom: 0; }
.event-date { display: inline-block; min-width: 90px; color: var(--muted); font-size: 12px; }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 18px; margin-top: 7px; }
.detail-list div { font-size: 13px; }
.detail-list b { color: var(--muted); font-weight: 500; margin-right: 5px; }
.empty-copy { color: var(--muted); font-style: italic; }
.warning-card { border-color: #f4d2a2; }
.warning-card summary { color: #a76a16; }
.subpage-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.subpage-head h1 { margin: 0; font-size: 28px; }
.timeline { position: relative; margin-left: 13px; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: #dfe5f5; }
.timeline-year { margin: 24px 0 12px -47px; font-size: 13px; color: var(--muted); }
.timeline-event { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 14px 16px; margin-bottom: 12px; }
.timeline-event::before { content: ""; position: absolute; width: 14px; height: 14px; border: 4px solid var(--blue-soft); background: var(--blue); border-radius: 50%; left: -35px; top: 18px; }
.timeline-event[data-kind="morphology"]::before { background: var(--violet); }
.timeline-event[data-kind="surgery"]::before { background: var(--orange); }
.timeline-event[data-kind="radiology"]::before { background: var(--green); }
.timeline-event h3 { margin: 4px 0 6px; font-size: 15px; }
.timeline-event .category { color: var(--blue); font-size: 11px; font-weight: 700; }
.report-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.report-card h2 { font-size: 17px; margin: 0 0 12px; }
.ai-block { background: var(--violet-soft); border-radius: 13px; padding: 13px; margin-bottom: 13px; }
.ai-block h3, .source-report h3 { margin: 0 0 7px; font-size: 13px; color: var(--violet); }
.source-report { border-top: 1px solid var(--line); padding-top: 13px; }
.source-report h3 { color: var(--navy); }
.source-report pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.55; margin: 0; color: #29344f; }
.document-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 13px; }
.document-card { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 16px; min-height: 145px; cursor: pointer; text-align: left; }
.document-card:hover { border-color: #adbbe9; }
.document-icon { width: 45px; height: 54px; display: grid; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); font-weight: 800; margin-bottom: 15px; }
.page-title { margin: 0 0 20px; font-size: 28px; }
.notification { display: flex; gap: 13px; align-items: flex-start; padding: 16px; border-bottom: 1px solid var(--line); }
.notification:last-child { border: 0; }
.notification-dot { width: 38px; height: 38px; border-radius: 12px; background: var(--blue-soft); display: grid; place-items: center; color: var(--blue); }
.notification.ready .notification-dot { background: var(--green-soft); color: var(--green); }
.notification h3 { font-size: 14px; margin: 0 0 5px; }
.notification p { margin: 0; color: var(--muted); font-size: 12px; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.health-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.health-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 17px; }
.health-card header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.health-card h3 { margin: 0; font-size: 14px; }
.health-value { font-size: 27px; font-weight: 750; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.status-dot.unknown { background: var(--muted); box-shadow: 0 0 0 5px #eef0f4; }
.device { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.device:last-child { border: 0; }
.device h3 { margin: 0 0 5px; font-size: 14px; }
.device p { margin: 0; color: var(--muted); font-size: 12px; }
.button, button.primary { border: 0; border-radius: 12px; min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; font-weight: 650; }
button.primary { background: var(--blue); color: #fff; box-shadow: 0 7px 15px rgba(66,105,225,.22); }
.button.subtle { background: var(--surface-soft); color: var(--navy); }
.button.danger { background: var(--red-soft); color: var(--red); }
.wide { width: 100%; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 10px; background: var(--red); color: #fff; font-size: 10px; padding: 0 5px; }
.auth-screen { min-height: 100dvh; overflow-y: auto; display: grid; place-items: center; padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 12%, #edf0ff, transparent 35%), var(--bg); }
.auth-card { width: min(440px,100%); background: rgba(255,255,255,.96); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(27,43,86,.12); border-radius: 26px; padding: 34px; }
.auth-logo { width: 74px; height: 74px; }
.auth-card h1 { margin: 4px 0 8px; font-size: 27px; line-height: 1.2; }
.auth-card form { display: grid; gap: 15px; margin-top: 25px; }
.auth-card label { display: grid; gap: 7px; font-size: 13px; font-weight: 650; }
.auth-card input[type="email"], .auth-card input[type="password"] { width: 100%; height: 48px; border: 1px solid #dfe3ee; border-radius: 12px; padding: 0 13px; outline: 0; }
.auth-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.trusted-choice { grid-template-columns: auto 1fr; align-items: start; padding: 12px; background: var(--surface-soft); border-radius: 12px; cursor: pointer; }
.trusted-choice input { width: 18px; height: 18px; accent-color: var(--blue); }
.trusted-choice span { display: grid; gap: 4px; }
.trusted-choice small { color: var(--muted); font-weight: 400; line-height: 1.4; }
.form-error { min-height: 18px; color: var(--red); font-size: 12px; margin: -4px 0; }
.security-note { text-align: center; color: var(--muted); font-size: 11px; margin: 18px 0 0; }
.viewer { width: min(1200px,100vw); height: min(900px,100dvh); max-width: none; max-height: none; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background: #e8ebf2; }
.viewer::backdrop { background: rgba(13,22,45,.55); backdrop-filter: blur(5px); }
.viewer-bar { height: 64px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.viewer-bar > div:first-child { display: grid; min-width: 0; }
.viewer-bar strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.viewer-bar small { color: var(--muted); }
.viewer-actions { display: flex; gap: 8px; }
.viewer-canvas { height: calc(100% - 124px); display: grid; place-items: center; overflow: auto; padding: 15px; }
.viewer-canvas iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-canvas img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: var(--shadow); }
.viewer-thumbs { height: 60px; display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 8px 15px max(8px, env(safe-area-inset-bottom)); background: #fff; }
.viewer-thumbs button { min-width: 42px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-soft); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: #172444; color: #fff; border-radius: 12px; padding: 12px 17px; box-shadow: var(--shadow); font-size: 13px; }
.mobile-header, .bottom-nav { display: none; }
.avatar { --skin: #edc5ab; --hair: #5c443a; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(145deg,#dfe7ff,#f0e8ff); display: grid; place-items: end center; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(30,49,94,.04); }
.avatar i { display: block; position: relative; width: 28px; height: 35px; border-radius: 48% 48% 44% 44%; background: radial-gradient(circle at 60% 35%,#f8d8c2,var(--skin) 72%); box-shadow: 0 -7px 0 -1px var(--hair), 0 10px 0 6px #d9e1f5; }
.avatar i::before { content: ""; position: absolute; left: 6px; top: 15px; width: 3px; height: 3px; border-radius: 50%; background: #3b3540; box-shadow: 13px 0 #3b3540; }
.avatar i::after { content: ""; position: absolute; left: 10px; top: 24px; width: 9px; height: 4px; border-bottom: 1.5px solid #a45f65; border-radius: 50%; }
.avatar.female { --hair: #49352f; }
.avatar.female i { box-shadow: -3px -7px 0 1px var(--hair), 3px -7px 0 1px var(--hair), 0 10px 0 6px #e1ddf5; }
.avatar.age-infant i { width: 25px; height: 30px; border-radius: 52% 52% 46% 46%; }
.avatar.age-child i { width: 26px; height: 32px; }
.avatar.age-teen i { width: 27px; height: 34px; }
.avatar.age-young { --skin: #efc8ae; }
.avatar.age-middle i::after { width: 10px; }
.avatar.age-senior { --hair: #b6b1ac; --skin: #dfb89f; }
.avatar.age-senior i { box-shadow: 0 -7px 0 -1px var(--hair), 0 10px 0 6px #d9e1f5, inset 0 -5px 8px rgba(125,76,63,.08); }
.avatar.age-neutral { --hair: #78849b; --skin: #d8b7a5; }
.avatar.large { width: 72px; height: 72px; }
.avatar.large i { transform: scale(1.38); transform-origin: bottom center; }
.avatar.small { width: 36px; height: 36px; }
.avatar.small i { transform: scale(.75); transform-origin: bottom center; }
.i { width: 20px; height: 20px; display: inline-block; background: currentColor; mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.i-people { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 19c0-4 2-6 6-6s6 2 6 6M16 6a3 3 0 0 1 0 6M17 14c2.7.3 4 2 4 5'/%3E%3C/svg%3E"); }
.i-search { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E"); }
.i-bell { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cpath d='M5 17h14l-2-3V9a5 5 0 0 0-10 0v5l-2 3Z'/%3E%3Cpath d='M10 20h4'/%3E%3C/svg%3E"); }
.i-system { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='3' y='4' width='18' height='14' rx='3'/%3E%3Cpath d='M8 21h8M9 13l2-2 2 2 3-4'/%3E%3C/svg%3E"); }
.i-settings { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19 13.5v-3l-2-.7-.5-1.2.9-1.9-2.1-2.1-1.9.9-1.2-.5-.7-2h-3l-.7 2-1.2.5-1.9-.9-2.1 2.1.9 1.9-.5 1.2-2 .7v3l2 .7.5 1.2-.9 1.9 2.1 2.1 1.9-.9 1.2.5.7 2h3l.7-2 1.2-.5 1.9.9 2.1-2.1-.9-1.9.5-1.2 2-.7Z'/%3E%3C/svg%3E"); }
.i-refresh { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M20 7v5h-5M4 17v-5h5M18 12a6 6 0 0 0-10-4L5 11M6 12a6 6 0 0 0 10 4l3-3'/%3E%3C/svg%3E"); }

@media (max-width: 1180px) {
  .app { grid-template-columns: 82px 320px minmax(0,1fr); }
  .sidebar { padding-inline: 14px; }
  .brand { margin-inline: auto; }
  .brand strong, .nav:not(.active)::after, .nav { font-size: 0; }
  .nav { justify-content: center; padding: 0; }
  .nav .i { width: 22px; height: 22px; }
  .nav .badge { position: absolute; margin: -27px 0 0 25px; }
  .account > div:last-child { display: none; }
  .account { justify-content: center; }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  .app { display: block; height: auto; min-height: 100dvh; padding-top: calc(62px + env(safe-area-inset-top)); padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .mobile-header { position: fixed; z-index: 20; left: 0; right: 0; top: 0; height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 18px 0; background: rgba(250,251,255,.91); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(223,227,239,.8); display: flex; align-items: center; justify-content: center; gap: 8px; }
  .mobile-header .brand-mark { width: 38px; }
  .mobile-header .icon-button { position: absolute; right: 14px; bottom: 9px; border: 0; background: transparent; }
  .patient-rail { display: block; overflow: visible; border: 0; padding: 20px 15px; min-height: calc(100dvh - 132px); }
  .patient-rail.hidden-mobile { display: none; }
  .rail-heading { padding-top: 4px; }
  .patient-list { overflow: visible; padding-bottom: 20px; }
  .patient-card { padding: 16px; }
  .workspace { display: none; overflow: visible; padding: 12px 14px 30px; }
  .workspace.mobile-active { display: block; }
  .content { max-width: none; }
  .welcome-state { min-height: 50vh; }
  .dossier-person { grid-template-columns: 62px minmax(0,1fr); gap: 13px; padding: 16px; }
  .avatar.large { width: 62px; height: 62px; }
  .header-status { grid-column: 2; margin-top: -8px; }
  .dossier-person h1 { font-size: 20px; }
  .person-meta { font-size: 12px; }
  .update-strip { display: grid; gap: 7px; padding: 11px 16px; }
  .action-grid { gap: 8px; }
  .action-card { min-height: 70px; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 8px 4px; font-size: 11px; }
  .action-card .i { width: 30px; height: 30px; }
  .clinical-card { border-radius: 16px; }
  .clinical-card summary { padding: 15px 14px; }
  .clinical-body { padding: 14px; }
  .detail-list { grid-template-columns: 1fr; }
  .health-grid { grid-template-columns: 1fr; }
  .bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding: 5px 12px env(safe-area-inset-bottom); border-top: 1px solid rgba(214,219,232,.85); background: rgba(252,252,255,.94); backdrop-filter: blur(18px); display: grid; grid-template-columns: repeat(4,1fr); }
  .bottom-nav button { position: relative; border: 0; background: transparent; color: #828ba0; display: grid; place-content: center; justify-items: center; gap: 2px; }
  .bottom-nav button.active { color: var(--blue); }
  .bottom-nav .i { width: 23px; height: 23px; }
  .bottom-nav small { font-size: 10px; }
  .bottom-nav .badge { position: absolute; top: 3px; left: calc(50% + 7px); }
  .page-title, .subpage-head h1 { font-size: 24px; }
  .viewer { width: 100vw; height: 100dvh; border-radius: 0; }
  .viewer-canvas { height: calc(100% - 130px - env(safe-area-inset-bottom)); padding: 8px; }
  .viewer-bar { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
  .viewer-actions .button { display: none; }
  .auth-card { padding: 27px 22px; border-radius: 22px; }
}
@media (min-width: 821px) and (max-width: 1050px) {
  .app { grid-template-columns: 290px minmax(0,1fr); }
  .sidebar { display: none; }
}
