:root {
  --bg: #07090c; --surface: #0f1318; --surface-2: #151b22; --border: #222b36; --text: #e8edf3; --muted: #8b96a5; --faint: #5d6877;
  --accent: #38bdf8; --accent-soft: rgba(56, 189, 248, 0.12); --good: #22c55e; --bad: #ef4444; --warn: #f59e0b;
  --radius: 12px; --fs-small: 0.86rem; --fs-tiny: 0.76rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 1rem;
  background: rgba(7, 9, 12, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 0.5rem; color: var(--text); font-weight: 700; white-space: nowrap; }
.top-search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.top-search input, .field input, .field select, select.inp, input.inp {
  width: 100%; padding: 0.55rem 0.75rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); outline: none; }
.top-search input:focus, .inp:focus, .field input:focus { border-color: var(--accent); }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; max-height: 60vh; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.search-results a { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.55rem 0.75rem; color: var(--text); border-bottom: 1px solid var(--border); }
.search-results a:last-child { border-bottom: 0; }
.search-results .add { color: var(--accent); }
main { padding: 1rem 1rem calc(5.5rem + var(--safe-bottom)); max-width: 980px; margin: 0 auto; }
h1 { font-size: 1.35rem; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.02rem; margin: 1.6rem 0 0.6rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(11, 14, 18, 0.97); border-top: 1px solid var(--border); padding: 0.35rem 0 calc(0.35rem + var(--safe-bottom)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 0.72rem; padding: 0.2rem 0.8rem; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--accent); }
.empty { color: var(--muted); padding: 1.2rem 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; }
.grid { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi .label { font-size: var(--fs-tiny); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi .value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 0.15rem; }
.kpi .sub { font-size: var(--fs-small); color: var(--muted); }
.light { display: flex; align-items: center; gap: 0.5rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.gruen { background: var(--good); } .dot.gelb { background: var(--warn); } .dot.rot { background: var(--bad); }
.up { color: var(--good); } .down { color: var(--bad); }
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.row { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); color: var(--text); }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: var(--fs-small); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank { width: 2rem; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.score { min-width: 2.6rem; text-align: center; padding: 0.2rem 0.4rem; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score.hi { background: rgba(34, 197, 94, 0.16); color: var(--good); }
.score.mid { background: rgba(245, 158, 11, 0.14); color: var(--warn); }
.score.lo { background: rgba(239, 68, 68, 0.14); color: var(--bad); }
.minibars { display: flex; gap: 2px; align-items: flex-end; height: 22px; }
.minibars i { width: 5px; background: var(--accent); border-radius: 2px; opacity: 0.8; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { font-size: var(--fs-tiny); padding: 0.2rem 0.55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.chip.warn { color: var(--warn); border-color: rgba(245, 158, 11, 0.4); }
.chip.theme { color: var(--accent); border-color: rgba(56, 189, 248, 0.35); }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 0.9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121c; font-weight: 600; }
.btn.small { padding: 0.3rem 0.6rem; font-size: var(--fs-small); }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.danger { color: var(--bad); }
.bar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; }
.seg { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; }
.head .price { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.factor { display: grid; grid-template-columns: 7.5rem 1fr 2.6rem; align-items: center; gap: 0.6rem; margin: 0.35rem 0; font-size: var(--fs-small); }
.factor .track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.factor .fill { height: 100%; background: var(--accent); border-radius: 4px; }
.reasons { display: grid; gap: 0.3rem; margin-top: 0.7rem; font-size: var(--fs-small); }
.reasons .p::before { content: "+ "; color: var(--good); font-weight: 700; }
.reasons .m::before { content: "– "; color: var(--bad); font-weight: 700; }
table.kv { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
table.kv td { padding: 0.4rem 0.2rem; border-bottom: 1px solid var(--border); }
table.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.chart { position: relative; width: 100%; height: 220px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart .tip { position: absolute; top: 4px; pointer-events: none; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.2rem 0.5rem; font-size: var(--fs-tiny); white-space: nowrap; }
.desc { color: var(--muted); font-size: var(--fs-small); line-height: 1.55; }
.alert .t { white-space: normal; }
.alert .s { white-space: normal; }
.alert .meta { font-size: var(--fs-tiny); color: var(--faint); margin-top: 0.15rem; }
.prio-hoch { border-left: 3px solid var(--bad); }
.prio-normal { border-left: 3px solid var(--accent); }
.prio-info { border-left: 3px solid var(--border); }
.thumbs { display: flex; gap: 0.3rem; }
.thumbs button { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 0.15rem 0.45rem; cursor: pointer; color: var(--muted); }
.thumbs button.on { border-color: var(--accent); color: var(--accent); }
.form { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.field label { display: block; font-size: var(--fs-tiny); color: var(--muted); margin-bottom: 0.25rem; }
.field .hint { font-size: var(--fs-tiny); color: var(--faint); margin-top: 0.2rem; }
.check { display: flex; gap: 0.5rem; align-items: center; font-size: var(--fs-small); color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(5rem + var(--safe-bottom)); transform: translateX(-50%); z-index: 50; background: var(--surface-2);
  border: 1px solid var(--border); padding: 0.6rem 1rem; border-radius: 10px; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.dialog { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,0.6); display: flex; align-items: flex-end; justify-content: center; }
.dialog .card { width: 100%; max-width: 520px; border-radius: 16px 16px 0 0; padding-bottom: calc(1.2rem + var(--safe-bottom)); }
.login { max-width: 360px; margin: 12vh auto 0; }
.login h1 { text-align: center; }
.muted { color: var(--muted); } .small { font-size: var(--fs-small); } .tiny { font-size: var(--fs-tiny); }
.right { margin-left: auto; }
.mt { margin-top: 0.8rem; }
@media (min-width: 900px) {
  .tabs { top: 56px; bottom: auto; left: 0; right: auto; width: 88px; height: calc(100vh - 56px); flex-direction: column; justify-content: flex-start;
    gap: 0.8rem; padding-top: 1rem; border-top: 0; border-right: 1px solid var(--border); }
  main { padding-left: 110px; max-width: 1100px; padding-bottom: 2rem; }
  .toast { bottom: 2rem; }
  .dialog { align-items: center; }
  .dialog .card { border-radius: 16px; }
}
