/* Monteurhaus Startseite – Kalkulationsrechner (Mobile First) */
.mhk {
  --k-ink: var(--mh-ink, #14202b); --k-muted: var(--mh-muted, #55626c); --k-line: var(--mh-line, #dfe3e2);
  --k-surface: var(--mh-surface, #fff); --k-tint: var(--mh-tint, #f3f5f4); --k-blue: var(--mh-blue, #1f5c86);
  --k-accent: var(--mh-accent, #a35f1f); --k-accent-soft: var(--mh-accent-soft, #f6ebe0);
  --k-pos: #2e7a4d; --k-neg: #b3361f; --k-display: var(--mh-display, "Barlow Semi Condensed", Arial, sans-serif);
  margin-top: 2rem; color: var(--k-ink); font-size: 1rem; line-height: 1.5;
}
@media (prefers-color-scheme: dark) { .mhk { --k-pos: #5db382; --k-neg: #ef8a75; } }
.mhk *, .mhk *::before, .mhk *::after { box-sizing: border-box; }
.mhk [hidden] { display: none !important; }
.mhk__noscript { padding: 1rem 1.25rem; border: 1px solid var(--k-line); border-radius: 12px; background: var(--k-surface); }

.mhk__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.mhk__inputs { display: grid; gap: 1rem; min-width: 0; }
.mhk__aside { display: grid; gap: .875rem; min-width: 0; padding: 1.25rem; border-radius: var(--mh-radius, 14px); background: var(--k-surface); border: 1px solid var(--k-line); box-shadow: 0 18px 40px -30px rgba(16, 42, 60, .6); }
.mhk__kpis-title { margin: 0; font-family: var(--k-display); font-weight: 700; font-size: 1.25rem; }

/* Modus */
.mhk-mode { margin: 0; padding: 1rem; border: 1px solid var(--k-line); border-radius: var(--mh-radius, 14px); background: var(--k-surface); min-width: 0; }
.mhk-mode__legend { padding: 0 .25rem; font-family: var(--k-display); font-weight: 700; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--k-muted); }
.mhk-mode__opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.mhk-mode__opt { position: relative; }
.mhk-mode__input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mhk-mode__label { display: flex; align-items: center; gap: .625rem; min-height: 48px; padding: .625rem 1rem; border: 2px solid var(--k-line); border-radius: 12px; font-family: var(--k-display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; cursor: pointer; transition: border-color .15s, background-color .15s; }
.mhk-mode__label::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--k-muted); background: var(--k-surface); }
.mhk-mode__input:checked + .mhk-mode__label { border-color: var(--k-accent); background: var(--k-accent-soft); }
.mhk-mode__input:checked + .mhk-mode__label::before { border-color: var(--k-accent); background: radial-gradient(circle, var(--k-accent) 0 45%, transparent 50%); }
.mhk-mode__input:focus-visible + .mhk-mode__label { outline: 3px solid var(--k-blue); outline-offset: 2px; }
.mhk-mode__hint { margin: .75rem 0 0; color: var(--k-muted); font-size: .95rem; }

/* Panels */
.mhk-panel { border: 1px solid var(--k-line); border-radius: var(--mh-radius, 14px); background: var(--k-surface); min-width: 0; }
.mhk-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem; min-height: 56px; padding: .75rem 3rem .75rem 1.125rem; position: relative; cursor: pointer; list-style: none; }
.mhk-panel__head::-webkit-details-marker { display: none; }
.mhk-panel__head::after { content: ""; position: absolute; right: 1.25rem; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--k-accent); border-bottom: 2px solid var(--k-accent); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.mhk-panel:not([open]) .mhk-panel__head::after { transform: translateY(-30%) rotate(-45deg); }
.mhk-panel__title { font-family: var(--k-display); font-weight: 700; font-size: 1.2rem; line-height: 1.2; }
.mhk-panel__sum { font-family: var(--k-display); font-weight: 600; color: var(--k-muted); font-variant-numeric: tabular-nums; }
.mhk-panel__body { display: grid; gap: 1.125rem; padding: 0 1.125rem 1.125rem; border-top: 1px solid var(--k-line); padding-top: 1rem; }
.mhk-panel__foot { display: flex; justify-content: flex-end; }

/* Felder */
.mhk-field { display: grid; gap: .375rem; }
.mhk-field__label { font-weight: 600; }
.mhk-field__ctrl { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem; gap: .75rem; align-items: center; }
.mhk-field__hint { margin: 0; color: var(--k-muted); font-size: .875rem; }
.mhk-range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; --p: 50%; }
.mhk-range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--k-accent) 0 var(--p), var(--k-line) var(--p) 100%); }
.mhk-range::-moz-range-track { height: 8px; border-radius: 999px; background: var(--k-line); }
.mhk-range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--k-accent); }
.mhk-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--k-surface); border: 3px solid var(--k-accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.mhk-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--k-surface); border: 3px solid var(--k-accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.mhk-range:focus-visible { outline: 3px solid var(--k-blue); outline-offset: 2px; border-radius: 8px; }
.mhk-num { position: relative; display: block; }
.mhk-num__unit { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); color: var(--k-muted); pointer-events: none; font-size: .9rem; }
.mhk-num .mhk-input { padding-right: 2rem; }
.mhk-input { width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--k-line); border-radius: 10px; background: var(--k-surface); color: var(--k-ink); font: inherit; font-size: 1rem; }
.mhk-input--num { text-align: right; font-variant-numeric: tabular-nums; }
.mhk-input:focus-visible { outline: 3px solid var(--k-blue); outline-offset: 1px; border-color: var(--k-blue); }
.mhk-input[aria-invalid="true"] { border-color: var(--k-neg); box-shadow: 0 0 0 2px color-mix(in srgb, var(--k-neg) 25%, transparent); }
.mhk-select { -webkit-appearance: none; appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 1rem center, right .7rem center; background-size: 5px 5px; background-repeat: no-repeat; }

/* Listen */
.mhk-list { display: grid; gap: .625rem; }
.mhk-list__title { margin: 0; font-family: var(--k-display); font-weight: 700; font-size: 1.05rem; }
.mhk-list__rows { display: grid; gap: .625rem; }
.mhk-list__empty { margin: 0; color: var(--k-muted); font-size: .9rem; }
.mhk-row { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding: .75rem; border: 1px solid var(--k-line); border-radius: 12px; background: var(--k-tint); align-items: end; }
.mhk-cell { display: grid; gap: .2rem; min-width: 0; }
.mhk-cell__label { font-size: .78rem; font-weight: 600; color: var(--k-muted); letter-spacing: .02em; }
.mhk-cell--n { grid-column: 1 / -1; padding-right: 52px; }
.mhk-cell--del { position: absolute; top: calc(.75rem + 1.2rem); right: .75rem; }
.mhk-row--units .mhk-cell--l { grid-column: 1 / -1; }
.mhk-row--inv .mhk-cell--v { grid-column: 1 / -1; }
.mhk-row--units, .mhk-row--loans { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mhk-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 999px; border: 2px solid var(--k-line); background: var(--k-surface); color: var(--k-ink); font-family: var(--k-display); font-weight: 700; font-size: 1rem; line-height: 1.2; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.mhk-btn:hover { border-color: var(--k-blue); }
.mhk-btn:focus-visible, .mhk-link:focus-visible { outline: 3px solid var(--k-blue); outline-offset: 2px; }
.mhk-btn:disabled { opacity: .5; cursor: not-allowed; }
.mhk-btn--primary { background: var(--k-accent); border-color: var(--k-accent); color: #fff; }
.mhk-btn--primary:hover { background: var(--mh-accent-hover, #8a4f18); border-color: var(--mh-accent-hover, #8a4f18); }
.mhk-btn--add { justify-self: start; border-style: dashed; color: var(--k-blue); }
.mhk-btn--add span { font-size: 1.3rem; line-height: 1; }
.mhk-btn--icon { width: 44px; padding: 0; font-size: 1.5rem; line-height: 1; color: var(--k-neg); }
.mhk-link { min-height: 44px; padding: .25rem .25rem; border: 0; background: none; color: var(--k-blue); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.mhk-warn { margin: 0; padding: .625rem .875rem; border-radius: 10px; background: color-mix(in srgb, var(--k-accent) 14%, transparent); color: var(--k-ink); font-size: .9rem; }

/* Kennzahlen */
.mhk-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; }
.mhk-kpi { display: grid; gap: .15rem; align-content: start; padding: .75rem .875rem; border-radius: 12px; background: var(--k-tint); border: 1px solid var(--k-line); min-width: 0; }
.mhk-kpi--main { grid-column: 1 / -1; background: linear-gradient(135deg, #102a3c, #1a3d55); border-color: transparent; color: #fff; }
.mhk-kpi__label { font-family: var(--k-display); font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--k-muted); }
.mhk-kpi__value { font-family: var(--k-display); font-weight: 700; font-size: clamp(1.25rem, 1.05rem + .9vw, 1.6rem); line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mhk-kpi__sub { font-size: .8rem; color: var(--k-muted); line-height: 1.3; }
.mhk-kpi--main .mhk-kpi__label, .mhk-kpi--main .mhk-kpi__sub { color: #c9d5dc; }
.mhk-kpi--main .mhk-kpi__value { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem); color: #fff; }
.mhk-kpi--pos:not(.mhk-kpi--main) .mhk-kpi__value { color: var(--k-pos); }
.mhk-kpi--neg .mhk-kpi__value { color: var(--k-neg); }
.mhk-kpi--main.mhk-kpi--neg .mhk-kpi__value { color: #ffb4a3; }
.mhk__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.mhk__actions .mhk-btn { flex: 1 1 auto; }
.mhk__share { margin: 0; font-size: .82rem; color: var(--k-muted); }
.mhk__status { margin: 0; min-height: 1.2em; font-size: .9rem; font-weight: 600; color: var(--k-pos); }
.mhk__status:empty { display: none; }

/* Mitlaufende Ergebnisleiste (Smartphone/Tablet) */
.mhk__mini { position: sticky; top: calc(var(--mh-header-h, 64px) + var(--mh-safe-top, 0px) + 6px); z-index: 50; display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: center; margin-bottom: 1rem; padding: .55rem .75rem; border-radius: 14px; background: #102a3c; color: #fff !important; text-decoration: none !important; box-shadow: 0 12px 28px -16px rgba(16, 42, 60, .9); }
.mhk__mini-item { display: grid; line-height: 1.15; min-width: 0; }
.mhk__mini-item span { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: #c9d5dc; font-weight: 700; }
.mhk__mini-item strong { font-family: var(--k-display); font-size: 1.15rem; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.mhk__mini-item strong.neg { color: #ffb4a3; }
.mhk__mini-go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; border-radius: 999px; background: var(--k-accent); color: #fff; font-family: var(--k-display); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.mhk__mini:focus-visible { outline: 3px solid #f0b67a; outline-offset: 2px; }
.mhk__aside:focus { outline: none; }

/* Ergebnisse */
.mhk__results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin-top: 1.5rem; }
.mhk-res { padding: 1.25rem; border-radius: var(--mh-radius, 14px); background: var(--k-surface); border: 1px solid var(--k-line); min-width: 0; }
.mhk-res > * + * { margin-top: .875rem; }
.mhk-res__title { margin: 0; font-family: var(--k-display); font-weight: 700; font-size: 1.3rem; line-height: 1.2; }
.mhk-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
.mhk-table:focus-visible { outline: 3px solid var(--k-blue); outline-offset: 2px; }
.mhk-table table { width: 100%; min-width: 420px; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .95rem; margin: 0; }
.mhk-table th, .mhk-table td { padding: .55rem .7rem; border: 0; border-bottom: 1px solid var(--k-line); text-align: left; vertical-align: top; color: var(--k-ink); background: transparent; }
.mhk-table thead th { font-family: var(--k-display); font-weight: 700; font-size: .85rem; color: var(--k-muted); border-bottom-width: 2px; }
.mhk-table tbody th { font-weight: 500; }
.mhk-table .num { text-align: right; white-space: nowrap; }
.mhk-table tr.sub th, .mhk-table tr.sub td { font-weight: 700; background: var(--k-tint); }
.mhk-table tfoot th, .mhk-table tfoot td, .mhk-table tr.total th, .mhk-table tr.total td { font-weight: 700; border-top: 2px solid var(--k-line); border-bottom: 0; }
.mhk-table tr.pos td:last-child { color: var(--k-pos); }
.mhk-table tr.neg td { color: var(--k-neg); }
.mhk-table tr.current th, .mhk-table tr.current td { background: var(--k-accent-soft); font-weight: 700; }
.mhk-note { margin: 0; color: var(--k-muted); font-size: .9rem; }
.mhk-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.mhk-facts li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--k-line); }
.mhk-facts span { color: var(--k-muted); }
.mhk-facts strong { font-variant-numeric: tabular-nums; text-align: right; }

.mhk-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.mhk-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: .25rem .75rem; align-items: center; }
.mhk-bar__label { grid-area: label; font-weight: 600; }
.mhk-bar__value { grid-area: value; font-family: var(--k-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.mhk-bar__track { grid-area: track; height: 14px; border-radius: 999px; background: var(--k-tint); overflow: hidden; }
.mhk-bar__fill { display: block; height: 100%; border-radius: 999px; background: var(--k-blue); transition: width .25s ease; }
.mhk-bar--costs .mhk-bar__fill { background: #8a97a1; }
.mhk-bar--service .mhk-bar__fill { background: var(--k-accent); }
.mhk-bar--pos .mhk-bar__fill { background: var(--k-pos); }
.mhk-bar--neg .mhk-bar__fill { background: var(--k-neg); }
.mhk-bar--neg .mhk-bar__value { color: var(--k-neg); }

.mhk__disclaimer { margin: 1.25rem 0 0; font-size: .85rem; color: var(--k-muted); max-width: 95ch; }

/* Kompakter Kopfbereich der Kalkulationsseite */
.mhs-landing-page .mh-hero.mh-hero--compact { min-height: auto; padding-block: clamp(2.5rem, 7vw, 4.5rem); }

/* XS */
@media (max-width: 374px) {
  .mhk__mini { grid-template-columns: 1fr 1fr; }
  .mhk__mini-go { display: none; }
  .mhk-field__ctrl { grid-template-columns: minmax(0, 1fr); }
  .mhk-kpis { grid-template-columns: minmax(0, 1fr); }
  .mhk-panel__head { padding-left: .875rem; }
  .mhk-panel__body { padding-inline: .875rem; }
  .mhk__aside, .mhk-res { padding: 1rem; }
}
/* M */
@media (min-width: 480px) {
  .mhk-mode__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mhk-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mhk-row--units .mhk-cell--l { grid-column: auto; }
  .mhk-row--costs .mhk-cell--t, .mhk-row--ocosts .mhk-cell--t, .mhk-row--revs .mhk-cell--t, .mhk-row--anc .mhk-cell--t { grid-column: span 2; }
}
/* L */
@media (min-width: 768px) {
  .mhk-row { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) 44px; }
  .mhk-row .mhk-cell--n { grid-column: auto; padding-right: 0; }
  .mhk-row .mhk-cell--t, .mhk-row .mhk-cell--v { grid-column: auto; }
  .mhk-cell--del { position: static; }
  .mhk-row--units { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) repeat(3, minmax(0, .9fr)) 44px; }
  .mhk-row--loans { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) 44px; }
  .mhk-row--inv { grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr) 44px; }
  .mhk__results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mhk-res--wide { grid-column: 1 / -1; }
}
/* XL: Ergebnisspalte läuft mit */
@media (min-width: 960px) {
  .mhk__mini { display: none; }
  .mhk__grid { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); }
  .mhk__aside { position: sticky; top: calc(var(--mh-header-h, 72px) + var(--mh-safe-top, 0px) + 16px); max-height: calc(100vh - var(--mh-header-h, 72px) - 32px); overflow-y: auto; }
}
@media (min-width: 1280px) {
  .mhk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (horizontal-viewport-segments: 2) {
  .mhk__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .mhk__aside { position: static; max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mhk * { transition: none !important; }
}
@media print {
  .mhk__mini, .mh-footer, .mh-section--cta, .mh-hero--compact .mh-stats, .mhk__actions, .mhk__share, .mhk-btn--add, .mhk-btn--icon, .mhk-panel__foot, .mhk-range { display: none !important; }
  .mhk__grid, .mhk__results { grid-template-columns: minmax(0, 1fr) !important; }
  .mhk__aside { position: static; max-height: none; box-shadow: none; }
  .mhk-kpi--main { background: #fff; color: #000; border: 2px solid #000; }
  .mhk-kpi--main .mhk-kpi__value, .mhk-kpi--main .mhk-kpi__label, .mhk-kpi--main .mhk-kpi__sub { color: #000; }
  .mhk-res, .mhk-panel { break-inside: avoid; }
}
