/* BauGenie v0.67 – klarere Rechnerführung und nachvollziehbare Vergleiche */

/* CO₂-Einstieg: Auswahl breit, Menge und Faktor sauber nebeneinander. */
.hero-co2-card .co2-feeling-inputs {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
  align-items: end;
  gap: 10px 12px;
}

.hero-co2-card .co2-feeling-inputs label:first-child {
  grid-column: 1 / -1 !important;
}

.hero-co2-card .co2-field-control {
  min-width: 0;
  grid-template-columns: minmax(0,1fr) minmax(78px,auto);
}

.hero-co2-card .co2-field-control > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Rechnerfragen erhalten eine einheitliche, sichtbare Überschrift. */
.home-calc-form > .curve-form-title {
  margin: 6px 0 14px;
  color: var(--navy);
  font-size: clamp(20px,2vw,27px);
  line-height: 1.12;
  letter-spacing: -.025em;
}

/* Der PCF-Einstieg folgt einem ruhigen, linearen Ablauf. */
.pcf-story {
  display: grid !important;
  grid-template-columns: minmax(220px,.85fr) minmax(420px,1.45fr) auto !important;
  align-items: center !important;
  gap: 18px !important;
  padding: 20px !important;
}

body:not(.pwa-standalone) #beton[data-focus-view="tool"] > .container > .pcf-story {
  display: grid !important;
}

.pcf-story > .pcf-story-intro,
.pcf-story > .pcf-story-actions {
  padding: 0 !important;
  background: transparent !important;
}

.pcf-path {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pcf-path li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 9px;
  align-items: center;
  min-height: 76px;
  padding: 11px;
  border: 1px solid #d7e5df;
  border-radius: 7px;
  background: #f4f8f6;
}

.pcf-path li:not(:last-child)::after {
  content: "›";
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -8px;
  width: 15px;
  transform: translateY(-50%);
  color: #a86f16;
  background: #fff;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.pcf-path li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: #f3c44d;
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
}

.pcf-path b,
.pcf-path small {
  display: block;
}

.pcf-path b {
  color: var(--navy);
  font-size: 11px;
  line-height: 1.25;
}

.pcf-path small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.pcf-story-actions {
  display: grid !important;
  min-width: 182px;
}

/* Aktives Bauteil: kompakte Aufteilung von Beton und Stahl. */
.precast-composition {
  width: 100%;
  margin: 15px 0 17px;
  padding-top: 13px;
  border-top: 1px solid #cbdcd4;
}

.precast-composition h4 {
  margin: 0 0 11px;
  color: var(--navy);
  font-size: 12px;
  line-height: 1.35;
}

.composition-row {
  margin: 9px 0;
}

.composition-row > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--navy);
  font-size: 9px;
}

.composition-row > div b {
  text-align: right;
}

.composition-row > i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 7px;
  background: #dce8e3;
}

.composition-row > i > em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.composition-row.steel > i > em {
  background: #d99b30;
}

.precast-composition p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.precast-summary-list {
  margin-top: 18px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.precast-summary-grid {
  display: grid !important;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  gap: 8px !important;
  padding: 0 !important;
  border: 0 !important;
}

.precast-summary-grid > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7faf8;
  font-size: 10px;
}

.precast-summary-grid > div b {
  text-align: left;
}

.precast-summary-grid > div small {
  color: var(--muted);
  font-size: 9px;
}

#precastPanel .toolbar-actions {
  align-items: center;
}

#openMassPartsBtn {
  white-space: nowrap;
}

/* Tabellenbauteile und PCF-Szenarien bekommen eigene Vergleichsflächen. */
.mass-comparison-card,
.pcf-compare {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.mass-comparison-card h3,
.pcf-compare h3 {
  margin: 4px 0;
  color: var(--navy);
  font-size: 20px;
}

.pcf-compare-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.pcf-comparison-list {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
  margin-top: 14px;
}

.pcf-comparison-list article {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.pcf-comparison-list article label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.pcf-comparison-list article input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 7px 8px;
  border: 1px solid #ccd9db;
  border-radius: 5px;
  color: var(--navy);
  font-weight: 800;
}

.pcf-comparison-list article > div {
  display: grid;
  gap: 3px;
}

.pcf-comparison-list article b {
  color: var(--teal-dark);
  font-size: 14px;
}

.pcf-comparison-list article span,
.pcf-comparison-list article small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

@media (max-width: 1050px) {
  .pcf-story {
    grid-template-columns: 1fr !important;
  }
  .pcf-story-actions {
    display: flex !important;
  }
}

@media (max-width: 680px) {
  .hero-co2-card .co2-feeling-inputs {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
  .hero-co2-card .co2-feeling-inputs label:first-child {
    grid-column: 1 / -1 !important;
  }
  .pcf-path,
  .precast-summary-grid,
  .pcf-comparison-list {
    grid-template-columns: 1fr !important;
  }
  .pcf-path li:not(:last-child)::after {
    content: "↓";
    top: auto;
    right: 50%;
    bottom: -11px;
    transform: translateX(50%);
  }
  .pcf-story-actions,
  .pcf-compare-actions {
    display: grid !important;
    min-width: 0;
  }
  .pcf-story-actions > *,
  .pcf-compare-actions > * {
    width: 100%;
  }
  .composition-row > div {
    display: grid;
  }
  .composition-row > div b {
    text-align: left;
  }
}

@media (max-width: 500px) {
  .hero-co2-card .co2-field-control {
    grid-template-columns: minmax(0,1fr);
    gap: 3px;
  }
  .hero-co2-card .co2-field-control > span {
    min-height: 22px;
    font-size: 9px;
  }
}

@media (max-width: 340px) {
  .hero-co2-card .co2-feeling-inputs {
    grid-template-columns: minmax(0,1fr) !important;
  }
  .hero-co2-card .co2-feeling-inputs label:first-child {
    grid-column: auto !important;
  }
}

@media print {
  .pcf-compare,
  .mass-comparison-card,
  #openMassPartsBtn {
    break-inside: avoid;
  }
}
