:root {
  --shield: #1f3b63;
  --ok: #1a7f37;
  --warn: #b08900;
  --high: #c2540a;
  --bad: #cf222e;
  --ink: #1f2328;
  --dim: #5b6570;
  --bg: #ffffff;
  --line: #e2e7ec;
  --surface2: #f0f3f6;
  --tone-ok-bg: #eef9f2; --tone-ok-border: #7bcc9d; --tone-ok-fg: #0f7a3d;
  --tone-warn-bg: #fdf8e6; --tone-warn-border: #e2c25c; --tone-warn-fg: #8a6a05;
  --tone-high-bg: #fdf1e5; --tone-high-border: #e8a765; --tone-high-fg: #8a4b00;
  --tone-bad-bg: #fcedef; --tone-bad-border: #df555c; --tone-bad-fg: #a80016;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
#card {
  padding: 14px 16px;
  border-left: 6px solid var(--tone-strong, var(--dim));
  min-height: 100vh;
}
#card .head { display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 12px; margin: -4px -4px 0;
  background: var(--tone-bg, transparent);
  border: 1px solid var(--tone-border, var(--line));
  border-radius: 9px; }
#card .dot {
  width: 12px; height: 12px; border-radius: 50%; margin-top: 3px;
  flex: 0 0 auto; background: var(--tone-strong, var(--dim));
}
#card .label { font-weight: 750; font-size: 16px; line-height: 1.25; letter-spacing: -.01em;
  color: var(--tone-fg, var(--ink)); }
#card .action { margin-top: 6px; font-weight: 650; line-height: 1.4; color: var(--tone-fg, var(--ink)); }
#card .action[hidden] { display: none; }
#card .reason { margin-top: 10px; color: var(--ink); line-height: 1.5; }
.more { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line, #d6d9de); }
.more[hidden] { display: none; }
.more summary { font-size: 12px; font-weight: 600; cursor: pointer; color: var(--dim); margin-bottom: 8px; }
#card .details { margin: 10px 0 0; padding: 0 0 0 20px; color: var(--dim); line-height: 1.6; }
.process { margin-top: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--tone-border, var(--line)); background: var(--tone-bg, transparent); }
.process[hidden], .safe-checks[hidden], .coverage[hidden] { display: none; }
.coverage { margin: 10px 0 0; font-size: 11px; color: var(--dim); }
.writeback-note { margin: 8px 0 0; font-size: 12px; color: var(--dim); }
.writeback-note.dead { color: var(--bad); font-weight: 600; }
.writeback-note[hidden] { display: none; }
.process .p-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.process .p-lead { font-size: 12px; line-height: 1.6; margin-bottom: 6px; }
.process ol { margin: 0; padding-left: 19px; font-size: 12px; line-height: 1.7; }
.process .p-why { font-size: 11px; line-height: 1.6; opacity: .8; margin: 7px 0 0; }
.safe-checks { margin-top: 10px; font-size: 12px; color: var(--dim); }
.safe-checks .s-h { font-weight: 600; }
.safe-checks ul { margin: 4px 0 0 18px; padding: 0; line-height: 1.7; }
#card .details:empty { display: none; }
#card .reco { margin-top: 8px; line-height: 1.5; color: var(--dim); }
#card .reco:empty { display: none; }
#card .meta { margin-top: 10px; font-size: 12px; color: #8a949e; }

/* „Erkannt durch"-Marker */
.detectors { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.detectors[hidden] { display: none; }
.chip {
  font-size: 11px; line-height: 1.4; padding: 2px 8px;
  border: 1px solid currentColor; border-radius: 999px;
  color: var(--dim); opacity: 0.9;
}

/* „Diese Mail jetzt prüfen" – bleibt in JEDEM Zustand sichtbar */
.recheck { margin-top: 12px; }
.recheck[hidden] { display: none; }
.btn-analyze { background: var(--shield); color: #fff; border-color: var(--shield); }
#analyze-status { margin-top: 6px; }

/* schon gemeldet: Hinweis + Zurücknehmen */
.reported {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.reported[hidden] { display: none; }
.reported-note { color: var(--dim); line-height: 1.5; margin-bottom: 8px; }
.btn-retract {
  background: var(--surface2); color: var(--dim);
  border-color: var(--line);
}

/* Melde-Bereich */
.report {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.report-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.report-row[hidden] { display: none; }
.warn { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.warn summary { font-size: 12px; font-weight: 600; cursor: pointer; color: var(--dim); margin-bottom: 8px; }
#warned-note { margin-top: 10px; }
.report input[type="text"],
.report select,
.warn input[type="text"],
.warn select {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
}
.btn {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  background: var(--surface2);
  color: var(--ink);
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-fraud { background: #c2410c; color: #fff; border-color: #c2410c; }
.btn-safe  { background: transparent; color: var(--ok); border-color: var(--ok); }
.report-status { font-size: 12px; color: var(--dim); min-height: 1em; }
.report-hint { font-size: 11px; color: var(--dim); line-height: 1.4; margin-top: 2px; }

/* Zustände */
.state-loading { --tone-strong: var(--shield); }
.state-ok { --tone-strong: var(--ok); --tone-bg: var(--tone-ok-bg); --tone-border: var(--tone-ok-border); --tone-fg: var(--tone-ok-fg); }
.state-warn { --tone-strong: var(--warn); --tone-bg: var(--tone-warn-bg); --tone-border: var(--tone-warn-border); --tone-fg: var(--tone-warn-fg); }
.state-high { --tone-strong: var(--high); --tone-bg: var(--tone-high-bg); --tone-border: var(--tone-high-border); --tone-fg: var(--tone-high-fg); }
.state-bad { --tone-strong: var(--bad); --tone-bg: var(--tone-bad-bg); --tone-border: var(--tone-bad-border); --tone-fg: var(--tone-bad-fg); }
.state-none, .state-error { --tone-strong: #8a949e; }
.state-error { --tone-fg: var(--bad); }
html.state-ok, body.state-ok, html.state-warn, body.state-warn,
html.state-high, body.state-high, html.state-bad, body.state-bad { background: var(--tone-bg); }
/* im "noch nicht geprüft"/-Fehlerzustand keine Melde-/Rücknahme-Bereiche */
.state-loading .report, .state-none .report, .state-error .report,
.state-loading .warn, .state-none .warn, .state-error .warn,
.state-loading .reported, .state-none .reported, .state-error .reported { display: none; }

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6edf3; --dim: #9aa7b2; --bg: #1b1b1b;
    --line: #2b343d; --surface2: #24303a;
    --tone-ok-bg: #12261a; --tone-ok-border: #2f7a4d; --tone-ok-fg: #62d18a;
    --tone-warn-bg: #2a2410; --tone-warn-border: #8a6a05; --tone-warn-fg: #e6c85a;
    --tone-high-bg: #2b1c0d; --tone-high-border: #a3651c; --tone-high-fg: #f0a860;
    --tone-bad-bg: #2e1418; --tone-bad-border: #a83a42; --tone-bad-fg: #ff8790;
  }
}
