:root {
  --bg: #f6f7f9; --card: #fff; --fg: #1b1f24; --muted: #5d6673; --line: #dde1e6;
  --accent: #15803d; --accent-bg: #dcfce7; --bad: #b91c1c; --bad-bg: #fee2e2; --warn: #a16207; --warn-bg: #fef9c3;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --card: #161b22; --fg: #e6edf3; --muted: #8b949e; --line: #30363d;
    --accent: #4ade80; --accent-bg: #14301f; --bad: #f87171; --bad-bg: #3b1515; --warn: #facc15; --warn-bg: #3a3110;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, sans-serif; }
header, nav, main, footer { max-width: 960px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 28px; }
h1 { margin: 0; font-size: 28px; }
.prompt { color: var(--accent); font-family: var(--mono); }
.sub, .hint, footer { color: var(--muted); }
footer { font-size: 13px; padding-bottom: 32px; }
nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px auto; }
nav button { background: var(--card); color: var(--fg); border: 1px solid var(--line); }
nav button.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.panel { display: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 20px; }
.panel.active { display: block; }
h2 { margin: 0 0 12px; font-size: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
input, select, textarea, button { font: inherit; border-radius: 6px; border: 1px solid var(--line); padding: 8px 10px; background: var(--bg); color: var(--fg); }
input:not([type=checkbox]) { flex: 1 1 220px; min-width: 0; }
input.short { flex: 0 0 90px; }
textarea { width: 100%; font-family: var(--mono); font-size: 13px; resize: vertical; }
button { cursor: pointer; background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .6; cursor: wait; }
label { display: inline-flex; align-items: center; gap: 6px; }
.out { overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; width: 1%; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
pre { background: var(--bg); border: 1px solid var(--line); padding: 10px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; margin: 6px 0 12px; }
.big { font-size: 32px; font-weight: 700; font-family: var(--mono); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.ok { background: var(--accent-bg); color: var(--accent); }
.bad { background: var(--bad-bg); color: var(--bad); }
.warn { background: var(--warn-bg); color: var(--warn); }
.err { color: var(--bad); }
.grade { font-size: 48px; font-weight: 800; font-family: var(--mono); line-height: 1; margin-right: 12px; }
.flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.copy { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 2px 8px; font-size: 12px; }
.pw { font-size: 20px; font-weight: 600; }

/* Verbindungstest & Diagramme */
:root { --s1: #2a78d6; --s2: #eb6834; --grid: #e4e6ea; }
@media (prefers-color-scheme: dark) { :root { --s1: #3987e5; --s2: #d95926; --grid: #262c34; } }
button.secondary { background: transparent; color: var(--fg); border-color: var(--line); }
progress { flex: 0 0 160px; accent-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.tile-label { color: var(--muted); font-size: 13px; }
.tile-value { font-size: 28px; font-weight: 700; font-family: var(--mono); }
.tile-value small { font-size: 14px; color: var(--muted); font-weight: 400; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; background: var(--muted); }
.key.s1 { background: var(--s1); } .key.s2 { background: var(--s2); }
.legend, .legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; margin: 8px 0; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; touch-action: pan-y; }
.chart-wrap .grid { stroke: var(--grid); stroke-width: 1; }
.chart-wrap .axis { fill: var(--muted); font-size: 11px; font-family: system-ui, sans-serif; }
.chart-wrap .line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart-wrap .area { stroke: var(--card); stroke-width: 2; opacity: .85; }
.chart-wrap .line.s1, .chart-wrap .dot.s1 { stroke: var(--s1); fill: var(--s1); } .chart-wrap .line.s1 { fill: none; }
.chart-wrap .line.s2, .chart-wrap .dot.s2 { stroke: var(--s2); fill: var(--s2); } .chart-wrap .line.s2 { fill: none; }
.chart-wrap .area.s1 { fill: var(--s1); } .chart-wrap .area.s2 { fill: var(--s2); }
.chart-wrap .loss { stroke: var(--bad); stroke-width: 2; }
.chart-wrap .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; top: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; pointer-events: none; box-shadow: 0 2px 8px rgb(0 0 0 / .12); white-space: nowrap; }
table.stats td, table.stats th { white-space: nowrap; width: auto; }
#ct-table, #report-out { overflow-x: auto; }
.verdict { border-left: 4px solid var(--accent); background: var(--accent-bg); padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.verdict.warn { border-color: var(--warn); background: var(--warn-bg); }
.verdict.bad { border-color: var(--bad); background: var(--bad-bg); }
.verdict div { color: var(--fg); font-size: 14px; }
.bar-col { width: 25%; min-width: 80px; }
.bar { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; }
pre.cmd { flex: 1 1 300px; margin: 0; }
h2.sep { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
h3 { font-size: 15px; margin: 18px 0 6px; }
a { color: var(--accent); }
