:root {
  --brand: #1f5eff; --brand-ink: #fff; --ink: #18202f; --muted: #667085; --line: #e4e7ec;
  --bg: #f5f7fb; --card: #fff; --ok: #12805c; --ok-bg: #e7f6ef; --err: #b42318; --err-bg: #fdecea;
  --warn: #9a6700; --warn-bg: #fff6e0; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #e6e9ef; --muted: #98a2b3; --line: #2b3242; --bg: #11151d; --card: #1a202b;
          --ok-bg: #12301f; --err-bg: #3a1714; --warn-bg: #3a2c0c; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
.langs a { margin-left: 10px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.langs a.active { color: var(--brand); }
main { padding: 24px 20px 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.card.subtle { background: transparent; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; }
h1 { font-size: 26px; margin: 0 0 6px; } h2 { font-size: 19px; margin: 0 0 10px; } h3 { font-size: 16px; margin: 0 0 6px; }
.lead { font-size: 16px; color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .err { color: var(--err); }
.steps { padding-left: 20px; } .steps li { margin: 4px 0; } .steps.compact { margin-bottom: 0; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 18px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.error { background: var(--err-bg); color: var(--err); }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--brand); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.small { padding: 5px 10px; font-size: 13px; } .btn.ghost { background: transparent; }
form { margin: 0; }
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 0; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 6px 16px 16px; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 10px; }
.side .btn { margin-top: 12px; }
.hint { background: var(--warn-bg); color: var(--warn); padding: 8px 10px; border-radius: 8px; font-size: 13px; margin: 8px 0 0; }
.probe-result { font-size: 13px; margin: 8px 0 0; min-height: 1em; }
.probe-result.ok { color: var(--ok); } .probe-result.err { color: var(--err); } .probe-result.busy { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; } .row-actions form { display: inline-block; margin-left: 4px; }
.prog { min-width: 170px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .6s; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--line); }
.s-done { background: var(--ok-bg); color: var(--ok); } .s-failed { background: var(--err-bg); color: var(--err); }
.s-running, .s-queued { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.s-cancelled { background: var(--warn-bg); color: var(--warn); }
.empty { color: var(--muted); padding: 10px 0; }
details.csv { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
details summary { cursor: pointer; font-weight: 600; }
pre { background: var(--bg); padding: 8px 10px; border-radius: 8px; overflow-x: auto; }
.foot { color: var(--muted); font-size: 13px; padding: 10px 20px 40px; }
/* Admin */
.admin-nav a { margin-left: 14px; text-decoration: none; font-weight: 600; font-size: 14px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.inline input, .inline select { width: auto; display: inline-block; margin: 0; }
.log { max-height: 320px; overflow: auto; font-size: 12px; }
@media (max-width: 760px) { .cols, .grid3 { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } h1 { font-size: 22px; } }
/* Postfach-Tabelle auf dem Handy als Karten */
@media (max-width: 760px) {
  table.mbs thead { display: none; }
  table.mbs, table.mbs tbody, table.mbs tr, table.mbs td { display: block; width: 100%; }
  table.mbs tr { border-bottom: 1px solid var(--line); padding: 10px 0; position: relative; }
  table.mbs td { border: 0; padding: 3px 0; }
  table.mbs td:nth-child(2)::before { content: "→ "; color: var(--muted); }
  table.mbs .row-actions { position: absolute; top: 10px; right: 0; width: auto; }
  table.mbs .prog { min-width: 0; }
}
