/* friedas — Wirtschaftlichkeitsrechner (vollständig). Baut auf styles.css + platform.css. */

.tool-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.tool-user { display: flex; align-items: center; gap: .75rem; font-size: .9rem; color: var(--text-muted); }
.tool-user b { color: var(--text); }

/* Tabs */
.tool-tabs { display: inline-flex; gap: .3rem; background: var(--surface-2); border-radius: var(--r-pill); padding: .3rem; margin-bottom: 1.75rem; }
.tool-tabs button { padding: .55rem 1.2rem; border-radius: var(--r-pill); font-weight: 600; font-size: .95rem; color: var(--text-muted); }
.tool-tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

/* Layout */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.calc-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(1.25rem, 2.5vw, 1.9rem); box-shadow: var(--shadow-sm); }
.calc-panel h2 { font-size: 1.2rem; margin-bottom: 1.1rem; }
.calc-panel + .calc-panel { margin-top: 1.5rem; }
.calc-rows { display: grid; gap: 1.1rem; }
.calc-rows .field > span { font-weight: 650; font-size: .9rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .82rem; color: var(--text-muted); margin-top: .3rem; }

/* Slider-Zeile: Range + Zahl + Badge */
.rng { display: grid; grid-template-columns: 1fr 84px 60px; gap: .6rem; align-items: center; }
.rng label { grid-column: 1 / -1; font-weight: 650; font-size: .9rem; }
.pct-badge { display: inline-grid; place-items: center; padding: .35rem .2rem; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .82rem; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: var(--border-strong); outline-offset: 4px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-fill); border: 3px solid var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent-fill); border: 3px solid var(--surface); cursor: pointer; }
input[type="range"]:disabled { opacity: .45; }
.is-disabled { opacity: .45; pointer-events: none; }

/* Segmented (Personal-Modus) + Switch */
.seg { display: grid; gap: .6rem; }
.seg label.opt { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .92rem; }
.switch { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 600; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Ergebnis-Karten */
.kpi-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin-bottom: 1.25rem; }
.kpi { background: var(--bg-2); border-radius: var(--r); padding: 1.1rem 1.2rem; }
.kpi .lbl { font-size: .8rem; color: var(--text-muted); }
.kpi .val { font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; margin-top: .25rem; }
.kpi .sub { font-size: .78rem; color: var(--text-muted); }
.kpi--ebit .val { color: var(--accent); }
.kpi--ebit[data-neg="true"] .val { color: #c0392b; }
[data-theme="dark"] .kpi--ebit[data-neg="true"] .val { color: #ff8a80; }

/* Tabellen */
.calc-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.calc-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.calc-table th, .calc-table td { padding: .55rem .8rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.calc-table thead th { background: var(--bg-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); position: sticky; top: 0; }
.calc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.calc-table tfoot td, .calc-table .total td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border-strong); }
.calc-table .neg { color: #c0392b; }
[data-theme="dark"] .calc-table .neg { color: #ff8a80; }
.calc-table tbody tr:hover { background: var(--accent-soft); }

.basis-list { display: grid; gap: .4rem; margin: 1rem 0; font-size: .92rem; }
.basis-list li { display: flex; justify-content: space-between; gap: 1rem; color: var(--text-muted); }
.basis-list b { color: var(--text); }

.tool-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }

/* Gate (Zugang anfordern) */
.gate-wrap { display: grid; grid-template-columns: minmax(0, 34rem) minmax(0, 24rem); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; justify-content: center; max-width: 64rem; margin: 0 auto; }
.gate-wrap .gate { max-width: none; margin: 0; text-align: left; }
.gate-wrap .gate .eyebrow { justify-content: flex-start; }
.gate-wrap .gate h1, .gate-wrap .gate .lead { text-align: left; margin-left: 0; margin-right: 0; }
.gate-aside { display: grid; gap: 1rem; }
.gate-aside figure { margin: 0; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); background: var(--surface-2); aspect-ratio: 4 / 3; }
.gate-aside figure:first-child { aspect-ratio: 3 / 2; }
.gate-aside img, .gate-aside picture { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .gate-wrap { grid-template-columns: 1fr; max-width: 34rem; } .gate-aside { order: -1; grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .gate-aside { grid-template-columns: 1fr; } }
.gate { max-width: 33rem; margin: 0 auto; text-align: center; }
.gate-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(1.75rem, 4vw, 2.75rem); text-align: left; position: relative; overflow: hidden; }
.gate-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--accent-fill), var(--green)); }
.gate-features { display: grid; gap: .55rem; margin: 1.25rem 0; }
.gate-features li { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; color: var(--text-muted); font-size: .95rem; }
.gate-features .ck { color: var(--green-text); margin-top: .15rem; }
.gate .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 920px) {
  .calc-grid { grid-template-columns: 1fr; }
  .kpi-cards { grid-template-columns: 1fr; }
}
