/* NAO Exchange · gemeinsame Gestaltung
   Eine Schrift (Geist), Schwarz auf Weiß, Grün/Rot nur für Veränderung und Kauf/Verkauf, Orange nur für Hinweise.
   Zwei Rahmen:
     body.public  – Börse und Derivate: Kopfleiste oben, weißer Grund, Inhalt zentriert (max. 1200), keine Kästen.
                    Gegliedert wird mit Abstand und Typografie; Flächen nur für Eingaben (.panel, z. B. Handelsmaske).
     body.tool    – Backoffice: Seitenleiste, hellgrauer Grund, weiße Karten.
   Dunkel per data-theme="dark". */
@font-face { font-family: 'Geist Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/geist-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/geist-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF; }

:root {
  --sans: 'Geist Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --ink: #0b0b0c; --muted: #6b6b70; --faint: #a1a1a6;
  --paper: #ffffff; --canvas: #f4f4f6; --field: #f4f4f6; --hover: #f7f7f8; --line: #ebebee; --track: #d4d4da;
  --gain: #0b8a5f; --gain-soft: #e7f5ee; --danger: #cf3a3f; --danger-soft: #fcecec; --warn: #a14b08; --warn-soft: #fdf3e1;
  --r: 12px; --r-lg: 16px;
  --w: 1200px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f7; --muted: #a1a1a6; --faint: #6e6e73;
  --paper: #0b0b0c; --canvas: #141416; --field: #1c1c1f; --hover: #161618; --line: #26262a; --track: #48484a;
  --gain: #34d399; --gain-soft: #0f2a1f; --danger: #f87171; --danger-soft: #3a1618; --warn: #fbbf24; --warn-soft: #33260b;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font: 400 15px/22px var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, p, dl, dd, ul, figure { margin: 0; padding: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[hidden] { display: none !important; }

.up { color: var(--gain); } .down { color: var(--danger); } .dim { color: var(--muted); } .warn { color: var(--warn); }
.label, .t th, .fld > span, .kpi dt { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
.num { text-align: right; white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--track); flex: none; }
.dot.on { background: var(--gain); }
.linkish { all: unset; cursor: pointer; color: var(--muted); }
.linkish:hover { color: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-size: 10px; font-weight: 600; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 15px; font-weight: 600; line-height: 20px; }
.brand-text small { font-size: 12px; color: var(--muted); line-height: 16px; }

/* ---------- Öffentlich: Kopfleiste ---------- */
.public .top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
.public .top-in { max-width: var(--w); margin: 0 auto; padding: 0 32px; height: 64px; display: flex; align-items: center; gap: 32px; }
.public .nav { display: flex; gap: 4px; flex: 1; }
.public .nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; white-space: nowrap; }
.public .nav a:hover { color: var(--ink); }
.public .nav a.is-on { color: var(--ink); background: var(--field); }
.public .nav .count { margin-left: 6px; font-size: 12px; color: var(--muted); }
.public .nav svg { display: none; }
.public .top-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.public .status { display: flex; align-items: center; gap: 8px; }
.public .who { display: flex; align-items: center; gap: 12px; }
.public .main { max-width: var(--w); margin: 0 auto; padding: 40px 32px 64px; display: flex; flex-direction: column; gap: 48px; }
.public .foot { max-width: var(--w); margin: 0 auto; padding: 24px 32px 48px; color: var(--muted); font-size: 12px; line-height: 18px; display: flex; justify-content: space-between; gap: 24px; }
/* Abschnitte statt Kästen */
.public .card { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.public .card h2 { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -.01em; }
.public .panel { background: var(--field); border-radius: var(--r-lg); padding: 24px; }
.public .kpi { display: grid; gap: 4px; }
.public .kpi dd { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; }
.public .grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }

/* ---------- Werkzeug: Seitenleiste ---------- */
.tool { background: var(--canvas); }
.tool .shell { min-height: 100vh; display: flex; }
.tool .side { width: 240px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; overflow-y: auto; padding: 20px 14px; }
.tool .side-top { display: flex; flex-direction: column; gap: 22px; }
.tool .brand { padding: 6px 8px; }
.tool .nav { display: flex; flex-direction: column; gap: 1px; }
.tool .nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.tool .nav a:hover { color: var(--ink); }
.tool .nav a.is-on { background: var(--paper); color: var(--ink); }
.tool .nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool .nav .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.tool .side-bottom { display: flex; flex-direction: column; gap: 14px; padding: 0 8px; font-size: 13px; }
.tool .box { display: grid; gap: 4px; }
.tool .box b { font-size: 13px; line-height: 18px; font-weight: 600; }
.tool .box small { font-size: 12px; line-height: 16px; color: var(--muted); }
.tool .links { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.tool .main { flex: 1; min-width: 0; padding: 28px 40px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; }
.tool .card { background: var(--paper); border-radius: var(--r-lg); padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tool .card h2 { font-size: 15px; line-height: 20px; font-weight: 600; }
.tool .kpi { background: var(--paper); border-radius: var(--r-lg); padding: 18px 20px; display: grid; gap: 4px; }
.tool .kpi dd { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- Gemeinsam ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing: -.02em; }
.page-head p { color: var(--muted); max-width: 640px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.grid { display: grid; gap: 24px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tool .grid { gap: 16px; }
.split { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 48px; }
.kpi small { color: var(--muted); font-size: 13px; }

/* Tabellen: ruhig, Zeilen nur durch Abstand und eine feine Linie */
.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; padding: 0 12px 10px; white-space: nowrap; }
.t td { padding: 14px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--hover); }
.t td:first-child, .t th:first-child { padding-left: 0; } .t td:last-child, .t th:last-child { padding-right: 0; }
.t .num, .t th.num { text-align: right; }
.tool .t td { padding: 11px 10px; }
.scroll { overflow-x: auto; }
.empty { color: var(--muted); padding: 8px 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 20px; background: var(--field); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--gain-soft); color: var(--gain); } .pill.bad { background: var(--danger-soft); color: var(--danger); } .pill.note { background: var(--warn-soft); color: var(--warn); }
.fname { display: flex; flex-direction: column; } .fname b { font-weight: 600; } .fname small { color: var(--muted); font-size: 13px; line-height: 18px; }

/* Formulare und Knöpfe */
.btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 500; font-size: 14px; line-height: 20px; text-align: center; white-space: nowrap; }
.btn:hover { opacity: .86; } .btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: var(--field); color: var(--ink); }
.tool .btn.ghost { background: var(--canvas); }
.btn.buy { background: var(--gain); color: #fff; } .btn.sell { background: var(--danger); color: #fff; }
.btn.small { padding: 6px 14px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.fld { display: grid; gap: 6px; }
.fld input, .fld select { width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); outline: none; }
.fld input:focus, .fld select:focus { border-color: var(--ink); }
.seg { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 3px; gap: 2px; }
.public .seg { background: var(--field); }
.public .panel .seg { background: var(--paper); }
.tool .seg { background: var(--paper); }
.seg button { all: unset; cursor: pointer; padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg.buysell button.on[data-v="buy"] { background: var(--gain); color: #fff; } .seg.buysell button.on[data-v="sell"] { background: var(--danger); color: #fff; }
.msg { padding: 10px 14px; border-radius: var(--r); font-size: 14px; }
.msg.err { background: var(--danger-soft); color: var(--danger); } .msg.ok { background: var(--gain-soft); color: var(--gain); } .msg.info { background: var(--field); color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { text-align: right; }

/* Diagramme */
.chart { width: 100%; height: 240px; display: block; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .line.nav { stroke: var(--faint); stroke-dasharray: 4 4; stroke-width: 1.5; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .grid line { stroke: var(--line); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 60; max-width: 90vw; }

/* Anmeldung */
.auth { max-width: 400px; width: 100%; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 18px; }
.auth h1 { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.02em; }
.auth p { color: var(--muted); }
.code-input { letter-spacing: .4em; font-size: 22px !important; text-align: center; }

.mt6 { margin-top: 6px; } .mt12 { margin-top: 12px; } .fs12 { font-size: 12px; line-height: 17px; } .between { justify-content: space-between; } .left { text-align: left; }

@media (max-width: 1100px) {
  .g4, .public .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .public .top-in { padding: 0 16px; gap: 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .public .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .public .status { display: none; }
  .public .main { padding: 24px 16px 40px; gap: 36px; }
  .public .foot { padding: 16px; flex-direction: column; }
  .tool .shell { flex-direction: column; }
  .tool .side { position: static; width: auto; height: auto; padding: 12px; gap: 12px; }
  .tool .nav { flex-direction: row; overflow-x: auto; } .tool .nav a { white-space: nowrap; }
  .tool .side-bottom .box:first-child { display: none; }
  .tool .main { padding: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 26px; line-height: 32px; }
  .hide-sm { display: none; }
}
.public #view { display: flex; flex-direction: column; gap: 48px; } .tool #view { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 760px) { .public #view { gap: 36px; } }
