:root {
  --ip-ink: #17262b;
  --ip-muted: #526269;
  --ip-line: #cfdadd;
  --ip-paper: #ffffff;
  --ip-ground: #f3f6f5;
  --ip-teal: #0f6d68;
  --ip-red: #a33431;
  --ip-blue: #315e9d;
  --ip-gold: #8b6500;
  --ip-violet: #70508c;
  --ip-green: #337247;
}

.ip-body {
  color: var(--ip-ink);
  background: var(--ip-ground);
}

.ip-page {
  --bg-red: var(--ip-red);
  --bg-green: var(--ip-green);
  --bg-blue: var(--ip-blue);
  --bg-gold: var(--ip-gold);
  --bg-violet: var(--ip-violet);
  --bg-ground: var(--ip-ground);
  --bg-line: var(--ip-line);
}

.ip-page p,
.ip-page li,
.ip-page dd {
  font-size: 1.08rem;
  line-height: 1.72;
}

.ip-hero {
  border-top-color: var(--ip-teal);
}

.ip-kicker {
  color: var(--ip-teal);
}

.ip-live {
  border-left-color: var(--ip-red);
}

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

.ip-live-metrics dd {
  color: var(--ip-red);
  overflow-wrap: anywhere;
}

.ip-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--ip-teal);
  border-color: var(--ip-teal);
}

.ip-pipeline {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, auto));
  align-items: stretch;
  margin: 0 0 30px;
  border-top: 4px solid var(--ip-teal);
  background: var(--ip-paper);
}

.ip-pipeline > div {
  min-width: 0;
  padding: 20px 16px;
  border: 1px solid var(--ip-line);
  border-top: 0;
}

.ip-pipeline > i {
  align-self: center;
  width: 22px;
  color: var(--ip-muted);
}

.ip-pipeline strong,
.ip-pipeline span {
  display: block;
}

.ip-pipeline strong {
  margin-bottom: 7px;
  color: var(--ip-teal);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.14rem;
}

.ip-pipeline span {
  color: var(--ip-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.ip-principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 34px;
  border: 1px solid var(--ip-line);
  background: var(--ip-paper);
}

.ip-principles > div {
  min-height: 125px;
  padding: 20px;
  border-right: 1px solid var(--ip-line);
}

.ip-principles > div:last-child {
  border-right: 0;
}

.ip-principles strong,
.ip-principles span {
  display: block;
}

.ip-principles strong {
  margin-bottom: 8px;
  color: var(--ip-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
}

.ip-principles span {
  color: var(--ip-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.ip-index-overview {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.45fr);
  gap: 24px;
  margin: 0 0 26px;
}

.ip-gauge,
.ip-formula {
  min-width: 0;
  border: 1px solid var(--ip-line);
  background: var(--ip-paper);
}

.ip-gauge {
  position: relative;
  display: flex;
  min-height: 370px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ip-gauge svg {
  display: block;
  width: min(330px, 100%);
  height: 190px;
  overflow: visible;
}

.ip-gauge path {
  fill: none;
  stroke-linecap: round;
  stroke-width: 22;
}

.ip-gauge-track {
  stroke: #e1e7e9;
}

.ip-gauge-value {
  stroke: var(--ip-teal);
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 700ms ease, stroke 250ms ease;
}

.ip-gauge > strong {
  position: absolute;
  top: 138px;
  color: var(--ip-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.5rem;
  line-height: 1;
}

.ip-gauge > span {
  max-width: 330px;
  margin-top: -10px;
  color: var(--ip-ink);
  font-size: 1.16rem;
  font-weight: 760;
  line-height: 1.45;
  text-align: center;
}

.ip-gauge > small {
  margin-top: 10px;
  color: var(--ip-muted);
  font-size: 1rem;
}

.ip-formula {
  padding: 28px;
  border-top: 4px solid var(--ip-blue);
}

.ip-formula h3 {
  margin: 0 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.72rem;
}

.ip-formula dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
}

.ip-formula dl > div {
  min-height: 108px;
  padding: 15px;
  border-left: 4px solid var(--ip-green);
  background: var(--ip-ground);
}

.ip-formula dl > div:nth-child(2) { border-left-color: var(--ip-red); }
.ip-formula dl > div:nth-child(3) { border-left-color: var(--ip-gold); }
.ip-formula dl > div:nth-child(4) { border-left-color: var(--ip-violet); }
.ip-formula dl > div:nth-child(5) { border-left-color: var(--ip-blue); }

.ip-formula dt {
  color: var(--ip-muted);
  font-size: 1rem;
  font-weight: 750;
}

.ip-formula dd {
  margin: 7px 0 0;
  color: var(--ip-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.76rem;
  font-weight: 700;
}

.ip-score-bands {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 36px;
  border: 1px solid var(--ip-line);
  background: var(--ip-paper);
}

.ip-score-bands > div {
  min-height: 170px;
  padding: 18px;
  border-top: 5px solid var(--ip-red);
  border-right: 1px solid var(--ip-line);
}

.ip-score-bands > div:nth-child(2) { border-top-color: var(--ip-gold); }
.ip-score-bands > div:nth-child(3) { border-top-color: var(--ip-blue); }
.ip-score-bands > div:nth-child(4) { border-top-color: var(--ip-green); }
.ip-score-bands > div:nth-child(5) { border-top-color: var(--ip-violet); border-right: 0; }

.ip-score-bands strong,
.ip-score-bands span,
.ip-score-bands small {
  display: block;
}

.ip-score-bands strong {
  color: var(--ip-red);
  font-size: 1.28rem;
}

.ip-score-bands span {
  margin: 7px 0;
  font-size: 1.04rem;
  font-weight: 780;
  line-height: 1.42;
}

.ip-score-bands small {
  color: var(--ip-muted);
  font-size: 0.96rem;
  line-height: 1.48;
}

.ip-zone-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 24px;
  border: 1px solid var(--ip-line);
  background: var(--ip-paper);
}

.ip-zone-card {
  position: relative;
  min-height: 225px;
  padding: 19px 16px 17px;
  overflow: hidden;
  border-right: 1px solid var(--ip-line);
}

.ip-zone-card:last-child { border-right: 0; }
.ip-zone-card[data-zone="predicate"] { background: #edf5f4; }

.ip-zone-card::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--zone-height, 0%);
  content: "";
  background: rgba(15, 109, 104, 0.13);
  pointer-events: none;
}

.ip-zone-card > * { position: relative; }

.ip-zone-card strong,
.ip-zone-card span,
.ip-zone-card small {
  display: block;
}

.ip-zone-card strong {
  color: var(--ip-teal);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
}

.ip-zone-card .ip-zone-share {
  margin: 13px 0 4px;
  color: var(--ip-red);
  font-size: 1.95rem;
  font-weight: 780;
}

.ip-zone-card span {
  color: var(--ip-muted);
  font-size: 0.96rem;
  line-height: 1.45;
}

.ip-zone-card small {
  margin-top: 10px;
  color: var(--ip-ink);
  font-size: 0.94rem;
  font-weight: 680;
}

.ip-live-table-shell {
  margin: 0 0 34px;
  overflow-x: auto;
  border: 1px solid var(--ip-line);
  background: var(--ip-paper);
}

.ip-live-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.ip-live-table th,
.ip-live-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ip-line);
  text-align: left;
}

.ip-live-table th {
  color: var(--ip-muted);
  background: #edf2f2;
  font-size: 0.96rem;
}

.ip-live-table td strong {
  color: var(--ip-red);
  font-size: 1.14rem;
}

.ip-bar-track {
  display: block;
  width: 100%;
  min-width: 150px;
  height: 12px;
  overflow: hidden;
  background: #e2e8e9;
}

.ip-bar-track > i {
  display: block;
  height: 100%;
  background: var(--ip-teal);
}

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

.ip-construction-card {
  min-width: 0;
  min-height: 235px;
  padding: 18px;
  border: 1px solid var(--ip-line);
  border-top: 5px solid var(--ip-teal);
  background: var(--ip-paper);
}

.ip-construction-card:nth-child(2) { border-top-color: var(--ip-blue); }
.ip-construction-card:nth-child(3) { border-top-color: var(--ip-violet); }
.ip-construction-card:nth-child(4) { border-top-color: var(--ip-gold); }
.ip-construction-card:nth-child(5) { border-top-color: var(--ip-red); }

.ip-construction-card h3 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.35;
}

.ip-construction-card > strong {
  display: block;
  color: var(--ip-red);
  font-size: 2.15rem;
}

.ip-construction-card > small {
  display: block;
  margin-bottom: 13px;
  color: var(--ip-muted);
  font-size: 0.96rem;
}

.ip-construction-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.ip-construction-card dl > div {
  padding: 8px;
  background: var(--ip-ground);
}

.ip-construction-card dt { color: var(--ip-muted); font-size: 0.86rem; }
.ip-construction-card dd { margin: 2px 0 0; font-size: 1rem; font-weight: 760; }

.ip-nesting-diagram {
  margin: 0 0 34px;
  padding: 24px;
  border: 1px solid var(--ip-line);
  background: var(--ip-paper);
}

.ip-nest {
  padding: 18px;
  border: 2px solid var(--ip-teal);
  background: #f7faf9;
}

.ip-nest + .ip-nest,
.ip-nest .ip-nest {
  margin-top: 15px;
}

.ip-nest-middle { border-color: var(--ip-violet); background: #faf8fc; }
.ip-nest-inner { border-color: var(--ip-gold); background: #fbfaf4; }

.ip-nest strong,
.ip-nest span { display: block; }
.ip-nest strong { font-size: 1.22rem; }
.ip-nest span { margin-top: 5px; color: var(--ip-muted); font-size: 1rem; }

.ip-profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 0 0 34px;
}

.ip-profile-layout > section {
  min-width: 0;
  border: 1px solid var(--ip-line);
  background: var(--ip-paper);
}

.ip-profile-layout > section > h3 {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ip-line);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
}

.ip-profile-list { margin: 0; padding: 0; list-style: none; }

.ip-profile-list li {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.5fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ip-line);
}

.ip-profile-list li:last-child { border-bottom: 0; }
.ip-profile-list strong { font-size: 1.02rem; }
.ip-profile-list small { color: var(--ip-muted); font-size: 0.9rem; }
.ip-profile-list b { color: var(--ip-red); font-size: 1.16rem; }

.ip-model-grid {
  display: grid;
  gap: 22px;
  margin: 0 0 36px;
}

.ip-model-card {
  min-width: 0;
  padding: 25px;
  border: 1px solid var(--ip-line);
  border-left: 5px solid var(--ip-blue);
  background: var(--ip-paper);
}

.ip-model-card:nth-child(3n+2) { border-left-color: var(--ip-teal); }
.ip-model-card:nth-child(3n) { border-left-color: var(--ip-violet); }

.ip-model-card > header {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.ip-model-card > header > span {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: #fff;
  background: var(--ip-blue);
  font-weight: 800;
}

.ip-model-card header p { margin: 0 0 3px; color: var(--ip-muted); font-size: 0.95rem; }
.ip-model-card h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.58rem; }

.ip-model-card > dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.ip-model-card > dl > div {
  min-width: 0;
  padding: 16px;
  border-top: 3px solid var(--ip-line);
  background: var(--ip-ground);
}

.ip-model-card dt { margin-bottom: 7px; color: var(--ip-teal); font-weight: 800; }
.ip-model-card dd { margin: 0; color: var(--ip-ink); font-size: 1.02rem; line-height: 1.64; }

.ip-model-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  background: var(--ip-line);
  border: 1px solid var(--ip-line);
}

.ip-model-flow > div { padding: 14px; background: var(--ip-paper); }
.ip-model-flow strong, .ip-model-flow span { display: block; }
.ip-model-flow strong { margin-bottom: 5px; color: var(--ip-red); font-size: 1.02rem; }
.ip-model-flow span { color: var(--ip-muted); font-size: 0.96rem; line-height: 1.5; }

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

.ip-chart-card {
  min-width: 0;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--ip-line);
  background: var(--ip-paper);
}

.ip-chart-card figcaption {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  min-height: 110px;
}

.ip-chart-card figcaption > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #fff;
  background: var(--ip-teal);
  font-weight: 800;
}

.ip-chart-card h3 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; }
.ip-chart-card figcaption p { margin: 0; color: var(--ip-muted); font-size: 0.98rem; line-height: 1.5; }

.ip-chart-stage {
  position: relative;
  min-height: 320px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--ip-line);
  background: #fafcfc;
}

.ip-chart-stage svg { display: block; width: 100%; min-height: 320px; }
.ip-chart-stage text { fill: var(--ip-muted); font-family: Arial, sans-serif; font-size: 14px; }

.ip-reading-note {
  margin: 15px 0 0;
  padding: 13px 15px;
  border-left: 4px solid var(--ip-gold);
  color: var(--ip-muted);
  background: #faf8ef;
  font-size: 0.98rem !important;
  line-height: 1.58 !important;
}

.ip-witness-status {
  margin-bottom: 18px;
  padding: 13px 16px;
  border-left: 4px solid var(--ip-teal);
  background: var(--ip-paper);
  font-size: 1.02rem;
  font-weight: 700;
}

.ip-witness-grid .bg-witness blockquote {
  font-size: 1.16rem;
  line-height: 1.68;
}

.ip-insights article p { font-size: 1.04rem; }

.ip-glossary dt { font-size: 1.08rem; }
.ip-glossary dd { font-size: 1.02rem; line-height: 1.64; }

.ip-local-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-left: 4px solid var(--ip-violet);
  color: var(--ip-muted);
  background: #f8f6fa;
}

.ip-local-note svg { flex: 0 0 22px; color: var(--ip-violet); }

.ip-loading {
  margin: 0;
  padding: 24px;
  color: var(--ip-muted);
  font-size: 1rem !important;
}

.ip-error {
  color: var(--ip-red) !important;
  background: #fff4f3;
}

@media (max-width: 1180px) {
  .ip-pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ip-pipeline > i { display: none; }
  .ip-pipeline > div { border-top: 1px solid var(--ip-line); }
  .ip-zone-map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ip-zone-card:nth-child(3) { border-right: 0; }
  .ip-zone-card:nth-child(-n+3) { border-bottom: 1px solid var(--ip-line); }
  .ip-construction-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .ip-live-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ip-principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ip-principles > div:nth-child(2) { border-right: 0; }
  .ip-principles > div:nth-child(-n+2) { border-bottom: 1px solid var(--ip-line); }
  .ip-index-overview,
  .ip-profile-layout,
  .ip-chart-grid { grid-template-columns: 1fr; }
  .ip-score-bands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ip-score-bands > div { border-bottom: 1px solid var(--ip-line); }
  .ip-score-bands > div:nth-child(2n) { border-right: 0; }
  .ip-score-bands > div:last-child { grid-column: 1 / -1; }
  .ip-model-card > dl { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .ip-page p,
  .ip-page li,
  .ip-page dd { font-size: 1.02rem; line-height: 1.68; }
  .ip-live-metrics,
  .ip-pipeline,
  .ip-principles,
  .ip-zone-map,
  .ip-construction-grid,
  .ip-score-bands,
  .ip-formula dl,
  .ip-model-flow { grid-template-columns: 1fr; }
  .ip-principles > div,
  .ip-zone-card,
  .ip-score-bands > div { border-right: 0; border-bottom: 1px solid var(--ip-line); }
  .ip-score-bands > div:last-child { grid-column: auto; }
  .ip-index-overview { grid-template-columns: minmax(0, 1fr); }
  .ip-gauge { min-height: 340px; }
  .ip-formula,
  .ip-model-card,
  .ip-chart-card { padding: 18px; }
  .ip-chart-card figcaption { min-height: 0; margin-bottom: 14px; }
  .ip-chart-stage { min-height: 280px; }
  .ip-chart-stage svg {
    width: 650px;
    min-width: 650px;
    min-height: 300px;
  }
  .ip-profile-list li { grid-template-columns: 1fr auto; }
  .ip-profile-list .ip-bar-track { grid-column: 1 / -1; }
  .ip-tabs button span { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .ip-gauge-value { transition: none; }
}
