/* evilbra.in — market control system theme */

:root {
  --eb-bg: #06060b;
  --eb-surface: #0c0c14;
  --eb-card: #12121f;
  --eb-card-hover: #181828;
  --eb-border: #252538;
  --eb-text: #e8e8f0;
  --eb-muted: #8888a8;
  --eb-accent: #8b5cf6;
  --eb-accent-2: #22d3ee;
  --eb-profit: #34d399;
  --eb-loss: #f43f5e;
  --eb-warn: #fbbf24;
  --eb-glow: rgba(139, 92, 246, 0.35);
  --eb-font-ui: "DM Sans", system-ui, sans-serif;
  --eb-font-display: "Syne", system-ui, sans-serif;
}

body.eb-body {
  font-family: var(--eb-font-ui);
  background: var(--eb-bg);
  color: var(--eb-text);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(34, 211, 238, 0.08), transparent);
}

.eb-display { font-family: var(--eb-font-display); }

.eb-wordmark {
  font-family: var(--eb-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.eb-wordmark .eb-domain {
  background: linear-gradient(135deg, var(--eb-accent), var(--eb-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eb-card {
  background: var(--eb-card);
  border: 1px solid var(--eb-border);
  border-radius: 0.75rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.eb-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--eb-accent), var(--eb-accent-2), transparent);
  opacity: 0.5;
}
.eb-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
}

.eb-btn-primary {
  background: linear-gradient(135deg, var(--eb-accent), #6d28d9);
  color: white;
  font-weight: 600;
  border-radius: 0.625rem;
  padding: 0.625rem 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 20px var(--eb-glow);
}
.eb-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--eb-glow);
}

.eb-nav-link {
  color: var(--eb-muted);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: color 0.15s, background 0.15s;
}
.eb-nav-link:hover { color: var(--eb-text); background: rgba(255,255,255,0.05); }
.eb-nav-link.active { color: var(--eb-text); background: rgba(139, 92, 246, 0.15); }

.eb-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--eb-muted);
}
.eb-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--eb-muted);
}
.eb-live-badge.connected .eb-live-dot {
  background: var(--eb-profit);
  box-shadow: 0 0 8px var(--eb-profit);
  animation: eb-pulse 2s infinite;
}
@keyframes eb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.eb-flash {
  animation: eb-flash 0.6s ease;
}
@keyframes eb-flash {
  0% { background-color: rgba(34, 211, 238, 0.25); }
  100% { background-color: transparent; }
}

.eb-live-mode-badge {
  color: #fff;
  background: linear-gradient(135deg, #be123c 0%, #9f1239 50%, #be123c 100%);
  background-size: 200% 200%;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.45);
  animation: eb-live-badge 1.4s ease-in-out infinite;
}
@keyframes eb-live-badge {
  0%, 100% { background-position: 0% 50%; opacity: 1; }
  50% { background-position: 100% 50%; opacity: 0.85; }
}

.eb-skeleton {
  background: linear-gradient(90deg, var(--eb-card) 25%, var(--eb-card-hover) 50%, var(--eb-card) 75%);
  background-size: 200% 100%;
  animation: eb-shimmer 1.2s infinite;
  border-radius: 0.5rem;
}
@keyframes eb-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.eb-toast.success {
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--eb-profit);
}

#eb-cooloff-banner > .eb-card {
  border-color: rgba(245, 158, 11, 0.35);
}

#eb-toast-stack {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 22rem;
}
.eb-toast {
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  border: 1px solid var(--eb-border);
  background: var(--eb-card);
  font-size: 0.875rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease-out;
}
.eb-toast.critical { border-color: var(--eb-loss); }

.eb-chart-wrap {
  min-height: 320px;
  border-radius: 0.75rem;
  overflow: hidden;
}

.eb-bot-chart-wrap {
  position: relative;
  min-height: 180px;
  height: min(240px, 28dvh);
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--eb-border);
  background: #12121f;
}

.eb-bot-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  font-size: 0.625rem;
  color: var(--eb-muted);
  margin-top: 0.5rem;
}

.eb-bot-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.eb-bot-chart-legend .dot-entry { color: #34d399; }
.eb-bot-chart-legend .dot-exit { color: #71717a; }
.eb-bot-chart-legend .line-open { color: rgba(139, 92, 246, 0.8); }
.eb-bot-chart-legend .line-sl { color: rgba(244, 63, 94, 0.7); }
.eb-bot-chart-legend .line-tp { color: rgba(52, 211, 153, 0.7); }
.eb-bot-chart-legend .dot-soldier-alive { color: #22d3ee; }
.eb-bot-chart-legend .dot-soldier-won { color: #fbbf24; }
.eb-bot-chart-legend .dot-soldier-dead { color: #f43f5e; }
.eb-bot-chart-legend .line-support { color: rgba(52, 211, 153, 0.75); }

.eb-soldiers-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 4.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--eb-border);
  background: rgba(18, 18, 31, 0.6);
}

.eb-soldiers-chip-count {
  font-size: 1.125rem;
  font-weight: 600;
  color: #e4e4e7;
  line-height: 1.2;
}

.eb-soldiers-chip-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--eb-muted);
  margin-top: 0.15rem;
}

.eb-soldiers-chip[data-status="alive"] .eb-soldiers-chip-count { color: #22d3ee; }
.eb-soldiers-chip[data-status="won"] .eb-soldiers-chip-count { color: #fbbf24; }
.eb-soldiers-chip[data-status="dead"] .eb-soldiers-chip-count { color: #fb7185; }

.eb-ms-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.6875rem;
  color: var(--eb-muted);
}

.eb-ms-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.eb-ms-chart-legend [class^="ms-icon-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.eb-ms-chart-legend .ms-icon-pivot-high { color: #fb7185; }
.eb-ms-chart-legend .ms-icon-pivot-low { color: #34d399; }
.eb-ms-chart-legend .ms-icon-support {
  color: rgba(52, 211, 153, 0.95);
  letter-spacing: -0.15em;
}
.eb-ms-chart-legend .ms-icon-resistance {
  color: rgba(244, 63, 94, 0.95);
  letter-spacing: -0.15em;
}
.eb-ms-chart-legend .ms-icon-up { color: #34d399; }
.eb-ms-chart-legend .ms-icon-down { color: #f43f5e; }

@media (max-width: 767px) {
  .eb-bot-chart-wrap {
    height: min(200px, 26dvh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eb-live-badge.connected .eb-live-dot { animation: none; }
  .eb-skeleton { animation: none; }
}

/* --- Mobile (Phase 7.6) --- */

:root {
  --eb-nav-height: 56px;
  --eb-touch-min: 44px;
  --eb-safe-bottom: env(safe-area-inset-bottom, 0px);
  --eb-safe-top: env(safe-area-inset-top, 0px);
}

body.eb-mobile-active {
  padding-bottom: calc(var(--eb-nav-height) + var(--eb-safe-bottom));
}

body.eb-mobile-active .eb-main {
  padding-bottom: 1rem;
}

body.eb-bot-actions-active {
  padding-bottom: calc(var(--eb-nav-height) + var(--eb-safe-bottom) + 52px);
}

.eb-mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding-bottom: var(--eb-safe-bottom);
  background: rgba(18, 18, 31, 0.96);
  border-top: 1px solid var(--eb-border);
  backdrop-filter: blur(12px);
}

.eb-mobile-nav__bar {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: var(--eb-nav-height);
  max-width: 32rem;
  margin: 0 auto;
}

.eb-mobile-nav__bar--5 {
  max-width: none;
  width: 100%;
  padding: 0 0.125rem;
  justify-content: space-between;
  gap: 0;
}

.eb-mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  min-height: var(--eb-touch-min);
  min-width: 0;
  padding: 0 0.1rem;
  font-size: 0.65rem;
  color: var(--eb-muted);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s;
}

.eb-mobile-nav__bar--5 .eb-mobile-tab {
  flex: 1 1 0;
  font-size: 0.58rem;
  gap: 0.0625rem;
  letter-spacing: -0.01em;
}

.eb-mobile-tab__icon {
  width: 1.375rem;
  height: 1.375rem;
  flex-shrink: 0;
}

.eb-mobile-nav__bar--5 .eb-mobile-tab__icon {
  width: 1.25rem;
  height: 1.25rem;
}

.eb-mobile-tab__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  line-height: 1.15;
}

.eb-mobile-tab:hover,
.eb-mobile-tab.active {
  color: var(--eb-text);
}
.eb-mobile-tab.active .eb-mobile-tab__icon,
.eb-mobile-tab.active svg {
  color: var(--eb-accent);
}

.eb-mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  padding-bottom: calc(var(--eb-nav-height) + var(--eb-safe-bottom));
}

.eb-mobile-sheet__panel {
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--eb-card);
  border: 1px solid var(--eb-border);
  border-radius: 1rem 1rem 0 0;
  padding: 1.25rem 1rem 1.5rem;
  animation: eb-sheet-up 0.25s ease;
}

@keyframes eb-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.eb-mobile-sheet__close {
  min-width: var(--eb-touch-min);
  min-height: var(--eb-touch-min);
  color: var(--eb-muted);
  font-size: 1.25rem;
}

.eb-mobile-sheet__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.eb-mobile-sheet__link {
  display: flex;
  align-items: center;
  min-height: var(--eb-touch-min);
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: var(--eb-text);
  background: var(--eb-surface);
  border: 1px solid var(--eb-border);
  text-decoration: none;
}
.eb-mobile-sheet__link:hover {
  border-color: rgba(139, 92, 246, 0.4);
}

.eb-bot-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 90;
  bottom: calc(var(--eb-nav-height) + var(--eb-safe-bottom));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(12, 12, 20, 0.95);
  border-top: 1px solid var(--eb-border);
  backdrop-filter: blur(10px);
}

.eb-bot-sticky-bar button,
.eb-bot-sticky-bar a {
  flex: 1;
  min-height: var(--eb-touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 0.5rem;
  text-decoration: none;
}

.eb-config-details {
  border: 1px solid var(--eb-border);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  background: var(--eb-surface);
}
.eb-config-details summary {
  min-height: var(--eb-touch-min);
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  list-style: none;
}
.eb-config-details summary::-webkit-details-marker {
  display: none;
}
.eb-config-details[open] summary {
  border-bottom: 1px solid var(--eb-border);
}
.eb-config-details__body {
  padding: 0.75rem;
}

.eb-bot-card {
  display: block;
  min-height: var(--eb-touch-min);
  padding: 1rem 1.25rem;
  text-decoration: none;
}

@media (min-width: 1024px) {
  body.eb-mobile-active,
  body.eb-bot-actions-active {
    padding-bottom: 0;
  }
  .eb-bot-sticky-bar {
    display: none;
  }
}

/* --- Mobile list cards (M3: trades, diary, logs) --- */

.eb-mobile-list-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.eb-mobile-list-card {
  border: 1px solid var(--eb-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: var(--eb-surface);
  min-height: var(--eb-touch-min);
}

.eb-mobile-list-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.eb-mobile-list-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--eb-text);
  min-width: 0;
}

.eb-mobile-list-card__meta {
  font-size: 0.75rem;
  color: var(--eb-muted);
  margin-top: 0.25rem;
}

.eb-mobile-list-card__rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
  margin-top: 0.625rem;
  font-size: 0.8125rem;
}

.eb-mobile-list-card__row-label {
  color: var(--eb-muted);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.eb-mobile-list-card__row-value {
  color: var(--eb-text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.eb-mobile-log-card {
  border: 1px solid var(--eb-border);
  border-radius: 0.5rem;
  background: var(--eb-surface);
  overflow: hidden;
}

.eb-mobile-log-card summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: var(--eb-touch-min);
  padding: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.eb-mobile-log-card summary::-webkit-details-marker {
  display: none;
}

.eb-mobile-log-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.eb-mobile-log-card__body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid var(--eb-border);
  font-size: 0.8125rem;
  color: var(--eb-muted);
}

.eb-mobile-log-card__message {
  color: var(--eb-text);
  font-size: 0.875rem;
  line-height: 1.4;
  word-break: break-word;
}

.eb-reports-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .eb-reports-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.eb-reports-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.eb-reports-filters label {
  flex: 1 1 8rem;
  min-width: 0;
}

.eb-reports-filters select,
.eb-reports-filters input,
.eb-reports-filters button {
  min-height: var(--eb-touch-min);
}

.eb-reports-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .eb-reports-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.eb-reports-downloads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.eb-reports-downloads a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--eb-touch-min);
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: var(--eb-text);
  background: var(--eb-surface);
  border: 1px solid var(--eb-border);
  text-decoration: none;
  text-align: center;
}

.eb-reports-downloads a:hover {
  border-color: rgba(139, 92, 246, 0.4);
  color: rgb(167, 139, 250);
}

/* --- Chart page (M4.1) --- */

.eb-chart-page {
  --eb-chart-chrome: 13rem;
}

.eb-chart-symbol-picker .eb-symbol-sync,
.eb-chart-symbol-picker #eb-ms-empty,
.eb-chart-symbol-picker #eb-ms-hero-structure {
  display: none;
}

.eb-chart-sticky-intervals {
  position: sticky;
  top: calc(3.5rem + var(--eb-safe-top));
  z-index: 34;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  background: rgba(6, 6, 11, 0.92);
  backdrop-filter: blur(10px);
}

.eb-chart-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.eb-chart-page-container {
  position: relative;
  width: 100%;
  min-height: min(72dvh, calc(100dvh - var(--eb-chart-chrome) - var(--eb-nav-height) - var(--eb-safe-bottom)));
  height: min(72dvh, calc(100dvh - var(--eb-chart-chrome) - var(--eb-nav-height) - var(--eb-safe-bottom)));
}

@media (max-width: 1023px) {
  .eb-chart-page {
    --eb-chart-chrome: 15rem;
  }

  .eb-chart-page-container {
    min-height: min(58dvh, calc(100dvh - var(--eb-chart-chrome) - var(--eb-nav-height) - var(--eb-safe-bottom)));
    height: min(58dvh, calc(100dvh - var(--eb-chart-chrome) - var(--eb-nav-height) - var(--eb-safe-bottom)));
  }
}

@media (min-width: 1024px) {
  .eb-chart-sticky-intervals {
    position: static;
    background: transparent;
    backdrop-filter: none;
  }
}

.eb-chart-tool {
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.eb-chart-tool--active {
  border-color: rgba(139, 92, 246, 0.65) !important;
  color: var(--eb-text) !important;
  background: rgba(139, 92, 246, 0.12);
}

.eb-chart-toolbar {
  flex-shrink: 0;
}

.eb-market-chart-main,
.eb-market-chart-rsi {
  position: relative;
}

/* --- Symbol combobox (market data) --- */

.eb-symbol-picker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.eb-symbol-hero {
  padding: 0.75rem;
  border-radius: 0.625rem;
  border: 1px solid var(--eb-border);
  background: var(--eb-surface);
}

.eb-symbol-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.eb-symbol-hero-id {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.eb-symbol-hero-text {
  min-width: 0;
}

.eb-symbol-hero-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.eb-symbol-base {
  font-family: var(--eb-font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.eb-symbol-rank {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--eb-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--eb-border);
  font-variant-numeric: tabular-nums;
}

.eb-symbol-hero-kind {
  font-size: 0.7rem;
  color: var(--eb-muted);
  margin-top: 0.1rem;
}

.eb-symbol-hero-price {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}

.eb-symbol-hero-change {
  font-size: 0.875rem;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.eb-symbol-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  color: var(--eb-muted);
}

.eb-symbol-hero-vol {
  font-variant-numeric: tabular-nums;
}

.eb-symbol-sync {
  font-variant-numeric: tabular-nums;
}

.eb-symbol-hero-structure {
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: rgba(167, 139, 250, 0.95);
  line-height: 1.35;
}

.eb-symbol-live-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--eb-profit);
  box-shadow: 0 0 8px var(--eb-profit);
  animation: eb-pulse 2s infinite;
}

.eb-symbol-icon-wrap {
  position: relative;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.eb-symbol-icon-wrap .eb-symbol-icon--hero {
  width: 2.25rem;
  height: 2.25rem;
}

.eb-symbol-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.eb-symbol-monogram {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.eb-symbol-monogram.is-fallback {
  display: flex;
}

.eb-symbol-data-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.eb-symbol-data-dot.ok {
  background: var(--eb-profit);
}
.eb-symbol-data-dot.warn {
  background: var(--eb-warn);
}
.eb-symbol-data-dot.error {
  background: var(--eb-loss);
}
.eb-symbol-data-dot.pending,
.eb-symbol-data-dot.syncing {
  background: var(--eb-warn);
  opacity: 0.65;
}

.eb-ms-engine-badge--ok {
  border-color: rgba(16, 185, 129, 0.4);
  color: rgba(52, 211, 153, 0.9);
}
.eb-ms-engine-badge--warn {
  border-color: rgba(245, 158, 11, 0.4);
  color: rgba(251, 191, 36, 0.9);
}
.eb-ms-engine-badge--error {
  border-color: rgba(244, 63, 94, 0.4);
  color: rgba(251, 113, 133, 0.9);
}

.eb-symbol-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.eb-symbol-pill {
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--eb-muted);
  background: var(--eb-surface);
  border: 1px solid var(--eb-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.eb-symbol-pill:hover {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.45);
}
.eb-symbol-pill.is-active {
  color: #fff;
  border-color: var(--eb-accent);
  background: rgba(139, 92, 246, 0.18);
}
.eb-symbol-pill--recent {
  border-style: dashed;
  border-color: rgba(139, 92, 246, 0.35);
}
.eb-symbol-pill--recent.is-active {
  border-style: solid;
}

.eb-symbol-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--eb-muted);
  background: var(--eb-surface);
  border: 1px solid var(--eb-border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.eb-symbol-trigger:hover {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.4);
}
.eb-symbol-trigger[aria-expanded="true"] {
  color: #fff;
  border-color: var(--eb-accent);
}
.eb-symbol-trigger-chevron {
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.eb-symbol-trigger[aria-expanded="true"] .eb-symbol-trigger-chevron {
  transform: rotate(180deg);
}

.eb-symbol-panel {
  margin-top: 0.35rem;
  border: 1px solid var(--eb-border);
  border-radius: 0.5rem;
  background: var(--eb-card);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.eb-symbol-search {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.8rem;
  color: #fff;
  background: var(--eb-surface);
  border: none;
  border-bottom: 1px solid var(--eb-border);
  outline: none;
}
.eb-symbol-search:focus {
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.45);
}

.eb-symbol-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 14rem;
  overflow-y: auto;
}

.eb-symbol-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.12s ease;
}
.eb-symbol-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.eb-symbol-row.is-active {
  background: rgba(139, 92, 246, 0.12);
}

.eb-symbol-row-main {
  flex: 1;
  min-width: 0;
}

.eb-symbol-row-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.eb-symbol-row-title .eb-symbol-base {
  font-size: 0.875rem;
}

.eb-symbol-row-sub {
  display: block;
  font-size: 0.65rem;
  color: var(--eb-muted);
  margin-top: 0.05rem;
}

.eb-symbol-row-end {
  text-align: right;
  flex-shrink: 0;
}

.eb-symbol-pct {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.eb-symbol-pct.up { color: var(--eb-profit); }
.eb-symbol-pct.down { color: var(--eb-loss); }

.eb-symbol-vol {
  display: block;
  font-size: 0.65rem;
  color: var(--eb-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 0.1rem;
}

.eb-symbol-tag {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--eb-accent-2);
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.eb-symbol-empty-row,
.eb-symbol-empty {
  font-size: 0.75rem;
  color: var(--eb-warn);
  padding: 0.5rem 0;
}
.eb-symbol-empty-row {
  padding: 0.75rem;
  color: var(--eb-muted);
  list-style: none;
}

/* Symbol picker — mobile bottom sheet */
.eb-symbol-sheet-backdrop {
  display: none;
}

body.eb-symbol-sheet-open {
  overflow: hidden;
}

/* Market Data page */
.eb-ms-chart-container {
  height: min(420px, 50dvh);
}

.eb-ms-sticky-tabs {
  -webkit-overflow-scrolling: touch;
}

.eb-ms-view-tabs {
  -webkit-overflow-scrolling: touch;
}

.eb-ms-view-tab {
  font-weight: 500;
  background: rgba(255, 255, 255, 0.02);
}

.eb-ms-view-tab.is-active,
.eb-ms-view-tab[aria-selected="true"] {
  background: rgba(139, 92, 246, 0.12);
}

.eb-ms-view-panel--hidden {
  display: none !important;
}

.eb-ms-metric-card {
  min-height: 5.5rem;
}

.eb-ms-placeholder-chart {
  min-height: min(280px, 40dvh);
}

.eb-ms-derivatives-chart-wrap {
  min-height: min(280px, 40dvh);
}

.eb-ms-derivatives-chart {
  height: min(280px, 40dvh);
}

.eb-ms-event-card {
  min-height: var(--eb-touch-min);
}

@media (max-width: 767px) {
  .eb-ms-sticky-view-tabs {
    position: sticky;
    top: calc(3.5rem + var(--eb-safe-top));
    z-index: 36;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    background: rgba(6, 6, 11, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--eb-border);
  }

  .eb-ms-view-tab {
    flex: 1 1 0;
    text-align: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.8125rem;
  }

  .eb-ms-sticky-tabs {
    position: sticky;
    top: calc(3.5rem + var(--eb-safe-top) + 3.25rem);
    z-index: 35;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    background: rgba(6, 6, 11, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--eb-border);
  }

  .eb-ms-engine-badge {
    font-size: 0.65rem;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .eb-ms-chart-container {
    height: min(480px, 55dvh);
  }

  .eb-ms-chart-legend {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .eb-ms-stream-details {
    margin: 0;
  }

  .eb-ms-stream-details summary {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .eb-symbol-hero {
    padding: 0.5rem 0.625rem;
  }

  .eb-symbol-hero-price {
    font-size: 1.25rem;
    margin-top: 0.35rem;
  }

  .eb-symbol-hero-kind {
    display: none;
  }

  .eb-symbol-hero-meta {
    font-size: 0.6rem;
    gap: 0.25rem 0.5rem;
  }

  .eb-symbol-base {
    font-size: 1rem;
  }

  .eb-symbol-quick {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    padding-left: 0.15rem;
    padding-right: 0.15rem;
    padding-bottom: 0.15rem;
  }

  .eb-symbol-pill {
    min-height: var(--eb-touch-min);
    padding: 0.35rem 0.75rem;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .eb-symbol-row {
    min-height: var(--eb-touch-min);
    padding: 0.625rem 0.75rem;
  }

  .eb-symbol-search {
    font-size: 16px;
    min-height: var(--eb-touch-min);
  }

  .eb-symbol-sheet-backdrop:not(.hidden) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(0, 0, 0, 0.55);
  }

  .eb-symbol-panel.eb-symbol-panel--sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 106;
    margin: 0;
    border-radius: 1rem 1rem 0 0;
    border-bottom: none;
    max-height: min(70vh, 32rem);
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--eb-nav-height) + var(--eb-safe-bottom));
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
    animation: eb-sheet-up 0.25s ease;
  }

  .eb-symbol-panel.eb-symbol-panel--sheet .eb-symbol-list {
    max-height: none;
    flex: 1;
    overflow-y: auto;
  }
}

@media (min-width: 768px) {
  .eb-ms-stream-details {
    border: none;
    background: transparent;
  }

  .eb-ms-stream-details summary {
    pointer-events: none;
    cursor: default;
    list-style: none;
    padding: 0;
    margin-bottom: 0.75rem;
    min-height: auto;
  }

  .eb-ms-stream-details summary::-webkit-details-marker {
    display: none;
  }

  .eb-ms-stream-details .eb-config-details__body {
    padding: 0;
  }
}

.eb-ms-refresh-btn svg {
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .eb-symbol-panel.eb-symbol-panel--sheet {
    animation: none;
  }
  .eb-symbol-live-dot,
  #eb-ms-live-dot {
    animation: none;
  }
  .eb-flash,
  .eb-ms-event-card {
    animation: none;
  }
}

body.eb-mobile-active #eb-toast-stack {
  bottom: calc(var(--eb-nav-height) + var(--eb-safe-bottom) + 0.5rem);
  right: 0.75rem;
  left: 0.75rem;
  max-width: none;
}
