/* Vestrix Website – Nachbau der Strategy-Lab-Oberfläche für die Hero-Demo.
   Werte aus dem App-Code (frontend/src: tailwind.config.js, globals.css, Layout/Sidebar/TopNav, AIChat, ChatInputArea,
   KpiStrip, CandlestickChart, StrategyReport, EquityCurve, MarketScanTable). Hell/Dunkel folgt dem Theme der Seite. */

.app {
  --a-base: #F8FAFC; --a-card: #FFFFFF; --a-elev: #F1F5F9; --a-border: #E2E8F0;
  --a-bg50: #F9FAFB; --a-bg50-80: rgba(249, 250, 251, .8); --a-bg50-50: rgba(249, 250, 251, .5); --a-bg100: #F3F4F6;
  --a-bd100: #F3F4F6; --a-bd200: #E5E7EB; --a-bd300: #D1D5DB;
  --a-t900: #111827; --a-t800: #1F2937; --a-t700: #374151; --a-t600: #4B5563; --a-t500: #6B7280; --a-t400: #9CA3AF; --a-t300: #D1D5DB;
  --a-body: #334155; --a-ubg: #EBF4FF; --a-utx: #1E40AF; --a-sky50: #F0F9FF;
  --a-primary: #0EA5E9; --a-cortix: #8B5CF6; --a-profit: #22C55E; --a-loss: #EF4444; --a-warn: #F59E0B;
  --a-legend: rgba(255, 255, 255, .55);
  font-family: Inter, system-ui, sans-serif; color: var(--a-body); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] .app {
  --a-base: #0C0F14; --a-card: #141820; --a-elev: #1E293B; --a-border: #1E293B;
  --a-bg50: #0F1318; --a-bg50-80: rgba(15, 19, 24, .8); --a-bg50-50: rgba(15, 19, 24, .5); --a-bg100: #1E293B;
  --a-bd100: #1E293B; --a-bd200: #1E293B; --a-bd300: #334155;
  --a-t900: #F1F5F9; --a-t800: #E2E8F0; --a-t700: #CBD5E1; --a-t600: #94A3B8; --a-t500: #94A3B8; --a-t400: #64748B; --a-t300: #475569;
  --a-body: #CBD5E1; --a-ubg: #1E3A5F; --a-utx: #93C5FD; --a-sky50: rgba(14, 165, 233, .1);
  --a-legend: rgba(12, 15, 20, .55);
}
.app *, .app *::before, .app *::after { box-sizing: border-box; }
.app svg.i { display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Rahmen */
.app { position: relative; display: flex; flex-direction: column; height: 700px; border-radius: 14px; overflow: hidden;
  background: var(--a-base); border: 1px solid var(--rule-2); box-shadow: var(--stage-shadow); }
.app__top { flex: none; height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--a-card); border-bottom: 1px solid var(--a-border); }
.app__wm { font-size: 14px; font-weight: 700; letter-spacing: -.03em; color: var(--a-t900); }
.app__wm span { font-weight: 400; color: #38BDF8; }
.app__body { flex: 1; min-height: 0; display: flex; }

/* Icon-Leiste */
.app__rail { flex: none; width: 64px; display: flex; flex-direction: column; justify-content: space-between; background: var(--a-card); border-right: 1px solid var(--a-border); }
.rail__nav, .rail__bottom { padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.rail__bottom { border-top: 1px solid var(--a-border); }
.rail__i { position: relative; display: grid; place-items: center; padding: 9px 0; border-radius: 8px; color: var(--a-t400); transition: background .3s, color .3s; }
.rail__bottom .rail__i { padding: 8px 0; }
.rail__i.on { background: var(--a-elev); color: var(--a-t900); }
.rail__i.on::before { content: ""; position: absolute; left: -2px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--a-primary); }

/* Chat */
.app__chat { flex: none; width: 36%; min-width: 360px; display: flex; flex-direction: column; background: var(--a-card); }
.chat__list { flex: 1; min-height: 0; overflow: hidden; padding: 12px 14px 10px 16px; display: flex; flex-direction: column; gap: 16px; justify-content: flex-end; }
.cm { display: flex; flex-direction: column; align-items: flex-start; animation: cmIn .35s var(--e) both; }
@keyframes cmIn { from { opacity: 0; transform: translateY(6px); } }
.cm__you { font-size: 10px; font-weight: 500; color: var(--a-t400); margin: 0 0 4px 4px; }
.cm__head { display: flex; align-items: center; gap: 6px; margin: 0 0 4px 4px; font-size: 10px; font-weight: 500; color: var(--a-cortix); }
.cm__dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(139, 92, 246, .2); display: grid; place-items: center; }
.cm__dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--a-cortix); }
.cm__bubble { max-width: 90%; border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.625; }
.cm--user .cm__bubble { background: var(--a-ubg); color: var(--a-utx); border-bottom-right-radius: 4px; }
.cm--ai .cm__bubble { background: var(--a-card); color: var(--a-t700); border-bottom-left-radius: 4px; padding-left: 4px; padding-top: 2px; }
.cm__bubble b { font-weight: 600; }
.cm__caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--a-primary); animation: blink 1s steps(1) infinite; }
.cm__steps { list-style: none; margin: 2px 0 0 4px; padding: 0; display: grid; gap: 4px; font-size: 11px; color: var(--a-t500); }
.cm__steps li { display: flex; align-items: center; gap: 7px; opacity: 0; transition: opacity .3s; }
.cm__steps li.on { opacity: 1; }
.cm__steps .sp { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--a-bd300); border-top-color: var(--a-cortix); animation: spin .8s linear infinite; }
.cm__steps li.ok .sp { animation: none; border: 0; background: var(--a-profit); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm-1.2 14.6l-4.3-4.3 1.4-1.4 2.9 2.9 6-6 1.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm-1.2 14.6l-4.3-4.3 1.4-1.4 2.9 2.9 6-6 1.4 1.4z'/%3E%3C/svg%3E") center/contain no-repeat; }

/* Iterationskarte */
.icard { max-width: 90%; width: 290px; border: 1px solid var(--a-bd200); border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); overflow: hidden; animation: cmIn .4s var(--e) both; }
.icard__h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 16px 8px; }
.icard__t { font-size: 13px; font-weight: 600; color: var(--a-t800); }
.icard__s { font-size: 11px; color: var(--a-t400); margin-top: 2px; }
.badge { white-space: nowrap; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge i { font-style: normal; font-weight: 400; opacity: .7; }
.badge small { font-size: 10px; opacity: .7; }
.badge--A { background: #D1FAE5; color: #047857; } .badge--B { background: #E0F2FE; color: #0369A1; }
.badge--C { background: #FEF3C7; color: #B45309; } .badge--D, .badge--F { background: #FEE2E2; color: #DC2626; }
.icard__rows { border-top: 1px solid var(--a-bd100); padding: 8px 16px; }
.icard__r { display: flex; align-items: center; padding: 4px 0; }
.icard__r span:first-child { width: 96px; font-size: 11px; color: var(--a-t500); }
.icard__r b { width: 80px; font-size: 13px; font-weight: 500; color: var(--a-t800); font-variant-numeric: tabular-nums; }
.icard__r em { margin-left: 8px; font-style: normal; font-size: 11px; font-weight: 500; }
.up { color: #059669; } .dn { color: var(--a-loss); }
.icard__more { margin-top: 4px; font-size: 11px; color: var(--a-t400); }
.icard__fb { border-top: 1px solid var(--a-bd100); padding: 10px 16px; font-size: 11px; color: var(--a-t500); font-style: italic; line-height: 1.6; }

/* Scan-/Prüfkarte (MarketScanTable) */
.tcard { width: 92%; border: 1px solid var(--a-bd200); border-radius: 12px; background: var(--a-card); overflow: hidden; font-size: 11px; animation: cmIn .4s var(--e) both; }
.tcard__h { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; border-bottom: 1px solid var(--a-bd100); }
.tcard__t { font-size: 13px; font-weight: 600; color: var(--a-t800); }
.tcard__b { padding: 0 6px; border-radius: 999px; background: var(--a-sky50); color: var(--a-primary); font-size: 10px; font-weight: 600; }
.tcard__v { padding: 8px 12px; background: var(--a-bg50); font-size: 12px; line-height: 1.6; color: var(--a-t700); }
.tcard table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tcard th { text-align: left; font-size: 11px; font-weight: 500; color: var(--a-t500); padding: 6px 8px; }
.tcard td { border-top: 1px solid var(--a-bd100); padding: 6px 8px; color: var(--a-t600); white-space: nowrap; }
.tcard td:first-child { color: var(--a-t800); font-weight: 600; }
.tcard tr.f td { background: var(--a-sky50); } .tcard tr.f td:first-child { box-shadow: inset 3px 0 0 var(--a-primary); }
.tcard .r { text-align: right; } .pos { color: var(--a-profit) !important; } .neg { color: var(--a-loss) !important; } .wrn { color: var(--a-warn) !important; }
.tcard__ck { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--a-bd100); color: var(--a-t700); font-size: 12px; }
.tcard__ck b { margin-left: auto; font-family: "JetBrains Mono", monospace; font-weight: 500; color: var(--a-t800); }
.tcard__ck i { width: 16px; height: 16px; flex: none; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: var(--a-profit); }
.tcard__ck i.mid { background: var(--a-warn); }
.tcard__ft { padding: 7px 12px; border-top: 1px solid var(--a-bd100); font-size: 10.5px; color: var(--a-t400); }

/* Eingabe */
.chat__input { flex: none; padding: 12px; background: var(--a-card); }
.ci__box { display: flex; align-items: flex-end; background: var(--a-elev); border: 1px solid var(--a-border); border-radius: 8px; }
.ci__left { display: flex; flex-direction: column; gap: 4px; padding: 0 0 8px 8px; color: var(--a-t400); }
.ci__left span { width: 28px; height: 28px; display: grid; place-items: center; }
.ci__ph { flex: 1; padding: 10px 8px; font-size: 13px; line-height: 1.375; color: var(--a-t400); min-height: 58px; }
.ci__send { margin: 0 8px 8px 0; width: 36px; height: 36px; border-radius: 8px; background: var(--a-primary); color: #fff; display: grid; place-items: center; opacity: .3; }
.ci__chips { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 6px 8px 0; overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 6px; font-size: 11px; font-weight: 500; color: var(--a-t600); white-space: nowrap; }
.chip svg.i { color: var(--a-primary); }
.chip .cv { opacity: .5; }
.chip--menu { color: var(--a-t400); padding: 0 4px; height: 28px; }
.chip--menu svg.i { color: inherit; }
.chip--tk { font-family: "JetBrains Mono", monospace; } .chip--tk b { font-weight: 600; }
.chip--mono { font-family: "JetBrains Mono", monospace; }
.chip--bt { margin-left: auto; border: 1px solid var(--a-bd300); padding: 4px 12px; }
.chip--bt svg.i { color: inherit; fill: currentColor; }

/* Trenner */
.app__split { flex: none; width: 6px; background: var(--a-bg100); border-left: 1px solid var(--a-bd200); border-right: 1px solid var(--a-bd200); display: grid; place-items: center; }
.app__split i { width: 2px; height: 32px; border-radius: 2px; background: var(--a-bd300); }
.app__split--h { width: auto; height: 6px; border: 0; border-top: 1px solid var(--a-bd200); border-bottom: 1px solid var(--a-bd200); }
.app__split--h i { width: 32px; height: 2px; }

/* Arbeitsbereich */
.app__ws { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--a-base); position: relative; }
.ws { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; transition: opacity .45s; }
.ws.on { opacity: 1; }
.ws__panel { background: var(--a-card); display: flex; flex-direction: column; min-height: 0; }
.ws__panel--chart { flex: 1; }
.ws__panel--report { flex: none; height: 38%; }
.ws__empty { flex: 1; display: grid; place-items: center; color: var(--a-t400); font-size: 12px; }

.kpis { flex: none; display: flex; border-bottom: 1px solid var(--a-bd200); background: var(--a-bg50-80); }
.kpi { flex: 1; min-width: 0; padding: 8px 16px; border-right: 1px solid var(--a-bd200); }
.kpi:last-of-type { border-right: 1px solid var(--a-bd200); }
.kpi__k { font-size: 10px; color: var(--a-t400); text-transform: uppercase; letter-spacing: .05em; line-height: 1; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__v { font: 700 14px/1.25 "JetBrains Mono", monospace; color: var(--a-t800); white-space: nowrap; }
.kpi__s { font: 10px/1 "JetBrains Mono", monospace; color: var(--a-t400); margin-top: 2px; white-space: nowrap; min-height: 10px; }
.kpis__max { flex: none; padding: 0 10px; display: grid; place-items: center; color: var(--a-t400); }

.chart { position: relative; flex: 1; min-height: 0; }
.chart__c { position: absolute; inset: 0; }
.chart__lg { position: absolute; top: 6px; left: 8px; z-index: 3; padding: 2px 6px; border-radius: 6px; background: var(--a-legend); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; gap: 2px; }
.lg__title { font-size: 10px; font-weight: 600; color: var(--a-t700); }
.lg__row { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--a-t400); }
.lg__row .d { width: 6px; height: 6px; border-radius: 50%; background: var(--a-cortix); }
.lg__row b { font-weight: 600; color: var(--a-t700); }
.lg__row .sep { color: var(--a-t300); }
.lg__row .ic { display: flex; gap: 2px; color: var(--a-t400); }
.lg__row .ic span { padding: 2px; }
.range { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px 12px; border-top: 1px solid var(--a-bd100); background: var(--a-bg50-50); font-size: 11px; font-weight: 500; color: var(--a-t400); white-space: nowrap; overflow: hidden; }
.range .dir { margin-right: 4px; } .range .bar { color: var(--a-bd200); margin: 0 4px; }
.range span.b { padding: 2px 8px; border-radius: 6px; }
.range span.b.on { background: var(--a-primary); color: #fff; }
.range .cal { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }

.rep__h { flex: none; display: flex; align-items: center; gap: 16px; padding: 8px 16px 0; border-bottom: 1px solid var(--a-bd200); font-size: 11px; font-weight: 500; }
.rep__t { display: flex; align-items: center; gap: 6px; color: var(--a-t600); padding-bottom: 8px; }
.rep__tab { padding: 0 12px 7px; border-bottom: 2px solid transparent; color: var(--a-t400); }
.rep__tab.on { border-color: var(--a-primary); color: var(--a-primary); }
.rep__ass { flex: none; padding: 6px 12px; font-size: 11px; color: var(--a-t500); border-bottom: 1px solid var(--a-bd100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep__ass b { font-weight: 500; color: var(--a-t600); }
.rep__eq { flex: 1; min-height: 0; padding: 8px; display: flex; flex-direction: column; }
.eq__h { flex: none; display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.eq__t { font-size: 11px; font-weight: 600; color: var(--a-t400); text-transform: uppercase; letter-spacing: .05em; }
.eq__tg { display: flex; border: 1px solid var(--a-bd200); border-radius: 6px; background: var(--a-bg100); overflow: hidden; font-size: 10px; font-weight: 500; }
.eq__tg span { padding: 2px 8px; color: var(--a-t500); } .eq__tg span.on { background: var(--a-primary); color: #fff; }
.eq__c { position: relative; flex: 1; min-height: 0; }
.eq__lb { position: absolute; left: 8px; top: 6px; z-index: 3; display: grid; gap: 2px; pointer-events: none; }
.eq__lb b { font-size: 11px; font-weight: 600; color: var(--a-primary); } .eq__lb span { font-size: 10px; font-weight: 500; color: #94A3B8; }

.vtab { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
.vtab th { text-align: left; font-weight: 500; color: var(--a-t400); padding: 8px 12px; }
.vtab td { padding: 8px 12px; border-top: 1px solid var(--a-bd100); font-family: "JetBrains Mono", monospace; color: var(--a-t700); }
.vtab td:first-child { font-family: Inter, sans-serif; font-weight: 600; color: var(--a-t800); }
.vtab tr.f td { background: var(--a-sky50); }

/* Portfolio- und Signalansicht */
.pf { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.pf__h { display: flex; align-items: center; gap: 10px; }
.pf__n { font-size: 14px; font-weight: 600; color: var(--a-t800); }
.pf__s { font-size: 11px; color: var(--a-t400); }
.pf__bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; }
.pf__bar span { display: grid; place-items: center; font: 600 10px "JetBrains Mono", monospace; color: #fff; width: 0; transition: width 1s var(--e); white-space: nowrap; overflow: hidden; }
.pf__rows { border: 1px solid var(--a-bd200); border-radius: 10px; overflow: hidden; background: var(--a-card); }
.pf__r { display: grid; grid-template-columns: 14px 1fr 70px 80px 60px; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--a-bd100); font-size: 12px; color: var(--a-t700); font-variant-numeric: tabular-nums; }
.pf__r:first-child { border-top: 0; font-size: 11px; color: var(--a-t400); font-weight: 500; }
.pf__r i { width: 10px; height: 10px; border-radius: 3px; }
.pf__r b { font-weight: 600; color: var(--a-t800); }
.pf__r .m { font-family: "JetBrains Mono", monospace; text-align: right; }

.sig { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--a-bd200); border-radius: 10px; background: var(--a-card); opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--e); }
.sig.on { opacity: 1; transform: none; }
.sig.f { border-color: rgba(14, 165, 233, .5); box-shadow: 0 0 0 3px rgba(14, 165, 233, .12); }
.sig__tk { width: 44px; font: 600 12px "JetBrains Mono", monospace; color: var(--a-t800); }
.sig__n { flex: 1; min-width: 0; font-size: 12px; color: var(--a-t700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig__n small { display: block; font-size: 10px; color: var(--a-t400); }
.sig__st { padding: 2px 8px; border-radius: 999px; background: var(--a-bg100); color: var(--a-t500); font-size: 10px; font-weight: 600; }
.sig__d { width: 72px; text-align: right; font: 500 12px "JetBrains Mono", monospace; }

/* Szenen-Reiter über der App */
.hero__app .demo__tabs { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.hero__app .demo__tab { min-width: 120px; }

/* Responsiv: unter 900px nur die Chat-Spalte, wie die App mobil (Chat-Reiter) */
@media (max-width: 900px) {
  .app { height: auto; min-height: 560px; }
  .chat__list { overflow: visible; justify-content: flex-start; }
  .app__rail, .app__split, .app__ws { display: none; }
  .app__chat { width: 100%; min-width: 0; }
  .hero__app .demo__tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .hero__app .demo__tabs::-webkit-scrollbar { display: none; }
  .hero__app .demo__tab { min-width: 0; flex: none; }
}
@media (max-width: 600px) {
  .app { border-radius: 12px; }
  .chat__list { padding: 16px 10px 10px 12px; }
  .ci__chips .chip:nth-child(n+4):not(.chip--bt) { display: none; }
}
