:root {
  --bg: #ffffff;
  --fg: #1d232b;
  --muted: #5d6875;
  --line: #d9dee4;
  --accent: #1f5fa8;
  --ok: #2e7d32;
  --err: #b3261e;
  --warn: #8a6100;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191e;
    --fg: #e4e8ec;
    --muted: #9aa5b1;
    --line: #2f363e;
    --accent: #7fb0ec;
    --ok: #81c784;
    --err: #f28b82;
    --warn: #e6c26b;
  }
}

body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.5; }
main { max-width: 72rem; margin: 0 auto; padding: 1rem; }
footer { max-width: 72rem; margin: 2rem auto; padding: 0 1rem; color: var(--muted); font-size: .85rem; }

.topbar { display: flex; gap: 2rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; }
nav a { color: var(--accent); text-decoration: none; margin-right: 1rem; }
nav a[aria-current="page"] { font-weight: 600; text-decoration: underline; }

table { border-collapse: collapse; width: 100%; margin: .5rem 0 1.5rem; }
th, td { text-align: left; padding: .35rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
td.error { color: var(--err); font-family: ui-monospace, monospace; font-size: .85rem; word-break: break-word; }

.alert { border: 1px solid var(--err); color: var(--err); padding: .6rem .8rem; border-radius: 4px; }
.badge { padding: .05rem .45rem; border-radius: 3px; border: 1px solid currentColor; font-size: .85rem; }
.badge-ok { color: var(--ok); }
.badge-error { color: var(--err); }
.badge-running { color: var(--warn); }
.badge-none { color: var(--muted); }
progress { width: 100%; max-width: 24rem; }

/* Suche */
form.search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
form.search input[type=search] { flex: 1 1 24rem; font-size: 1.05rem; padding: .45rem .6rem; }
form.search details { flex-basis: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .5rem; }
.filters label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
button, select, input { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: .3rem .5rem; }
button { cursor: pointer; }
.hits { padding-left: 1.5rem; }
.hits li { margin-bottom: 1.1rem; }
.hit-title { font-weight: 600; color: var(--accent); text-decoration: none; white-space: pre-line; }
.meta { font-size: .85rem; color: var(--muted); display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.snippet { margin: .3rem 0 0; font-size: .92rem; white-space: pre-line; }
mark { background: #ffe58a; color: #1d232b; padding: 0 .1rem; }
.chip { font-size: .85rem; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .6rem; }
.pager { display: flex; gap: 1rem; }

/* Dokument */
.doc-text { white-space: pre-wrap; font-family: ui-serif, Georgia, serif; line-height: 1.55; max-height: 70vh; overflow: auto; border: 1px solid var(--line); padding: 1rem; border-radius: 4px; }
a.mention { background: color-mix(in srgb, var(--accent) 15%, transparent); color: inherit; text-decoration: none; border-bottom: 1px solid var(--accent); }
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; }
dl.kv dt { color: var(--muted); }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin: .25rem 0; }
.timeline li { margin-bottom: .6rem; }
.chart-box { position: relative; height: 260px; }
#cy { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 4px; }

/* LLM-Ausgaben (Zusammenfassung, Dossier, Wochenbrief) */
section.llm { border: 1px solid var(--line); border-radius: 4px; padding: .6rem 1rem; margin: 1rem 0; }
ul.claims { padding-left: 1.2rem; }
ul.claims > li { margin-bottom: .6rem; }
ul.evidence { list-style: none; padding-left: .6rem; margin: .2rem 0; border-left: 2px solid var(--line); font-size: .85rem; color: var(--muted); }
.small { font-size: .85rem; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.pre-line { white-space: pre-line; }
.input-days { width: 5rem; }
