:root {
  --bg: #f4f3ef; --panel: #ffffff; --ink: #1d1d1b; --muted: #6b6a66; --line: #e2e0da;
  --accent: #1f3a5f; --accent-hover: #2b4f80; --accent-ink: #ffffff; --warn: #9a3412; --ok: #166534;
  --hit: #fde68a; --hit-ink: #1d1d1b; --off: #e5e7eb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161615; --panel: #212120; --ink: #ecebe7; --muted: #a09f9a; --line: #34332f;
    --accent: #4f7fbf; --accent-hover: #6b97d1; --warn: #fb923c; --ok: #4ade80; --hit: #854d0e; --hit-ink: #fff7e0; --off: #3a3a38;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161615; --panel: #212120; --ink: #ecebe7; --muted: #a09f9a; --line: #34332f;
  --accent: #4f7fbf; --accent-hover: #6b97d1; --warn: #fb923c; --ok: #4ade80; --hit: #854d0e; --hit-ink: #fff7e0; --off: #3a3a38;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
a { color: var(--accent); }
header.top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
header.top .brand { font-weight: 700; font-size: 18px; margin-right: auto; display: flex; align-items: center; gap: 8px; }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
header.top nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; }
header.top nav a[aria-current="page"] { color: var(--ink); background: var(--bg); font-weight: 600; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
p.sub, .muted { color: var(--muted); font-size: 14px; }
p.sub { margin: 0 0 16px; }
button, .btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 10px; padding: 9px 14px; font: inherit; font-size: 15px; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
button:hover { border-color: var(--accent); }
button:active { transform: scale(.98); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: var(--accent-hover); }
button:disabled { opacity: .55; cursor: default; }
button.danger { color: var(--warn); }
button.link { border: 0; background: none; padding: 4px 6px; color: var(--muted); }
input[type="text"], input[type="password"], textarea, select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%;
}
textarea { min-height: 220px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
label.lbl { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.tabs button { border: 0; border-radius: 0; padding: 8px 18px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 36px 16px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.drop b { color: var(--ink); }
.status { min-height: 1.4em; font-size: 14px; margin: 10px 0 0; }
.status.err { color: var(--warn); }
.status.ok { color: var(--ok); }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.canvas-wrap { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: repeating-conic-gradient(var(--off) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
canvas { display: block; max-width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.items { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.items li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.items li:last-child { border-bottom: 0; }
.items code { font-size: 13px; word-break: break-all; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 1px 6px; border-radius: 6px; background: var(--off); color: var(--ink); white-space: nowrap; }
pre.out { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 120px; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 0; }
pre.out mark { background: var(--hit); color: var(--hit-ink); border-radius: 4px; padding: 0 2px; }
pre.out .kept { text-decoration: underline dotted var(--warn); }
.hint { font-size: 13px; color: var(--muted); margin-top: 8px; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: 13px; color: var(--muted); font-weight: 600; }
table.list td.act { text-align: right; white-space: nowrap; }
table.list input, table.list select { padding: 6px 8px; }
.notice { font-size: 14px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 12px; background: var(--panel); margin-bottom: 16px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; text-align: center; }
.login .card p { color: var(--muted); }
.login button.primary { width: 100%; padding: 13px; }
.login .setup { text-align: left; margin-top: 16px; }
.icon { width: 22px; height: 22px; }
[hidden] { display: none !important; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mt0 { margin-top: 0; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; }
.m0 { margin: 0; } .g6 { gap: 6px; } .grow { flex: 1; min-width: 180px; } .wauto { width: auto; } .w240 { max-width: 240px; }
.h140 { min-height: 140px; } .between { justify-content: space-between; }
/* Hell/Dunkel-Knopf */
.theme-btn { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 17px; line-height: 1; display: inline-grid; place-items: center; }
.login .card { position: relative; }
.login .theme-btn { position: absolute; top: 12px; right: 12px; }
/* Profil */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.tile b { display: block; font-size: 22px; line-height: 1.2; }
.tile span { font-size: 13px; color: var(--muted); }
.tile.warn b { color: var(--warn); }
.scroll { overflow-x: auto; }
table.list.small { font-size: 13px; }
table.list.small td, table.list.small th { padding: 6px 5px; }
.pill { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--off); white-space: nowrap; }
.pill.bad { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.pill.good { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.locked { text-align: center; padding: 18px 8px; }
.locked p { color: var(--muted); margin: 0 0 14px; }
h3.sub { font-size: 15px; margin: 22px 0 8px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.check-list label { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 15px; }
header.top .theme-btn { order: 0; }
@media (max-width: 560px) { header.top nav { order: 1; width: 100%; } }
