/* Kostenrechner: Eingaben in Karten links, das Ergebnis als Kassenzettel rechts.
   Farben: jede Eingabe-Gruppe hat eine Farbfamilie, die im Balken und in den Posten des Zettels wiederkehrt. */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Kopf ---------- */
.page-head h1 em { font-style: normal; color: var(--coral); }
.calc-head { position: relative; overflow: hidden; }
.calc-head .container { position: relative; }
.calc-head-copy { position: relative; z-index: 1; max-width: 700px; }
/* Schmuck: Tasten wie auf einem Taschenrechner. Es sind Knöpfe, also drücken sie sich ein. */
.calc-keys { position: absolute; right: var(--pad); top: 50%; display: grid; grid-template-columns: repeat(3, 68px); gap: 16px 14px; transform: translateY(-50%) rotate(-6deg); }
.calc-keys span {
  --k: var(--card); --k-d: var(--line-2); --k-fg: var(--ink);
  height: 60px; border-radius: 16px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; color: var(--k-fg); background: var(--k);
  box-shadow: 0 6px 0 var(--k-d); transition: transform .09s ease, box-shadow .09s ease; user-select: none;
}
.calc-keys span:hover { transform: translateY(5px); box-shadow: 0 1px 0 var(--k-d); }
.calc-keys .k-sun { --k: var(--sun); --k-d: var(--sun-d); }
.calc-keys .k-blue { --k: var(--blue); --k-d: var(--blue-d); --k-fg: #fff; }
.calc-keys .k-ink { --k: var(--ink); --k-d: #000; --k-fg: #fff; }
.calc-keys .k-wide { grid-column: span 2; }
@media (max-width: 1080px) { .calc-keys { grid-template-columns: repeat(3, 54px); gap: 13px 11px; } .calc-keys span { height: 48px; font-size: 21px; border-radius: 13px; } }
@media (max-width: 900px) { .calc-keys { display: none; } }

/* ---------- Leiste: Währung und Zurücksetzen ---------- */
.calc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 28px; }
.calc-cur { display: flex; align-items: center; gap: 12px; }
.calc-cur-k { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.calc-bar .seg { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.calc-bar .seg button { padding: 8px 16px; font-size: 13px; }
@media (max-width: 480px) { .calc-cur-k { display: none; } .calc-bar { flex-wrap: nowrap; } .calc-bar .seg button { padding: 8px 12px; } .calc-bar .btn { padding: 0 13px; gap: 7px; } }
@media (max-width: 350px) { .calc-bar .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }

/* ---------- Kurzfassung: klebt auf schmalen Bildschirmen unter der Kopfzeile ---------- */
.sumbar { display: none; }
@media (max-width: 900px) {
  .sumbar {
    position: sticky; top: calc(var(--nav-h) + 8px); z-index: 20; display: flex; align-items: center; gap: 18px;
    margin-top: 16px; padding: 9px 9px 12px 18px; border-radius: 18px; background: var(--ink); color: #fff;
    box-shadow: 0 4px 0 #000, 0 14px 28px -10px rgba(22, 24, 31, .45);
    transition: opacity .2s ease, transform .2s ease;
  }
  .sumbar.is-off { opacity: 0; pointer-events: none; transform: translateY(-8px); }
}
.sb-col { display: grid; min-width: 0; }
.sb-k { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #B9BDC9; white-space: nowrap; }
.sb-n { font-family: var(--font-display); font-weight: 600; font-size: 21px; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sb-n.is-profit { color: var(--sun); }
.sumbar:focus-visible { outline-offset: 3px; border-radius: 18px; }
.sb-go { margin-left: auto; width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--sun-d); }
.sumbar:active .sb-go { transform: translateY(3px); box-shadow: 0 0 0 var(--sun-d); }

/* ---------- Raster ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 36px; align-items: start; padding-top: 20px; }
@media (max-width: 1040px) { .calc { grid-template-columns: minmax(0, 1fr) 352px; gap: 24px; } }
@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 16px; } }

/* Hinweis: Werte kommen aus dem Editor */
.ed-note { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 16px 12px 12px; border-radius: 16px; background: var(--mint-t); color: #0A6644; font-size: 15px; line-height: 1.35; }
.ed-note[hidden] { display: none; }
.ed-ic { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--mint); color: #fff; box-shadow: 0 2px 0 #0B7A50; }
.ed-note b { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.ed-vals { margin-left: 6px; font-family: var(--font-mono); font-size: 13px; font-weight: 500; white-space: nowrap; }

/* ---------- Eingabe-Gruppen ---------- */
#groups { display: grid; gap: 18px; }
.grp { --g: var(--blue); --g-t: var(--blue-t); background: var(--card); border-radius: var(--r-card); padding: 22px 24px 24px; box-shadow: inset 0 0 0 1.5px var(--line), 0 5px 0 var(--line-2); }
.grp-energy { --g: #8A6200; --g-t: var(--sun-t); }
.grp-labor { --g: var(--coral-d); --g-t: var(--coral-t); }
.grp-fees { --g: #0B7A50; --g-t: var(--mint-t); }
.grp-head { display: flex; align-items: center; gap: 14px; }
.grp-ic { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--g-t); color: var(--g); }
.grp-title { flex: 1; min-width: 0; }
.grp-title h2 { font-size: 22px; letter-spacing: -.01em; }
.grp-title p { margin-top: 3px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.grp-sum { flex: none; align-self: flex-start; margin-top: 2px; padding: 5px 10px; border-radius: 10px; background: var(--g-t); color: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

.fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 14px; margin-top: 20px; align-items: end; }
.field { grid-column: span 3; min-width: 0; }
.fields[data-n="3"] .field, .fields[data-n="5"] .field:nth-child(-n+3) { grid-column: span 2; }
.field label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.ed-tag { padding: 1px 7px; border-radius: 6px; background: var(--mint-t); color: #0A6644; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.field:not(.is-ed) .ed-tag { display: none; }
.input-unit { display: flex; align-items: center; height: 50px; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line-2); transition: box-shadow .12s ease, background .12s ease; }
.input-unit:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.input-unit:focus-within { background: var(--card); box-shadow: inset 0 0 0 2.5px var(--blue); }
.is-ed .input-unit { box-shadow: inset 0 0 0 2px var(--mint); }
.input-unit input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; background: none; padding: 0 4px 0 14px; font-family: var(--font-mono); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.input-unit input::-webkit-outer-spin-button, .input-unit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-unit input:focus { outline: none; }
.input-unit span { flex: none; padding: 0 14px 0 6px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
@media (max-width: 620px) {
  .grp { padding: 18px 16px 20px; }
  .grp-head { gap: 12px; align-items: flex-start; }
  .grp-ic { width: 42px; height: 42px; border-radius: 13px; }
  .grp-title h2 { font-size: 20px; }
  .grp-title p { font-size: 13.5px; }
  .fields { gap: 14px 10px; margin-top: 16px; }
  .fields[data-n="3"] .field, .fields[data-n="5"] .field:nth-child(-n+3) { grid-column: span 3; }
  .fields[data-n="3"] .field:last-child, .fields[data-n="5"] .field:last-child { grid-column: 1 / -1; }
  .field label { font-size: 13px; }
  .input-unit input { padding-left: 12px; }
  .input-unit span { padding-right: 12px; }
}
@media (max-width: 480px) { .grp-sum { display: none; } }

/* ---------- Ergebnis: Kassenzettel ---------- */
.result { min-width: 0; scroll-margin-top: calc(var(--nav-h) + 16px); filter: drop-shadow(0 16px 22px rgba(22, 24, 31, .13)); }
@media (min-width: 901px) {
  .result { position: sticky; top: calc(var(--nav-h) + 18px); max-height: calc(100vh - var(--nav-h) - 28px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 14px; }
  .result::-webkit-scrollbar { display: none; }
}
/* Schlitz, aus dem der Zettel kommt */
.rcpt-slot { position: sticky; top: 0; z-index: 2; height: 18px; border-radius: 9px; background: var(--ink); box-shadow: 0 4px 0 #000; }
.rcpt {
  --zz: 9px; position: relative; margin: -6px 12px 0; padding: 30px 22px calc(22px + var(--zz));
  background: linear-gradient(rgba(22, 24, 31, .16), rgba(22, 24, 31, 0) 16px) #fff;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zz)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zz)) 100%;
}
.rcpt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 12px; }
.rcpt-brand .wm { font-size: 25px; }
.rcpt-meta { display: grid; justify-items: end; font-family: var(--font-mono); font-size: 11px; line-height: 1.45; color: var(--ink-2); text-align: right; }
.rcpt-meta b { font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); }
.rcpt-spec { margin: 0 -22px; padding: 6px 22px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink-2); background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 5px, rgba(22, 24, 31, .07) 5px 6px); }
.rcpt-k { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.rcpt-hero { padding-top: 16px; }
.rcpt-price { margin-top: 4px; font-family: var(--font-display); font-weight: 700; font-size: 50px; line-height: 1; letter-spacing: -.025em; color: var(--blue); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcpt-warn { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--sun-t); color: #5C4300; font-size: 13.5px; line-height: 1.4; }
.rcpt-warn svg { flex: none; margin-top: 1px; }
.rcpt-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.rcpt-duo > div { min-width: 0; padding: 10px 12px 9px; border-radius: 12px; background: var(--paper); }
.rcpt-duo .rcpt-k { font-size: 10px; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcpt-n { margin-top: 2px; font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rcpt-duo .is-profit { background: var(--mint-t); }
.rcpt-duo .is-profit .rcpt-k, .rcpt-duo .is-profit .rcpt-n { color: #0A6644; }
.rcpt-bar { display: flex; gap: 2px; height: 10px; margin: 16px 0 10px; }
.rcpt-bar i { flex: 0 0 0; min-width: 3px; border-radius: 2px; }
.rcpt-bar i:first-child { border-radius: 5px 2px 2px 5px; }
.rcpt-bar i:last-child { border-radius: 2px 5px 5px 2px; }
.rcpt-rows { margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.3; }
.rcpt-rows .row { display: flex; align-items: baseline; gap: 6px; padding: 4.5px 0; }
.rcpt-rows dt { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.rcpt-rows dt::after { content: ""; flex: 1; min-width: 12px; border-bottom: 1.5px dotted var(--line-2); }
.rcpt-rows dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcpt-rows .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; align-self: center; }
.rcpt-rows .pct { color: var(--ink-2); font-size: 11.5px; }
.rcpt-rows .total { margin-top: 6px; padding-top: 9px; border-top: 1.5px dashed var(--line-2); font-weight: 600; }
.rcpt-rows .total + .row:not(.total):not(.even) { margin-top: 2px; }
.rcpt-rows .total dt::after { border-bottom-color: transparent; }
.rcpt-rows .even { color: var(--ink-2); }
.rcpt-rows .even dt::after { border-bottom-color: transparent; }
.rcpt-hint { margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.rcpt-foot { margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed var(--line-2); text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
/* Niedrige Fenster: der Zettel wird knapper, damit er neben den Eingaben sichtbar bleibt */
@media (min-width: 901px) and (max-height: 780px) {
  .rcpt { padding-top: 26px; }
  .rcpt-price { font-size: 44px; }
  .rcpt-rows .row { padding: 3px 0; }
  .rcpt-hint { display: none; }
  .rcpt-foot { margin-top: 10px; padding-top: 10px; }
}
@media (min-width: 901px) and (max-height: 700px) {
  .rcpt { padding-top: 22px; padding-bottom: calc(14px + var(--zz)); }
  .rcpt-head { padding-bottom: 10px; }
  .rcpt-hero { padding-top: 12px; }
  .rcpt-price { font-size: 40px; }
  .rcpt-duo { margin-top: 10px; }
  .rcpt-duo > div { padding: 7px 10px 6px; }
  .rcpt-n { font-size: 20px; }
  .rcpt-bar { margin: 12px 0 6px; }
  .rcpt-rows .row { padding: 2px 0; }
  .rcpt-rows .total { margin-top: 4px; padding-top: 6px; }
  .rcpt-foot { display: none; }
}
@media (max-width: 900px) { .result { max-width: 460px; width: 100%; margin: 0 auto; } }
@media (max-width: 380px) { .rcpt { margin: -6px 8px 0; padding-left: 18px; padding-right: 18px; } .rcpt-spec { margin: 0 -18px; padding: 6px 18px; } .rcpt-price { font-size: 44px; } }

/* ---------- darunter: Rechenweg und Weg zu den Tools ---------- */
.calc-more { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; margin-top: clamp(40px, 6vw, 72px); }
.calc-how { background: var(--paper-2); border-radius: var(--r-card); padding: 26px 28px 28px; }
.calc-how dl { margin: 16px 0 0; display: grid; gap: 12px; }
.calc-how dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 16px; align-items: baseline; padding-bottom: 12px; border-bottom: 1.5px dashed var(--line-2); }
.calc-how dt { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.calc-how dd { margin: 0; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; color: var(--ink); }
.calc-how > p { margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.calc-tools { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; background: var(--blue-t); border-radius: var(--r-card); padding: 26px 28px 40px; }
.calc-tools::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background-image: repeating-linear-gradient(to bottom, transparent 0 4px, rgba(45, 78, 245, .2) 4px 6px); }
.calc-tools > * { position: relative; z-index: 1; }
.calc-tools h2 { font-size: 26px; }
.calc-tools p { margin: 10px 0 22px; color: var(--ink-2); flex: 1; max-width: 300px; }
.calc-tools .calc-knob { position: absolute; z-index: 0; right: -26px; bottom: -34px; width: 168px; overflow: visible; }
.calc-knob .ck-press { transition: transform .12s ease; }
.calc-tools:hover .calc-knob .ck-press { transform: translateY(6px); }
@media (max-width: 1100px) { .calc-tools .calc-knob { width: 120px; right: -20px; bottom: -24px; } }
@media (max-width: 900px) { .calc-more { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .calc-how, .calc-tools { padding-left: 20px; padding-right: 20px; } .calc-how dl > div { grid-template-columns: minmax(0, 1fr); } }
