/* ══ FlybirdQuant · Design-Tokens (einzige Quelle) ═══════════════════════════════
   Look nach tradingterminal.com: tiefschwarz bzw. weiß, klare Karten mit 1-px-Rand, Blau als Primärfarbe,
   IBM Plex Sans. Themes: dark (Standard), light, graphit (klassisch), darker, midnight.
   Lädt nach allen Alt-Stylesheets: die alten Variablennamen (--bg, --gold, --ui-*, --wb-*)
   werden hier auf die Tokens umgelenkt, damit jedes Modul die Palette erbt.
   Im Hellmodus bleiben Bereiche mit fest kodierten Dunkelfarben „dunkle Inseln“ (.tx-dark-island). */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-display: swap; font-weight: 100 700;
  src: url('/fonts/ibm-plex-sans-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: 'IBM Plex Sans'; font-style: normal; font-display: swap; font-weight: 100 700;
  src: url('/fonts/ibm-plex-sans-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+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 600 800; src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2'); }
/* Alte Schriften bleiben registriert (Rückfall, gespeicherte Exporte/Popouts) */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations'); }

/* Dunkel (Standard) — und dieselben Werte für dunkle Inseln im Hellmodus */
:root,
:root[data-tx-theme=light] .tx-dark-island{
  /* Flächen (von hinten nach vorn) */
  --tx-bg-0: #000000; --tx-bg-1: #0a0a0a; --tx-bg-2: #121212; --tx-bg-3: #1a1a1a; --tx-bg-4: #262626;
  --tx-line: #262626; --tx-line-strong: #333333; --tx-line-soft: rgba(255, 255, 255, .06);
  --tx-text-1: #fafafa; --tx-text-2: #a3a3a3; --tx-text-3: #737373;
  --tx-pos: #22c55e; --tx-neg: #ef4444; --tx-warn: #f59e0b; --tx-info: #60a5fa;
  --tx-pos-soft: rgba(34, 197, 94, .14); --tx-neg-soft: rgba(239, 68, 68, .14); --tx-warn-soft: rgba(245, 158, 11, .14); --tx-info-soft: rgba(96, 165, 250, .14);
  --tx-shadow-1: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 1px 2px rgba(0, 0, 0, .4);
  --tx-shadow-2: 0 12px 32px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .35);
  --tx-card-shadow: none;
  color-scheme: dark;
}
:root{
  --tx-accent: #3b82f6; --tx-accent-strong: #2563eb; --tx-accent-soft: color-mix(in srgb, var(--tx-accent) 14%, transparent); --tx-on-accent: #ffffff;
  /* Form */
  --tx-r-sm: 6px; --tx-r-md: 10px; --tx-r-lg: 14px; --tx-r-full: 999px;
  --tx-focus: 0 0 0 2px var(--tx-bg-0), 0 0 0 4px color-mix(in srgb, var(--tx-accent) 55%, transparent);
  /* Typo */
  --tx-font: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tx-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  --tx-fs-11: 11px; --tx-fs-12: 12px; --tx-fs-13: 13px; --tx-fs-15: 15px; --tx-fs-18: 18px; --tx-fs-24: 24px;
  /* Motion */
  --tx-fast: 120ms; --tx-base: 200ms; --tx-slow: 320ms; --tx-ease: cubic-bezier(.2, .8, .2, 1);
  /* Shell */
  --tx-sidebar-w: 232px; --tx-sidebar-w-collapsed: 64px; --tx-header-h: 60px; --tx-topbar-h: 64px;
}
/* Hell */
:root[data-tx-theme=light]{
  --tx-bg-0: #fafafa; --tx-bg-1: #ffffff; --tx-bg-2: #f5f5f5; --tx-bg-3: #efeff0; --tx-bg-4: #e4e4e7;
  --tx-line: #e5e5e5; --tx-line-strong: #d4d4d8; --tx-line-soft: rgba(0, 0, 0, .05);
  --tx-text-1: #0a0a0a; --tx-text-2: #52525b; --tx-text-3: #71717a;
  --tx-accent: #2563eb; --tx-accent-strong: #1d4ed8; --tx-accent-soft: color-mix(in srgb, var(--tx-accent) 10%, transparent); --tx-on-accent: #ffffff;
  --tx-pos: #16a34a; --tx-neg: #dc2626; --tx-warn: #d97706; --tx-info: #2563eb;
  --tx-pos-soft: rgba(22, 163, 74, .10); --tx-neg-soft: rgba(220, 38, 38, .10); --tx-warn-soft: rgba(217, 119, 6, .12); --tx-info-soft: rgba(37, 99, 235, .10);
  --tx-shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --tx-shadow-2: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
  --tx-card-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  color-scheme: light;
}
/* Klassisch (bisheriges Graphit) */
:root[data-tx-theme=graphit]{
  --tx-bg-0: #0a0d12; --tx-bg-1: #0f131a; --tx-bg-2: #151a23; --tx-bg-3: #1c222d; --tx-bg-4: #252c39;
  --tx-line: #222937; --tx-line-strong: #2e3646; --tx-line-soft: rgba(148, 163, 184, .08);
  --tx-text-1: #e6eaf0; --tx-text-2: #a3adbd; --tx-text-3: #6b7586;
  --tx-pos: #2ebd85; --tx-neg: #f6465d; --tx-warn: #f0b429; --tx-info: #5b8def;
  --tx-pos-soft: rgba(46, 189, 133, .14); --tx-neg-soft: rgba(246, 70, 93, .14);
}
:root[data-tx-theme=darker]{
  --tx-bg-0: #050608; --tx-bg-1: #0a0c10; --tx-bg-2: #101318; --tx-bg-3: #161a21; --tx-bg-4: #1e232c;
  --tx-line: #1a1f27; --tx-line-strong: #262c36; --tx-text-1: #e6eaf0; --tx-text-2: #9aa3b2; --tx-text-3: #636c7b;
}
:root[data-tx-theme=midnight]{
  --tx-bg-0: #070b16; --tx-bg-1: #0c1222; --tx-bg-2: #121a2e; --tx-bg-3: #18223a; --tx-bg-4: #202c48;
  --tx-line: #1e2942; --tx-line-strong: #2a3758; --tx-text-1: #e4e9f5; --tx-text-2: #a0abc6; --tx-text-3: #667290;
  --tx-pos: #34d399; --tx-neg: #fb7185; --tx-warn: #fbbf24; --tx-info: #818cf8;
}

/* Akzentfarbe (Einstellungen › Darstellung). Steht nach den Themes → gewinnt gegen jedes Theme.
   Im Hellmodus dunklere Töne für Kontrast auf Weiß. */
:root[data-tx-accent=blue]{ --tx-accent: #3b82f6; --tx-accent-strong: #2563eb; --tx-on-accent: #ffffff; }
:root[data-tx-accent=teal]{ --tx-accent: #2dd4bf; --tx-accent-strong: #14b8a6; --tx-on-accent: #04110f; }
:root[data-tx-accent=violet]{ --tx-accent: #a78bfa; --tx-accent-strong: #8b5cf6; --tx-on-accent: #0d0820; }
:root[data-tx-accent=amber]{ --tx-accent: #f0b429; --tx-accent-strong: #d99a0b; --tx-on-accent: #1a1200; }
:root[data-tx-accent=rose]{ --tx-accent: #fb7185; --tx-accent-strong: #f43f5e; --tx-on-accent: #1f0509; }
:root[data-tx-theme=light][data-tx-accent=blue]{ --tx-accent: #2563eb; --tx-accent-strong: #1d4ed8; }
:root[data-tx-theme=light][data-tx-accent=teal]{ --tx-accent: #0d9488; --tx-accent-strong: #0f766e; --tx-on-accent: #ffffff; }
:root[data-tx-theme=light][data-tx-accent=violet]{ --tx-accent: #7c3aed; --tx-accent-strong: #6d28d9; --tx-on-accent: #ffffff; }
:root[data-tx-theme=light][data-tx-accent=amber]{ --tx-accent: #d97706; --tx-accent-strong: #b45309; --tx-on-accent: #ffffff; }
:root[data-tx-theme=light][data-tx-accent=rose]{ --tx-accent: #e11d48; --tx-accent-strong: #be123c; --tx-on-accent: #ffffff; }
:root[data-tx-accent=custom]{ --tx-accent-strong: color-mix(in srgb, var(--tx-accent) 84%, #000); }
:root[data-tx-accent]{ --tx-accent-soft: color-mix(in srgb, var(--tx-accent) 12%, transparent); }

/* ── Alias-Schicht: alte Namen → neue Tokens (gleiche Spezifität wie die Theme-Blöcke der Alt-CSS, lädt später) ── */
:root,:root[data-tx-theme],:root[data-tx-theme=light] .tx-dark-island{
  --bg: var(--tx-bg-0); --bg1: var(--tx-bg-1); --bg2: var(--tx-bg-2); --bg3: var(--tx-bg-3);
  --border: var(--tx-line); --border2: var(--tx-line-strong);
  --text: var(--tx-text-1); --muted: var(--tx-text-3); --muted2: var(--tx-text-2);
  --gold: var(--tx-accent); --gold-dim: var(--tx-accent-soft); --accent: var(--tx-accent); --accent2: var(--tx-info);
  --green: var(--tx-pos); --green-dim: var(--tx-pos-soft); --red: var(--tx-neg); --red-dim: var(--tx-neg-soft);
  --panel-shadow: var(--tx-shadow-1);
  --fn: var(--tx-mono);
  --ui-bg-0: var(--tx-bg-0); --ui-bg-1: var(--tx-bg-1); --ui-bg-2: var(--tx-bg-2); --ui-bg-3: var(--tx-bg-3);
  --ui-line: var(--tx-line); --ui-line-soft: var(--tx-line-soft);
  --ui-text: var(--tx-text-1); --ui-text-2: var(--tx-text-2); --ui-text-3: var(--tx-text-3);
  --ui-accent: var(--tx-accent); --ui-accent-2: var(--tx-info); --ui-pos: var(--tx-pos); --ui-neg: var(--tx-neg); --ui-warn: var(--tx-warn);
  --fs-xs: 10px; --fs-sm: 11px; --fs-md: 12px; --fs-lg: 14px;
  --wb-accent: var(--tx-accent); --wb-background: var(--tx-bg-0); --wb-surface: var(--tx-bg-1);
  --wb-text: var(--tx-text-1); --wb-muted: var(--tx-text-2); --wb-border: var(--tx-line); --wb-radius: var(--tx-r-md);
  --sidebar: var(--tx-sidebar-w);
}

/* ── Basis ── */
html{ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body{ background: var(--tx-bg-0) !important; color: var(--tx-text-1); font-family: var(--tx-font) !important; letter-spacing: 0; }
.tx-dark-island{ color: var(--tx-text-1); }
button,input,select,textarea{ font-family: inherit; }
::selection{ background: color-mix(in srgb, var(--tx-accent) 28%, transparent); color: inherit; }
:focus-visible{ outline: none !important; box-shadow: var(--tx-focus) !important; border-radius: var(--tx-r-sm); }
/* Zahlen immer tabellarisch → keine springenden Spalten bei Live-Kursen */
[class*="price"],[class*="-px"],[class*="pnl"],[class*="kpi"],td,.mono,code,kbd,[style*="monospace"]{ font-variant-numeric: tabular-nums; }
code,kbd,pre,.mono{ font-family: var(--tx-mono); }
*{ scrollbar-width: thin; scrollbar-color: var(--tx-bg-4) transparent; }
::-webkit-scrollbar{ width: 10px; height: 10px; }
::-webkit-scrollbar-thumb{ background: var(--tx-bg-4); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover{ background-color: var(--tx-line-strong); }
::-webkit-scrollbar-track,::-webkit-scrollbar-corner{ background: transparent; }
