/* ============================================================
   nulleinspeisung.com · Abregelungs-Simulator, Methodik, Tabelle
   Ergänzt styles.css. Diagrammfarben auf Navy validiert
   (dataviz-Validator, dunkle Fläche #0B1F3A):
   --serie-1 #C98500 (Amber, gekappt), --serie-2 #3987E5 (Blau).
   ============================================================ */
:root {
  --serie-1: #C98500;
  --serie-2: #3987E5;
  --gitter: rgba(255,255,255,0.10);
  --feld-bg: rgba(255,255,255,0.05);
  --feld-rand: rgba(255,255,255,0.18);
}

/* ── Rechner-Formular ── */
.rechner { max-width: 960px; margin: 0 auto; }
.rechner-karte {
  background: rgba(255,255,255,0.03); border: 1px solid var(--card-border);
  border-radius: 18px; padding: clamp(18px, 4vw, 32px);
}
.rechner fieldset { border: none; margin: 0 0 22px; padding: 0; }
.rechner legend {
  font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--amber); margin-bottom: 12px; padding: 0;
}
.feld-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.feld-grid.zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feld.breit { grid-column: 1 / -1; }
.feld label, .feld .label { font-size: 14px; font-weight: 600; color: #fff; }
.feld small { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.rechner input[type="text"], .rechner input[type="number"], .rechner input[type="search"],
.rechner select {
  width: 100%; font-family: inherit; font-size: 16px; color: #fff;
  background: var(--feld-bg); border: 1px solid var(--feld-rand); border-radius: 10px;
  padding: 11px 12px; min-height: 46px;
}
.rechner select option { color: #0B1F3A; }
.rechner input:focus-visible, .rechner select:focus-visible, .rechner summary:focus-visible,
.rechner button:focus-visible, .spanne-balken:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: #fff; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--amber); flex-shrink: 0; }
.lasten-wahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lasten-wahl .check { background: var(--feld-bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 14px; }
.optionen { margin-top: 14px; padding: 16px; border-radius: 12px; background: rgba(255,255,255,0.025); border: 1px solid var(--card-border); }
.optionen h4 { font-size: 14px; color: #fff; margin-bottom: 10px; }
.gruppen-hinweis { font-size: 13.5px; color: var(--text-muted); margin: -4px 0 12px; line-height: 1.55; }
details.mehr { margin-top: 12px; border-top: 1px solid var(--card-border); padding-top: 12px; }
details.mehr summary { cursor: pointer; font-weight: 600; color: var(--amber); font-size: 14.5px; }
details.mehr[open] summary { margin-bottom: 12px; }
.rechner-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 8px; }
.rechner-status { font-size: 13.5px; color: var(--text-muted); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }

/* ── Ergebnis ── */
.ergebnis { max-width: 960px; margin: 28px auto 0; transition: opacity .2s; }
.ergebnis.rechnet { opacity: .55; }
.ergebnis-karte {
  background: linear-gradient(135deg, rgba(245,162,0,0.06), rgba(26,95,212,0.05));
  border: 1px solid rgba(245,162,0,0.28); border-radius: 18px; padding: clamp(18px, 4vw, 32px);
}
.ergebnis h2 { font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.erg-kopf { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 18px; overflow-wrap: anywhere; }
.erg-kopf strong { color: #fff; }
.kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.kachel { background: rgba(11,31,58,0.55); border: 1px solid var(--card-border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kachel-haupt { border-color: rgba(245,162,0,0.55); }
.kachel-label { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.kachel-wert { font-size: clamp(20px, 2.5vw, 26px); font-weight: 800; color: #fff; line-height: 1.15; overflow-wrap: anywhere; }
.kachel-sub { font-size: 13.5px; color: rgba(255,255,255,0.78); }

.erg-abschnitt { margin-top: 26px; }
.erg-abschnitt h3 { font-size: 17px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.erg-hinweis { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-top: 10px; }

/* Spannen-Diagramm: horizontale Bänder von–bis */
.spannen { position: relative; }
.spanne-zeile { display: grid; grid-template-columns: 200px minmax(0, 1fr) 110px; align-items: center; gap: 12px; min-height: 34px; }
.spanne-name { font-size: 13.5px; color: rgba(255,255,255,0.84); line-height: 1.3; }
.spanne-spur { position: relative; height: 16px; border-left: 1px solid rgba(255,255,255,0.28);
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--gitter) calc(100% - 1px));
  background-repeat: repeat-x; background-size: 10% 100%; }
.spanne-balken { position: absolute; top: 0; height: 16px; min-width: 4px; background: var(--serie-1); border-radius: 4px; cursor: default; }
.spanne-balken:hover { filter: brightness(1.15); }
.spanne-wert { font-size: 13.5px; color: #fff; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spanne-achszeile { min-height: 22px; }
.spanne-achse { position: relative; height: 18px; }
.spanne-achse span { position: absolute; transform: translateX(-50%); font-size: 11.5px; color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.spanne-tipp { position: absolute; transform: translate(-50%, -100%); background: #fff; color: var(--navy); font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; z-index: 5; box-shadow: 0 6px 20px rgba(0,0,0,0.35); }

/* Ergebnistabelle */
.erg-tabelle { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.erg-tabelle th, .erg-tabelle td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.erg-tabelle thead th { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--amber); background: rgba(245,162,0,0.08); }
.erg-tabelle tbody th { color: #fff; font-weight: 700; white-space: nowrap; }
.zelle-kwh { display: block; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zelle-pct { display: block; color: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Gesteuerte Lasten */
.lasten-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lasten-karte { background: rgba(57,135,229,0.08); border: 1px solid rgba(57,135,229,0.35); border-radius: 14px; padding: 16px 18px; }
.lasten-karte h4 { font-size: 14.5px; color: #fff; margin-bottom: 10px; }
.lasten-karte dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 14px; font-size: 14px; align-items: baseline; }
.lasten-karte dt { color: rgba(255,255,255,0.8); }
.lasten-karte dd { color: #fff; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.erg-euro ul { margin: 6px 0 0 1.1em; font-size: 14.5px; color: rgba(255,255,255,0.85); line-height: 1.6; }

.teilen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.teilen input { flex: 1 1 260px; min-width: 0; font-size: 13px; color: var(--text-muted); background: var(--feld-bg); border: 1px solid var(--feld-rand); border-radius: 10px; padding: 10px 12px; }
.teilen-status { font-size: 13px; color: var(--text-muted); }
.erg-stand { font-size: 12.5px; color: var(--text-dim); margin-top: 18px; line-height: 1.6; }

/* Weichen und In-eigener-Sache-Kasten (außerhalb des Ergebnisfelds) */
.weiche { max-width: 960px; margin: 22px auto 0; }
.hinweis-box { background: var(--card-bg); border: 1px solid var(--card-border); border-left: 3px solid var(--blue-light); border-radius: 12px; padding: 18px 22px; font-size: 14.5px; line-height: 1.65; color: rgba(255,255,255,0.84); }
.hinweis-box strong { color: #fff; }
.hinweis-box .tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--blue-light); margin-bottom: 6px; }
.eigene-sache { max-width: 960px; margin: 22px auto 0; background: linear-gradient(135deg, rgba(245,162,0,0.08), rgba(26,95,212,0.06)); border: 1px solid rgba(245,162,0,0.25); border-radius: 16px; padding: 22px 26px; }
.eigene-sache .tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; }
.eigene-sache h3 { font-size: 19px; color: #fff; margin-bottom: 8px; }
.eigene-sache p { font-size: 14.5px; color: var(--text-muted); line-height: 1.65; }
.eigene-sache .btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* Datierter Entwurfs-Kasten */
.entwurf { border-left-color: var(--amber); }
.entwurf .tag { color: var(--amber); }

/* ── Tabellenseite ── */
.datentabelle { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.datentabelle th, .datentabelle td { padding: 9px 10px; border-bottom: 1px solid var(--card-border); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.datentabelle th:first-child, .datentabelle td:first-child { text-align: left; }
.datentabelle thead th { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--amber); background: rgba(245,162,0,0.08); }
.datentabelle tbody tr:hover { background: rgba(255,255,255,0.03); }
.datentabelle tfoot td { color: #fff; font-weight: 700; border-top: 2px solid rgba(245,162,0,0.4); }
.tabelle-box { max-width: 1080px; margin: 0 auto 36px; }
.tabelle-box h2 { font-size: 22px; color: #fff; margin-bottom: 8px; }
.tabelle-box p { color: var(--text-muted); font-size: 14.5px; line-height: 1.65; margin-bottom: 12px; }
.download-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; }

/* ── Methodik: Validierungstabellen ── */
.prose table.module-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prose table.module-table th.num { text-align: right; }
.prose table.module-table th { line-height: 1.35; }
.prose table.kompakt th, .prose table.kompakt td { padding: 10px 11px; }
.prose table.kompakt thead th { letter-spacing: 0.6px; font-size: 11px; }
.prose .tabelle-notiz { font-size: 13px; color: var(--text-muted); margin-top: -10px; }
.prose .qscroll { margin: 0 0 8px; }
.formel { font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace; font-size: 13.5px; background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; color: #fff; }

@media (max-width: 860px) {
  .feld-grid, .lasten-wahl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kacheln { grid-template-columns: 1fr; }
  .lasten-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .feld-grid, .feld-grid.zwei, .lasten-wahl { grid-template-columns: 1fr; }
  .spanne-zeile { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name wert" "spur spur"; gap: 4px 10px; padding: 6px 0; }
  .spanne-name { grid-area: name; }
  .spanne-wert { grid-area: wert; }
  .spanne-spur, .spanne-achse { grid-area: spur; }
  .spanne-achszeile .spanne-name, .spanne-achszeile .spanne-wert { display: none; }
}
@media print {
  nav, .topbar, .rechner-aktionen, .teilen, .eigene-sache { display: none !important; }
  body { background: #fff; color: #000; }
}
