:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: #11161e;
  --panel2: #161d27;
  --line: #26303d;
  --text: #f6f8fb;
  --text2: #c2cad6;
  --muted: #8e9bad;
  --accent: #63e6be;
  --danger: #ff8787;
  --radius: 14px;
  /* Diagramme: eigene Reihe und neutrale Vergleichsreihe, gegen --panel geprüft */
  --series-own: #3987e5;
  --series-other: #858580;
  --grid: #222b37;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
h1 { margin: 2px 0 0; font-size: 28px; line-height: 1.2; }
h2 { margin: 0 0 14px; font-size: 18px; }
.muted { color: var(--muted); }
.eyebrow { margin: 0; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }

.topnav { display: flex; align-items: center; gap: 24px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; font-size: 17px; text-decoration: none; white-space: nowrap; }
.brand .muted { font-weight: 500; }
.topnav nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topnav nav a { padding: 7px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; }
.topnav nav a:hover, .topnav nav a.active { background: var(--panel2); color: var(--text); }
.logout { display: flex; align-items: center; gap: 12px; margin: 0; }

.main { max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.section { margin-top: 34px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card + .card { margin-top: 10px; }
.empty-state { max-width: 620px; margin: 60px auto; padding: 32px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tiles .card + .card { margin-top: 0; }
.tile { display: grid; gap: 4px; align-content: start; }
.tile-label { color: var(--muted); font-size: 13px; }
.tile-value { font-size: 26px; line-height: 1.2; font-weight: 700; }
.tile-value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile-delta { color: var(--text2); font-size: 12.5px; }

.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.charts .card + .card { margin-top: 0; }
.chart-card { margin: 0; }
.chart-card figcaption { font-weight: 600; margin-bottom: 8px; }
.chart-card figcaption .muted { font-weight: 400; font-size: 13px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart text.value { fill: var(--text); font-weight: 600; }
.chart text.name { fill: var(--text2); }
.chart text.name.own { fill: var(--text); font-weight: 700; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .guide { stroke: var(--line); stroke-width: 1; }
.chart .avg { stroke: var(--muted); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--series-own); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--series-own); stroke: var(--panel); stroke-width: 2; }
.chart .dot.other { fill: var(--series-other); }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; visibility: hidden; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:focus { outline: none; }
.chart .hit:focus-visible + .focus-ring, .chart .row:focus-visible .focus-ring { visibility: visible; }
.chart .focus-ring { fill: none; stroke: var(--accent); stroke-width: 2; visibility: hidden; }
.chart .row:focus { outline: none; }
.tooltip { position: absolute; pointer-events: none; background: #05070b; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; z-index: 5; visibility: hidden; transform: translate(-50%, -100%); }
.tooltip strong { display: block; font-size: 14px; }

.button { border: 0; border-radius: 10px; padding: 9px 14px; background: var(--accent); color: #06110e; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
.button.secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.button.small { padding: 6px 10px; font-size: 13px; }
.button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, pre:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span, .field > label { color: var(--muted); font-size: 13px; }
.field.inline { grid-auto-flow: column; align-items: center; gap: 10px; }
.field input, .field select, .field textarea { width: 100%; background: #0b1016; border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 9px 11px; }
.field textarea { resize: vertical; min-height: 120px; }
.field select { max-width: 420px; }
.form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.upload { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.upload .field { flex: 1; min-width: 240px; }

.notice { overflow-wrap: anywhere; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; background: rgba(99, 230, 190, .12); color: var(--accent); }
.notice.error { background: rgba(255, 135, 135, .12); color: var(--danger); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 400; }
.table thead th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.table .num { text-align: right; }
.table .own { background: rgba(57, 135, 229, .12); color: var(--text); font-weight: 600; }
.table tr.group th { padding-top: 16px; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; border-bottom-color: var(--line); }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table-details { margin-top: 10px; }
.table-details summary, .report summary { cursor: pointer; font-weight: 600; }
.table-details[open] summary { margin-bottom: 12px; }

.report { padding: 12px 18px; }
.report .code { display: inline-block; min-width: 54px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.report pre { margin: 12px 0 4px; padding: 14px; overflow-x: auto; background: #0b1016; border: 1px solid var(--line); border-radius: 10px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text2); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); padding: 30px; }
.login-card h1 { margin-bottom: 4px; }
.login-card .form { margin-top: 18px; }

@media (max-width: 720px) {
  .topnav { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .main { padding: 20px 16px 48px; }
  .logout .muted { display: none; }
  .charts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .topnav nav a { transition: background-color .12s, color .12s; }
}

/* Parameter und News */
h3 { margin: 0 0 10px; font-size: 15px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 11px; border-radius: 9px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tabs a:hover, .tabs a.active { background: var(--panel2); color: var(--text); }
.tabs a.active { border-color: var(--accent); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button[disabled] { opacity: .45; cursor: not-allowed; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice.suggest { background: rgba(255, 212, 59, .1); color: #ffd43b; }
.notes { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--text2); overflow-wrap: anywhere; }
fieldset { margin: 0; min-width: 0; }
fieldset.card + fieldset.card { margin-top: 0; }
legend { padding: 0 8px; margin-left: -8px; font-weight: 700; font-size: 15px; }
.param-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; align-items: start; }
.param-group { display: grid; gap: 10px; }
.param { display: grid; grid-template-columns: 1fr 172px; gap: 2px 12px; align-items: center; }
.param label { color: var(--text2); font-size: 14px; }
.param-input { display: grid; grid-template-columns: 1fr auto; align-items: center; background: #0b1016; border: 1px solid var(--line); border-radius: 9px; }
.param-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.param-input input { width: 100%; min-width: 0; background: transparent; border: 0; color: var(--text); padding: 7px 4px 7px 10px; text-align: right; font-variant-numeric: tabular-nums; outline: none; }
.param-input .unit { padding: 0 9px 0 4px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.param .hint { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.param.suggested .param-input { border-color: #ffd43b; }
.param.suggested .hint { color: #ffd43b; }
.suggested-block { border-color: #ffd43b; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.input-table caption { text-align: left; font-weight: 600; padding: 0 0 6px 10px; color: var(--text2); }
.input-table td { padding: 4px 6px; border-bottom: 0; }
.input-table input { width: 100%; min-width: 84px; background: #0b1016; border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 7px 9px; text-align: right; font-variant-numeric: tabular-nums; }
.input-table input.short { min-width: 48px; width: 56px; text-align: center; text-transform: uppercase; }
.sticky-foot { position: sticky; bottom: 0; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); justify-content: flex-start; }
@media (max-width: 720px) { .param { grid-template-columns: 1fr 150px; } }

/* Planungsrechner */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.warn-text { color: #ffd43b; font-weight: 600; }
.param select { width: 100%; background: #0b1016; border: 1px solid var(--line); border-radius: 9px; color: var(--text); padding: 7px 9px; }
.checks { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.checks-title { color: var(--text2); font-size: 14px; }
.check { display: flex; gap: 8px; align-items: baseline; font-size: 14px; color: var(--text2); }
.check input { accent-color: var(--accent); }
.assumptions { margin-top: 14px; }
.assumptions summary { cursor: pointer; font-weight: 600; }
.assumptions .param-groups { grid-template-columns: minmax(0, 520px); margin-top: 12px; }
.assumptions .param-group { display: grid; gap: 10px; }
.sticky-foot .field.inline input { width: 260px; max-width: 100%; }
.sticky-foot { z-index: 4; margin-top: 14px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
.result-grid .card + .card { margin-top: 0; }
.result-card.wide { grid-column: 1 / -1; }
.table.compact th, .table.compact td { padding: 6px 4px; white-space: normal; }
.table.compact td.num { white-space: nowrap; }
.table.compact tr.total th, .table.compact tr.total td { font-weight: 700; color: var(--text); border-top: 1px solid var(--muted); }
.table.compact tbody th { color: var(--text2); }
.fineprint { font-size: 12.5px; margin-top: 14px; max-width: 900px; }
.table a { color: var(--text); }
