/* Modularer Wärmebedarfs-Schätzer */
.hd-estimator {
  display: grid;
  gap: 20px;
}

.hd-estimator-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 18px;
  align-items: start;
}

.hd-estimator-layout::after {
  content: "";
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}

.hd-estimator-column {
  min-width: 0;
}

.hd-estimator-section-title {
  margin: 2px 0 18px;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hd-estimator-column-form {
  display: grid;
  gap: 18px;
}

.hd-field {
  min-width: 0;
}

.hd-field-checkbox {
  padding-top: 2px;
}

.hd-field-more[hidden] {
  display: none !important;
}

.hd-renovation-field {
  gap: 8px;
}

.hd-field-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 1px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted-ui-strong);
  letter-spacing: 0.01em;
}

.hd-renovation-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hd-renovation-options .hd-renovation-option {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 0;
  margin: 0;
  padding: 8px 4px 2px;
  cursor: pointer;
}

.hd-renovation-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hd-renovation-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(220, 230, 247, 0.36);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.hd-renovation-dot::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin: 5px;
  border-radius: inherit;
  background: transparent;
  transition: background 0.16s ease;
}

.hd-renovation-label {
  color: rgba(220, 230, 247, 0.72);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
}

.hd-renovation-option:hover .hd-renovation-dot,
.hd-renovation-option input:focus-visible + .hd-renovation-dot {
  border-color: rgba(220, 230, 247, 0.72);
}

.hd-renovation-option input:checked + .hd-renovation-dot {
  border-color: rgba(245, 248, 252, 0.94);
  background: rgba(245, 248, 252, 0.08);
  box-shadow: 0 0 0 3px rgba(245, 248, 252, 0.12), inset 0 1px 0 rgba(255,255,255,0.08);
}

.hd-renovation-option input:checked + .hd-renovation-dot::after {
  background: rgba(245, 248, 252, 0.96);
}

.hd-renovation-option input:checked ~ .hd-renovation-label {
  color: var(--text);
}

.hd-estimator.is-before-renovation .hd-renovation-option input:checked + .hd-renovation-dot {
  border-color: rgba(220, 230, 247, 0.36);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.hd-estimator.is-before-renovation .hd-renovation-option input:checked + .hd-renovation-dot::after {
  background: rgba(220, 230, 247, 0.42);
}

.hd-estimator.is-before-renovation .hd-renovation-option input:checked ~ .hd-renovation-label {
  color: rgba(220, 230, 247, 0.72);
}

.hd-estimator.is-guide-renovation .hd-renovation-options {
  box-shadow: none;
}

.hd-estimator.is-guide-renovation .hd-renovation-dot {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28), inset 0 1px 0 rgba(255,255,255,0.06);
}

.hd-checkbox-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.hd-checkbox-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.hd-checkbox-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(220, 230, 247, 0.62);
}

.hd-checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.hd-estimator-column-widget {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-column: 2;
  gap: 14px;
  align-items: start;
  padding: 0 clamp(5px, 0.5vw, 10px);
}

.hd-widget-stage {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.hd-widget-illustration {
  min-height: 130px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 3px 0 0;
}

.hd-widget-mount {
  position: relative;
  width: min(100%, 255px);
  height: 112px;
}

.hd-widget-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.36s ease;
}

.hd-widget-layer.is-entering {
  opacity: 0;
}

.hd-widget-layer.is-exiting {
  opacity: 0;
}

.hd-widget-layer svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
}

.hd-scale-block {
  position: relative;
  padding-bottom: 58px;
  opacity: 0.38;
  filter: saturate(0.55);
  transition: opacity 0.42s ease, filter 0.42s ease;
}

.hd-estimator.is-scale-ready .hd-scale-block {
  opacity: 1;
  filter: none;
}

.hd-scale-track {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3cd68d 0%, #f3d44f 30%, #ff9f00 55%, #ff5a00 78%, #ff0d68 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

.hd-scale-marker {
  position: absolute;
  left: 100%;
  top: 26px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  transition: left 0.24s ease, opacity 0.16s ease;
}

.hd-scale-marker.is-hidden {
  opacity: 0;
}

.hd-scale-arrow {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 10px solid rgba(245, 248, 252, 0.98);
}

.hd-scale-value {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.hd-scale-meta {
  color: rgba(214, 223, 240, 0.62);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.hd-summary-badge {
  padding: 12px 14px 10px;
  border-radius: 14px;
  border: 1px solid rgba(149, 170, 207, 0.22);
  background: rgba(42, 55, 76, 0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  text-align: center;
}

.hd-summary-label {
  font-size: 0.76rem;
  color: rgba(223, 232, 247, 0.7);
}

.hd-summary-value {
  margin-top: 2px;
  font-size: clamp(1.55rem, 2.2vw, 2.15rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text);
}

.hd-flow-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  justify-items: stretch;
}

.hd-flow-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hd-flow-chart {
  position: relative;
  display: grid;
  gap: 5px;
  padding-top: 8px;
}

.hd-flow-axis {
  position: absolute;
  inset: 0 0 14px;
  pointer-events: none;
}

.hd-flow-axis-line {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 1px;
  height: 100%;
  background: rgba(223, 232, 247, 0.16);
}

.hd-flow-axis-line:first-child {
  background: rgba(223, 232, 247, 0.46);
}

.hd-flow-axis-labels {
  position: relative;
  height: 11px;
  color: rgba(223, 232, 247, 0.54);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
}

.hd-flow-axis-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.hd-flow-card {
  width: 100%;
  text-align: center;
}

.hd-flow-card-space {
  grid-column: 1;
  text-align: left;
}

.hd-flow-card-water {
  grid-column: 2;
  text-align: right;
}

.hd-flow-card.is-hidden,
.hd-flow-segment span.is-hidden {
  display: none;
}

.hd-flow-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #62a7ff;
}

.hd-flow-value {
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #62a7ff;
}

.hd-flow-label-space,
.hd-flow-value-space {
  color: #ff6a00;
}

.hd-flow-stack {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  border-radius: 0 999px 999px 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.hd-flow-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(243, 246, 251, 0.94);
  font-size: 0.78rem;
  font-weight: 700;
  transition: width 0.22s ease;
}

.hd-flow-segment-water {
  min-height: 0;
  min-width: 0;
  background: #58a3ff;
}

.hd-flow-segment-space {
  min-height: 0;
  min-width: 0;
  background: #ff5a00;
}

.hd-flow-segment:first-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

@media (max-width: 1200px) {
  .hd-estimator-layout {
    grid-template-columns: minmax(224px, 260px) minmax(360px, 1fr);
    column-gap: 28px;
    row-gap: 28px;
  }

  .hd-estimator-layout::after {
    display: none;
  }

}

@media (max-width: 900px) {
  .hd-estimator-layout {
    grid-template-columns: 1fr;
    column-gap: 0;
  }

  .hd-estimator-column-widget {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .hd-widget-mount {
    width: min(100%, 285px);
  }

  .hd-flow-column {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .hd-flow-card {
    width: 100%;
  }

  .hd-flow-stack {
    height: 34px;
  }
}

.hd-summary-actions {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}
