/* (c) 2026 DANWUCON.AI — Daniel Wuttke. Alle Rechte vorbehalten. */
/* AMTA Dashboard v3 – dunkles Layout, Orange als Akzent. Keine externen Ressourcen. */
:root {
  --bg: #08090c;
  --bg-2: #0c0e12;
  --card: #121419;
  --card-2: #171a20;
  --card-3: #1d2028;
  --line: #22252d;
  --line-2: #2e323c;
  --text: #f3f4f6;
  --text-2: #c9ccd3;
  --muted: #8a909c;
  --dim: #5f6570;
  --accent: #ff7a1a;
  --accent-2: #ffa149;
  --accent-soft: rgba(255, 122, 26, .14);
  --accent-glow: rgba(255, 122, 26, .45);
  --good: #2fd27a;
  --good-soft: rgba(47, 210, 122, .13);
  --bad: #ff5b5b;
  --bad-soft: rgba(255, 91, 91, .13);
  --warn: #f5b83d;
  --warn-soft: rgba(245, 184, 61, .13);
  --info: #6aa8ff;
  --info-soft: rgba(106, 168, 255, .13);
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px rgba(0, 0, 0, .35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 70% -10%, rgba(255, 122, 26, .05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--accent);
  color: #111; padding: 6px 12px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* --- Grundgerüst ---------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px; background: linear-gradient(180deg, #0d0f13, #0a0b0e);
  border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 8px; }
.brand img { width: 38px; height: 38px; filter: drop-shadow(0 0 10px var(--accent-glow)); }
.brand-name { font-size: 24px; font-weight: 750; letter-spacing: .04em; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500; border: 1px solid transparent;
}
.nav a:hover { background: var(--card-2); color: var(--text); }
.nav a[aria-current="page"] {
  background: linear-gradient(90deg, rgba(255, 122, 26, .2), rgba(255, 122, 26, .06));
  border-color: rgba(255, 122, 26, .45); color: var(--text);
  box-shadow: 0 0 18px rgba(255, 122, 26, .12);
}
.nav a[aria-current="page"] .icon { color: var(--accent); }
.nav .icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.side-spacer { flex: 1; }
.sysbox {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; font-size: 13px;
}
.sysbox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-weight: 650; margin-bottom: 8px; }
.sysbox-head .icon { width: 16px; height: 16px; color: var(--good); }
.sysbox dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
.sysbox .status { white-space: normal; }
.sysbox dt { color: var(--muted); }
.sysbox dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sysbox .hint { margin-top: 8px; color: var(--dim); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 18px 26px 12px; flex-wrap: wrap;
}
.topbar-title { flex: 1 1 320px; min-width: 0; }
.topbar h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: .005em; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn.menu-btn { display: none; }
.content { padding: 4px 26px 40px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Demo-Etikett und Schalter oben rechts */
.demo-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(245, 184, 61, .45); background: var(--warn-soft); color: var(--warn);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.demo-badge .icon { width: 14px; height: 14px; }
.switch {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--card);
  cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.switch:hover { border-color: var(--dim); }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative;
  transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #cfd3da; transition: transform .2s;
}
.switch.on { border-color: rgba(47, 210, 122, .45); color: var(--good); }
.switch.on .track { background: var(--good); }
.switch.on .track::after { transform: translateX(16px); background: #fff; }
.switch.kill { border-color: rgba(255, 91, 91, .5); color: var(--bad); }

/* Banner */
.banner {
  margin: 0 26px 6px; padding: 10px 14px; border-radius: var(--radius-s);
  border: 1px solid rgba(255, 91, 91, .5); background: var(--bad-soft); color: #ffd1d1;
  display: flex; gap: 10px; align-items: center; font-weight: 550;
}
.banner[hidden] { display: none; }
.banner .icon { width: 18px; height: 18px; color: var(--bad); flex: none; }
.is-stale .stale-able { opacity: .55; filter: saturate(.4); }

/* --- Karten --------------------------------------------------------------------- */
.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(262px, 1fr)); }
.row-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row-main { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.row-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.row-trading { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 0; display: flex; flex-direction: column;
}
.card-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; flex-wrap: wrap;
}
.card-head h2 {
  margin: 0; font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 9px;
}
.card-head h2 .icon { width: 18px; height: 18px; color: var(--accent); }
.card-head .sub { color: var(--muted); font-weight: 450; font-size: 13px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 6px 16px 16px; min-width: 0; flex: 1; }
.card-body.flush { padding: 0 0 8px; }
.card-foot { padding: 0 16px 14px; color: var(--dim); font-size: 12px; }

.kpi { padding: 16px 18px; display: flex; flex-direction: row; gap: 14px; align-items: center; position: relative;
  overflow: hidden; }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--card-3); border: 1px solid var(--line-2); color: var(--accent);
}
.kpi-icon .icon { width: 22px; height: 22px; }
.kpi-icon.good { color: var(--good); background: var(--good-soft); border-color: rgba(47, 210, 122, .3); }
.kpi-icon.bad { color: var(--bad); background: var(--bad-soft); border-color: rgba(255, 91, 91, .3); }
.kpi-text { min-width: 0; flex: 1; position: relative; z-index: 1; }
.kpi-label { color: var(--text-2); font-size: 13px; }
.kpi-value { font-size: clamp(19px, calc(.85rem + .6vw), 24px); font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-value .unit { font-size: .58em; font-weight: 600; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.kpi-sub { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.kpi-spark { position: absolute; right: 0; bottom: 0; width: 62%; height: 58%; opacity: .45; z-index: 0;
  pointer-events: none; }

.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.strong { font-weight: 650; }

/* Status-Punkte, Pillen */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none;
  background: var(--dim); }
.dot.good { background: var(--good); box-shadow: 0 0 8px rgba(47, 210, 122, .7); }
.dot.bad { background: var(--bad); box-shadow: 0 0 8px rgba(255, 91, 91, .6); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(245, 184, 61, .5); }
.dot.accent { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--text-2);
  background: var(--card-3); white-space: nowrap;
}
.pill.good { color: var(--good); background: var(--good-soft); border-color: rgba(47, 210, 122, .3); }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: rgba(255, 91, 91, .3); }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(245, 184, 61, .3); }
.pill.info { color: var(--info); background: var(--info-soft); border-color: rgba(106, 168, 255, .3); }
.pill.accent { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(255, 122, 26, .35); }
.pill.swarm { color: var(--accent-2); background: var(--accent-soft); border-color: rgba(255, 122, 26, .35); }
.pill.trend { color: var(--info); background: var(--info-soft); border-color: rgba(106, 168, 255, .3); }

/* Reiter */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 11px; overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.tabs button {
  border: 1px solid transparent; background: transparent; padding: 6px 14px; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] {
  background: var(--card-3); color: var(--text); border-color: var(--line-2);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.tabs.underline { background: none; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 0 12px; }
.tabs.underline button { border-radius: 0; padding: 10px 12px; }
.tabs.underline button[aria-selected="true"] { background: none; border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--accent); }
.tf { display: inline-flex; padding: 3px 10px; border-radius: 7px; font-size: 12px; font-weight: 700;
  border: 1px solid rgba(255, 122, 26, .5); color: var(--accent-2); background: var(--accent-soft); }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px;
  border-radius: 9px; border: 1px solid var(--line-2); background: var(--card-3); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none; font-size: 13.5px;
}
.btn:hover { border-color: var(--dim); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ff8a33, #f06a0c); border-color: #ff8a33; color: #160a02; }
.btn.danger { background: linear-gradient(180deg, #e54848, #c42f2f); border-color: #ff6b6b; color: #fff; }
.btn.danger-outline { border-color: rgba(255, 91, 91, .6); color: var(--bad); background: var(--bad-soft); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn .icon { width: 16px; height: 16px; }
.icon-btn { width: 38px; height: 38px; padding: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 5px 11px; cursor: pointer; color: var(--muted);
  font-weight: 600; font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-2); }

/* Tabellen */
.table-wrap { overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid rgba(34, 37, 45, .7); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.t { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td, tbody tr.clickable:focus-visible td { background: rgba(255, 255, 255, .025); }
.wrap-text { overflow-wrap: anywhere; min-width: 220px; }
.asset { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.coin {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #111; background: #f7931a; flex: none;
}
.coin.eth { background: #8c9cf5; }
.coin.other { background: #9aa0aa; }

/* Leer-, Lade- und Fehlerzustände */
.empty, .loading, .card-error {
  padding: 22px 14px; text-align: center; color: var(--muted); font-size: 13.5px;
  border: 1px dashed var(--line-2); border-radius: var(--radius-s); margin: 4px 0;
}
.empty strong { display: block; color: var(--text-2); margin-bottom: 3px; }
.loading { border-style: solid; border-color: var(--line); position: relative; overflow: hidden; }
.loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .04), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.card-error { border-color: rgba(255, 91, 91, .45); color: #ffc4c4; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; }
.activity li {
  display: grid; grid-template-columns: 48px 22px minmax(0, 1fr); gap: 8px; padding: 7px 0;
  border-bottom: 1px solid rgba(34, 37, 45, .7); align-items: start; font-size: 13.5px;
}
.activity li:last-child { border-bottom: 0; }
.activity .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.activity .icon { width: 17px; height: 17px; color: var(--accent); margin-top: 1px; }
.activity .icon.bad { color: var(--bad); }
.activity .icon.warn { color: var(--warn); }
.activity .icon.info { color: var(--info); }
.activity .who { font-weight: 650; }
.activity .what { color: var(--text-2); overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kv.left dd { text-align: left; }
.bullets { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
.bullets li { margin: 2px 0; overflow-wrap: anywhere; }
.bullets.risk li::marker { color: var(--bad); }
.note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.section-title { margin: 14px 0 6px; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 16px 4px;
  color: var(--muted); font-size: 13px; }

/* --- Charts --------------------------------------------------------------------- */
.chart-box { position: relative; width: 100%; height: 330px; min-width: 0; }
.chart-box.tall { height: 470px; }
.chart-box.mid { height: 260px; }
.chart-box.small { height: 150px; }
.chart-box canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.chart-box:focus-visible { outline: 2px solid var(--accent); }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5; background: rgba(12, 14, 18, .95);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font-size: 12px;
  min-width: 150px; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); font-variant-numeric: tabular-nums;
}
.tooltip[hidden] { display: none; }
.tooltip .tt-head { color: var(--muted); margin-bottom: 4px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; }
.tooltip .tt-mark { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); color: var(--text-2);
  max-width: 260px; white-space: normal; }
.chart-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 2px 0 8px; }
.chart-head .sym { font-size: 17px; font-weight: 700; }
.chart-head .px { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; padding-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--dim); }
.legend i.ma20 { background: var(--accent); }
.legend i.ma50 { background: var(--info); }
.legend i.entry { background: #e8e8e8; }
.legend i.stop { background: var(--bad); }
.legend i.target { background: var(--good); }
.legend i.swarm { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.legend i.trend { width: 9px; height: 9px; border-radius: 2px; background: var(--info); transform: rotate(45deg); }
.legend i.dd { background: var(--bad); }
.legend i.eq { background: var(--accent); }

.ticker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ticker .tick { padding: 12px 14px; cursor: pointer; text-align: left; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-2), var(--card)); border-radius: var(--radius); color: var(--text); }
.ticker .tick[aria-pressed="true"] { border-color: rgba(255, 122, 26, .6); box-shadow: 0 0 16px rgba(255, 122, 26, .12); }
.ticker .tick .px { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Donut / Balken */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.donut text { fill: var(--text); font-family: var(--font); }
.legend-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; font-size: 13px; }
.legend-list li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; padding: 3px 0; }
.legend-list .sw { width: 10px; height: 10px; border-radius: 3px; }
.bars { width: 100%; height: auto; max-height: 220px; display: block; }
.meter { height: 10px; border-radius: 999px; background: var(--card-3); border: 1px solid var(--line);
  overflow: hidden; position: relative; }
.meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--good); }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }
.meter-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px; gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid rgba(34, 37, 45, .7); }
.meter-row:last-child { border-bottom: 0; }
.meter-row .val { text-align: right; font-variant-numeric: tabular-nums; }
.stance-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--card-3); min-width: 90px; }
.stance-bar span { display: block; height: 100%; }
.stance-bar .l { background: var(--good); }
.stance-bar .s { background: var(--bad); }
.stance-bar .n { background: var(--dim); }

/* --- Agenten-Netzwerk ------------------------------------------------------------ */
.network { position: relative; width: 100%; height: 360px; }
.network svg.links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.network .link { fill: none; stroke: var(--line-2); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.network .link.on { stroke: var(--accent); stroke-opacity: .75; stroke-dasharray: 5 6;
  animation: flow 1.6s linear infinite; }
.network .link.err { stroke: var(--bad); stroke-opacity: .7; stroke-dasharray: 3 5; }
.network .link.off { stroke-dasharray: 2 6; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.core {
  position: absolute; width: 132px; height: 132px; transform: translate(-50%, -50%); border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 45%, #2a1608 0%, #160c05 55%, #0c0806 100%);
  border: 1px solid rgba(255, 122, 26, .6);
  box-shadow: 0 0 0 10px rgba(255, 122, 26, .05), 0 0 40px rgba(255, 122, 26, .35), inset 0 0 30px rgba(255, 122, 26, .25);
}
.core.idle { border-color: var(--line-2); box-shadow: 0 0 0 10px rgba(255, 255, 255, .02); filter: saturate(.3); }
.core img { width: 46px; height: 46px; display: block; margin: 0 auto 2px; }
.core .core-name { font-weight: 800; letter-spacing: .08em; font-size: 17px; }
.core .core-sub { font-size: 10.5px; color: var(--muted); }
.core::before {
  content: ""; position: absolute; inset: -18px; border-radius: 50%; border: 1px dashed rgba(255, 122, 26, .25);
  animation: spin 40s linear infinite;
}
.core.idle::before { border-color: var(--line); animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.node {
  position: absolute; transform: translate(-50%, -50%); width: 192px; padding: 8px 10px;
  border-radius: 11px; background: rgba(18, 20, 25, .94); border: 1px solid var(--line-2);
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 3px 8px; align-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45); font-size: 12px; text-decoration: none; color: var(--text);
}
.node.on { border-color: rgba(255, 122, 26, .5); box-shadow: 0 0 18px rgba(255, 122, 26, .16), 0 6px 18px rgba(0, 0, 0, .45); }
.node.err { border-color: rgba(255, 91, 91, .55); }
.node.det { border-style: dashed; border-color: rgba(106, 168, 255, .55); border-radius: 6px; }
.node .n-icon { grid-row: span 2; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.node.det .n-icon { background: var(--info-soft); color: var(--info); }
.node.err .n-icon { background: var(--bad-soft); color: var(--bad); }
.node.off .n-icon { background: var(--card-3); color: var(--dim); }
.node .n-icon .icon { width: 16px; height: 16px; }
.node .n-name { font-weight: 650; font-size: 12.5px; display: flex; align-items: center; gap: 6px;
  min-width: 0; white-space: nowrap; }
.node .n-state { color: var(--muted); font-size: 11.5px; line-height: 1.3; overflow-wrap: anywhere; }
.network-empty {
  position: absolute; left: 50%; top: 74%; transform: translate(-50%, -50%); width: min(60%, 340px);
  text-align: center; font-size: 12.5px; color: var(--text-2); background: rgba(12, 14, 18, .9);
  border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px 12px; z-index: 2;
}
.net-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12.5px; }

/* Konsens */
.consensus-top { display: flex; align-items: center; gap: 14px; }
.ring { width: 84px; height: 84px; flex: none; }
.ring text { fill: var(--text); font-family: var(--font); font-weight: 700; }
.consensus-dir { font-size: 18px; font-weight: 700; }
.agent-lines { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.agent-lines li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(34, 37, 45, .7); }
.agent-lines li:last-child { border-bottom: 0; }
.agent-lines .icon { width: 16px; height: 16px; color: var(--accent); }
.quote { margin: 10px 0 0; padding: 9px 11px; border-left: 3px solid var(--accent); background: var(--card-3);
  border-radius: 0 8px 8px 0; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.gate { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed rgba(106, 168, 255, .5);
  background: var(--info-soft); font-size: 13px; overflow-wrap: anywhere; }

/* Stimmen (Zyklus-Detail) */
.votes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vote { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); min-width: 0; }
.vote.err { border-color: rgba(255, 91, 91, .5); }
.vote-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.vote-head .icon { width: 18px; height: 18px; color: var(--accent); }
.vote-head strong { font-size: 14px; }
.vote-meta { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.err-text { color: var(--bad); overflow-wrap: anywhere; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; }

/* Dialog und Meldungen */
dialog {
  border: 1px solid var(--line-2); border-radius: 16px; background: var(--card-2); color: var(--text);
  padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog.danger { border-color: rgba(255, 91, 91, .6); }
.dlg-body { padding: 20px 22px 8px; }
.dlg-body h2 { margin: 0 0 8px; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.dlg-body h2 .icon { width: 22px; height: 22px; color: var(--accent); }
dialog.danger .dlg-body h2 .icon { color: var(--bad); }
.dlg-body p { color: var(--text-2); margin: 6px 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; flex-wrap: wrap; }
.toast-area { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 36px)); }
.toast { padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--card-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5); font-size: 13.5px; }
.toast.good { border-color: rgba(47, 210, 122, .5); }
.toast.bad { border-color: rgba(255, 91, 91, .6); }

.action-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--card); }
.action-card.danger-zone { border-color: rgba(255, 91, 91, .45); background: linear-gradient(180deg, rgba(255, 91, 91, .07), var(--card)); }
.action-card h3 { margin: 0 0 4px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.action-card h3 .icon { width: 18px; height: 18px; }
.action-card p { margin: 4px 0 12px; color: var(--muted); font-size: 13px; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); padding: 28px 26px; }
.login-card .brand { justify-content: center; padding: 0 0 6px; }
.login-card .brand img { width: 48px; height: 48px; }
.login-card .brand-name { font-size: 30px; }
.login-card .lead { text-align: center; color: var(--muted); margin: 0 0 14px; }
.login-card label { display: block; font-weight: 600; margin: 16px 0 6px; }
.login-card input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text);
}
.login-card input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .btn { width: 100%; margin-top: 14px; padding: 11px; }
.login-card .error { color: var(--bad); min-height: 1.4em; margin: 8px 0 0; font-size: 13px; }
.login-card .center { display: flex; justify-content: center; margin-top: 16px; }

/* --- Responsiv ------------------------------------------------------------------- */
.scrim { display: none; }
@media (max-width: 1280px) {
  .row-main, .row-wide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .row-trading { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: 264px; transform: translateX(-105%);
    transition: transform .2s ease; box-shadow: 20px 0 40px rgba(0, 0, 0, .5);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; }
  .btn.menu-btn { display: inline-flex; }
  .row-2 { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 14px 16px 10px; }
  .content { padding: 4px 16px 32px; }
  .banner { margin: 0 16px 6px; }
}
@media (max-width: 700px) {
  .network { height: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .network svg.links, .network .core { display: none; }
  .network .node { position: static; transform: none; width: auto; }
  .network-empty { position: static; transform: none; width: auto; }
  .chart-box { height: 280px; }
  .chart-box.tall { height: 340px; }
  .meter-row { grid-template-columns: minmax(0, 1fr) auto; }
  .meter-row .meter { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .topbar h1 { font-size: 20px; }
  .topbar p { display: none; }
  .kpi-value { font-size: 22px; }
  .votes { grid-template-columns: minmax(0, 1fr); }
  .switch .label-long { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
