:root {
  color-scheme: light;
  --ink: #202a35;
  --muted: #657286;
  --line: #d8dde2;
  --panel: #fffdf9;
  --band: #f3f5f2;
  --accent: #22776f;
  --accent-2: #3f6f9f;
  --accent-3: #8a6f3d;
  --accent-4: #9b5d6a;
  --accent-5: #627d62;
  --warn: #a66f2f;
  --danger: #a8444c;
  --ok: #4f7f5f;
  --soft-teal: #e5f0ed;
  --soft-blue: #e5edf5;
  --soft-gold: #f2ebda;
  --soft-rose: #f3e4e7;
  --soft-sage: #e8eee5;
  --soft-danger: #f5dddd;
  --soft-warn: #f5ecd8;
  --soft-ok: #e2eddf;
  --shadow: 0 10px 30px rgba(32, 42, 53, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eef3f0 0%, var(--band) 260px),
    var(--band);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  background: rgba(255, 253, 249, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.demo-banner {
  padding: 8px 28px;
  background: var(--soft-gold);
  border-bottom: 1px solid #ded2b6;
  color: #745c30;
  font-size: 12px;
  font-weight: 750;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, #fffdf9, #edf4f1);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.brand-mark svg {
  width: 48px;
  height: 48px;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.brand-mark .kidney-main {
  fill: #bd1f36;
  stroke: #8f1629;
  stroke-width: 1.8;
}

.brand-mark .kidney-inner {
  fill: #ee5a63;
  opacity: 0.88;
  stroke: none;
}

.brand-mark .collecting-system {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
}

.brand-mark .ureter-red {
  fill: none;
  stroke: #d7263d;
  stroke-width: 5;
}

.brand-mark .lens,
.brand-mark .handle {
  fill: #fff;
  stroke: #0b376d;
  stroke-width: 4.5;
}

.brand-mark .eye-outline {
  fill: #fff;
  stroke: #0b376d;
  stroke-width: 3;
}

.brand-mark .iris {
  fill: #2d7fb8;
  stroke: #0b376d;
  stroke-width: 1.5;
}

.brand-mark .pupil {
  fill: #0b2a55;
  stroke: none;
}

.brand-mark .highlight {
  fill: #fff;
  stroke: none;
}

.brand-mark .handle {
  stroke: #0b376d;
  fill: none;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand span {
  color: #536577;
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-switch {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.select.compact {
  width: auto;
  min-width: 132px;
  min-height: 36px;
  padding: 7px 9px;
}

.layout {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: calc(100vh - 73px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfaf4;
  padding: 18px;
}

.nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: var(--soft-teal);
  color: #155f59;
}

.main {
  padding: 24px 28px 48px;
}

.app-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(34, 119, 111, 0.24);
  background: var(--soft-teal);
  color: #155f59;
  font-weight: 760;
  box-shadow: 0 8px 22px rgba(32, 42, 53, 0.07);
}

.app-notice.error {
  border-color: rgba(168, 68, 76, 0.28);
  background: var(--soft-danger);
  color: #84343c;
}

.app-notice button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  font-size: 20px;
  line-height: 1;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.view-header h2 {
  margin: 0 0 6px;
  font-size: 26px;
  color: #2f4658;
}

.view-header p {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.patient-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.action-row.capture {
  padding: 8px;
  border: 1px solid rgba(34, 119, 111, 0.2);
  border-radius: 8px;
  background: var(--soft-teal);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.units {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  background: linear-gradient(180deg, #fffdf9 0%, #fff 100%);
}

.panel {
  padding: 18px;
}

.disclosure summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 760;
}

.disclosure summary::marker {
  color: var(--accent);
}

.section-disclosure {
  background: transparent;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.section-disclosure summary {
  padding: 0 4px;
}

.section-disclosure > :not(summary) {
  margin-top: 14px;
}

.nested-grid {
  align-items: start;
}

.card {
  padding: 16px;
}

.unit-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  position: relative;
  overflow: hidden;
  background: #fffdf9;
}

.unit-card::before,
.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--accent);
}

.unit-card:nth-child(1)::before {
  background: var(--accent);
}

.unit-card:nth-child(2)::before {
  background: var(--accent-2);
}

.unit-card:nth-child(3)::before {
  background: var(--accent-4);
}

.unit-card:nth-child(4)::before {
  background: var(--accent-3);
}

.unit-card:nth-child(1) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-teal) 100%);
}

.unit-card:nth-child(2) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-blue) 100%);
}

.unit-card:nth-child(3) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-rose) 100%);
}

.unit-card:nth-child(4) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-gold) 100%);
}

.unit-card h3,
.panel h3,
.card h3 {
  margin: 0;
  font-size: 17px;
  color: #2f4658;
}

.unit-card strong {
  font-size: 34px;
  color: #2f4658;
}

.subtle {
  color: var(--muted);
  font-size: 14px;
}

.metric {
  min-height: 112px;
  text-align: left;
  position: relative;
  overflow: hidden;
  background: #fffdf9;
}

.metric .value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 760;
  color: #2f4658;
}

.metric-clickable {
  cursor: pointer;
}

.metric-clickable:hover,
.metric-clickable:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.14);
}

.metrics .metric:nth-child(5n + 1) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-teal) 100%);
}

.metrics .metric:nth-child(5n + 2) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-blue) 100%);
}

.metrics .metric:nth-child(5n + 3) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-sage) 100%);
}

.metrics .metric:nth-child(5n + 4) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-gold) 100%);
}

.metrics .metric:nth-child(5n + 5) {
  background: linear-gradient(145deg, #fffdf9 0%, var(--soft-rose) 100%);
}

.metrics .metric:nth-child(5n + 1)::before {
  background: var(--accent);
}

.metrics .metric:nth-child(5n + 1) .value {
  color: var(--accent);
}

.metrics .metric:nth-child(5n + 2)::before {
  background: var(--accent-2);
}

.metrics .metric:nth-child(5n + 2) .value {
  color: var(--accent-2);
}

.metrics .metric:nth-child(5n + 3)::before {
  background: var(--accent-5);
}

.metrics .metric:nth-child(5n + 3) .value {
  color: var(--accent-5);
}

.metrics .metric:nth-child(5n + 4)::before {
  background: var(--accent-3);
}

.metrics .metric:nth-child(5n + 4) .value {
  color: var(--accent-3);
}

.metrics .metric:nth-child(5n + 5)::before {
  background: var(--accent-4);
}

.metrics .metric:nth-child(5n + 5) .value {
  color: var(--accent-4);
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  padding: 10px 11px;
  min-height: 40px;
}

.toolbar .input {
  max-width: 310px;
}

.btn {
  min-height: 40px;
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 650;
}

.btn.secondary {
  background: #e8eef2;
  color: var(--ink);
}

.btn.warn {
  background: var(--warn);
}

.btn.danger {
  background: var(--danger);
}

.btn.small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef1eb;
  color: #3e5062;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.badge.ok {
  background: var(--soft-ok);
  color: var(--ok);
}

.badge.warn {
  background: var(--soft-warn);
  color: var(--warn);
}

.badge.danger {
  background: var(--soft-danger);
  color: var(--danger);
}

.badge.neutral {
  background: #e8eef2;
  color: #3e5062;
}

.flag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chart {
  width: 100%;
  height: 270px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 18px 4px 2px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

.bar-wrap {
  flex: 1;
  min-width: 68px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  text-align: center;
}

.bar {
  width: 100%;
  min-height: 10px;
  border-radius: 8px 8px 3px 3px;
  background: var(--accent-2);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  font-weight: 760;
}

.bar.abnormal {
  background: var(--danger);
}

.bar-wrap:nth-child(2n) .bar:not(.abnormal) {
  background: var(--accent);
}

.bar-wrap:nth-child(3n) .bar:not(.abnormal) {
  background: var(--accent-5);
}

.bar-wrap:nth-child(4n) .bar:not(.abnormal) {
  background: var(--accent-3);
}

.bar-label {
  min-height: 34px;
  font-size: 12px;
  color: var(--muted);
}

.patient-top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail {
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
  background: rgba(255, 253, 249, 0.68);
  border-radius: 7px;
  padding: 8px 9px;
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.detail strong {
  font-size: 14px;
}

.trend {
  min-height: 340px;
  overflow: hidden;
}

.line-chart {
  height: 210px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: stretch;
  overflow: hidden;
}

.line-chart.combined {
  height: 285px;
}

.line-chart.dual-axis {
  grid-template-columns: 76px 1fr 42px;
}

.axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.axis.right {
  text-align: left;
}

.axis.target-axis {
  font-size: 11px;
  line-height: 1.2;
}

.axis.target-axis.right {
  color: transparent;
}

.plot {
  position: relative;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 190px;
  overflow: hidden;
  background: #fbfcf8;
}

.combined .plot {
  min-height: 220px;
}

.trend-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.trend-line {
  fill: none;
  stroke-width: 1.9;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
}

.trend-band {
  opacity: 0.65;
}

.trend-marker {
  cursor: pointer;
}

.trend-marker circle {
  pointer-events: all;
}

.marker-x-line {
  stroke-linecap: round;
  stroke-width: 5px;
  paint-order: stroke;
  vector-effect: non-scaling-stroke;
}

.trend-marker:hover .marker-x-line,
.trend-marker:focus-visible .marker-x-line {
  stroke-width: 7px;
}

.trend-mini-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.trend-mini-row {
  display: grid;
  grid-template-columns: 86px 48px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 118px;
}

.mini-metric {
  display: grid;
  align-content: center;
  gap: 3px;
  font-size: 13px;
}

.mini-metric strong {
  font-size: 15px;
}

.mini-metric span {
  color: var(--muted);
}

.mini-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  padding: 2px 0 8px;
}

.mini-plot {
  position: relative;
  min-height: 112px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  background: #fbfcf8;
}

.mini-date-axis {
  position: relative;
  height: 28px;
  margin-left: 144px;
  color: var(--muted);
  font-size: 11px;
}

.mini-date-axis span {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.trend-tooltip {
  position: fixed;
  z-index: 2000;
  max-width: 160px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
  transform: translateY(-2px);
  transition: opacity 0.08s ease;
  white-space: nowrap;
}

.point {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-2);
  transform: translate(-50%, 50%);
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

.point.abnormal {
  background: var(--danger);
}

.x-point {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  box-shadow: none;
  font-size: 16px;
  line-height: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

.x-point.abnormal {
  background: transparent;
}

.point::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  min-width: 64px;
  max-width: 120px;
  padding: 5px 7px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  white-space: normal;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
  transition: opacity 0.12s ease;
}

.point:hover::after,
.point:focus-visible::after {
  opacity: 1;
}

.target-band {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(21, 128, 61, 0.12);
  border-top: 1px dashed rgba(21, 128, 61, 0.55);
  border-bottom: 1px dashed rgba(21, 128, 61, 0.55);
}

.range-band {
  position: absolute;
  left: 4px;
  right: 4px;
  border-top: 1px dashed currentColor;
  border-bottom: 1px dashed currentColor;
  opacity: 0.45;
  pointer-events: none;
  z-index: 1;
}

.x-axis {
  position: relative;
  height: 34px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
}

.x-axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
}

.check-chip input {
  width: 16px;
  height: 16px;
}

.check-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: #fffefb;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(32, 42, 53, 0.48);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 18px;
  overflow: auto;
}

.modal {
  width: min(900px, 100%);
  background: #fffdf9;
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.32);
  border: 1px solid var(--line);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #f7f4ec;
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.user-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  margin-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 16px;
}

.form-section:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.form-section h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 12px;
  color: #3e5062;
}

.monthly-checklist {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.monthly-checklist h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
}

.monthly-checklist div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.monthly-checklist span,
.monthly-checklist button {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid var(--line);
}

.monthly-checklist button {
  cursor: pointer;
}

.monthly-checklist button:hover,
.monthly-checklist button:focus-visible {
  box-shadow: 0 0 0 3px rgba(166, 111, 47, 0.16);
}

.monthly-checklist .done {
  color: #3f6f4c;
  background: var(--soft-ok);
  border-color: #c9dac4;
}

.monthly-checklist .missing {
  color: #9a4650;
  background: var(--soft-danger);
  border-color: #e8c6c8;
}

.field-attention {
  border-radius: 8px;
  padding: 8px;
  background: var(--soft-warn);
  outline: 1px solid #e1c98f;
}

.summary-text {
  white-space: pre-wrap;
  line-height: 1.55;
}

.summary-editor {
  min-height: 520px;
  font-family: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
}

.summary-snapshots {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.summary-snapshots h3 {
  font-weight: 800;
  margin-bottom: 10px;
}

.summary-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.summary-snapshot-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffefb;
}

.summary-snapshot-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
}

.summary-snapshot-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.summary-snapshot-label {
  display: grid;
  gap: 1px;
  font-size: 11px;
  color: var(--muted);
}

.summary-snapshot-label strong {
  color: var(--ink);
}

.summary-snapshot-svg {
  width: 100%;
  height: 38px;
  display: block;
}

.data-notes {
  display: grid;
  gap: 12px;
}

.data-notes div {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.data-notes div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.data-notes span {
  color: var(--muted);
  font-size: 14px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 120px 120px 100px 120px;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

.demo-banner.live {
  background: #e8f2ee;
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.22);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(176, 62, 79, 0.08)),
    var(--page);
}

.auth-card {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-brand {
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form h2,
.loading-state h2 {
  margin: 0;
}

.form-error {
  padding: 10px 12px;
  border: 1px solid rgba(176, 62, 79, 0.32);
  background: #f9e7ea;
  color: #8f2737;
  border-radius: 6px;
  font-weight: 700;
}

.code-input {
  max-width: 180px;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
  text-align: center;
}

.mfa-secret-box {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(34, 119, 111, 0.24);
  border-radius: 8px;
  background: var(--soft-teal);
}

.mfa-secret-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.mfa-secret-box strong {
  color: #155f59;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 18px;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .layout,
  .patient-top,
  .grid.units,
  .grid.metrics,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .layout {
    display: block;
  }

  .topbar,
  .view-header {
    flex-direction: column;
    align-items: stretch;
  }

  .main {
    padding: 18px;
  }

  .details,
  .form-grid,
  .settings-row {
    grid-template-columns: 1fr;
  }
}
