:root {
  --bg: #f6f7f9; --panel: #ffffff; --panel2: #f0f2f5; --line: #e3e6eb; --text: #141a22; --muted: #5d6877;
  --up: #0a8f5a; --down: #d23c3c; --warn: #b7791f; --accent: #2f6fde; --accent2: #e8f0fd;
  --g: #12a26a; --y: #d39b1d; --r: #d64545; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --radius: 14px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d141c; --panel: #131c26; --panel2: #18232f; --line: #233140; --text: #e6ebf1; --muted: #8b98a8;
    --up: #2fbf7f; --down: #f06363; --warn: #e3a93a; --accent: #5b93f0; --accent2: #17263b;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d141c; --panel: #131c26; --panel2: #18232f; --line: #233140; --text: #e6ebf1; --muted: #8b98a8;
  --up: #2fbf7f; --down: #f06363; --warn: #e3a93a; --accent: #5b93f0; --accent2: #17263b;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; padding-bottom: calc(70px + env(safe-area-inset-bottom));
}
a { color: inherit; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; text-decoration: none; letter-spacing: .2px; }
.logo { width: 22px; height: 22px; border-radius: 6px; background:
  linear-gradient(135deg, var(--accent) 0 50%, var(--up) 50% 100%); }
.nav { display: none; gap: 4px; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav a.on { background: var(--accent2); color: var(--accent); }
.status { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--g); vertical-align: 1px; }
.status .dot.old { background: var(--y); }
main { max-width: 1180px; margin: 0 auto; padding: 16px; outline: none; }
.loading, .empty { color: var(--muted); padding: 40px 0; text-align: center; }
h1 { font-size: 22px; margin: 4px 0 2px; letter-spacing: -.2px; }
h2 { font-size: 15px; margin: 26px 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.sub { color: var(--muted); margin: 0 0 14px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; min-width: 0; }
.kpi .lab { font-size: 12.5px; color: var(--muted); }
.kpi .val { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.world { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; }
.world .big { font-size: 26px; line-height: 1; }
.list { display: grid; gap: 10px; }
.pos { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-decoration: none; }
.pos .sym { font-weight: 700; }
.pos .nm { color: var(--muted); font-size: 13px; }
.pos .pl { font-weight: 700; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.pos .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.bar { grid-column: 1 / -1; height: 6px; background: var(--panel2); border-radius: 99px; position: relative; overflow: hidden; margin-top: 4px; }
.bar i { position: absolute; top: 0; bottom: 0; background: var(--up); border-radius: 99px; }
.bar i.neg { background: var(--down); }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.pill.long { background: color-mix(in srgb, var(--up) 15%, transparent); color: var(--up); }
.pill.short { background: color-mix(in srgb, var(--down) 15%, transparent); color: var(--down); }
.amp { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.amp.gruen { background: var(--g); } .amp.gelb { background: var(--y); } .amp.rot { background: var(--r); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.tabs button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl { overflow-x: auto; padding: 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; background: var(--panel2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--panel2); }
td.num, th.num { text-align: right; }
.symcell { display: flex; align-items: center; gap: 10px; }
.symcell b { display: block; }
.symcell small { color: var(--muted); display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.hide-s { display: none; }
.chart { height: 380px; padding: 0; overflow: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.head .px { margin-left: auto; text-align: right; }
.head .px .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.back { display: inline-block; text-decoration: none; color: var(--accent); margin-bottom: 8px; font-weight: 500; }
.explain { background: var(--accent2); border-color: transparent; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.sig { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; align-items: center; text-decoration: none; }
.sig .ic { font-size: 18px; width: 26px; text-align: center; }
.sig .t { color: var(--muted); font-size: 12.5px; text-align: right; }
.sig .w { font-size: 13px; color: var(--muted); grid-column: 2 / 4; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); color: var(--muted); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--accent2); color: var(--accent); }
.foot { max-width: 1180px; margin: 30px auto 0; padding: 16px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11.5px; color: var(--muted); text-decoration: none; }
.tabbar a.on { color: var(--accent); }
.ti { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ti-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12l9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3C/svg%3E"); }
.ti-list { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E"); }
.ti-bell { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 10-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 01-3.4 0'/%3E%3C/svg%3E"); }
.ti-info { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7h.01'/%3E%3C/svg%3E"); }
@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .nav { display: flex; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-s { display: table-cell; }
  .chart { height: 460px; }
  main { padding: 22px 24px; }
}
@media (max-width: 719px) { .grid.two { grid-template-columns: 1fr; } .head .px { margin-left: 0; text-align: left; } }
