/*
 * Projektvertrieb – Rechenbeispiel: neutrales Basis-Layout.
 * Alle Regeln in :where() ohne Spezifität: Themes überschreiben Farben, Schrift und Abstände
 * mit einfachen Klassenselektoren (.calc__…). Farben folgen currentColor.
 */
:where(.pv-calc) { --pv-gap: clamp(20px, 3vw, 40px); --pv-line: color-mix(in srgb, currentColor 25%, transparent); }
:where(.pv-calc .calc__head) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-top: 20px; border-top: 1px solid var(--pv-line); }
:where(.pv-calc .calc__head h3) { margin: 0; }
:where(.pv-calc .calc__teaser) { margin: 6px 0 0; opacity: .8; }
:where(.pv-calc .calc__toggle) {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 18px;
  border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; cursor: pointer;
}
:where(.pv-calc .calc__chevron) {
  width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .3s ease-out;
}
:where(.pv-calc .calc__toggle[aria-expanded="true"] .calc__chevron) { transform: translateY(2px) rotate(-135deg); }

/* Aufklappen ohne feste Höhe */
:where(.pv-calc .calc__body) { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s cubic-bezier(0.23, 1, 0.32, 1); }
:where(.pv-calc .calc__body.is-open) { grid-template-rows: 1fr; }
:where(.pv-calc .calc__inner) { overflow: hidden; min-height: 0; }
:where(.pv-calc .calc__body:not(.is-open) .calc__inner) { visibility: hidden; transition: visibility 0s .5s; }

:where(.pv-calc .calc__tabs) { display: inline-flex; margin-top: 24px; border: 1px solid var(--pv-line); }
:where(.pv-calc .calc__tabs button) { padding: 10px 16px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
:where(.pv-calc .calc__tabs button[aria-selected="true"]) { background: color-mix(in srgb, currentColor 14%, transparent); font-weight: 600; }

:where(.pv-calc .calc__inputs) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px var(--pv-gap); margin-top: 24px; }
:where(.pv-calc .calc__field) { display: grid; gap: 8px; min-width: 0; }
:where(.pv-calc .calc__field[hidden], .pv-calc .calc__panel[hidden]) { display: none; }
:where(.pv-calc .calc__field label) { display: flex; justify-content: space-between; }
:where(.pv-calc .calc__field select) { width: 100%; min-width: 0; min-height: 44px; font: inherit; text-overflow: ellipsis; }
:where(.pv-calc .calc__field input[type="range"]) { width: 100%; height: 36px; margin: 0; }

:where(.pv-calc .calc__panel) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--pv-gap); }
:where(.pv-calc .calc__results) { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--pv-gap); margin: 28px 0 0; }
:where(.pv-calc .calc__panel--invest .calc__results) { grid-column: 1 / span 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
:where(.pv-calc .calc__panel--invest .calc__chart) { grid-column: 3; margin-top: 28px; }
:where(.pv-calc .calc__results div) { padding: 14px 0; border-top: 1px solid var(--pv-line); }
:where(.pv-calc .calc__results dd) { margin: 4px 0 0; font-variant-numeric: tabular-nums; font-size: 1.2em; }
:where(.pv-calc .calc__key dd) { font-size: 1.5em; }

:where(.pv-calc .calc__bars) { display: grid; gap: 10px; align-items: end; height: 150px; padding-top: 16px; border-top: 1px solid var(--pv-line); }
:where(.pv-calc .calc__bar) { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 8px; font-size: 12px; }
:where(.pv-calc .calc__bar-stack) { display: flex; flex-direction: column; justify-content: flex-end; }
:where(.pv-calc .calc__bar-stack span) { display: block; transition: height .6s ease-out; }
:where(.pv-calc .calc__bar-stack .deg, .pv-calc .sw--deg) { background: #a3a897; }
:where(.pv-calc .calc__bar-stack .sonder, .pv-calc .sw--sonder) { background: #b8874f; }
:where(.pv-calc .calc__legend) { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 0; font-size: 12px; }
:where(.pv-calc .sw) { display: inline-block; width: 10px; height: 10px; margin-right: 6px; }

:where(.pv-calc .calc__assumptions) { margin-top: 24px; }
:where(.pv-calc .calc__assumptions summary) { cursor: pointer; }
:where(.pv-calc .calc__disclaimer) { margin-top: 18px; font-size: 12px; line-height: 1.55; opacity: .85; max-width: 78ch; }
:where(.pv-calc .calc__note) { margin-top: 14px; font-size: 12px; opacity: .75; }

@media (max-width: 900px) {
  :where(.pv-calc .calc__inputs, .pv-calc .calc__results, .pv-calc .calc__panel, .pv-calc .calc__panel--invest .calc__results) { grid-template-columns: 1fr; }
  :where(.pv-calc .calc__panel--invest .calc__results, .pv-calc .calc__panel--invest .calc__chart) { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  :where(.pv-calc *) { transition: none !important; }
}
