/* Gemeinsame Grundlage: ruhig, sachlich, hoher Kontrast. */
:root {
  --bg: #f3f3f1; --surface: #ffffff; --surface-2: #f8f8f6; --text: #1b1d1f; --muted: #5f6368;
  --border: #d3d3cf; --border-strong: #a9a9a4;
  --accent: #23466b; --accent-text: #ffffff; --accent-soft: #e3e9f0;
  --ok: #2b6e2f; --ok-soft: #e2efe2; --warn: #8a5a00; --warn-soft: #fbf0d6; --err: #a8271d; --err-soft: #f7e1df;
  --mark: #f2c230; --bar: #1f2429; --bar-text: #f1f1ee;
  --radius: 3px; --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181a; --surface: #1f2225; --surface-2: #26292c; --text: #e8e8e4; --muted: #a0a4a8;
    --border: #3a3e42; --border-strong: #5a5f64; --accent: #7aa6d6; --accent-text: #0d1620; --accent-soft: #233243;
    --ok: #79c07d; --ok-soft: #1f3321; --warn: #e5b452; --warn-soft: #3a2f16; --err: #f08a80; --err-soft: #3e1f1c;
    --bar: #0e1012;
  }
}
:root[data-theme="dark"] {
  --bg: #16181a; --surface: #1f2225; --surface-2: #26292c; --text: #e8e8e4; --muted: #a0a4a8;
  --border: #3a3e42; --border-strong: #5a5f64; --accent: #7aa6d6; --accent-text: #0d1620; --accent-soft: #233243;
  --ok: #79c07d; --ok-soft: #1f3321; --warn: #e5b452; --warn-soft: #3a2f16; --err: #f08a80; --err-soft: #3e1f1c;
  --bar: #0e1012;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--err); border-color: var(--err); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input, select, textarea {
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  padding: 7px 9px; min-height: 36px; width: 100%;
}
label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
label.chk { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
label.chk input { width: auto; min-height: 0; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 2px; font-size: 12px; border: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.tag.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.langsw { display: inline-flex; border: 1px solid currentColor; border-radius: var(--radius); overflow: hidden; }
.langsw button { border: 0; background: transparent; padding: 4px 9px; font-size: 13px; font-weight: 600; letter-spacing: .03em; min-height: 30px; }
.langsw button + button { border-left: 1px solid currentColor; }
.langsw button[aria-pressed="true"] { background: var(--mark); color: #1b1d1f; }
dialog { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; max-width: min(560px, calc(100vw - 24px)); width: 100%; }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .dh { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 16px; }
dialog .db { padding: 14px 16px; }
dialog .df { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: calc(100% - 24px); max-width: 520px; }
#toast div { background: var(--bar); color: var(--bar-text); padding: 10px 14px; border-radius: var(--radius); border-left: 5px solid var(--accent); width: 100%; }
#toast div.ok { border-left-color: #4caf50; } #toast div.warn { border-left-color: var(--mark); } #toast div.err { border-left-color: #e5534b; }
