:root {
  color-scheme: light;
  --bg: #eef1f5;
  --surface: #ffffff;
  --soft: #f4f6f9;
  --ink: #14203a;
  --muted: #5a6679;
  --line: #d6dce5;
  --accent: #0a4fa0;
  --accent-hover: #083f80;
  --on-accent: #ffffff;
  --ok: #1b7447;
  --err: #b3261e;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e141d;
    --surface: #151d29;
    --soft: #1a2432;
    --ink: #e6ebf2;
    --muted: #98a4b5;
    --line: #2a3647;
    --accent: #6ea8ff;
    --accent-hover: #93bfff;
    --on-accent: #0a1322;
    --ok: #53c48b;
    --err: #ff8a80;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
}
h1, h2 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-bottom: 1.1rem; }
h2 { font-size: 1.15rem; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
[hidden] { display: none !important; }

/* Kopfzeile */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1000px; margin: 0 auto; padding: 1.1rem 1.25rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 650; }
.brand svg { width: 26px; height: 26px; }
.brand rect { fill: var(--accent); }
.brand path { stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.link { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.link:hover { color: var(--ink); text-decoration: underline; }

main { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem 4rem; }
main.narrow { max-width: 460px; padding-top: 2.5rem; }
.lead { color: var(--muted); margin: -0.4rem 0 1.4rem; }

/* Adresszeile – das zentrale Element */
.capture { padding: 1.5rem 0 1.25rem; }
.address {
  display: flex; align-items: stretch;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.address:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.scheme {
  border: 0; background: none; cursor: pointer;
  padding: 0 0.15rem 0 1.15rem;
  font: 500 clamp(1rem, 2.4vw, 1.45rem)/1 var(--mono);
  color: var(--muted);
}
.scheme:hover { color: var(--accent); }
.address input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent; color: var(--ink);
  padding: 1.05rem 0.5rem 1.05rem 0.1rem;
  font: 650 clamp(1.4rem, 4.2vw, 2.4rem)/1.15 var(--sans);
  letter-spacing: -0.025em;
}
.address input::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.go {
  border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
  font: 650 1.05rem/1 var(--sans);
  padding: 0 1.8rem;
}
.go:hover { background: var(--accent-hover); }
.go:disabled { opacity: .55; cursor: progress; }

@media (max-width: 620px) {
  .address { flex-wrap: wrap; }
  .address input { flex-basis: 60%; }
  .go { flex-basis: 100%; padding: 0.95rem; }
}

/* Einstellungen */
.opts { margin-top: 0.9rem; }
.opts summary { cursor: pointer; color: var(--muted); font-size: 0.95rem; width: max-content; }
.opts summary:hover { color: var(--ink); }
.opts[open] summary { margin-bottom: 1rem; color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem 1rem; }
.grid.two { grid-template-columns: 3fr 2fr; margin-top: 1rem; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } .grid.two { grid-template-columns: 1fr; } }
.checks { display: grid; gap: 0.35rem; margin-top: 1rem; }
.checks label { display: flex; gap: 0.55rem; align-items: baseline; cursor: pointer; }
.checks input { accent-color: var(--accent); transform: translateY(1px); }

.field { display: grid; gap: 0.3rem; align-content: start; }
.field span { font-size: 0.85rem; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 0.55rem 0.7rem;
}
.field textarea { font-family: var(--mono); font-size: 0.88rem; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.stack { display: grid; gap: 0.9rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 0.93rem/1 var(--sans);
  padding: 0.62rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.quiet { border-color: transparent; background: none; color: var(--muted); }
.btn.quiet:hover { color: var(--err); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.error { color: var(--err); margin: 0.6rem 0 0; }
.hint { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* Laufende Sicherung */
.run {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.1rem;
  margin: 0.5rem 0 2.25rem;
}
.run-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.run-head h2 { font-size: 1.3rem; word-break: break-all; }
.phase { margin: 0.2rem 0 0; color: var(--muted); }
.phase.ok { color: var(--ok); font-weight: 600; }
.phase.bad { color: var(--err); font-weight: 600; }
.run-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.meter { height: 4px; border-radius: 2px; background: var(--soft); overflow: hidden; margin: 1.1rem 0 1rem; position: relative; }
.meter span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); border-radius: 2px; transition: width .4s ease; }
.meter.busy span { width: 30%; animation: sweep 1.4s ease-in-out infinite; }
.meter.paused span { animation-play-state: paused; opacity: .4; }
.meter.ok span { background: var(--ok); }
@keyframes sweep { 0% { left: -30%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .meter.busy span { animation: none; left: 0; width: 100%; opacity: .35; }
  .address { transition: none; }
}

.stats { display: flex; flex-wrap: wrap; gap: 0.5rem 2.2rem; margin: 0 0 1rem; }
.stats div { display: grid; }
.stats dt { font-size: 0.8rem; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }

.note { margin: 0 0 0.9rem; padding: 0.6rem 0.8rem; border-radius: 8px; background: var(--soft); font-size: 0.93rem; }

.log {
  list-style: none; margin: 0 0 0.8rem; padding: 0.4rem 0;
  max-height: 15rem; overflow: auto;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.log:empty { display: none; }
.log li { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 0.75rem; padding: 0.16rem 0; align-items: baseline; }
.log .t { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.log .u { font: 0.82rem/1.4 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log li.e .t, .log li.e .u { color: var(--err); }

.errs { margin: 0 0 0.8rem; }
.errs summary { cursor: pointer; color: var(--err); font-size: 0.93rem; }
.errs ol { margin: 0.5rem 0 0; padding-left: 1.2rem; font: 0.82rem/1.5 var(--mono); }
.errs li { word-break: break-all; }

/* Archiv */
.archive h2 { margin-bottom: 0.6rem; }
.jobs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.jobs li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 1rem; align-items: center; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.jobs li.empty { display: block; color: var(--muted); }
.jobs .host { font-weight: 650; word-break: break-all; }
.jobs .meta { color: var(--muted); font-size: 0.88rem; }
.jobs .meta .bad { color: var(--err); }
.jobs .acts { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 620px) { .jobs li { grid-template-columns: 1fr; } .jobs .acts { justify-content: flex-start; } }
