/* Customer health score figures. This article-local stylesheet loads after resources.css.
   Element+class selectors keep these ahead of the .article-content p / ul / li rules. */

.health-layers,
.health-scorecard,
.health-compare {
  margin: 38px 0;
  padding: 34px 38px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg-muted);
}

/* Figure 1 — product usage is one layer */

.health-layers__grid {
  display: grid;
  grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.health-layers__layer {
  padding: 20px 22px 22px;
  border: 1px dashed #c6d2e2;
  border-radius: 12px;
}

.health-layers__layer--scored {
  border: 1px solid #b6dfc6;
  background: #fff;
}

.health-layers__rule {
  height: 4px;
  margin-bottom: 16px;
  border-radius: 2px;
  background: #cfd9e7;
}

.health-layers__layer--scored .health-layers__rule {
  background: var(--color-accent-green);
}

p.health-layers__eyebrow {
  margin: 0;
  color: #5b6a83;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.health-layers__layer--scored p.health-layers__eyebrow {
  color: #17693f;
}

p.health-layers__title {
  margin: 6px 0 14px;
  color: var(--color-text);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
}

ul.health-layers__items {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.health-layers__items li {
  color: var(--color-text-muted);
  font-size: 15px;
  line-height: 1.45;
}

.health-layers__layer--scored .health-layers__items li {
  color: #243650;
}

.health-layers__review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 22px;
  padding: 22px 26px;
  border-radius: 12px;
  background: var(--color-primary);
}

p.health-layers__review-title {
  margin: 0;
  color: #fff;
  font-size: 21px;
  font-weight: 600;
}

p.health-layers__review-text {
  margin: 0;
  color: #a9bdd8;
  font-size: 16px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* Figure 2 — a transparent scorecard */

.health-scorecard__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 48px;
}

.health-scorecard__head,
.health-scorecard__row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 86px 108px;
  align-items: center;
  gap: 20px;
}

.health-scorecard__head {
  padding-bottom: 12px;
  border-bottom: 1.5px solid #d3ddec;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.health-scorecard__head span:nth-child(3),
.health-scorecard__head span:nth-child(4) {
  text-align: right;
}

.health-scorecard__row {
  padding: 18px 0;
  border-bottom: 1px solid #e5ebf4;
}

.health-scorecard__row:last-child {
  border-bottom: 0;
}

.health-scorecard__row--flag {
  padding-inline: 12px;
  margin-inline: -12px;
  border-radius: 8px;
  background: #fff8e9;
}

.health-scorecard__name {
  color: var(--color-text);
  font-size: 17px;
  font-weight: 600;
}

.health-scorecard__flag {
  display: block;
  margin-top: 3px;
  color: #8a6510;
  font-size: 14px;
  font-weight: 600;
}

.health-scorecard__meter {
  display: flex;
  align-items: center;
  gap: 14px;
}

.health-scorecard__track {
  flex: 1 1 auto;
  height: 16px;
  border-radius: 999px;
  background: #e4ebf5;
}

.health-scorecard__track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-accent-green);
}

.health-scorecard__track--warn {
  background: #eee2c6;
}

.health-scorecard__track--warn span {
  background: #e2a33a;
}

.health-scorecard__meter b {
  flex: 0 0 auto;
  width: 34px;
  color: var(--color-text);
  font-size: 17px;
  font-weight: 700;
}

.health-scorecard__weight {
  color: var(--color-text-muted);
  font-size: 16px;
  text-align: right;
}

.health-scorecard__points {
  color: var(--color-text);
  font-size: 19px;
  font-weight: 700;
  text-align: right;
}

.health-scorecard__total {
  padding: 26px 28px 28px;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  background: #fff;
}

p.health-scorecard__total-label {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

p.health-scorecard__total-value {
  margin: 8px 0 0;
  color: var(--color-text);
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

p.health-scorecard__total-unit {
  margin: 4px 0 20px;
  color: var(--color-text-muted);
  font-size: 15px;
}

.health-scorecard__stack {
  display: flex;
  gap: 3px;
  height: 22px;
  margin-bottom: 12px;
}

.health-scorecard__stack span:first-child {
  border-radius: 5px 0 0 5px;
}

.health-scorecard__stack-rest {
  flex: 1 1 auto;
  border-radius: 0 5px 5px 0;
  background: #e4ebf5;
}

p.health-scorecard__total-note {
  margin: 0;
  color: #243650;
  font-size: 15px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* Figure 3 — same score, different actions */

.health-compare__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.health-compare__card {
  padding: 26px 28px 28px;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  background: #fff;
}

.health-compare__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5ebf4;
}

p.health-compare__name {
  margin: 0;
  color: var(--color-text);
  font-size: 22px;
  font-weight: 600;
}

p.health-compare__score {
  margin: 0 0 0 auto;
  color: var(--color-text);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.health-compare__rows {
  display: grid;
  gap: 14px;
  padding-top: 22px;
}

.health-compare__row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
}

.health-compare__label {
  color: var(--color-text-muted);
  font-size: 15px;
}

.health-compare__label.is-weak {
  color: var(--color-text);
  font-weight: 700;
}

.health-compare__track {
  height: 14px;
  border-radius: 999px;
  background: #eef3fa;
}

.health-compare__track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-accent-green);
}

.health-compare__track--warn { background: #f6e6c8; }
.health-compare__track--warn span { background: #e2a33a; }
.health-compare__track--alert { background: #f6d9d4; }
.health-compare__track--alert span { background: #e07a68; }

.health-compare__row b {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.health-compare__inspect {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--color-bg-muted);
}

.health-compare__inspect--warn { background: #fff8e9; }
.health-compare__inspect--alert { background: #fdf0ed; }

p.health-compare__inspect-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.health-compare__inspect--warn p.health-compare__inspect-label { color: #8a6510; }
.health-compare__inspect--alert p.health-compare__inspect-label { color: #97402f; }

p.health-compare__inspect-text {
  margin: 5px 0 0;
  color: #243650;
  font-size: 16px;
  line-height: 1.5;
}

p.health-compare__note {
  margin: 24px 0 0;
  color: #243650;
  font-size: 17px;
  line-height: 1.6;
  text-wrap: pretty;
}

@media (max-width: 1100px) {
  .health-layers__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-layers__layer--scored {
    grid-column: 1 / -1;
  }

  .health-scorecard__body {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .health-compare__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .health-layers,
  .health-scorecard,
  .health-compare {
    padding: 24px 20px;
  }

  .health-layers__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .health-scorecard__head {
    display: none;
  }

  .health-scorecard__row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    padding: 16px 0;
  }

  .health-scorecard__meter {
    grid-column: 1 / -1;
    order: 3;
  }

  .health-scorecard__weight {
    text-align: left;
  }

  p.health-scorecard__total-value {
    font-size: 54px;
  }

  .health-compare__row {
    grid-template-columns: 110px minmax(0, 1fr) 30px;
  }
}
