/* Peptivé — Calculadora final progresiva.
   Alcance aislado a .cpf-* para no alterar otras páginas. */

.cpf-hero {
  padding-bottom: var(--s-5);
}

.cpf-route-section,
.cpf-guide-only,
.cpf-manual-flow {
  padding: var(--s-6) 0;
}

.cpf-route-section {
  background: var(--travertine);
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

.cpf-route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  max-width: 920px;
  margin: var(--s-5) auto 0;
}

.cpf-route-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5);
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: var(--r-md);
  background: var(--paper);
}

.cpf-route-card.is-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.cpf-route-number,
.cpf-summary-label {
  font-family: var(--font-body);
  font-weight: var(--weight-body-bold);
  font-size: var(--text-label-size);
  line-height: var(--text-label-line);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--gold-deep);
}

.cpf-route-card h3,
.cpf-guide-result h3,
.cpf-table-intro h3 {
  font-family: var(--font-editorial);
  font-weight: 400;
  font-size: var(--text-heading-m-size);
  line-height: 1.15;
  color: var(--ink-100);
}

.cpf-route-card p {
  color: var(--ink-70);
  line-height: 1.55;
}

.cpf-route-btn {
  margin-top: auto;
  align-self: flex-start;
}

.cpf-guide-only,
.cpf-manual-flow {
  background: var(--travertine-light);
  scroll-margin-top: 80px;
}

.cpf-flow-container {
  max-width: 980px;
}

.cpf-step {
  padding: var(--s-6) 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  scroll-margin-top: 80px;
}

.cpf-step:first-child {
  border-top: 0;
  padding-top: 0;
}

.cpf-step-heading {
  max-width: 760px;
  margin-bottom: var(--s-4);
}

.cpf-step-heading h2 {
  margin: var(--s-1) 0 var(--s-2);
  font-family: var(--font-editorial);
  font-weight: 300;
  font-size: var(--text-heading-l-size);
  line-height: 1.05;
  color: var(--ink-100);
}

.cpf-step-heading p:not(.calc-guide-kicker) {
  color: var(--ink-70);
  line-height: 1.55;
}

.cpf-field-card {
  max-width: 620px;
  padding: var(--s-4);
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: var(--r-md);
  background: var(--paper);
}

.cpf-field-card > label,
.cpf-post-row label {
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--font-body);
  font-weight: var(--weight-body-bold);
  font-size: var(--text-label-size);
  line-height: var(--text-label-line);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-70);
}

.cpf-guide-result,
.cpf-selection-summary,
.cpf-context-strip,
.cpf-dose-result,
.cpf-yield-panel {
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: var(--r-md);
  background: var(--paper);
}

.cpf-guide-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-4);
  padding: var(--s-4);
}

.cpf-guide-result p {
  max-width: 62ch;
  margin-top: var(--s-1);
  color: var(--ink-70);
  line-height: 1.5;
}

/* Corrección visual: tarjeta de selector de producto en Guía Rápida
   (item de QA, 2026-09). Escopado a .cpf-guide-only para no afectar
   .cpf-field-card en Manual/Dosis -- ningún cambio de lógica, contenido
   ni estructura, solo caja editorial + select a ancho completo. */
.cpf-guide-only .cpf-field-card {
  width: min(100%, 620px);
  max-width: 620px;
  box-sizing: border-box;
  padding: clamp(22px, 2.5vw, 32px);
  margin: 0;
}

.cpf-guide-only #cpf-guide-product {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  box-sizing: border-box;
}

.cpf-guide-only .cpf-guide-result {
  width: min(100%, 760px);
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .cpf-guide-only .cpf-field-card,
  .cpf-guide-only .cpf-guide-result {
    width: 100%;
    max-width: none;
  }
}

.cpf-reconstitution-wrap {
  margin-top: var(--s-4);
}

.cpf-table-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

.cpf-inline-link {
  font-weight: var(--weight-body-medium);
  color: var(--gold-deep);
  text-decoration: none;
}

.cpf-inline-link:hover,
.cpf-inline-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cpf-table-scroll {
  overflow-x: auto;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: var(--r-md);
  background: var(--paper);
}

.cpf-reconstitution-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.cpf-reconstitution-table th,
.cpf-reconstitution-table td {
  padding: var(--s-3);
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}

.cpf-reconstitution-table th {
  font-family: var(--font-body);
  font-size: var(--text-label-size);
  line-height: var(--text-label-line);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-50);
  background: var(--travertine);
}

.cpf-reconstitution-table td {
  color: var(--ink-70);
}

.cpf-reconstitution-table td small {
  display: block;
  margin-top: 3px;
  color: var(--ink-50);
}

.cpf-reconstitution-table tr:last-child td {
  border-bottom: 0;
}

.cpf-reconstitution-table tr.is-selected {
  background: color-mix(in srgb, var(--gold) 8%, var(--paper));
}

.cpf-reconstitution-table tr.is-unavailable {
  color: var(--ink-50);
  background: color-mix(in srgb, var(--travertine) 40%, var(--paper));
}

.cpf-select-recon {
  min-height: 40px;
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--ink-30);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-family: var(--font-body);
  font-weight: var(--weight-body-medium);
  color: var(--ink-100);
  cursor: pointer;
}

.cpf-select-recon:hover,
.cpf-select-recon:focus-visible {
  border-color: var(--ink-100);
}

.cpf-reconstitution-table tr.is-selected .cpf-select-recon {
  background: var(--ink-100);
  color: var(--paper);
}

.cpf-unavailable-label,
.cpf-table-note {
  color: var(--ink-50);
  font-size: var(--text-body-s-size, 0.875rem);
}

.cpf-table-note {
  margin-top: var(--s-2);
}

.cpf-selection-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding: var(--s-4);
}

.cpf-summary-value {
  margin-top: var(--s-1);
  font-family: var(--font-editorial);
  font-size: var(--text-body-l-size);
  color: var(--ink-100);
}

.cpf-context-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  margin-bottom: var(--s-4);
  padding: var(--s-3);
  color: var(--ink-70);
}

.cpf-context-strip span:first-child {
  font-weight: var(--weight-body-bold);
  color: var(--ink-100);
}

.cpf-dose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  align-items: start;
}

.cpf-custom-dose[hidden] {
  display: none !important;
}

.cpf-dose-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-2);
  align-items: center;
}

.cpf-dose-result {
  margin-top: var(--s-4);
  padding: var(--s-4);
}

.cpf-result-primary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
}

.cpf-result-value {
  margin-top: var(--s-1);
  font-family: var(--font-editorial);
  font-size: var(--text-heading-m-size);
  color: var(--ink-100);
}

.cpf-error-notice {
  margin-top: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--color-error);
  border-radius: var(--r-sm);
  color: var(--color-error);
  line-height: 1.45;
}

.cpf-syringe-choice {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

.cpf-syringe-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-2);
}

.cpf-syringe-btn {
  min-height: 44px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--ink-30);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-family: var(--font-body);
  color: var(--ink-100);
  cursor: pointer;
}

.cpf-syringe-btn:hover,
.cpf-syringe-btn:focus-visible,
.cpf-syringe-btn.is-active {
  border-color: var(--ink-100);
}

.cpf-syringe-btn.is-active {
  background: var(--ink-100);
  color: var(--paper);
}

.cpf-single-syringe {
  margin-top: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--travertine);
}

.cpf-single-syringe-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-3);
}

.cpf-syringe-reading {
  font-family: var(--font-editorial);
  font-size: var(--text-heading-m-size);
  color: var(--ink-100);
}

.cpf-syringe-track {
  position: relative;
  height: 56px;
  margin-top: var(--s-3);
  overflow: hidden;
  border: 1px solid var(--ink-30);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(10% - 1px),
      color-mix(in srgb, var(--ink) 20%, transparent) calc(10% - 1px),
      color-mix(in srgb, var(--ink) 20%, transparent) 10%
    ),
    var(--paper);
}

.cpf-syringe-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: color-mix(in srgb, var(--gold) 24%, transparent);
}

.cpf-syringe-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  transform: translateX(-1px);
  background: var(--gold-deep);
}

.cpf-syringe-scale {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s-1);
  font-size: var(--text-label-size);
  color: var(--ink-50);
}

.cpf-syringe-warning {
  margin-top: var(--s-2);
  color: var(--color-error);
  line-height: 1.45;
}

.cpf-download-area {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

.cpf-download-btn {
  min-width: 220px;
}

.cpf-download-area p {
  margin-top: var(--s-2);
  color: var(--ink-50);
  font-size: var(--text-body-s-size, 0.875rem);
}

.cpf-yield-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}

.cpf-yield-mode {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  min-height: 132px;
  padding: var(--s-4);
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: var(--r-md);
  background: var(--paper);
  cursor: pointer;
}

.cpf-yield-mode span {
  font-family: var(--font-editorial);
  font-size: var(--text-body-l-size);
  color: var(--ink-100);
}

.cpf-yield-mode small {
  font-family: var(--font-body);
  font-size: var(--text-body-m-size);
  line-height: 1.5;
  color: var(--ink-70);
}

.cpf-yield-mode:hover,
.cpf-yield-mode:focus-visible,
.cpf-yield-mode.is-active {
  border-color: var(--gold);
}

.cpf-yield-mode.is-active {
  box-shadow: 0 0 0 1px var(--gold);
}

.cpf-yield-panel {
  margin-top: var(--s-4);
  padding: var(--s-4);
}

.cpf-yield-panel .cpf-result-primary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cpf-post-help {
  margin: var(--s-3) 0;
  color: var(--ink-70);
}

.cpf-post-rows {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.cpf-post-row {
  display: grid;
  grid-template-columns: 1fr 1fr 130px auto;
  gap: var(--s-2);
  align-items: end;
  padding: var(--s-3);
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
  border-radius: var(--r-sm);
  background: var(--travertine-light);
}

.cpf-post-row label {
  margin-bottom: var(--s-1);
}

.cpf-post-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink-30);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 1.2rem;
  cursor: pointer;
}

.cpf-add-application {
  width: 100%;
  min-height: 44px;
  margin-top: var(--s-2);
  border: 1px dashed var(--ink-30);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-70);
  cursor: pointer;
}

.cpf-post-results {
  margin-top: var(--s-4);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cpf-procedure-guide {
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .cpf-route-grid,
  .cpf-dose-grid,
  .cpf-yield-mode-grid {
    grid-template-columns: 1fr;
  }

  .cpf-route-card {
    padding: var(--s-4);
  }

  .cpf-step-heading h2 {
    font-size: var(--text-heading-l-size);
  }

  .cpf-selection-summary,
  .cpf-result-primary,
  .cpf-yield-panel .cpf-result-primary,
  .cpf-post-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cpf-guide-result,
  .cpf-table-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .cpf-syringe-buttons {
    flex-direction: column;
  }

  .cpf-syringe-btn {
    width: 100%;
  }

  .cpf-post-row {
    grid-template-columns: 1fr 1fr;
  }

  .cpf-post-remove {
    justify-self: end;
  }
}

@media (max-width: 430px) {
  .cpf-selection-summary,
  .cpf-result-primary,
  .cpf-yield-panel .cpf-result-primary,
  .cpf-post-results {
    grid-template-columns: 1fr;
  }

  .cpf-field-card,
  .cpf-dose-result,
  .cpf-yield-panel {
    padding: var(--s-3);
  }

  .cpf-dose-input-row {
    grid-template-columns: 1fr;
  }

  .cpf-post-row {
    grid-template-columns: 1fr;
  }

  .cpf-single-syringe-head {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Contención estricta de la tabla en viewports angostos: la tabla conserva
   sus columnas legibles, pero el desplazamiento horizontal vive dentro
   de su propio contenedor y nunca expande el documento. */
.cpf-flow-container,
.cpf-reconstitution-wrap,
.cpf-table-scroll {
  min-width: 0;
  max-width: 100%;
}

.cpf-table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.cpf-manual-flow,
.cpf-guide-only {
  overflow-x: clip;
}

@media (max-width: 760px) {
  .cpf-table-scroll {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .cpf-reconstitution-table,
  .cpf-reconstitution-table tbody,
  .cpf-reconstitution-table tr,
  .cpf-reconstitution-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .cpf-reconstitution-table {
    width: 100%;
    min-width: 0;
  }

  .cpf-reconstitution-table thead {
    display: none;
  }

  .cpf-reconstitution-table tr {
    margin-bottom: var(--s-3);
    padding: var(--s-3);
    border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
    border-radius: var(--r-md);
    background: var(--paper);
  }

  .cpf-reconstitution-table tr.is-selected {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
  }

  .cpf-reconstitution-table tr.is-unavailable {
    background: color-mix(in srgb, var(--travertine) 45%, var(--paper));
  }

  .cpf-reconstitution-table td {
    display: grid;
    grid-template-columns: minmax(100px, 0.85fr) minmax(0, 1.15fr);
    gap: var(--s-2);
    align-items: start;
    padding: var(--s-2) 0;
    border: 0;
  }

  .cpf-reconstitution-table td::before {
    content: attr(data-label);
    font-family: var(--font-body);
    font-weight: var(--weight-body-bold);
    font-size: var(--text-label-size);
    line-height: var(--text-label-line);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--ink-50);
  }

  .cpf-reconstitution-table td[data-label=""] {
    display: block;
    padding-top: var(--s-3);
  }

  .cpf-reconstitution-table td[data-label=""]::before {
    content: none;
  }

  .cpf-reconstitution-table td[colspan] {
    display: grid;
  }

  .cpf-select-recon {
    width: 100%;
  }
}
