:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --paper: #ffffff;
  --ink: #17202a;
  --muted: #64707d;
  --line: #dfe5df;
  --line-strong: #c9d2ca;
  --green: #2f7d5b;
  --green-soft: #e7f3ed;
  --yellow: #b7791f;
  --yellow-soft: #fff4d9;
  --red: #b94a48;
  --red-soft: #fae6e4;
  --blue: #315d8c;
  --blue-soft: #e8f0f8;
  --gray-soft: #eef1f3;
  --shadow: 0 18px 50px rgba(27, 41, 33, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(246, 247, 243, 0.96)),
    var(--bg);
  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;
  letter-spacing: 0;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 44px) 48px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
  gap: 24px;
  align-items: end;
  padding: 10px 0 22px;
}

.brand-block h1 {
  margin: 6px 0 4px;
  font-size: clamp(32px, 5vw, 62px);
  line-height: 0.95;
  font-weight: 760;
}

.brand-block p,
.section-header p,
.source-block,
.metric-helper,
.content-panel p,
.decision-panel p,
.interpretation-panel p,
.callout-panel p,
td,
li {
  color: var(--muted);
}

.brand-block p {
  margin: 0;
  font-size: 18px;
}

.mockup-label,
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 720;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.source-block {
  display: grid;
  gap: 7px;
  justify-items: end;
  text-align: right;
  font-size: 14px;
}

.imh-logo {
  display: block;
  width: min(210px, 100%);
  height: auto;
  margin-bottom: 2px;
}

.source-block span {
  color: var(--ink);
  font-weight: 680;
}

.last-updated {
  color: var(--blue);
  font-weight: 680;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  padding: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 26px rgba(40, 54, 47, 0.06);
  backdrop-filter: blur(14px);
}

.tabs button {
  flex: 1 0 max-content;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: transparent;
  color: #4b5966;
  cursor: pointer;
  white-space: nowrap;
}

.tabs button.active {
  background: #1f2d38;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 45, 56, 0.18);
}

.view {
  display: grid;
  gap: 20px;
}

.view > *,
.section-header > *,
.metric-grid,
.metric-card,
.content-panel,
.decision-panel,
.interpretation-panel,
.callout-panel,
.split-layout > *,
.ops-grid > *,
.foundation-grid > *,
.intake-grid > * {
  min-width: 0;
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 0.55fr);
  gap: 24px;
  align-items: end;
  padding: 10px 0 6px;
}

.section-header h2 {
  margin: 3px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.02;
}

.section-header p {
  margin: 0;
  max-width: 620px;
  font-size: 16px;
  line-height: 1.55;
}

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

.metric-card,
.content-panel,
.decision-panel,
.interpretation-panel,
.callout-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  align-content: space-between;
  min-height: 146px;
  padding: 18px;
  border-top: 4px solid var(--line-strong);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.3;
}

.metric-value {
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
}

.metric-helper {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.35;
}

.tone-good {
  border-top-color: var(--green);
}

.tone-warning {
  border-top-color: #d6a13a;
}

.tone-risk {
  border-top-color: var(--red);
}

.tone-muted {
  border-top-color: #8b97a3;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
}

.split-layout.large-left {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
}

.content-panel,
.decision-panel,
.interpretation-panel,
.callout-panel {
  padding: 20px;
}

.content-panel h3,
.decision-panel h3,
.interpretation-panel h3,
.callout-panel h3 {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.2;
}

.content-panel p,
.decision-panel p,
.interpretation-panel p,
.callout-panel p {
  margin: 0;
  line-height: 1.6;
}

.panel-title-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-title-row h3 {
  margin: 0;
}

.panel-title-row strong {
  color: var(--blue);
  font-size: 24px;
}

.hero-progress,
.bar-track {
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ec;
}

.hero-progress {
  height: 18px;
  border: 1px solid var(--line);
}

.hero-progress span,
.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.decision-panel {
  display: grid;
  align-content: center;
  border-color: #c8d7e8;
  background: linear-gradient(145deg, #ffffff, var(--blue-soft));
}

.interpretation-panel {
  border-color: #d6c69b;
  background: linear-gradient(145deg, #ffffff, #fff8e7);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 14px;
}

th {
  color: #34404c;
  font-size: 12px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f2f5f1;
}

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

td:first-child {
  color: var(--ink);
  font-weight: 680;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 26px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 760;
}

.pill-green {
  color: var(--green);
  background: var(--green-soft);
}

.pill-yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.pill-red {
  color: var(--red);
  background: var(--red-soft);
}

.pill-gray {
  color: #5b6570;
  background: var(--gray-soft);
}

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

.intake-grid .content-panel {
  min-height: 210px;
}

.three-columns {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.25fr) minmax(240px, 0.9fr);
  gap: 16px;
}

ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

li {
  line-height: 1.45;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fbfcfb;
  color: #46525d;
  font-size: 13px;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mini-bars {
  display: grid;
  gap: 14px;
}

.mini-bar-row {
  display: grid;
  gap: 7px;
}

.mini-bar-copy,
.fact-list div {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: baseline;
}

.mini-bar-copy span,
.fact-list span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.mini-bar-copy strong,
.fact-list strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.bar-track {
  height: 9px;
}

.fact-list {
  display: grid;
  gap: 13px;
}

.fact-list.compact {
  gap: 10px;
}

.risk-table {
  padding-bottom: 10px;
}

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

.foundation-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 310px;
}

.foundation-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #1f2d38;
  color: #ffffff;
  font-size: 13px;
  font-weight: 760;
}

.foundation-action {
  margin-top: 16px !important;
  color: var(--blue) !important;
  font-weight: 680;
}

.callout-panel {
  border-color: #d8c188;
  background: linear-gradient(135deg, #ffffff, #fff6dc);
}

@media (max-width: 1280px) {
  .metric-grid,
  .ops-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .three-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell {
    padding-inline: 14px;
  }

  .topbar,
  .section-header,
  .split-layout,
  .split-layout.large-left {
    grid-template-columns: 1fr;
  }

  .source-block {
    justify-items: start;
    text-align: left;
  }

  .imh-logo {
    width: 170px;
  }

  .metric-grid,
  .ops-grid,
  .intake-grid,
  .foundation-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 124px;
  }

  .progress-labels {
    flex-direction: column;
  }

  .tabs {
    position: static;
  }
}
