:root {
  color-scheme: light;
  --ink: #102236;
  --muted: #667789;
  --navy: #071a2f;
  --navy-2: #102f4d;
  --teal: #0b7772;
  --teal-bright: #25b7a8;
  --teal-soft: #e6f7f4;
  --blue-soft: #eaf1fb;
  --paper: #f4f7fa;
  --surface: #ffffff;
  --line: #dce5eb;
  --red: #bd2230;
  --red-soft: #fff0f1;
  --amber: #a76000;
  --amber-soft: #fff5dd;
  --green: #087a52;
  --shadow: 0 16px 42px rgba(15, 34, 54, .09);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #45aee7; outline-offset: 3px; }
a { color: var(--teal); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.9rem, 5vw, 2.7rem); letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 1.08rem; letter-spacing: -.015em; }

.prototype-note { background: #f9dc69; color: #382e08; padding: 7px 16px; text-align: center; font-size: .78rem; font-weight: 750; letter-spacing: .01em; }
.app-frame { min-height: 100vh; }
.security-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 10%, #dff8f4, transparent 42%), var(--paper); }
.security-card { width: min(460px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.security-card h1 { margin-bottom: 16px; }
.security-icon { width: 88px; height: 88px; margin-bottom: 15px; border-radius: 24px; }
.security-view { display: grid; gap: 10px; }
.security-view p { color: var(--muted); line-height: 1.5; }
.form-message { min-height: 1.3em; margin: 8px 0 0; color: var(--muted); font-size: .84rem; }
.desktop-rail { display: none; }
.app-main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px 110px; }
.mobile-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -16px 12px; padding: 12px 16px; background: rgba(244,247,250,.88); border-bottom: 1px solid rgba(220,229,235,.75); backdrop-filter: blur(18px); }
.mobile-brand, .brand { display: flex; align-items: center; gap: 9px; color: var(--navy); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.mobile-brand small, .brand small { color: var(--muted); font-weight: 600; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(145deg, var(--teal-bright), var(--teal)); color: white; box-shadow: 0 7px 16px rgba(11,119,114,.22); }
.header-actions { display: flex; gap: 8px; }
.icon-button, .safety-button { min-height: 42px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); font-weight: 760; cursor: pointer; }
.icon-button { width: 42px; }
.safety-button { padding: 0 14px; color: var(--red); border-color: #f1c4c8; background: var(--red-soft); }
.desktop-safety { display: none; }

.page { animation: page-in .25s ease-out both; }
@keyframes page-in { from { opacity: .25; transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 22px 2px 18px; }
.eyebrow { margin-bottom: 4px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.treatment-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 230px; padding: 24px; border-radius: 26px; color: white; background: radial-gradient(circle at 90% 15%, rgba(54,211,194,.36), transparent 34%), linear-gradient(135deg, var(--navy), var(--navy-2)); box-shadow: 0 22px 48px rgba(7,26,47,.22); }
.treatment-hero::after { content: ""; position: absolute; width: 160px; height: 160px; right: -45px; bottom: -85px; border-radius: 50%; border: 30px solid rgba(255,255,255,.05); }
.treatment-hero > div, .treatment-hero > button { position: relative; z-index: 2; }
.today-treatment-character { position: absolute; z-index: 1; right: 0; bottom: -5%; width: min(41%, 185px); height: 94%; object-fit: contain; object-position: bottom right; opacity: .32; filter: drop-shadow(0 15px 16px rgba(0,0,0,.32)); pointer-events: none; }
.hero-label { margin-bottom: 8px; color: #a9dcd8; font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.finish-number { display: flex; align-items: baseline; gap: 9px; margin-bottom: 5px; }
.finish-number strong { font-size: clamp(3.4rem, 14vw, 5.4rem); line-height: .9; letter-spacing: -.08em; font-variant-numeric: tabular-nums; }
.finish-number span { max-width: 70px; color: #cfdae5; font-size: .9rem; line-height: 1.15; }
.treatment-hero > div > p:last-child { color: #dbe8f2; }
.progress-ring { position: relative; z-index: 1; display: grid; place-content: center; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, var(--navy-2) 55%, transparent 57%), conic-gradient(var(--teal-bright) 0 18%, rgba(255,255,255,.15) 18% 100%); text-align: center; }
.progress-ring span { font-size: 1.35rem; font-weight: 850; }
.progress-ring small { color: #c9d7e4; }
.hero-link { position: relative; z-index: 1; grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; background: rgba(255,255,255,.08); color: white; font-weight: 750; cursor: pointer; }

.dashboard-grid, .content-grid, .info-grid { display: grid; gap: 14px; margin-top: 14px; }
.surface { padding: 19px; border: 1px solid rgba(214,225,232,.88); border-radius: 21px; background: var(--surface); box-shadow: 0 8px 28px rgba(15,34,54,.055); }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.card-heading .eyebrow { margin-bottom: 3px; }
.text-button, .read-more { min-height: 38px; padding: 0; border: 0; background: transparent; color: var(--teal); font-weight: 800; cursor: pointer; }
.next-event { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 17px; background: var(--teal-soft); text-align: left; cursor: pointer; }
.next-event > span:not(.date-tile) { display: grid; gap: 4px; }
.next-event small, .quick-actions small { color: var(--muted); }
.date-tile { display: grid; place-content: center; width: 58px; height: 58px; border-radius: 15px; background: white; text-align: center; box-shadow: 0 5px 15px rgba(15,34,54,.08); }
.date-tile strong { font-size: 1.4rem; }
.date-tile small { font-size: .65rem; text-transform: uppercase; }
.chevron { color: var(--teal); font-size: 1.8rem; }
.compact-rows { margin-top: 9px; }
.compact-rows button { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; width: 100%; min-height: 48px; padding: 0 5px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.compact-rows strong { font-size: .82rem; }

.blood-chip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.blood-chip { display: grid; gap: 2px; min-height: 92px; padding: 12px; border: 1px solid var(--line); border-top-width: 4px; border-radius: 16px; background: #fbfcfd; text-align: left; cursor: pointer; }
.blood-chip strong { font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.blood-chip small { color: var(--muted); font-weight: 700; }
.blood-chip.improving { border-top-color: var(--green); }
.blood-chip.improving strong { color: var(--green); }
.blood-chip.worsening { border-top-color: var(--red); }
.blood-chip.worsening strong { color: var(--red); }
.blood-chip.steady { border-top-color: var(--teal); }
.blood-chip:last-child { grid-column: 1 / -1; }
.result-colour-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.result-colour-key span { display: inline-flex; align-items: center; gap: 6px; }
.result-colour-key span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.result-colour-key .good { color: var(--green); }
.result-colour-key .poor { color: var(--red); }
.results-key { margin: 1px 2px 13px; }
.clinical-note { margin: 13px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.quick-actions { display: grid; gap: 8px; }
.quick-actions button { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 8px; border: 0; border-radius: 15px; background: #f8fafb; text-align: left; cursor: pointer; }
.quick-actions button > span:last-child { display: grid; gap: 3px; }
.quick-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; font-size: 1.4rem; font-weight: 500; }
.quick-icon.blood { color: #4f46ad; background: #efedff; }
.quick-icon.weight { color: var(--teal); background: var(--teal-soft); }
.quick-icon.note { color: #9a5d00; background: var(--amber-soft); }
.empty-reading { display: flex; align-items: baseline; gap: 7px; }
.empty-reading span { font-size: 3rem; font-weight: 800; }
.weight-snapshot > p { color: var(--muted); }
.secondary-action, .primary-action { min-height: 44px; padding: 0 15px; border-radius: 13px; font-weight: 800; cursor: pointer; }
.secondary-action { border: 1px solid var(--line); background: white; color: var(--teal); }
.primary-action { border: 1px solid var(--teal); background: var(--teal); color: white; }

.treatment-banner { position: relative; overflow: hidden; display: grid; min-height: 260px; border-radius: 25px; background: linear-gradient(145deg, var(--navy), #163f61); color: white; box-shadow: var(--shadow); }
.banner-content { position: relative; z-index: 2; align-self: end; padding: 25px; background: linear-gradient(90deg, rgba(7,26,47,.98) 0 55%, transparent); }
.banner-content h2 { margin-bottom: 4px; font-size: 1.65rem; }
.treatment-banner img { position: absolute; right: 3%; top: 4%; width: min(43%, 330px); height: 92%; object-fit: contain; object-position: center; opacity: .76; filter: drop-shadow(0 14px 15px rgba(0,0,0,.28)); }
.linear-progress { height: 9px; margin-top: 22px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.16); }
.linear-progress span { display: block; height: 100%; border-radius: inherit; background: var(--teal-bright); }
.progress-labels { display: flex; justify-content: space-between; margin-top: 7px; color: #bfd0df; font-size: .75rem; }
.progress-labels strong { color: white; }
.large-date { margin: 23px 0 7px; font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; }
.summary-list { margin: 8px 0 0; }
.summary-list div { display: flex; justify-content: space-between; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.summary-list div:last-child { border-bottom: 0; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 800; }
.status { padding: 5px 8px; border-radius: 8px; font-size: .75rem; }
.status.amber { color: var(--amber); background: var(--amber-soft); }
.status-button { min-height: 34px; border: 0; cursor: pointer; font-weight: 800; }
.status-button.ordered { color: var(--green); background: var(--teal-soft); }
.timeline-card { margin-top: 14px; }
.cycle-track { display: grid; grid-template-columns: repeat(15, minmax(28px, 1fr)); gap: 5px; overflow-x: auto; padding-bottom: 8px; }
.cycle-track span { display: grid; place-items: center; min-width: 30px; height: 42px; border-radius: 10px; background: var(--blue-soft); color: #51667c; font-size: .75rem; font-weight: 800; }
.cycle-track span.done { background: #d5efeb; color: var(--teal); }
.cycle-track span.current { background: var(--teal); color: white; box-shadow: 0 6px 16px rgba(11,119,114,.24); }
.cycle-track span:nth-child(n+4) { background-image: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(11,119,114,.08) 6px 12px); }
.timeline-legend { display: flex; gap: 18px; margin-top: 10px; color: var(--muted); font-size: .75rem; }
.timeline-legend span { display: flex; align-items: center; gap: 6px; }
.timeline-legend i { width: 9px; height: 9px; border-radius: 50%; background: #d5efeb; }
.timeline-legend span:last-child i { background: repeating-linear-gradient(-45deg, #d5efeb 0 3px, #92c9c0 3px 6px); }

.segmented-control { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-width: 350px; margin-bottom: 15px; padding: 4px; border-radius: 14px; background: #e5ebef; }
.segmented-control button { min-height: 40px; border: 0; border-radius: 11px; background: transparent; font-weight: 800; cursor: pointer; }
.segmented-control button.active { background: white; color: var(--teal); box-shadow: 0 3px 10px rgba(15,34,54,.09); }
.results-summary-row { display: grid; grid-auto-columns: minmax(145px, 1fr); grid-auto-flow: column; gap: 9px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.result-summary { display: grid; gap: 3px; min-height: 112px; padding: 14px; border: 1px solid var(--line); border-top-width: 4px; border-radius: 17px; background: white; text-align: left; scroll-snap-align: start; cursor: pointer; }
.result-summary strong { font-size: 1.8rem; }
.result-summary small { color: var(--muted); }
.result-summary.improving { border-top-color: var(--green); }
.result-summary.improving strong { color: var(--green); }
.result-summary.worsening { border-top-color: var(--red); }
.result-summary.worsening strong { color: var(--red); }
.result-summary.active { box-shadow: 0 0 0 2px rgba(11,119,114,.32); }
.chart-surface { margin-bottom: 14px; }
.chart-heading { align-items: flex-end; }
.chart-heading label { display: grid; gap: 4px; color: var(--muted); font-size: .7rem; font-weight: 800; }
select, input, textarea { min-height: 44px; border: 1px solid #bdcbd5; border-radius: 11px; background: white; color: var(--ink); padding: 0 11px; }
textarea { padding-top: 10px; resize: vertical; }
.chart-wrap { position: relative; width: 100%; overflow: hidden; }
#bloodChart { display: block; width: 100%; min-height: 250px; }
.chart-tooltip { position: absolute; z-index: 5; max-width: 210px; padding: 8px 10px; border-radius: 10px; background: var(--navy); color: white; font-size: .78rem; box-shadow: var(--shadow); pointer-events: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 6px; color: var(--muted); font-size: .76rem; font-weight: 700; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--series-color); }
.chart-legend i.healthy-band { width: 18px; border: 1px solid #2d9a67; border-radius: 3px; background: rgba(45,154,103,.25); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child { position: sticky; left: 0; z-index: 2; background: white; text-align: left; box-shadow: 8px 0 12px rgba(255,255,255,.9); }
thead th { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.weight-empty { padding-block: 50px; text-align: center; }
.empty-illustration { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 23px; background: var(--teal-soft); color: var(--teal); font-size: 2rem; }
.weight-empty p { max-width: 430px; margin: 10px auto 20px; color: var(--muted); }

.info-panel { position: relative; display: grid; grid-template-columns: 46px 1fr auto; gap: 13px; padding: 19px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 8px 28px rgba(15,34,54,.05); }
.info-panel.important { border-left: 4px solid var(--red); }
.info-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); font-weight: 900; }
.info-panel.important .info-icon { color: var(--red); background: var(--red-soft); }
.info-panel h2 { margin-bottom: 10px; }
.info-panel p { margin-bottom: 7px; color: var(--muted); line-height: 1.5; }
.info-body { white-space: pre-wrap; }
.number-value { color: var(--ink) !important; font-size: 1.3rem; font-weight: 800; letter-spacing: .04em; }
.panel-actions { display: flex; gap: 4px; align-self: start; }
.panel-actions button { width: 40px; height: 40px; border: 0; border-radius: 11px; background: #f5f7f9; color: var(--muted); cursor: pointer; }

.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); min-height: calc(69px + env(safe-area-inset-bottom)); padding: 7px 5px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(210,222,230,.9); background: rgba(255,255,255,.92); backdrop-filter: blur(20px); }
.bottom-nav .nav-link { display: grid; place-items: center; align-content: center; gap: 2px; min-height: 50px; border: 0; border-radius: 13px; background: transparent; color: var(--muted); font-size: .69rem; font-weight: 750; cursor: pointer; }
.nav-icon { display: grid; place-items: center; width: 26px; height: 23px; font-size: 1.25rem; font-weight: 800; }
.bottom-nav .nav-link.active { color: var(--teal); background: var(--teal-soft); }

.app-dialog { width: min(680px, calc(100% - 22px)); max-height: min(760px, calc(100vh - 28px)); padding: 0; border: 0; border-radius: 25px; background: white; color: var(--ink); box-shadow: 0 30px 90px rgba(7,26,47,.33); }
.app-dialog::backdrop { background: rgba(6,21,36,.58); backdrop-filter: blur(5px); }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 20px 21px 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.dialog-close { width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 14px; background: white; font-size: 1.7rem; cursor: pointer; }
#dialogBody { padding: 20px 21px 25px; }
.dialog-stack { display: grid; gap: 14px; }
.dialog-copy { color: var(--muted); line-height: 1.55; }
.choice-row, .form-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.choice-button { flex: 1; min-width: 120px; min-height: 52px; border: 1px solid var(--line); border-radius: 15px; background: white; font-weight: 850; cursor: pointer; }
.choice-button.red { border-color: #e6aab0; color: var(--red); background: var(--red-soft); }
.choice-button.amber { border-color: #efca77; color: var(--amber); background: var(--amber-soft); }
.traffic-image { display: block; width: 100%; margin-top: 14px; border-radius: 13px; }
.form-grid { display: grid; gap: 12px; }
.form-grid label { display: grid; gap: 6px; font-size: .83rem; font-weight: 800; }
.appointment-form-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.appointment-form-row label { display: grid; gap: 6px; color: var(--muted); font-size: .75rem; font-weight: 800; }
.appointment-form-row button { min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--teal); font-weight: 800; }
.appointment-urgent { color: var(--red) !important; font-weight: 850 !important; }
.date-tile.appointment-urgent { background: var(--red-soft); }
.file-choice { display: grid; place-items: center; padding: 0 14px; }
.file-button { display: inline-grid; place-items: center; padding: 0 15px; }
.dialog-section { padding-top: 16px; border-top: 1px solid var(--line); }
.saved-note { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.saved-note p { margin: 0; white-space: pre-wrap; }
.saved-note button, .photo-grid button, .table-actions button, .weight-history button { border: 0; background: transparent; color: var(--red); font-weight: 800; cursor: pointer; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.photo-grid article { display: grid; gap: 7px; }
.photo-grid img { width: 100%; max-height: 240px; object-fit: contain; border-radius: 12px; background: #eef2f4; }
.table-actions { display: flex; gap: 10px; }
.table-actions button:first-child { color: var(--teal); }
.weight-history { display: grid; }
.weight-history > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; min-height: 50px; border-bottom: 1px solid var(--line); }
.schedule-list { display: grid; gap: 7px; }
.schedule-row { display: grid; grid-template-columns: 60px 1fr; gap: 9px; padding: 11px; border-radius: 13px; background: #f6f8fa; }
.schedule-row.current { color: white; background: var(--teal); }
.schedule-row span { display: flex; justify-content: space-between; gap: 10px; font-size: .83rem; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 92px; transform: translateX(-50%); width: min(420px, calc(100% - 30px)); padding: 12px 16px; border-radius: 13px; background: var(--navy); color: white; text-align: center; box-shadow: var(--shadow); }

@media (min-width: 680px) {
  .dashboard-grid, .content-grid, .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .treatment-hero { grid-template-columns: 1fr auto; }
  .blood-chip-grid { grid-template-columns: repeat(5, 1fr); }
  .blood-chip:last-child { grid-column: auto; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .quick-actions button { align-items: flex-start; flex-direction: column; }
}

@media (min-width: 940px) {
  body { background: #edf2f5; }
  .app-frame { display: grid; grid-template-columns: 238px 1fr; }
  .desktop-rail { position: sticky; top: 29px; height: calc(100vh - 29px); display: flex; flex-direction: column; padding: 24px 16px 18px; border-right: 1px solid var(--line); background: rgba(255,255,255,.92); }
  .brand { margin: 0 8px 26px; font-size: 1.05rem; }
  .rail-links { display: grid; gap: 5px; }
  .rail-links .nav-link { display: flex; align-items: center; gap: 12px; min-height: 49px; padding: 0 13px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); text-align: left; font-weight: 760; cursor: pointer; }
  .rail-links .nav-link.active { color: var(--teal); background: var(--teal-soft); }
  .rail-footer { display: grid; gap: 12px; margin-top: auto; padding: 0 10px; color: var(--muted); font-size: .73rem; }
  .quiet-link { padding: 0; border: 0; background: transparent; color: var(--muted); text-align: left; font-weight: 760; cursor: pointer; }
  .mobile-header, .bottom-nav { display: none; }
  .app-main { padding: 28px 32px 60px; }
  .desktop-safety { display: inline-flex; align-items: center; }
  .page-heading { margin-top: 0; }
  .dashboard-grid { grid-template-columns: 1.25fr .75fr; }
  .blood-snapshot { grid-column: 1 / -1; }
  .treatment-hero { min-height: 245px; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 440px) {
  .page-heading .primary-action { min-height: 40px; padding-inline: 11px; font-size: .78rem; }
  .finish-number strong { font-size: 3.55rem; }
  .progress-ring { width: 88px; height: 88px; }
  .chart-heading { align-items: stretch; flex-direction: column; }
  .chart-heading select { width: 100%; }
  .info-panel { grid-template-columns: 42px 1fr; }
  .panel-actions { grid-column: 2; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --ink: #ecf3f7; --muted: #a9b8c4; --paper: #08131e; --surface: #10202d; --line: #263847; --teal-soft: #123733; --blue-soft: #172b42; --red-soft: #35191d; --amber-soft: #392b12; --shadow: 0 18px 46px rgba(0,0,0,.28); }
  .prototype-note { background: #6c5616; color: #ffecad; }
  .mobile-header, .bottom-nav, .desktop-rail { background: rgba(8,19,30,.9); }
  .mobile-brand, .brand { color: var(--ink); }
  .blood-chip, .quick-actions button, .segmented-control button.active, .result-summary, .info-panel, .panel-actions button, .app-dialog, .dialog-header, .dialog-close, select, input, textarea, .appointment-form-row button { background: var(--surface); }
  .date-tile, th:first-child { background: var(--surface); }
  th:first-child { box-shadow: 8px 0 12px rgba(16,32,45,.95); }
  .segmented-control { background: #1b2c38; }
  .schedule-row { background: #172733; }
}
