/* CLIEAIR — Constitutional Health Index visual. Navy/gold system; score-driven
   red->green. Designed to read as undeniable: big numbers, ranked, sourced. */

#health-index { background: var(--clieair-navy, #0d1b2a); color: var(--clieair-cream, #faf8f5); }
#health-index .rg-section__title,
#health-index .ci-h3 { color: var(--clieair-gold, #c9a227); }
.ci-lede { max-width: 60ch; color: #c7d0db; font-size: 1.05rem; line-height: 1.5; margin: 0 0 1.6rem; }
.ci-h3 { font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; margin: 2rem 0 .9rem; }

/* National hero */
.ci-national {
  display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center;
  background: linear-gradient(135deg, #14233a, #0d1b2a);
  border: 1px solid #243349; border-left: 5px solid var(--ci-c, #22c55e);
  border-radius: 14px; padding: 1.6rem 1.8rem;
}
.ci-nat__score { font-size: 4.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ci-nat__outof { font-size: 1.6rem; color: #6b7a8d; font-weight: 600; }
.ci-nat__tier { font-size: 1.3rem; font-weight: 700; letter-spacing: .02em; }
.ci-nat__label { color: #9fb0c2; font-size: .95rem; margin: .15rem 0 .7rem; }
.ci-nat__nums { color: #c7d0db; font-size: 1rem; line-height: 1.6; }
.ci-national .ci-bar { grid-column: 1 / -1; }

/* Bars */
.ci-bar { height: 14px; background: #1c2b40; border-radius: 8px; overflow: hidden; margin-top: .6rem; }
.ci-bar--sm { height: 9px; }
.ci-bar__fill { height: 100%; border-radius: 8px; transition: width .6s ease; }

/* Federal chambers */
.ci-fed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.ci-fed { background: #14233a; border: 1px solid #243349; border-radius: 12px; padding: 1.1rem 1.2rem; }
.ci-fed__name { color: #9fb0c2; font-size: .95rem; font-weight: 600; }
.ci-fed__score { font-size: 2.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ci-fed__out { font-size: 1rem; color: #6b7a8d; }
.ci-fed__tier { font-weight: 700; font-size: 1rem; }
.ci-fed__nums { color: #aebccd; font-size: .9rem; margin-top: .2rem; }

/* State leaderboard */
.ci-states__head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .6rem; }
.ci-sort { display: flex; gap: .4rem; }
.ci-sort__btn {
  background: #14233a; color: #aebccd; border: 1px solid #2a3a52; border-radius: 999px;
  padding: .35rem .9rem; font-size: .82rem; cursor: pointer; font-family: inherit;
}
.ci-sort__btn.is-on { background: var(--clieair-gold, #c9a227); color: #0d1b2a; border-color: var(--clieair-gold, #c9a227); font-weight: 700; }
.ci-legend, .ci-row {
  display: grid; grid-template-columns: 34px minmax(120px, 1.4fr) 2.2fr auto 1.1fr;
  gap: .8rem; align-items: center;
}
.ci-legend { color: #6b7a8d; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; padding: .3rem .2rem; border-bottom: 1px solid #243349; }
.ci-legend > :first-child { grid-column: 1 / 3; }
.ci-row { padding: .55rem .2rem; border-bottom: 1px solid #1a2840; }
.ci-row:hover { background: #11203500; background: rgba(201,162,39,.05); }
.ci-row__rank { color: #6b7a8d; font-variant-numeric: tabular-nums; text-align: right; font-size: .9rem; }
.ci-row__name { font-weight: 600; }
.ci-row__sub { display: block; color: #6b7a8d; font-size: .75rem; font-weight: 400; }
.ci-row__bar { height: 11px; background: #1c2b40; border-radius: 6px; overflow: hidden; }
.ci-row__fill { height: 100%; border-radius: 6px; }
.ci-row__score { font-weight: 800; font-size: 1.25rem; font-variant-numeric: tabular-nums; text-align: right; }
.ci-row__tier { display: block; font-size: .68rem; color: #8190a3; font-weight: 600; text-transform: uppercase; }
.ci-row__nums { font-size: .95rem; color: #aebccd; text-align: right; font-variant-numeric: tabular-nums; }
.ci-row__msr { display: block; color: #6b7a8d; font-size: .72rem; }

/* Trajectory / trend */
.ci-trend__row { display: grid; grid-template-columns: minmax(140px, 1fr) 3fr; gap: 1rem; align-items: center; padding: .7rem .2rem; border-bottom: 1px solid #1a2840; }
.ci-trend__name { font-weight: 600; color: #cdd7e2; }
.ci-trend__pts { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.ci-trend__pt { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.ci-trend__pt > b { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ci-trend__per { font-size: .78rem; color: #9fb0c2; }
.ci-trend__msr { font-size: .68rem; color: #6b7a8d; }
.ci-trend__arrow { font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }
.ci-trend__note { grid-column: 1 / -1; color: #6b7a8d; font-size: .8rem; font-style: italic; }

.ci-method { color: #8190a3; font-size: .82rem; line-height: 1.5; max-width: 80ch; margin-top: 1.8rem; border-top: 1px solid #243349; padding-top: 1rem; }

@media (max-width: 640px) {
  .ci-national { grid-template-columns: 1fr; text-align: center; }
  .ci-legend, .ci-row { grid-template-columns: 26px 1.3fr 1.6fr auto; }
  .ci-row__nums, .ci-legend > .ci-row__nums { display: none; }
}
