/* Hearts360 — Clinical Command design system
   Deep ink + teal clinical accent. Distinctive type. Soft atmospheric ground. */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Sora:wght@500;600;700&display=swap');

:root {
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;

  --ink: #0b1f33;
  --ink-2: #16324f;
  --ink-muted: #5a7189;
  --paper: #f3f7fa;
  --surface: #ffffff;
  --surface-2: #eaf1f6;
  --line: rgba(11, 31, 51, 0.08);
  --line-strong: rgba(11, 31, 51, 0.14);

  --brand: #0b3d66;
  --brand-2: #0a6aa6;
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --accent-glow: rgba(13, 148, 136, 0.35);

  --ok: #159947;
  --ok-soft: rgba(21, 153, 71, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --info: #0284c7;
  --info-soft: rgba(2, 132, 199, 0.12);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(11, 31, 51, 0.04), 0 8px 24px rgba(11, 31, 51, 0.06);
  --shadow-lg: 0 4px 12px rgba(11, 31, 51, 0.06), 0 20px 48px rgba(11, 31, 51, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 8% -10%, rgba(13, 148, 136, 0.14), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(10, 106, 166, 0.12), transparent 50%),
    radial-gradient(800px 400px at 50% 100%, rgba(11, 61, 102, 0.06), transparent 55%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--brand-2); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent); }
button, select, input { font: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
}

/* ── Shell / Header ── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.ms-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(115deg, #071828 0%, #0b3d66 48%, #0a6aa6 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(7, 24, 40, 0.25);
}

.ms-banner-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.ms-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.ms-brand:hover { color: #fff; opacity: 0.92; }
.ms-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  padding: 4px;
}
.ms-wordmark { display: flex; flex-direction: column; line-height: 1.1; }
.ms-word-medisoft {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}
.ms-word-hearts {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.ms-word-360 { color: #5eead4; }

.ms-region-nav {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}
.ms-region-nav .hover-button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s var(--ease);
}
.ms-region-nav .hover-button:hover,
.ms-region-nav:focus-within .hover-button {
  background: rgba(255,255,255,0.16);
}
.ms-region-nav .nav-hover-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 260px;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  padding: 0.75rem;
  z-index: 200;
}
.ms-region-nav:hover .nav-hover-content,
.ms-region-nav:focus-within .nav-hover-content { display: block; animation: rise 0.25s var(--ease); }
.ms-region-nav .hover-button-hover-state {
  display: none;
}
.ms-region-nav .region-search {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  margin-bottom: 0.5rem;
  background: var(--surface-2);
}
.ms-region-nav .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}
.ms-region-nav .nav-list a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.9rem;
}
.ms-region-nav .nav-list a:hover,
.ms-region-nav .nav-list a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.ms-top-nav { margin-left: auto; display: flex; gap: 0.35rem; }
.ms-top-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}
.ms-top-nav a:hover,
.ms-top-nav a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.link-dashboards {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 64px;
  z-index: 90;
}
.link-dashboards ul {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  list-style: none;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}
.link-dashboards a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.85rem 1rem;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.link-dashboards a span {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.link-dashboards li.active-link a,
.link-dashboards a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ── Main layout ── */
.main, main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
}

.page-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  animation: rise 0.5s var(--ease) both;
}
.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
}
.page-hero .eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.page-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
}
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }

/* ── View controls ── */
.view-controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
  animation: rise 0.55s var(--ease) 0.05s both;
}
.view-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
}
.control-group { display: flex; flex-direction: column; gap: 0.35rem; min-width: 140px; }
.control-group label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.control-group select,
.field-select {
  appearance: none;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%235a7189' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 0.75rem center / 12px no-repeat;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  color: var(--ink);
  min-width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.control-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.view-btn {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.view-btn.active,
.view-btn:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(11,31,51,0.08);
}
.view-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ── KPI strip ── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise 0.55s var(--ease) both;
}
.kpi:nth-child(1) { animation-delay: 0.08s; }
.kpi:nth-child(2) { animation-delay: 0.12s; }
.kpi:nth-child(3) { animation-delay: 0.16s; }
.kpi:nth-child(4) { animation-delay: 0.2s; }
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}
.kpi.ok::before { background: var(--ok); }
.kpi.warn::before { background: var(--warn); }
.kpi.danger::before { background: var(--danger); }
.kpi.info::before { background: var(--info); }
.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}
.kpi-sub {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* ── Panels / cards ── */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 1rem;
  animation: rise 0.5s var(--ease) both;
}
.section-title h2 {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.section-title h2 .sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.section-title p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.grid-2-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  animation: rise 0.55s var(--ease) both;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.panel:hover {
  box-shadow: var(--shadow-lg);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.panel-head h3 {
  font-size: 0.95rem;
  font-weight: 600;
}
.panel-desc {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  max-width: 42ch;
}
.panel-stat {
  margin-bottom: 0.75rem;
}
.panel-stat .big {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.panel-stat .big.ok { color: var(--ok); }
.panel-stat .big.warn { color: var(--warn); }
.panel-stat .big.danger { color: var(--danger); }
.panel-stat .big.accent { color: var(--accent); }
.panel-stat .big.info { color: var(--info); }
.panel-stat .detail {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.chart-box {
  position: relative;
  flex: 1;
  min-height: 200px;
  height: 220px;
}
.chart-box.tall { height: 300px; min-height: 280px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }

/* ── Cascade bars ── */
.cascade {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  align-items: end;
  margin-top: 0.5rem;
  flex: 1;
}
.cascade-col {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.cascade-track {
  width: 100%;
  max-width: 56px;
  height: 160px;
  background: var(--surface-2);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.cascade-fill {
  width: 100%;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--accent) 0%, #0f766e 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.4rem;
  min-height: 8%;
  transition: height 0.8s var(--ease);
}
.cascade-fill.reg { background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%); }
.cascade-fill.care { background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 100%); }
.cascade-fill.ctrl { background: linear-gradient(180deg, #4ade80 0%, #159947 100%); }
.cascade-col strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.cascade-col span {
  font-size: 0.7rem;
  color: var(--ink-muted);
  line-height: 1.3;
}

/* ── Outcome tiles ── */
.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.outcome {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid transparent;
}
.outcome h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}
.outcome .pct {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}
.outcome .pct.ok { color: var(--ok); }
.outcome .pct.warn { color: var(--warn); }
.outcome .pct.danger { color: var(--danger); }
.outcome .note { font-size: 0.8rem; color: var(--ink-muted); margin-top: 0.25rem; }
.outcome .mini-chart { height: 120px; margin-top: 0.75rem; }

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th,
table th.head-bg {
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}
td, th {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
tbody tr:hover { background: rgba(13, 148, 136, 0.04); }
tbody tr:last-child td,
tbody tr:last-child th { border-bottom: 0; }
.text-right { text-align: right; }
.totals th, .totals td {
  font-weight: 700;
  background: var(--surface-2);
}
.badge {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-2); color: var(--ink-muted); }

.demo-bar {
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  display: inline-block;
  min-width: 2.5rem;
  text-align: center;
}
.demo-bar.f { background: rgba(94, 234, 212, 0.45); }
.demo-bar.m { background: rgba(125, 211, 252, 0.55); }

.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--brand-2);
}
.link-cta:hover { color: var(--accent); }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-muted);
}
.empty-state h3 { margin-bottom: 0.35rem; color: var(--ink); }

.facility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.facility-actions a {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.facility-actions a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.about-grid {
  display: grid;
  gap: 1rem;
}
.about-grid .panel h3 { margin-bottom: 0.65rem; }
.about-grid .panel p { color: var(--ink-muted); margin: 0 0 0.75rem; }
.about-grid .panel p:last-child { margin-bottom: 0; }

.app-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chart-empty,
.no-data-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
  background: rgba(243, 247, 250, 0.55);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.chart-toolbar {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}
.chart-toolbar button {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chart-toolbar button.active,
.chart-toolbar button:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(11,31,51,0.08);
}

.defs-panel { margin-bottom: 1rem; }
.defs-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}
.defs-list li { margin-bottom: 0.45rem; }
.defs-list strong { color: var(--ink); }

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

.mini-chart {
  position: relative;
  height: 110px;
  margin-top: 0.75rem;
}

@media print {
  .ms-banner, .link-dashboards, .view-controls, .app-footer, .chart-toolbar { display: none !important; }
  body { background: #fff; }
  .panel { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
  .kpi-strip, .grid-2, .grid-3 { break-inside: avoid; }
}

@media (max-width: 980px) {
  .cascade-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Legacy class bridges so old markup still looks okay */
.columns-header { /* unused — kept for safety */ display: none; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.large-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}
.bp-controlled { color: var(--ok); }
.bp-uncontrolled { color: var(--warn); }
.three-month-ltfu { color: var(--danger); }
.twelve-month-ltfu { color: var(--danger); }
.under-care { color: var(--accent); }
.registrations { color: var(--info); }
.overdue { color: var(--warn); }
.overdue-called { color: var(--warn); }
.overdue-returned { color: #7c3aed; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-2-equal, .outcome-grid { grid-template-columns: 1fr; }
  .cascade { grid-template-columns: repeat(4, 1fr); }
  .desktop-only { display: none; }
  .link-dashboards { top: 56px; }
}

@media (max-width: 640px) {
  .kpi-strip { grid-template-columns: 1fr; }
  .cascade { grid-template-columns: repeat(2, 1fr); }
  .cascade-track { height: 120px; }
  .ms-banner-inner { padding: 0.75rem 1rem; }
  .mobile-only { display: block; }
  .page-hero h1 { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
