@import url("ds/colors_and_type.css");
@import url("ds/animations.css");

/* ─────────────────────────────────────────────────────────────
   Reset + canvas
   ───────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #0d0f0d;          /* slightly darker than canvas — frames sit on top */
  color: var(--color-text-primary);
  font-family: var(--font-inter);
  font-size: var(--text-md);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; color: inherit; }
input  { font-family: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* tabular nums utility */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* eyebrow */
.eyebrow {
  font-size: 12px; color: var(--color-text-tertiary);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   App shell — each artboard hosts one of these
   ───────────────────────────────────────────────────────────── */
.app {
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  min-height: 100%;
  display: flex; flex-direction: column;
  font-feature-settings: "ss01" 1, "cv11" 1;
}

/* ─────────────────────────────────────────────────────────────
   Header (top nav)
   ───────────────────────────────────────────────────────────── */
.hdr {
  height: 52px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--color-stroke-divider);
  background: var(--color-bg-primary);
  position: sticky; top: 0; z-index: 30;
}
.hdr__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  letter-spacing: -0.2px;
}
.hdr__brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent, var(--color-brand));
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-dark); font-size: 13px; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.hdr__links { display: flex; gap: 26px; flex: 1; }
.hdr__link {
  font-size: 13px; color: var(--color-text-secondary);
  background: none; border: none; padding: 6px 0; cursor: pointer;
  transition: color 125ms var(--ease-out-1);
  position: relative;
}
.hdr__link:hover { color: var(--color-text-primary); }
.hdr__link.is-active { color: var(--color-text-primary); }
.hdr__link.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -19px;
  height: 2px; background: var(--accent, var(--color-brand));
}
.hdr__right { display: flex; align-items: center; gap: 14px; }
.hdr__status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--color-text-secondary);
  padding: 4px 10px; border-radius: 999px;
  background: var(--color-white-2); border: 1px solid var(--color-stroke-divider);
}
.hdr__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, var(--color-brand)) 0%, rgba(255,255,255,0.2) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-dark); font-weight: 700; font-size: 12px;
  border: 1px solid rgba(255,255,255,0.10);
}

/* ─────────────────────────────────────────────────────────────
   Sidebar (Layout B variant)
   ───────────────────────────────────────────────────────────── */
.side {
  width: 200px; flex-shrink: 0;
  border-right: 1px solid var(--color-stroke-divider);
  background: rgba(255,255,255,0.012);
  padding: 24px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
/* Scroll-Bereich der Einträge: wächst das Menü über die Fensterhöhe hinaus,
   rollt nur dieser Teil; Marke oben und Fußzeile unten bleiben sichtbar. */
.side__nav {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 4px;
  margin: 0 -6px; padding: 0 6px;
  scrollbar-width: thin;
}
.side__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 24px;
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
}
.side__section {
  font-size: 12px; color: var(--color-text-tertiary);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 14px 10px 6px;
}
.side__link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--color-text-secondary);
  cursor: pointer; transition: all 125ms var(--ease-out-1);
  background: none; border: none; text-align: left;
}
.side__link:hover { background: var(--color-white-4); color: var(--color-text-primary); }
.side__link.is-active {
  background: var(--color-white-4);
  color: var(--color-text-primary);
  box-shadow: inset 2px 0 0 var(--accent, var(--color-brand));
}
.side__link-glyph {
  width: 16px; text-align: center; color: var(--color-text-tertiary);
  font-size: 12px;
}
.side__link.is-active .side__link-glyph { color: var(--accent, var(--color-brand)); }
.side__footer {
  margin-top: auto; padding: 12px 8px;
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--color-stroke-divider);
  font-size: 12px; color: var(--color-text-secondary);
}

/* ─────────────────────────────────────────────────────────────
   Main area
   ───────────────────────────────────────────────────────────── */
.main {
  width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  padding: 20px 20px 36px;
  display: flex; flex-direction: column; gap: 14px;
  --gap: 14px;
}
.app.is-compact .main { padding: 14px 16px 24px; gap: 10px; --gap: 10px; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 32px; letter-spacing: -0.6px; line-height: 1.05;
  display: flex; align-items: center; gap: 12px;
}
.page-sub { font-size: 12px; color: var(--color-text-tertiary); margin-top: 4px; }

/* ─────────────────────────────────────────────────────────────
   Cards (extended)
   ───────────────────────────────────────────────────────────── */
.card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-stroke-divider);
  background: var(--color-white-2);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.card--hover { transition: background .15s ease, border-color .15s ease; }
.card--hover:hover { background: var(--color-white-4); border-color: var(--color-stroke-primary); }
.app.is-compact .card { padding: 14px 16px; gap: 8px; border-radius: var(--radius-lg); }

.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card__title { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }
.card__sub { font-size: 12px; color: var(--color-text-tertiary); }

/* tab strip inside a card head */
.tabs {
  display: inline-flex; padding: 2px;
  background: var(--color-white-2);
  border: 1px solid var(--color-stroke-divider);
  border-radius: 8px;
}
.tab {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  color: var(--color-text-secondary); background: none; border: none;
  cursor: pointer; font-weight: 500;
  transition: all 125ms var(--ease-out-1);
}
.tab:hover { color: var(--color-text-primary); }
.tab.is-active {
  background: var(--color-white-10);
  color: var(--color-text-primary);
}

/* ─────────────────────────────────────────────────────────────
   KPI card (large hero stat)
   ───────────────────────────────────────────────────────────── */
.kpi { padding: 16px 18px; gap: 6px; min-height: 108px; }
.kpi__label { font-size: 12px; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.kpi__value {
  font-family: var(--font-display); font-weight: 700;
  font-size: 28px; line-height: 1; letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums; margin-top: auto;
}
.kpi__value--lg { font-size: 38px; letter-spacing: -0.6px; }
.kpi__sub { font-size: 12px; color: var(--color-text-tertiary); display: flex; align-items: center; gap: 6px; }
.kpi__spark { height: 28px; margin-top: 4px; }
.kpi--accent .kpi__value { color: var(--accent, var(--color-brand)); }
.kpi.is-success .kpi__value { color: var(--color-success-light); }
.kpi.is-error   .kpi__value { color: var(--color-error-light); }

/* trend pill */
.trend {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; border-radius: 6px;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.trend--up   { background: var(--color-success-bg); color: var(--color-success-light); }
.trend--down { background: var(--color-error-bg);   color: var(--color-error-light); }
.trend--flat { background: var(--color-white-4);    color: var(--color-text-secondary); }

/* ─────────────────────────────────────────────────────────────
   Chips & pills
   ───────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip--success { background: var(--color-success-bg); color: var(--color-success-light); }
.chip--error   { background: var(--color-error-bg);   color: var(--color-error-light); }
.chip--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.chip--info    { background: rgba(163, 168, 158, 0.14);  color: #a3a89e; }
.chip--neutral { background: var(--color-white-4);    color: var(--color-text-secondary); }
.chip--brand   { background: var(--color-brand-bg);   color: var(--color-brand); }

.state-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px 2px 6px; border-radius: 4px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
  font-family: var(--font-inter); font-variant-numeric: tabular-nums;
}
.state-chip__glyph { font-size: 10px; }
.state-HOLDING         { background: var(--color-success-bg); color: var(--color-success-light); }
.state-ENTERING        { background: var(--color-brand-bg);   color: var(--color-brand); }
.state-EXITING         { background: var(--color-warning-bg); color: var(--color-warning); }
.state-IDLE            { background: var(--color-white-4);    color: var(--color-text-tertiary); }
.state-PAUSED_ENTERING { background: rgba(255,178,0,0.08);    color: #e1a44b; }
.state-KILLED          { background: var(--color-error-bg);   color: var(--color-error-light); }

/* exchange pill */
.ex {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.ex__dot { width: 6px; height: 6px; border-radius: 50%; }
.ex__logo { width: 14px; height: 14px; border-radius: 3px; object-fit: contain; flex: none; }

/* ─────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-inter); font-size: 12px; font-weight: 500;
  height: 32px; padding: 0 12px;
  border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--color-text-primary); cursor: pointer; white-space: nowrap;
  transition: all 125ms var(--ease-out-1);
}
.btn:hover { background: var(--color-white-4); }
.btn--sm { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn--lg { height: 40px; padding: 0 16px; font-size: 13px; }
.btn--outline { border-color: var(--color-stroke-divider); color: var(--color-text-secondary); }
.btn--outline:hover { border-color: var(--color-stroke-primary); color: var(--color-text-primary); background: var(--color-white-4); }
.btn--solid {
  background: var(--accent, var(--color-brand));
  color: var(--color-text-dark); font-weight: 600;
}
/* Hintergrund wiederholen: .btn:hover (Klasse + Pseudoklasse) schlägt sonst .btn--solid. */
.btn--solid:hover { background: var(--accent, var(--color-brand)); filter: brightness(1.08); }
.btn--danger { color: var(--color-error-light); border: 1px solid var(--color-error-stroke); }
.btn--danger:hover { background: var(--color-error-bg); }
.btn--ghost { color: var(--color-text-secondary); }
.btn--ghost:hover { background: var(--color-white-4); color: var(--color-text-primary); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* icon-only btn */
.icon-btn {
  width: 28px; height: 28px; padding: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  color: var(--color-text-secondary); cursor: pointer;
  transition: all 125ms var(--ease-out-1);
}
.icon-btn:hover { background: var(--color-white-4); color: var(--color-text-primary); border-color: var(--color-stroke-divider); }

/* ─────────────────────────────────────────────────────────────
   Tables
   ───────────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl thead th {
  text-align: left; padding: 10px 12px;
  font-size: 12px; color: var(--color-text-tertiary);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
  border-bottom: 1px solid var(--color-stroke-divider);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.tbl thead th:hover { color: var(--color-text-secondary); }
.tbl thead th .sort-ind { color: var(--color-text-tertiary); margin-left: 4px; opacity: 0.5; }
.tbl thead th.is-sorted .sort-ind { opacity: 1; color: var(--accent, var(--color-brand)); }
.tbl tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--color-stroke-divider);
  vertical-align: middle; font-variant-numeric: tabular-nums;
}
.tbl tbody tr { cursor: pointer; transition: background 125ms var(--ease-out-1); }
.tbl tbody tr:hover { background: var(--color-white-2); }
.tbl tbody tr.is-selected { background: var(--color-white-4); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .pair { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-secondary); }
.tbl .bot-id { font-weight: 600; font-size: 12px; }

/* compact density */
.app.is-compact .tbl thead th { padding: 8px 10px; }
.app.is-compact .tbl tbody td { padding: 8px 10px; font-size: 12px; }

/* ─────────────────────────────────────────────────────────────
   Bot mini card / row
   ───────────────────────────────────────────────────────────── */
.bot-row {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  color: inherit; text-decoration: none;
  cursor: pointer; transition: background .12s ease;
}
.bot-row:hover { background: var(--color-white-4); }
.bot-row__bar { width: 3px; height: 32px; border-radius: 3px; background: var(--color-text-tertiary); }
.bot-row__bar.is-HOLDING { background: var(--color-success); }
.bot-row__bar.is-ENTERING { background: var(--color-brand); }
.bot-row__bar.is-EXITING { background: var(--color-warning); }
.bot-row__bar.is-PAUSED_ENTERING { background: #e1a44b; }
.bot-row__bar.is-IDLE { background: var(--color-text-tertiary); }
.bot-row__name { font-size: 13px; font-weight: 600; }
.bot-row__meta { font-size: 12px; color: var(--color-text-tertiary); margin-top: 1px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bot-row__pnl { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.bot-row__pnl.pos { color: var(--color-success-light); }
.bot-row__pnl.neg { color: var(--color-error-light); }

/* ─────────────────────────────────────────────────────────────
   Status dot
   ───────────────────────────────────────────────────────────── */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot--brand   { background: transparent; box-shadow: inset 0 0 0 2px var(--color-brand); }
.dot--success { background: var(--color-success); }
.dot--error   { background: var(--color-error); }
.dot--warning { background: var(--color-warning); }
.dot--neutral { background: var(--color-text-tertiary); }
.dot--pulse   { animation: pulse 1.2s ease-in-out infinite; }

/* ─────────────────────────────────────────────────────────────
   Time range pill
   ───────────────────────────────────────────────────────────── */
.range {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--color-white-2);
  border: 1px solid var(--color-stroke-divider);
  border-radius: 8px;
}
.range__opt {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--color-text-secondary); font-weight: 500;
  transition: all 125ms var(--ease-out-1);
  font-variant-numeric: tabular-nums;
}
.range__opt:hover { color: var(--color-text-primary); }
.range__opt.is-active {
  background: var(--color-white-10);
  color: var(--color-text-primary);
}

/* ─────────────────────────────────────────────────────────────
   Activity feed
   ───────────────────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed__row {
  display: grid; grid-template-columns: 64px 52px 1fr; gap: 10px;
  padding: 7px 0; border-top: 1px dashed rgba(255,255,255,0.05);
  font-size: 12px; align-items: baseline;
}
.feed__row:first-child { border-top: none; }
.feed__t { color: var(--color-text-tertiary); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.feed__lvl { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.feed__lvl.is-INFO { color: var(--color-text-tertiary); }
.feed__lvl.is-OK   { color: var(--color-success-light); }
.feed__lvl.is-WARN { color: var(--color-warning); }
.feed__lvl.is-ERR  { color: var(--color-error-light); }
.feed__msg { color: var(--color-text-secondary); }

/* ─────────────────────────────────────────────────────────────
   Charts: SVG-based, share axes/grid
   ───────────────────────────────────────────────────────────── */
.chart { width: 100%; display: block; }
.chart text {
  font-family: var(--font-inter); fill: var(--color-text-tertiary);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.chart .grid line { stroke: var(--color-stroke-divider); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.6; }
.chart .axis line, .chart .axis path { stroke: var(--color-stroke-divider); stroke-width: 1; }
.chart-tip {
  position: absolute; pointer-events: none;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-stroke-primary);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: var(--shadow-popover);
  z-index: 10;
  font-variant-numeric: tabular-nums;
  min-width: 130px;
  transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip__t { font-size: 12px; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.chart-tip__v { font-size: 13px; font-weight: 600; margin-top: 2px; }
.chart-wrap { position: relative; overflow: hidden; }

/* equity curve gradient */
.curve-stroke { stroke: var(--accent, var(--color-brand)); stroke-width: 1.8; fill: none; }
.curve-fill   { fill: url(#curveGrad); opacity: 0.4; }
.curve-axis-y { fill: var(--color-text-tertiary); font-size: 12px; }

/* heatmap */
.heat { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.heat__cell { aspect-ratio: 1 / 1; border-radius: 3px; background: var(--color-white-2); cursor: pointer; transition: transform 100ms var(--ease-out-1); }
.heat__cell:hover { transform: scale(1.18); z-index: 2; outline: 1px solid var(--color-stroke-primary); }
.heat__legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-text-tertiary); }
.heat__swatch { width: 12px; height: 12px; border-radius: 3px; }

/* donut allocation */
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend__row { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.donut-legend__sw { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend__pct { color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }

/* sparkline */
.spark { width: 100%; height: 100%; display: block; }
.spark path.line { fill: none; stroke-width: 1.5; }
.spark path.fill { opacity: 0.18; }

/* ─────────────────────────────────────────────────────────────
   Section header
   ───────────────────────────────────────────────────────────── */
.sec {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.sec__title { font-size: 14px; font-weight: 600; }
.sec__sub { font-size: 12px; color: var(--color-text-tertiary); }

/* ─────────────────────────────────────────────────────────────
   Bento grid pieces (Layout C)
   ───────────────────────────────────────────────────────────── */
.bento { display: grid; gap: var(--gap); grid-template-columns: repeat(12, 1fr); }
.bento > * { min-width: 0; }
.c-12 { grid-column: span 12; }
.c-8  { grid-column: span 8; }
.c-6  { grid-column: span 6; }
.c-5  { grid-column: span 5; }
.c-4  { grid-column: span 4; }
.c-3  { grid-column: span 3; }
.c-7  { grid-column: span 7; }
.r-2  { grid-row: span 2; }
/* Narrow screens (same breakpoints as the Positions grids in shell.css):
   below 900px only the half tiles stay side by side, below 560px every tile
   takes the full row. Above 900px the 12-column split is unchanged. */
@media (max-width: 900px) {
  .bento > .c-3, .bento > .c-4, .bento > .c-5, .bento > .c-7, .bento > .c-8 { grid-column: span 12; }
  .bento > .r-2 { grid-row: auto; }
}
@media (max-width: 560px) {
  .bento > .c-6 { grid-column: span 12; }
}

/* ─────────────────────────────────────────────────────────────
   Bot detail (modal-style overlay inside artboard)
   ───────────────────────────────────────────────────────────── */
.detail-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-radius: var(--radius-lg);
  background: var(--color-white-2); border: 1px solid var(--color-stroke-divider);
  position: relative;
}
.detail-bar.is-active::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--border-angle,0deg), transparent 0%, var(--color-brand) 25%, transparent 40%, transparent 72%, var(--color-brand) 85%, transparent 100%);
  animation: border-rotate 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude; pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────
   Misc
   ───────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--color-stroke-divider); width: 100%; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.fade-in { animation: fade-in 200ms var(--ease-out-1); }

/* keyboard-style chips */
.kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-white-4);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-stroke-divider);
}

/* search bar */
.search {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; min-width: 160px; max-width: 280px; flex: 0 1 220px;
  background: var(--color-white-2);
  border: 1px solid var(--color-stroke-divider);
  border-radius: 8px;
  font-size: 12px; color: var(--color-text-secondary);
}
.search input {
  background: transparent; border: none; outline: none;
  color: var(--color-text-primary); flex: 1; font-size: 12px;
}
.search input::placeholder { color: var(--color-text-tertiary); }

/* ─────────────────────────────────────────────────────────────
   Market ticker strip
   ───────────────────────────────────────────────────────────── */
.ticker {
  height: 34px;
  overflow: hidden;
  border-bottom: 1px solid var(--color-stroke-divider);
  background: rgba(255,255,255,0.012);
  display: flex; align-items: center;
  position: relative;
}
.ticker::before, .ticker::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 60px; pointer-events: none; z-index: 2;
}
.ticker::before { left: 0;  background: linear-gradient(90deg, var(--color-bg-primary), transparent); }
.ticker::after  { right: 0; background: linear-gradient(-90deg, var(--color-bg-primary), transparent); }
.ticker__track {
  display: flex; align-items: center; gap: 32px;
  white-space: nowrap;
  animation: tickerScroll 90s linear infinite;
}
.ticker__item {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.ticker__sym {
  font-weight: 700; color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.04em;
}
.ticker__price {
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}
.ticker__ch {
  font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.ticker__ch.pos { color: var(--color-success-light); }
.ticker__ch.neg { color: var(--color-error-light); }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─────────────────────────────────────────────────────────────
   Command palette
   ───────────────────────────────────────────────────────────── */
.cmdk-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: fade-in 150ms var(--ease-out-1);
}
.cmdk {
  width: 560px; max-width: 92vw;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-stroke-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.cmdk__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-stroke-divider);
}
.cmdk__head input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--color-text-primary); font-size: 15px;
  font-family: inherit;
}
.cmdk__head input::placeholder { color: var(--color-text-tertiary); }
.cmdk__list { max-height: 360px; overflow: auto; padding: 6px; }
.cmdk__row {
  display: grid; grid-template-columns: 24px 1fr auto auto; gap: 12px;
  align-items: center;
  width: 100%; padding: 9px 12px;
  background: transparent; border: none;
  font-family: inherit; color: var(--color-text-primary);
  cursor: pointer; border-radius: 8px;
  transition: background 100ms;
  font-size: 13px;
}
.cmdk__row:hover { background: var(--color-white-4); }
.cmdk__row:first-child { background: var(--color-white-2); }
.cmdk__glyph { color: var(--color-text-tertiary); font-size: 14px; text-align: center; }
.cmdk__lbl { text-align: left; }
.cmdk__hint { font-size: 12px; color: var(--color-text-tertiary); }
.cmdk__kind { font-size: 12px; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; background: var(--color-white-2); border-radius: 4px; }
.cmdk__foot {
  display: flex; gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--color-stroke-divider);
  font-size: 12px; color: var(--color-text-tertiary);
}

/* ─────────────────────────────────────────────────────────────
   Notification dropdown
   ───────────────────────────────────────────────────────────── */
.notif-pop {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  width: 380px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-stroke-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-popover);
  z-index: 100;
  display: flex; flex-direction: column;
  animation: fade-in 125ms var(--ease-out-1);
}
.notif-pop__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-stroke-divider);
}
.notif-pop__list { max-height: 380px; overflow: auto; }
.notif-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-stroke-divider);
  cursor: pointer; transition: background 100ms;
}
.notif-row:hover { background: var(--color-white-2); }
.notif-row.is-unread { background: var(--color-brand-bg); }
.notif-pop__foot { padding: 8px; border-top: 1px solid var(--color-stroke-divider); }

/* ─────────────────────────────────────────────────────────────
   Modal (new bot wizard)
   ───────────────────────────────────────────────────────────── */
.modal {
  width: 560px; max-width: 92vw;
  max-height: 86vh;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-stroke-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-popover);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal__head { padding: 20px 24px 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.modal__body { padding: 0 24px 16px; overflow: auto; flex: 1; min-height: 0; }
.modal__foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  border-top: 1px solid var(--color-stroke-divider);
  background: var(--color-white-2);
}
.step-dot { width: 18px; height: 4px; border-radius: 2px; transition: background 125ms; }

.strat-card {
  text-align: left;
  padding: 12px 14px;
  background: var(--color-white-2);
  border: 1px solid var(--color-stroke-divider);
  border-radius: 10px;
  cursor: pointer; transition: all 125ms var(--ease-out-1);
  color: inherit; font-family: inherit;
}
.strat-card:hover { background: var(--color-white-4); border-color: var(--color-stroke-primary); }
.strat-card.is-active { border-color: var(--accent, var(--color-brand)); background: var(--color-brand-bg); }

.ex-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--color-white-2);
  border: 1px solid var(--color-stroke-divider);
  border-radius: 8px;
  cursor: pointer; transition: all 125ms;
  color: inherit; font-family: inherit; font-size: 13px;
}
.ex-pick:hover:not(:disabled) { background: var(--color-white-4); border-color: var(--color-stroke-primary); }
.ex-pick.is-active { border-color: var(--accent, var(--color-brand)); background: var(--color-brand-bg); }
.ex-pick:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────────────
   Toast / inline status
   ───────────────────────────────────────────────────────────── */
.toast-host {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-stroke-primary);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: var(--shadow-popover);
  display: flex; align-items: center; gap: 10px;
  animation: fade-in 200ms var(--ease-out-1);
  pointer-events: auto;
  min-width: 280px;
}
.toast.is-success { border-color: var(--color-success-stroke); }
.toast.is-error { border-color: var(--color-error-stroke); }

/* PageHead renders `.page-eyebrow` (PageHead.tsx), but only `.eyebrow` was ever
   defined — so every eyebrow rendered unstyled. Aliased rather than renamed in
   the component: `.eyebrow` has other consumers. */
.page-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  margin-bottom: 2px;
}

/* v3 lifecycle words (Phase 11). The `is-HOLDING`/`is-ENTERING`/… modifiers above
   are DNA position states and do not overlap with these three. */
.bot-row__bar.is-running { background: var(--color-success); }
.bot-row__bar.is-stopped { background: var(--color-text-tertiary); }
.bot-row__bar.is-errored { background: var(--color-error); }

/* Token icon (components/ui/CoinIcon.tsx); the fallback carries the first letters. */
.coin-icon { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.coin-icon--fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-white-4); color: var(--color-text-secondary);
  font-weight: 700; line-height: 1;
}

/* Boersen-Marke (components/ui/VenueMark.tsx): Logo, sonst Monogramm. */
.venue-mark { flex-shrink: 0; border-radius: 6px; object-fit: contain; background: var(--color-white-4); }
.venue-mark--tile { width: 28px; height: 28px; }
.venue-mark--md { width: 22px; height: 22px; border-radius: 5px; }
.venue-mark--mini { width: 14px; height: 14px; border-radius: 3px; }
.venue-mark--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.venue-mark--mini.venue-mark--initial { font-size: 9px; }
.venue-mark--md.venue-mark--initial { font-size: 11px; }
