/* Kidney Failure Risk Equation (KFRE) */

.hero.hero--kfre .hero-copy {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  text-align: center;
}

.hero.hero--kfre .hero-copy .h1-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.06em;
  line-height: 1.08;
  font-size: clamp(1.65rem, 5vw, 2.55rem);
  margin-inline: auto;
  width: 100%;
  color: #fff;
}

.hero.hero--kfre .hero-copy .h1-line {
  display: block;
  text-align: center;
  width: 100%;
}

.hero.hero--kfre h1 {
  color: #fff !important;
}

.hero.hero--kfre .hero-lead {
  text-align: center;
  margin-inline: auto;
  max-width: 62ch;
}

.prose--kfre .quick-answer,
.prose--kfre .quick-answer h2 {
  text-align: left;
}

/* Calculator card title: one line, left-aligned */
.hero--kfre .calc-head {
  justify-content: flex-start;
  text-align: left;
}

.hero--kfre .calc-head h2 {
  justify-content: flex-start;
  width: 100%;
  white-space: nowrap;
  font-size: clamp(0.78rem, 3.4vw, 1.24rem);
  gap: 0.45rem;
}

@media (max-width: 380px) {
  .hero--kfre .calc-head h2 {
    font-size: 0.72rem;
    gap: 0.3rem;
  }
  .hero--kfre .calc-head h2 svg {
    width: 16px;
    height: 16px;
  }
}

.hero--kfre .seg--stacked {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.hero--kfre .seg--stacked label {
  width: 100%;
  text-align: center;
  padding: 0.55rem 0.75rem;
}

@media (max-width: 639px) {
  .hero--kfre .seg--ibw label,
  .hero--kfre .seg--stacked label {
    font-size: 0.82rem;
    padding: 0.5rem 0.55rem;
  }
}

.results--kfre .ibw-big,
.results--kfre .ibw-sub,
.results--kfre .ibw-formula-chip,
.results--kfre .fwd-metric span,
.results--kfre .fwd-metric b,
.results--kfre .ibw-compare li span,
.results--kfre .ibw-compare li b,
.results--kfre .ibw-tip,
.results--kfre .field-note,
.results--kfre h3 {
  color: #eaf2f8;
}

.results--kfre .kfre-dual-result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.results--kfre .kfre-risk-box {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  text-align: center;
}

.results--kfre .kfre-risk-box .ibw-big {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
}

.results--kfre .kfre-risk-box .field-note {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kfre-risk-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 0.45rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(53, 224, 196, 0.16);
  border: 1px solid rgba(53, 224, 196, 0.35);
  color: #dffef6;
}

.kfre-risk-pill[data-tone="mild"] {
  background: rgba(96, 165, 250, 0.16);
  border-color: rgba(96, 165, 250, 0.4);
  color: #dbeafe;
}

.kfre-risk-pill[data-tone="warn"] {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.kfre-risk-pill[data-tone="crit"] {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.kfre-spectrum {
  position: relative;
  height: 8px;
  margin: 0.85rem 0 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #35e0c4 0%, #60a5fa 25%, #f59e0b 55%, #ef4444 85%, #b91c1c 100%);
}

.kfre-spectrum-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0f172a;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.results--kfre .ibw-gauge {
  width: 100%;
  max-width: 7rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.results--kfre .ibw-gauge i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #35e0c4, #f59e0b, #ef4444);
  transition: width 0.35s ease;
}

.results--kfre .ibw-formula-chip {
  display: block;
  margin: 0.85rem 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(53, 224, 196, 0.1);
  border: 1px solid rgba(53, 224, 196, 0.28);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.82rem;
  line-height: 1.45;
  color: #dffef6 !important;
}

.results--kfre .ibw-compare {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.results--kfre .ibw-compare li {
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.results--kfre .ibw-compare li.is-primary {
  border-color: rgba(53, 224, 196, 0.45);
  background: rgba(53, 224, 196, 0.08);
}

.results--kfre .ibw-compare li span {
  font-size: 0.78rem;
  opacity: 0.85;
}

.results--kfre .ibw-compare li b {
  font-size: 1rem;
}

.kfre-viz-grid {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
}

@media (min-width: 720px) {
  .kfre-viz-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kfre-viz-card {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--surface-2, #0a121d);
  border: 1px solid var(--line, rgba(148, 163, 184, 0.2));
}

.kfre-viz-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.kfre-viz-card p {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  color: var(--text-500);
}

/* Mobile-friendly KFRE flow diagram */
.kfre-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.7rem;
  border-radius: 14px;
  background: #0a121d;
  border: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
}

.kfre-flow-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  max-width: 20rem;
}

@media (min-width: 480px) {
  .kfre-flow-inputs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: none;
  }
}

.kfre-flow-inputs span,
.kfre-flow-eq,
.kfre-flow-outs span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.2;
}

.kfre-flow-inputs span {
  background: #1a2a3d;
  border: 1px solid #3c93ff;
  color: #eaf2f8;
}

.kfre-flow-eq {
  width: 100%;
  max-width: 16rem;
  background: #122033;
  border: 1px solid #35e0c4;
  color: #35e0c4;
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.9rem;
}

.kfre-flow-arrow {
  width: 2px;
  height: 14px;
  background: #35e0c4;
  position: relative;
}

.kfre-flow-arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 0;
  margin-left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #35e0c4;
}

.kfre-flow-outs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  width: 100%;
  max-width: 20rem;
}

.kfre-out--2y {
  background: #1a2a3d;
  border: 1px solid #f59e0b;
  color: #fde68a;
}

.kfre-out--5y {
  background: #1a2a3d;
  border: 1px solid #ef4444;
  color: #fecaca;
}

.kfre-threshold-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.kfre-threshold-table th,
.kfre-threshold-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.kfre-threshold-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-500);
}

/* Light theme unit dropdowns */
html:not([data-theme="dark"]) .hero--kfre .ibw-unit-meta .unit-select {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a;
  background-color: rgba(15, 23, 42, 0.04) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230f172a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
}

.hero--kfre .ibw-unit-meta .unit-select {
  color: #eaf2f8 !important;
  -webkit-text-fill-color: #eaf2f8;
  text-align: left;
  text-align-last: left;
  background-color: rgba(255, 255, 255, 0.06) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23eaf2f8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}
