/* Creatinine Unit Converter — layout & visuals */
.hero--cuc { padding-bottom: 2.4rem; }

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

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

.hero.hero--cuc .hero-copy .h1-line {
  display: block;
  text-align: center;
  width: 100%;
  white-space: nowrap;
}

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

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

.hero--cuc .calc-head {
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.hero--cuc .calc-head h2 {
  justify-content: flex-start;
  width: 100%;
  white-space: nowrap;
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
  font-weight: 700;
  gap: 0.5rem;
  color: #fff;
}

.hero--cuc ~ .section .prose h2,
.hero--cuc + .section .prose h2,
#guide .prose h2 {
  font-size: clamp(1.45rem, 4.2vw, 1.85rem);
  font-weight: 750;
  line-height: 1.28;
  color: #0b1622;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

html[data-theme="dark"] #guide .prose h2,
html[data-theme="dark"] #guide .prose .quick-answer h2,
html[data-theme="dark"] .hero--cuc ~ .section .prose h2 {
  color: #eaf2f8;
}

#guide .prose .quick-answer h2 {
  white-space: nowrap;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  font-weight: 750;
  color: #0b1622;
  margin: 0 0 .55rem;
}

#guide .prose,
#guide .prose p,
#guide .prose li,
#guide .prose strong,
#guide .prose h3,
#guide .prose h4,
#guide .prose figcaption,
#guide .prose td,
#guide .prose th,
#guide .prose code {
  color: var(--text-900);
}

#guide .prose p,
#guide .prose li {
  color: var(--text-700);
}

.cuc-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 1.35rem;
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.cuc-col:not(.cuc-col--si) {
  padding: 1rem 0.85rem 1rem 0.35rem;
}

.cuc-col--si {
  padding: 1rem 1.2rem 1rem 0.85rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(23, 195, 170, .06) 0%, transparent 100%);
  border-radius: var(--r-md);
}

.cuc-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-bottom: 1rem;
}

.cuc-col-head h3 {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.4rem);
  font-weight: 750;
  color: var(--text-900);
}

.cuc-badge {
  display: inline-flex;
  align-items: center;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--teal-700);
  border: 1px solid rgba(23, 195, 170, .35);
  background: rgba(23, 195, 170, .12);
}

html[data-theme="dark"] .cuc-badge { color: var(--teal-400); }

.cuc-si-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid rgba(23, 195, 170, .28);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(23, 195, 170, .06);
}

.cuc-si-field .cuc-unit-label {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-900);
  white-space: nowrap;
}

.cuc-si-field .cuc-unit-input {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  color: var(--text-900);
  text-align: right;
  border: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  padding: 0;
  outline: none;
}

html[data-theme="dark"] .cuc-si-field .cuc-unit-input { color: var(--text-900); }

.cuc-si-note {
  margin: .65rem 0 0;
  font-size: .82rem;
  color: var(--text-700);
}

.cuc-conv-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.cuc-conv-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  align-items: center;
  gap: .55rem;
  padding: .55rem .7rem;
  border-radius: var(--r-sm);
  background: rgba(15, 23, 42, .03);
  border: 1px solid var(--line);
}

html[data-theme="dark"] .cuc-conv-row { background: rgba(255, 255, 255, .03); }

.cuc-conv-row .cuc-unit-label {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-900);
}

.cuc-conv-row .cuc-unit-input {
  font-size: 1rem;
  font-weight: 700;
  text-align: right;
  border: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  padding: .15rem 0;
  color: var(--text-900);
  outline: none;
}

.cuc-conv-row:focus-within {
  border-color: rgba(23, 195, 170, .35);
  box-shadow: 0 0 0 2px rgba(23, 195, 170, .12);
}

.cuc-ref-viz {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--paper);
}

.cuc-ref-viz h3 {
  margin: 0 0 .75rem;
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-900);
}

.cuc-ref-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ok-soft) 0%, var(--ok-soft) 26%, var(--mild-soft) 26%, var(--mild-soft) 53%, var(--warn-soft) 53%, var(--high-soft) 78%, var(--crit-soft) 100%);
  margin-bottom: .45rem;
}

.cuc-ref-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--teal-600);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 2px rgba(23, 195, 170, .35);
  transition: left .25s var(--ease);
}

.cuc-ref-labels {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--text-700);
  margin-bottom: .55rem;
}

.cuc-ref-caption {
  margin: 0;
  font-size: .84rem;
  color: var(--text-700);
  line-height: 1.5;
}

.cuc-formula-live {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.2rem;
  margin-top: 1rem;
  padding: .85rem 1rem;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(60, 147, 255, .35);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .88rem;
  line-height: 1.55;
  color: #eaf2f8;
}

.cuc-formula-live,
.cuc-formula-pair,
.cuc-formula-pair b {
  color: #eaf2f8;
}

.cuc-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}

.cuc-visual-card {
  padding: 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--paper);
  text-align: center;
}

.cuc-visual-card svg {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto .65rem;
}

.cuc-visual-card figcaption {
  font-size: .84rem;
  color: var(--text-700);
  line-height: 1.45;
}

.cuc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0 1.4rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  max-width: 100%;
}

.cuc-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: .88rem;
  color: var(--text-900);
}

.cuc-table th,
.cuc-table td {
  padding: .65rem .85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  color: var(--text-900);
  vertical-align: top;
}

.cuc-table th {
  background: rgba(23, 195, 170, .08);
  font-weight: 700;
  color: var(--text-900);
}

.cuc-table tr:last-child td { border-bottom: none; }

.cuc-table code {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .84rem;
  color: var(--text-900);
  white-space: nowrap;
}

.cuc-h2-clinical {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.35rem;
}

.cuc-h2-clinical .cuc-h2-a,
.cuc-h2-clinical .cuc-h2-b {
  display: inline;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .cuc-h2-clinical {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.06em;
    font-size: clamp(1.02rem, 4.5vw, 1.4rem) !important;
  }
  .cuc-h2-clinical .cuc-h2-a {
    white-space: nowrap;
  }
  .cuc-panel {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .cuc-col--si,
  .cuc-col:not(.cuc-col--si) {
    padding: 0.85rem 0.2rem;
  }
  .cuc-col--si {
    border-right: none;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--line);
  }
  .cuc-conv-row { grid-template-columns: 4.8rem 1fr; }
  .hero--cuc .calc-head h2,
  #guide .prose .quick-answer h2 {
    white-space: nowrap;
  }
  .cuc-table {
    min-width: 0;
    font-size: .86rem;
  }
  .cuc-table thead { display: none; }
  .cuc-table,
  .cuc-table tbody,
  .cuc-table tr,
  .cuc-table td {
    display: block;
    width: 100%;
  }
  .cuc-table tr {
    padding: .75rem .85rem;
    border-bottom: 1px solid var(--line);
  }
  .cuc-table tr:last-child { border-bottom: none; }
  .cuc-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    padding: .28rem 0;
    border: 0;
  }
  .cuc-table td::before {
    content: attr(data-label);
    font-weight: 700;
    flex: 0 0 42%;
    color: var(--text-900);
  }
  .cuc-table td code { white-space: normal; text-align: right; }
}
