﻿@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Inter:wght@300;400;500;600;700&display=swap');

@font-face {
  font-family: 'Haettenschweiler';
  src: local('Haettenschweiler'), local('Arial Narrow Bold'), local('Arial');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg-gradient-start: #03040a;
  --bg-gradient-end: #050b16;
  --panel: #080c1a;
  --panel-soft: #0e152b;
  --accent: #14b8ff;
  --accent-soft: #31d2ff;
  --secondary: #7c3aed;
  --positive: #22d67a;
  --negative: #ff4d4f;
  --stopped: #f59e0b;
  --text-main: #eef4ff;
  --text-soft: #c7d2ff;
  --text-muted: #7a84a6;
  --border: rgba(20, 184, 255, 0.28);
  --border-soft: rgba(148, 163, 184, 0.18);
  --shadow: 0 30px 120px rgba(0, 20, 60, 0.6);
}

body[data-theme='light'] {
  --bg-gradient-start: #f4f7fb;
  --bg-gradient-end: #e2e8f0;
  --panel: #ffffff;
  --panel-soft: #eef2ff;
  --accent: #2563eb;
  --accent-soft: #1d4ed8;
  --secondary: #7c3aed;
  --positive: #16a34a;
  --negative: #dc2626;
  --stopped: #b45309;
  --text-main: #0f172a;
  --text-soft: #1f2937;
  --text-muted: #4b5563;
  --border: rgba(37, 99, 235, 0.25);
  --border-soft: rgba(148, 163, 184, 0.25);
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

/* Keep dropdown lists readable across Chromium/WebView variants on Windows. */
select,
select option,
select optgroup {
  background-color: #0b1220;
  color: #eef4ff;
}

body[data-theme='light'] select,
body[data-theme='light'] select option,
body[data-theme='light'] select optgroup {
  background-color: #ffffff;
  color: #0f172a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(140% 120% at 20% 0%, rgba(20, 184, 255, 0.12), transparent 60%),
    linear-gradient(160deg, var(--bg-gradient-start), var(--bg-gradient-end));
  background-color: var(--bg-gradient-end);
}

body {
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  background-attachment: fixed;
}

main {
  width: min(1680px, 96vw);
  margin: clamp(1.8rem, 3vw, 2.6rem) auto clamp(2.6rem, 4vw, 3.6rem);
  padding: 0 clamp(2rem, 3vw, 3rem);
}

.hero-sync {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  align-self: stretch;
  justify-self: end;
  padding-top: 0;
  margin-right: clamp(0.5rem, 1.8vw, 1.6rem);
}

.sync-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
  text-align: right;
  font-family: 'Orbitron', sans-serif;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  min-width: 220px;
  width: clamp(220px, 24vw, 320px);
  margin-left: clamp(1.2rem, 3.2vw, 2.8rem);
}

.sync-badge::after {
  display: none;
}

.sync-label {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.5rem;
  color: rgba(255, 255, 255, 0.55);
}

.sync-time {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-main);
  text-shadow: 0 8px 24px rgba(20, 184, 255, 0.25);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.sync-badge.is-pending {
  opacity: 0.8;
}

.sync-badge.is-pending .sync-time {
  color: var(--text-muted);
  text-shadow: none;
}

.sync-badge.is-stale {
  opacity: 1;
}

.sync-badge.is-stale .sync-time {
  color: var(--negative);
  text-shadow: 0 0 24px rgba(255, 77, 79, 0.35);
}

.sync-badge.is-warning {
  opacity: 1;
}

.sync-badge.is-warning .sync-time {
  color: var(--stopped);
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.32);
}

.sync-badge.is-fresh {
  opacity: 1;
}

.sync-badge.is-fresh .sync-time {
  color: var(--positive);
  text-shadow: 0 0 16px rgba(34, 214, 122, 0.28);
}

.sync-badge.is-fresh .last-trade-mini {
  border-left-color: rgba(34, 214, 122, 0.65);
}

.sync-badge.is-warning .last-trade-mini {
  border-left-color: rgba(245, 158, 11, 0.68);
}

.sync-badge.is-stale .last-trade-mini {
  border-left-color: rgba(255, 77, 79, 0.55);
}

.sync-badge.is-pending .last-trade-mini {
  border-left-color: rgba(148, 163, 184, 0.35);
}

.sync-badge .last-trade-mini {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.85rem clamp(0.6rem, 1vw, 1rem);
  border-radius: 0 20px 20px 0;
  background: linear-gradient(110deg, rgba(20, 184, 255, 0.12), transparent 75%);
  border-left: 3px solid rgba(20, 184, 255, 0.55);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  text-align: right;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 14px 34px rgba(4, 20, 54, 0.35);
}

.last-trade-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.panel--meta .meta-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: clamp(1.4rem, 2.2vw, 2.4rem);
  align-items: start;
}

.meta-active {
  padding: 1.4rem;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(20, 184, 255, 0.12), rgba(5, 14, 32, 0.95));
  border: 1px solid rgba(20, 184, 255, 0.25);
  box-shadow: 0 18px 40px rgba(2, 14, 40, 0.35);
}

.meta-active__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.meta-active__badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--positive);
}

.meta-active__name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.meta-active__meta {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 0.6rem;
}

.meta-active__reason {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.meta-residual {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: rgba(8, 18, 38, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.18);
  min-width: 0;
  overflow: hidden;
}

.meta-residual--parallel {
  background: linear-gradient(180deg, rgba(26, 24, 54, 0.78), rgba(12, 20, 40, 0.82));
  border-color: rgba(244, 114, 182, 0.18);
}

.meta-residual__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.meta-residual__header h4 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  min-width: 0;
}

.meta-residual__badge {
  display: inline-block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-soft);
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: right;
}

.meta-residual--parallel .meta-residual__badge {
  color: #f9a8d4;
}

.meta-residual__reason {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.meta-residual__list {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.meta-residual__item {
  display: grid;
  gap: 0.18rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.14);
  min-width: 0;
  overflow: hidden;
}

.meta-residual__item--selected {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(22, 101, 52, 0.18);
}

.meta-residual__item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  min-width: 0;
  flex-wrap: wrap;
}

.meta-residual__item-head strong {
  color: var(--text-main);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-residual__item-score {
  color: var(--accent-soft);
  font-variant-numeric: tabular-nums;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-residual__item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  font-size: 0.72rem;
  color: var(--text-soft);
  min-width: 0;
}

.meta-residual__item-why {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 640px) {
  .meta-residual__header,
  .meta-residual__item-head {
    align-items: flex-start;
  }

  .meta-residual__badge,
  .meta-residual__item-score {
    text-align: left;
  }
}

.meta-active__leafs {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow: auto;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.meta-active__leafs li {
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
  overflow: hidden;
  max-width: 100%;
}

.meta-active__leaf-item {
  cursor: pointer;
}

.meta-active__leaf-item:hover {
  color: var(--accent-soft);
}

.meta-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
  align-content: start;
  align-items: stretch;
}

.meta-card {
  background: rgba(8, 14, 30, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  overflow: hidden;
}

.meta-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.meta-card header strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-card__badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-card__metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: var(--text-soft);
  min-width: 0;
}

.meta-card__metrics > * {
  min-width: 0;
}

.meta-card__metrics span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.meta-card__metrics strong {
  min-width: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  justify-self: start;
}

.meta-card__metric {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.meta-card__metric span {
  min-width: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.meta-card__metric strong {
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-card__open-best {
  width: 100%;
  justify-content: center;
  margin-top: 0.2rem;
  min-height: 46px;
  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

.meta-card__hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.meta-card__context {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.28);
  font-size: 0.72rem;
  line-height: 1.28;
}

.meta-card__context strong {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.meta-card__context span {
  color: var(--text-muted);
}

.meta-card__context--scoped {
  border-color: rgba(20, 184, 255, 0.3);
  background: linear-gradient(135deg, rgba(20, 184, 255, 0.15), rgba(15, 23, 42, 0.22));
}

.meta-card__context--active {
  border-color: rgba(34, 214, 122, 0.38);
  background: linear-gradient(135deg, rgba(34, 214, 122, 0.18), rgba(15, 23, 42, 0.22));
}

.meta-card__context--obs {
  border-color: rgba(148, 163, 184, 0.25);
}

.meta-card--active {
  border-color: rgba(34, 214, 122, 0.6);
  box-shadow: 0 0 30px rgba(34, 214, 122, 0.18);
}

.meta-card--inactive {
  border-color: rgba(148, 163, 184, 0.2);
}

.meta-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 980px) {
  .panel--meta .meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1450px) {
  .meta-cards {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

.last-trade-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: flex-end;
}

.last-trade-meta strong {
  font-size: 0.95rem;
  color: var(--accent-soft);
}

.last-trade-meta span {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.last-trade-stats {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
}

.last-trade-direction {
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.last-trade-pnl {
  font-weight: 600;
}

.last-trade-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) clamp(240px, 28vw, 380px);
  align-items: center;
  gap: clamp(1.6rem, 3.5vw, 3.2rem);
  padding: clamp(1.4rem, 3.1vw, 2.4rem) clamp(1.8rem, 4.6vw, 3.4rem);
  border-radius: 34px;
  background: linear-gradient(130deg, rgba(20, 184, 255, 0.18), rgba(8, 12, 26, 0.95));
  border: 1px solid rgba(20, 184, 255, 0.28);
  box-shadow: var(--shadow);
  overflow: visible;
}

.hero--with-sync {
  grid-template-columns: minmax(0, 1.3fr) clamp(240px, 28vw, 380px) minmax(220px, 0.8fr);
  align-items: center;
  gap: clamp(1.4rem, 3vw, 3rem);
}

.hero--with-sync .hero-sync {
  padding-left: clamp(0.3rem, 1.2vw, 1.3rem);
  margin-left: 0;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, rgba(20, 184, 255, 0.18), transparent 55%);
  pointer-events: none;
}

.hero .title-font {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.hero-title {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 640px;
}

.hero-brand {
  font-family: 'Haettenschweiler', 'Impact', 'Anton', 'Oswald', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #14b8ff;
  text-shadow: 0 12px 30px rgba(20, 184, 255, 0.35);
}

.hero-media {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  margin-left: 0;
  align-self: center;
  justify-self: center;
}

.hero--with-sync .hero-media {
  margin-left: 0;
}

.hero-rocket {
  width: clamp(220px, 26vw, 360px);
  max-width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  transform: translateY(2px);
  transition: transform 0.25s ease;
  filter: drop-shadow(0 0 18px rgba(20, 184, 255, 0.45));
}

.hero:hover .hero-rocket {
  transform: translateY(0);
}

.table-wrapper--spaced {
  margin-top: 1rem;
}

.panel-note {
  margin-top: 1rem;
}

.panel-note--wide {
  margin-top: 1.4rem;
}

.note-centered {
  text-align: center;
}

.note-centered-sm {
  padding: 0.6rem 0;
}

.note-centered-md {
  padding: 0.8rem 0;
}

.hero-subtitle {
  margin: 0;
  max-width: 560px;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-main);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 1.15rem;
  margin-top: 0.4rem;
}

.hero-metrics .metric {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 4.4rem;
}

.metric-label {
  display: block;
  font-size: clamp(0.6rem, 0.95vw, 0.72rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  white-space: nowrap;
  line-height: 1.25;
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent-soft);
  line-height: 1.2;
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.coin-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(8, 47, 73, 0.4);
}

.coin-logo span {
  font-size: 1.8rem;
}

.coin-btc {
  background: radial-gradient(circle at 30% 30%, rgba(255, 162, 0, 0.8), rgba(255, 94, 0, 0.65));
  color: #fff8ee;
}

.coin-sol {
  background: linear-gradient(135deg, rgba(86, 204, 242, 0.85), rgba(142, 45, 226, 0.85));
}

.sol-bar {
  width: 32px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.8);
}

.primary-actions {
  margin: clamp(2.6rem, 4vw, 3.5rem) 0 clamp(2.8rem, 4.5vw, 3.6rem) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 1rem;
  row-gap: 0.7rem;
}

.primary-actions nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.62rem 0.68rem;
  margin: 0;
  width: 100%;
  max-width: 100%;
  align-items: start;
  justify-content: flex-start;
  grid-column: 1;
  grid-row: 1 / span 2;
}

.primary-actions nav + .page-toolbar {
  margin-left: 0;
}

.primary-actions .page-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.6rem;
  margin: 0;
  width: max-content;
  grid-column: 2;
  grid-row: 1;
}

nav {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  align-items: stretch;
  justify-content: flex-start;
}

.nav-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-soft);
  padding: 0.52rem 0.86rem;
  min-height: 2.35rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 184, 255, 0.2);
  background: rgba(5, 11, 24, 0.65);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(20, 184, 255, 0.1);
  box-shadow: inset 0 0 12px rgba(20, 184, 255, 0.15);
}

.nav-svg svg {
  width: 16px;
  height: 16px;
}

.nav-label {
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--accent-soft);
  border-color: rgba(20, 184, 255, 0.5);
  transform: translateY(-1px);
}

.nav-link.is-active {
  background: rgba(20, 184, 255, 0.12);
  border-color: rgba(20, 184, 255, 0.6);
  color: var(--accent-soft);
}

.nav-link--shield {
  border-color: rgba(255, 107, 53, 0.4);
  color: #ff9e7a;
  background: rgba(50, 18, 10, 0.45);
}

.nav-link--shield .nav-svg {
  background: rgba(255, 107, 53, 0.15);
  box-shadow: inset 0 0 12px rgba(255, 107, 53, 0.2);
}

.nav-link--shield:hover,
.nav-link--shield.is-active {
  border-color: rgba(255, 107, 53, 0.7);
  color: #ffb18f;
  background: rgba(255, 107, 53, 0.14);
}

.page-toolbar {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: flex-end;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  min-height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 184, 255, 0.25);
  background: rgba(4, 10, 24, 0.7);
  color: var(--text-soft);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.toolbar-btn:hover {
  border-color: rgba(20, 184, 255, 0.55);
  transform: translateY(-1px);
}

.toolbar-btn.is-busy,
.toolbar-btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

.toolbar-btn .btn-icon {
  font-size: 1rem;
}

.api-banner {
  margin: 2rem 0 0;
  padding: 0.85rem 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(20, 184, 255, 0.28);
  background: rgba(8, 12, 26, 0.9);
  color: var(--text-soft);
  font-size: 0.9rem;
  display: none;
}

.api-banner.is-error {
  display: block;
  border-color: rgba(255, 77, 79, 0.5);
  color: var(--negative);
}

.leaderboard-section {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.75rem;
  justify-content: stretch;
}

.panel {
  padding: 2rem;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(8, 12, 26, 0.92), rgba(14, 21, 43, 0.78));
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 18px;
  border: 1px solid rgba(20, 184, 255, 0.08);
  pointer-events: none;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: clamp(0.8rem, 1.2vw, 1.4rem);
  flex-wrap: wrap;
}

.panel-header > summary,
details > .panel-header {
  cursor: pointer;
}
details > summary.panel-header {
  list-style: none;
}
details > summary.panel-header::before {
  content: '\25BC';
  font-size: 0.65rem;
  margin-right: 0.5rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}
details:not([open]) > summary.panel-header::before {
  content: '\25B6';
}

.panel-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-soft);
}

.panel-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 184, 255, 0.35);
  color: var(--accent);
}

.panel-tag.electric {
  color: var(--accent-soft);
  background: rgba(20, 184, 255, 0.15);
}

.panel-tag.danger {
  color: var(--negative);
  background: rgba(255, 77, 79, 0.12);
}

.panel-content {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.leaderboard {
  display: flex;
  flex-direction: column;
}

.leaderboard.is-collapsed .leaderboard-list li:nth-child(n + 4) {
  display: none;
}

.leaderboard__toggle {
  margin-left: auto;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 184, 255, 0.25);
  background: rgba(5, 11, 24, 0.6);
  color: var(--text-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.leaderboard__toggle:hover {
  border-color: rgba(20, 184, 255, 0.55);
}

.leaderboard-list {
  list-style: none;
  padding: 0 0 0.6rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 18px;
  background: rgba(10, 16, 34, 0.88);
  border: 1px solid rgba(20, 184, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(4, 12, 24, 0.55);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.leaderboard-list li[data-bot] {
  cursor: pointer;
}

.leaderboard-list li:hover {
  border-color: rgba(20, 184, 255, 0.6);
  box-shadow: inset 0 0 0 1px rgba(20, 184, 255, 0.35);
  transform: translateY(-2px);
}

.leaderboard-empty {
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed rgba(20, 184, 255, 0.2);
  background: rgba(12, 17, 34, 0.55);
  font-size: 0.85rem;
}

.leaderboard-list .rank {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-align: center;
}

.leaderboard-list .meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.leaderboard-list .meta strong {
  font-size: 1rem;
  color: var(--text-main);
}

.leaderboard-list .meta small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.leaderboard-list .pnl {
  font-weight: 600;
  font-size: 0.95rem;
}

.value-delta {
  font-size: 0.78rem;
  margin-left: 0.4rem;
}

.value-delta.positive {
  color: var(--positive);
}

.value-delta.negative {
  color: var(--negative);
}

.value-delta.neutral {
  color: var(--text-muted);
}

.section-grid {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  gap: 1.75rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
  margin-top: 1.4rem;
}

.status-card {
  border-radius: 16px;
  padding: 1rem;
  background: rgba(8, 12, 26, 0.85);
  border: 1px solid rgba(20, 184, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(5, 15, 35, 0.55);
}

.status-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.status-value {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.15;
  color: var(--accent-soft);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.guardian-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.recent-updates {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.recent-updates li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(20, 184, 255, 0.12);
}

.recent-updates time {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ============================================================
   BARRE DE FILTRES - PAGE BOTS
   ============================================================ */
.bots-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(20, 184, 255, 0.03);
  border: 1px solid rgba(20, 184, 255, 0.15);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 140px;
}

.filter-group.filter-actions {
  flex-direction: row;
  align-items: flex-end;
  gap: 1rem;
  margin-left: auto;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-input {
  padding: 0.5rem 0.75rem;
  background: rgba(20, 184, 255, 0.05);
  border: 1px solid rgba(20, 184, 255, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  min-width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 255, 0.15);
}

.filter-input::placeholder {
  color: var(--text-muted);
}

.filter-select {
  padding: 0.5rem 0.75rem;
  background: rgba(20, 184, 255, 0.05);
  border: 1px solid rgba(20, 184, 255, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-select option {
  background: var(--bg-main);
  color: var(--text-primary);
}

.filter-buttons {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 0.65rem;
  background: transparent;
  border: 1px solid rgba(20, 184, 255, 0.25);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn:hover {
  background: rgba(20, 184, 255, 0.1);
  border-color: var(--accent);
  color: var(--text-primary);
}

.filter-btn.is-active {
  background: rgba(20, 184, 255, 0.2);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.filter-btn.filter-reset {
  background: rgba(255, 77, 79, 0.1);
  border-color: rgba(255, 77, 79, 0.3);
  color: #ff6b6b;
}

.filter-btn.filter-reset:hover {
  background: rgba(255, 77, 79, 0.2);
  border-color: #ff4d4f;
}

.filter-results {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .bots-filter-bar {
    gap: 0.75rem;
  }
  
  .filter-group {
    min-width: 120px;
  }
  
  .filter-input {
    min-width: 150px;
  }
}

@media (max-width: 768px) {
  .bots-filter-bar {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .filter-group {
    width: 100%;
    min-width: unset;
  }
  
  .filter-group.filter-actions {
    margin-left: 0;
    flex-wrap: wrap;
  }
  
  .filter-input,
  .filter-select {
    width: 100%;
    min-width: unset;
  }
  
  .filter-buttons {
    justify-content: flex-start;
  }
}

/* ============================================================
   FIN BARRE DE FILTRES
   ============================================================ */

.table-wrapper {
  margin-top: 1.2rem;
  border-radius: 20px;
  border: 1px solid rgba(20, 184, 255, 0.12);
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(3, 8, 23, 0.45);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  overflow-y: hidden;
}

.table-wrapper table {
  min-width: 100%;
}

.table-wrapper--bots {
  background:
    radial-gradient(120% 120% at 15% 10%, rgba(56, 189, 248, 0.06), transparent 55%),
    linear-gradient(180deg, rgba(7, 14, 28, 0.98), rgba(4, 10, 22, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow: 0 24px 60px rgba(3, 10, 24, 0.55);
}

.table-cell--status {
  width: 140px;
  text-align: center;
  white-space: nowrap;
}

.table--performance th.table-cell--status,
.table--performance td.table-cell--status {
  text-align: center;
}

.table--performance td:first-child {
  white-space: normal;
  word-break: break-word;
  min-width: 160px;
  max-width: 260px;
}

.table--performance {
  min-width: 500px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 0.92rem;
  table-layout: auto;
}

thead {
  background: linear-gradient(135deg, rgba(10, 18, 38, 0.98), rgba(6, 12, 24, 0.98));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--text-muted);
}

thead th {
  padding: 0.9rem 1rem;
  text-align: left;
  white-space: nowrap;
}

.table--bots thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(135deg, rgba(10, 18, 38, 0.98), rgba(6, 12, 24, 0.98));
  backdrop-filter: blur(10px);
}

tbody tr {
  background: linear-gradient(135deg, rgba(9, 18, 38, 0.96), rgba(7, 14, 30, 0.9));
  border: 1px solid rgba(20, 184, 255, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 22px rgba(3, 8, 23, 0.26);
}

tbody tr:nth-child(even) {
  background: linear-gradient(135deg, rgba(10, 18, 38, 0.92), rgba(15, 26, 52, 0.86));
}

tbody tr:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(3, 8, 23, 0.4);
  background: rgba(20, 184, 255, 0.16);
  cursor: pointer;
}

tbody td {
  padding: 0.9rem 1.1rem;
  border-bottom: none;
  background-clip: padding-box;
  color: var(--text-soft);
  white-space: nowrap;
}

tbody tr td:first-child {
  border-radius: 14px 0 0 14px;
}

tbody tr td:last-child {
  border-radius: 0 14px 14px 0;
}

.table-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-date {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  min-width: 96px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table--bots td {
  vertical-align: middle;
}

.table--bots .cell-bot,
.table--bots .cell-series,
.table--bots .cell-strategy,
.table--bots .cell-pair {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table--bots .cell-bot {
  font-weight: 600;
  color: #f8fafc;
}

.table--bots .cell-series {
  max-width: 160px;
  text-align: center;
}

.table--bots .cell-strategy {
  color: rgba(226, 232, 240, 0.78);
}

.table--bots .cell-pair {
  color: rgba(148, 163, 184, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-running::before {
  background: var(--positive);
}

.status-stopped::before {
  background: var(--stopped);
}

.status-alert::before {
  background: var(--negative);
}

.value-positive {
  color: var(--positive);
}

.value-negative {
  color: var(--negative);
}

.value-neutral {
  color: var(--text-soft);
}

.footer {
  margin-top: 3.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.bot-drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(12px);
  z-index: 60;
}

.bot-drawer.is-open {
  display: flex;
}

.bot-drawer__panel {
  margin-left: auto;
  width: min(420px, 90%);
  background: rgba(8, 12, 26, 0.98);
  border-left: 1px solid rgba(20, 184, 255, 0.35);
  box-shadow: -24px 0 60px rgba(0, 8, 24, 0.65);
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  overflow-y: auto;
}

.bot-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.bot-drawer__title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
}

.bot-drawer__close {
  background: rgba(14, 21, 43, 0.7);
  border: 1px solid rgba(20, 184, 255, 0.35);
  border-radius: 999px;
  color: var(--text-soft);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.bot-drawer__close:hover {
  transform: scale(1.05);
  border-color: rgba(20, 184, 255, 0.7);
}

.bot-drawer__section {
  border: 1px solid rgba(20, 184, 255, 0.25);
  border-radius: 18px;
  padding: 1.25rem;
  background: rgba(10, 16, 34, 0.9);
}

.bot-drawer__section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.bot-drawer__section p,
.bot-drawer__section li {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.bot-drawer__section ul {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.bot-drawer__section ul li + li {
  margin-top: 0.35rem;
}

#bot-drawer-trades li {
  position: relative;
}

#bot-drawer-trades .sparkline-item {
  padding: 0.2rem 0.1rem 0.5rem;
  border: none;
}

#bot-drawer-trades canvas {
  margin-top: 0.45rem;
  width: 100%;
  height: 56px;
}

.bot-capital__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bot-capital__title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.bot-capital__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.bot-capital__head h3 {
  margin: 0;
}

.bot-capital__strategy,
.bot-capital__expand {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(50, 74, 112, 0.55);
  background: linear-gradient(145deg, rgba(14, 24, 48, 0.92), rgba(6, 12, 28, 0.92));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.04), 0 6px 18px rgba(4, 12, 28, 0.45);
  color: rgba(112, 136, 174, 0.85);
  cursor: pointer;
  padding: 0;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.bot-capital__strategy::after,
.bot-capital__expand::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, rgba(30, 50, 86, 0.55), transparent 68%);
  opacity: 0.6;
  transition: opacity 0.18s ease;
}

.bot-capital__strategy-icon,
.bot-capital__expand-icon {
  width: 19px;
  height: 19px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: stroke 0.18s ease;
}

.bot-capital__strategy.is-enabled,
.bot-capital__expand.is-enabled {
  color: #16c2ff;
  border-color: rgba(22, 194, 255, 0.55);
  background: linear-gradient(145deg, rgba(20, 184, 255, 0.25), rgba(7, 20, 42, 0.92));
  box-shadow: 0 8px 25px rgba(20, 184, 255, 0.22);
}

.bot-capital__strategy.is-enabled::after,
.bot-capital__expand.is-enabled::after {
  opacity: 0.85;
  background: radial-gradient(circle at 30% 30%, rgba(20, 184, 255, 0.45), transparent 70%);
}

.bot-capital__strategy.is-enabled:hover,
.bot-capital__expand.is-enabled:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 184, 255, 0.75);
  box-shadow: 0 10px 28px rgba(20, 184, 255, 0.3);
}

.bot-capital__strategy.is-enabled:active,
.bot-capital__expand.is-enabled:active {
  transform: scale(0.96);
}

.bot-capital__strategy:focus-visible,
.bot-capital__expand:focus-visible {
  outline: 2px solid rgba(20, 184, 255, 0.75);
  outline-offset: 2px;
}

.bot-capital__strategy:disabled,
.bot-capital__expand:disabled {
  cursor: not-allowed;
  color: rgba(90, 112, 148, 0.6);
  border-color: rgba(40, 56, 84, 0.55);
  background: linear-gradient(145deg, rgba(10, 18, 36, 0.92), rgba(4, 9, 20, 0.92));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.04), 0 2px 8px rgba(3, 8, 20, 0.3);
}

.bot-capital__summary {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.bot-capital__summary span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(20, 184, 255, 0.12);
  color: var(--text-soft);
}

.bot-capital__summary span.positive {
  background: rgba(34, 214, 122, 0.12);
  color: var(--positive);
}

.bot-capital__summary span.negative {
  background: rgba(255, 77, 79, 0.12);
  color: var(--negative);
}

.bot-capital__chart {
  position: relative;
  margin-top: 1.25rem;
  padding: 1.15rem 1.1rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(34, 102, 156, 0.28);
  background: linear-gradient(165deg, rgba(10, 20, 42, 0.96), rgba(3, 8, 20, 0.92));
  box-shadow: inset 0 20px 36px rgba(3, 10, 22, 0.5), 0 16px 32px rgba(2, 10, 26, 0.32);
  overflow: hidden;
}

.bot-capital__chart canvas {
  display: block;
  width: 100%;
  height: 240px;
  min-height: 220px;
  border-radius: 12px;
}

.bot-capital__chart::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  background: radial-gradient(circle at 60% 0%, rgba(47, 118, 191, 0.18), transparent 60%);
  opacity: 0.8;
}

.bot-capital__empty {
  margin: 0;
  padding: 1.75rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
}

.chart-modal.is-open {
  display: block;
}

.chart-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(12px);
}

.chart-modal__panel {
  position: relative;
  z-index: 1;
  margin: 1.5rem auto;
  width: min(1400px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  border-radius: 24px;
  border: 1px solid rgba(20, 184, 255, 0.22);
  background:
    radial-gradient(120% 120% at 15% 10%, rgba(49, 210, 255, 0.06), transparent 50%),
    radial-gradient(140% 120% at 80% 18%, rgba(124, 58, 237, 0.05), transparent 55%),
    linear-gradient(180deg, rgba(10, 18, 40, 0.98), rgba(3, 7, 18, 0.96));
  box-shadow: 0 32px 70px rgba(3, 11, 26, 0.65), 0 0 0 1px rgba(20, 184, 255, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chart-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 2rem 1.2rem;
  border-bottom: 1px solid rgba(20, 184, 255, 0.12);
}

.chart-modal__header h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-modal__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chart-modal__controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chart-modal__timeframes {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chart-modal__tf {
  border: 1px solid rgba(20, 184, 255, 0.2);
  background: rgba(9, 16, 34, 0.65);
  color: var(--text-soft);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.chart-modal__tf:hover,
.chart-modal__tf:focus-visible {
  border-color: rgba(20, 184, 255, 0.5);
  color: #14b8ff;
}

.chart-modal__tf.is-active {
  background: linear-gradient(135deg, rgba(20, 184, 255, 0.35), rgba(20, 184, 255, 0.15));
  border-color: rgba(20, 184, 255, 0.6);
  color: #14b8ff;
  box-shadow: 0 0 12px rgba(20, 184, 255, 0.25);
}

.chart-modal__close {
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.chart-modal__close:hover,
.chart-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: scale(1.05);
}

.chart-modal__body {
  display: grid;
  grid-template-columns: 320px 2fr 1fr;
  flex: 1;
  min-height: 0;
  gap: 1.9rem;
  padding: 1.75rem 2.5rem 2.3rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 184, 255, 0.45) transparent;
}

.chart-modal__body::-webkit-scrollbar {
  width: 8px;
}

.chart-modal__body::-webkit-scrollbar-track {
  background: transparent;
}

.chart-modal__body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(20, 184, 255, 0.65), rgba(124, 58, 237, 0.55));
  border-radius: 8px;
}

.chart-modal__body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(20, 184, 255, 0.85), rgba(124, 58, 237, 0.75));
}

.chart-modal__chart {
  flex: 1.6;
  min-width: 0;
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(34, 112, 172, 0.25);
  background: linear-gradient(170deg, rgba(7, 16, 36, 0.96), rgba(2, 6, 18, 0.92));
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  cursor: crosshair;
  overflow: hidden;
}

.chart-modal__canvas {
  flex: 1;
  min-height: clamp(320px, 50vh, 520px);
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-modal__canvas > div,
.chart-modal__canvas canvas {
  max-width: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
}

.chart-modal__svg-fallback {
  opacity: 0.92;
}

.chart-modal__empty {
  margin: auto;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.chart-modal__tooltip {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 220px;
  max-width: 280px;
  padding: 0.85rem 1rem 0.9rem;
  background: linear-gradient(160deg, rgba(9, 18, 38, 0.95), rgba(7, 12, 24, 0.92));
  border: 1px solid rgba(20, 184, 255, 0.4);
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(3, 12, 32, 0.55);
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 12;
}

.chart-modal__tooltip.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.chart-modal__tooltip-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.chart-modal__tooltip time {
  display: block;
  font-size: 0.76rem;
  color: rgba(148, 163, 184, 0.85);
  margin-bottom: 0.45rem;
}

.chart-modal__tooltip p {
  margin: 0;
  color: rgba(226, 232, 240, 0.88);
}

.chart-modal__tooltip-meta {
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.chart-modal__tooltip-meta li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(226, 232, 240, 0.86);
  font-size: 0.8rem;
}

.chart-modal__tooltip-meta span {
  color: rgba(148, 163, 184, 0.9);
}

.chart-modal__sidebar {
  flex: 0 0 360px;
  min-width: 260px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(14, 21, 43, 0.88);
  border: 1px solid rgba(20, 184, 255, 0.18);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chart-modal__metrics,
.chart-modal__events-section {
  border: 1px solid rgba(20, 184, 255, 0.18);
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
  background: rgba(7, 14, 32, 0.82);
  backdrop-filter: blur(6px);
}

.chart-modal__events-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.chart-modal__event-detail {
  border-radius: 14px;
  border: 1px solid rgba(34, 112, 172, 0.32);
  background: linear-gradient(135deg, rgba(8, 18, 40, 0.96), rgba(5, 12, 29, 0.9));
  padding: 0.975rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.85rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chart-modal__event-detail strong {
  font-size: 0.98rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(214, 233, 255, 0.95);
}

.chart-modal__event-detail span,
.chart-modal__event-detail time {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.chart-modal__metrics h3,
.chart-modal__events-section h3 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.chart-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.chart-metric__label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chart-metric__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
}

.chart-modal__events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 184, 255, 0.45) transparent;
}

.chart-modal__events::-webkit-scrollbar {
  width: 8px;
}

.chart-modal__events::-webkit-scrollbar-track {
  background: transparent;
}

.chart-modal__events::-webkit-scrollbar-thumb {
  background: rgba(20, 184, 255, 0.38);
  border-radius: 8px;
}

.chart-modal__events::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 184, 255, 0.55);
}

.analytics-grid {
  display: grid;
  gap: 24px;
  margin: 24px 0;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  justify-content: stretch;
}

.panel--chart .panel-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel--chart .panel-content.chart-distribution {
  gap: 16px;
}

.chart-box {
  position: relative;
  width: 100%;
  min-height: 220px;
  height: clamp(220px, 28vw, 260px);
}

.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.75);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 12px;
}

.panel--chart canvas[hidden] + .chart-empty {
  display: flex;
}

.chart-meta {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.chart-meta--compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.chart-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(20, 184, 255, 0.08), rgba(10, 132, 255, 0.04));
  border: 1px solid rgba(20, 184, 255, 0.12);
}

.chart-metric span {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.7);
}

.chart-metric strong {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f8fafc;
}

.chart-metric__sub {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.75);
  margin-top: 0.15rem;
}

.chart-legend {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chart-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.chart-legend__left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.chart-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-legend__values {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.9rem;
}

.chart-legend__values small {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.75);
}

.chart-legend__empty {
  padding: 12px;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.75);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.18);
}

.market-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-row {
  display: grid;
  grid-template-columns: 70px 1fr 110px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--panel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.market-symbol {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text-soft);
}

.market-price {
  font-size: 1.05rem;
  font-weight: 600;
}

.market-change {
  justify-self: end;
  font-weight: 600;
}

.chart-modal__layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 18px;
  align-items: start;
}

.chart-modal__side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-modal__trade-focus {
  background: linear-gradient(160deg, rgba(12, 20, 38, 0.9), rgba(8, 13, 26, 0.92));
  border: 1px solid rgba(20, 184, 255, 0.18);
  border-radius: 12px;
  padding: 14px;
  min-height: 140px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chart-modal__trade-focus h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #dfe9ff;
}

.chart-modal__trade-focus .trade-focus__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  font-size: 0.9rem;
}

.chart-modal__trade-focus .trade-focus__meta strong {
  display: block;
  color: var(--text-main);
}

.chart-modal__recent-trades {
  background: linear-gradient(170deg, rgba(10, 17, 34, 0.92), rgba(7, 12, 24, 0.9));
  border: 1px solid rgba(20, 184, 255, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  max-height: 280px;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 184, 255, 0.45) transparent;
}

.chart-modal__recent-trades h5 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.chart-modal__recent-trades ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chart-modal__recent-trades li {
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 6px;
  font-size: 0.9rem;
}

.chart-modal__recent-trades li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.chart-modal__recent-trades .tone-pos {
  color: var(--positive);
}

.chart-modal__recent-trades .tone-neg {
  color: var(--negative);
}

@media (max-width: 768px) {
  .analytics-grid {
    margin-top: 20px;
    gap: 20px;
  }

  .chart-meta {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

.chart-modal__event {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 0.75rem;
  align-items: baseline;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  background: rgba(20, 184, 255, 0.08);
  border: 1px solid rgba(20, 184, 255, 0.12);
}

.chart-modal__event time {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(20, 184, 255, 0.85);
}

.chart-modal__event strong {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.chart-modal__event span {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chart-modal__event--empty {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-modal__event.is-active {
  border-color: rgba(20, 184, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(20, 184, 255, 0.25);
}

.chart-modal__event--status {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

.chart-modal__event--lifecycle {
  border-color: rgba(34, 214, 122, 0.4);
  background: rgba(34, 214, 122, 0.12);
}

.chart-modal__event--config {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.12);
}

.chart-modal__event--file {
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.12);
}

.chart-modal__event--trade {
  border-color: rgba(236, 72, 153, 0.45);
  background: rgba(236, 72, 153, 0.12);
}

.strategy-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.strategy-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.strategy-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 22, 0.6);
  backdrop-filter: blur(4px);
}

.strategy-modal__panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  width: min(760px, 92vw);
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
  box-shadow: var(--shadow);
  z-index: 1;
}

.strategy-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.strategy-modal__header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.strategy-modal__subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.strategy-modal__close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.strategy-modal__close:hover,
.strategy-modal__close:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.strategy-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.strategy-modal__description {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.strategy-modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.strategy-modal__list li {
  background: var(--panel-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  color: var(--text-main);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.strategy-modal__list li strong {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .chart-modal__panel {
    margin: 1.5rem auto;
    max-width: min(96vw, 1020px);
  }

  .chart-modal__body {
    grid-template-columns: 1fr;
  }

  .chart-modal__sidebar {
    flex-direction: row;
    min-width: 0;
    gap: 1rem;
  }

  .chart-modal__metrics,
  .chart-modal__events-section {
    flex: 1;
  }

  .chart-modal__chart {
    min-height: 340px;
  }
}

@media (max-width: 768px) {
  .chart-modal__panel {
    margin: 1rem auto;
    max-width: calc(100% - 1.5rem);
    min-height: 80vh;
  }

  .chart-modal__body {
    padding: 1.25rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chart-modal__sidebar {
    flex-direction: column;
  }

  .chart-modal__chart {
    min-height: 300px;
  }

  .chart-modal__controls {
    width: 100%;
    justify-content: space-between;
  }

  .chart-modal__timeframes {
    justify-content: flex-start;
  }
}

.bot-search {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 70;
}

.bot-search.is-open {
  display: block;
}

.bot-search__overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(10px);
}

.bot-search__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 92vw);
  max-height: 80vh;
  background: rgba(8, 12, 26, 0.98);
  border: 1px solid rgba(20, 184, 255, 0.35);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 8, 24, 0.6);
  display: flex;
  flex-direction: column;
}

.bot-search__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid rgba(20, 184, 255, 0.18);
}

.bot-search__header h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.bot-search__close {
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 1.5rem;
  cursor: pointer;
}

.bot-search__close:hover {
  color: var(--accent-soft);
}

.bot-search__input {
  padding: 0.85rem 1.3rem;
  border-bottom: 1px solid rgba(20, 184, 255, 0.15);
}

.bot-search__input input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(20, 184, 255, 0.25);
  background: rgba(4, 10, 24, 0.65);
  color: var(--text-main);
  font-size: 0.95rem;
}

.bot-search__results {
  list-style: none;
  margin: 0;
  padding: 0.6rem 0;
  overflow-y: auto;
  flex: 1;
}

.bot-search__results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 1.3rem;
  border-bottom: 1px solid rgba(20, 184, 255, 0.08);
  cursor: pointer;
  transition: background 0.2s ease;
}

.bot-search__results li:hover,
.bot-search__results li.is-active {
  background: rgba(20, 184, 255, 0.1);
}

.bot-search__result-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.bot-search__result-meta strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

.bot-search__result-meta span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.bot-search__footer {
  padding: 0.75rem 1.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid rgba(20, 184, 255, 0.15);
}

.bot-search__empty {
  padding: 1.2rem 1.3rem;
  text-align: center;
  color: var(--text-muted);
}

#bot-drawer-trades {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#bot-drawer-trades li {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(6, 10, 22, 0.9);
  border: 1px solid rgba(20, 184, 255, 0.18);
}

#bot-drawer-trades li strong {
  color: var(--accent-soft);
}

#bot-drawer-trades li div:last-child {
  font-weight: 600;
}

.bot-drawer__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.bot-drawer__tag {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 184, 255, 0.25);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

@media (max-width: 1320px) {
  .primary-actions {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
    row-gap: 0.75rem;
    column-gap: 0;
  }

  .primary-actions nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.62rem;
    width: 100%;
    max-width: none;
    grid-column: 1;
    grid-row: 1;
  }

  .primary-actions .page-toolbar {
    width: 100%;
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 960px) {
  .primary-actions {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 0.75rem;
  }

  .primary-actions nav,
  nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  .primary-actions .page-toolbar {
    justify-content: center;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2rem;
    gap: 1.75rem;
  }

  .hero-title {
    align-items: center;
  }

  .hero-media {
    justify-content: center;
    margin: 1.5rem auto 0;
    margin-left: 0;
  }

  .hero-sync {
    justify-content: center;
    order: 3;
    width: 100%;
    margin-right: 0;
    padding-top: 0.5rem;
  }

  .sync-badge {
    margin: 0 auto;
  }

  .leaderboard-section {
    grid-template-columns: 1fr;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  main {
    width: 100%;
    margin: 1.4rem auto 2.4rem;
    padding: 0 clamp(1.2rem, 4vw, 1.6rem);
  }

  .hero {
    padding: 2rem;
    gap: 1.5rem;
  }

  .primary-actions {
    align-items: stretch;
  }

  .primary-actions nav,
  nav {
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .primary-actions .page-toolbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-link {
    width: auto;
    justify-content: center;
  }

  .page-toolbar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .hero-media {
    align-items: center;
    width: auto;
    margin-left: 0;
  }

  .hero-sync {
    width: 100%;
    margin-right: 0;
    padding-top: 0.35rem;
  }

  .sync-badge {
    width: 100%;
    min-width: 0;
    position: static;
    margin: 1.5rem auto 0;
    text-align: center;
    align-items: center;
    transform: none;
  }

  .sync-badge .last-trade-mini {
    text-align: center;
  }

  .last-trade-stats {
    justify-content: center;
    gap: 1rem;
  }
}




/* chart-modal rules consolidated above (L2017+) */

/* ============================================
   BOT GROUP HEADERS - Category Sections
   ============================================ */

.bot-group-header {
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent !important;
}

.bot-group-header:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.bot-group-header td {
  padding: 1rem 1.5rem !important;
  border-bottom: none !important;
}

.bot-group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bot-group-icon {
  font-size: 1.4rem;
}

.bot-group-count {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.bot-group-toggle {
  transition: transform 0.3s ease;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.bot-group-header.collapsed .bot-group-toggle {
  transform: rotate(-90deg);
}

/* Group-specific colors */
.bot-group-short {
  background: linear-gradient(90deg, rgba(255, 77, 77, 0.25) 0%, rgba(255, 77, 77, 0.08) 100%);
  border-left: 4px solid #ff4d4d;
}

.bot-group-scalper {
  background: linear-gradient(90deg, rgba(255, 193, 7, 0.25) 0%, rgba(255, 193, 7, 0.08) 100%);
  border-left: 4px solid #ffc107;
}

.bot-group-trailing {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.25) 0%, rgba(0, 230, 118, 0.08) 100%);
  border-left: 4px solid #00e676;
}

.bot-group-grid {
  background: linear-gradient(90deg, rgba(156, 39, 176, 0.25) 0%, rgba(156, 39, 176, 0.08) 100%);
  border-left: 4px solid #9c27b0;
}

.bot-group-ai {
  background: linear-gradient(90deg, rgba(0, 188, 212, 0.25) 0%, rgba(0, 188, 212, 0.08) 100%);
  border-left: 4px solid #00bcd4;
}

.bot-group-trend {
  background: linear-gradient(90deg, rgba(33, 150, 243, 0.25) 0%, rgba(33, 150, 243, 0.08) 100%);
  border-left: 4px solid #2196f3;
}

.bot-group-contrarian {
  background: linear-gradient(90deg, rgba(255, 152, 0, 0.25) 0%, rgba(255, 152, 0, 0.08) 100%);
  border-left: 4px solid #ff9800;
}

.bot-group-other {
  background: linear-gradient(90deg, rgba(158, 158, 158, 0.25) 0%, rgba(158, 158, 158, 0.08) 100%);
  border-left: 4px solid #9e9e9e;
}

/* Bot rows within groups */
.bot-row-grouped {
  transition: all 0.3s ease;
}

.bot-row-grouped.hidden {
  display: none !important;
}

/* Group collapse animation */
.bot-group-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* Mode badges */
.mode-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

/* Series badges + toggle */
.series-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.5rem;
  margin-left: 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.series-badge.series-meta {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.series-badge.series-solo {
  background: rgba(244, 114, 182, 0.18);
  border-color: rgba(244, 114, 182, 0.45);
  color: #f9a8d4;
}

.series-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 999px;
  background: rgba(10, 18, 38, 0.55);
  border: 1px solid rgba(20, 184, 255, 0.15);
  position: relative;
  z-index: 8;
  pointer-events: auto;
}

.series-toggle__btn {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.series-toggle__btn:hover {
  border-color: rgba(125, 211, 252, 0.6);
  color: #e2f3ff;
}

.series-toggle__btn.is-active {
  background: rgba(20, 184, 255, 0.25);
  border-color: rgba(20, 184, 255, 0.6);
  color: #e0f2fe;
  box-shadow: 0 0 14px rgba(14, 116, 144, 0.35);
}

.series-toggle__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mode-badge-short {
  background: rgba(255, 77, 77, 0.3);
  color: #ff6b6b;
  border: 1px solid rgba(255, 77, 77, 0.5);
}

.mode-badge-long {
  background: rgba(0, 230, 118, 0.3);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.5);
}

.mode-badge-margin {
  background: rgba(255, 193, 7, 0.3);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.5);
}

/* Group header content layout */
.group-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  background: linear-gradient(135deg, rgba(10, 18, 38, 0.92), rgba(8, 12, 26, 0.95));
  border: 1px solid rgba(20, 184, 255, 0.14);
  border-radius: 16px;
  transition: background 0.2s ease;
}

.bot-group-header:hover .group-header-content {
  background: linear-gradient(135deg, rgba(12, 22, 44, 0.95), rgba(10, 18, 36, 0.95));
}

.group-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  min-width: 200px;
}

.group-count {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.group-pnl {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 120px;
  text-align: right;
}

.group-pnl.tone-positive {
  color: #22d67a;
}

.group-pnl.tone-negative {
  color: #ff4d4f;
}

.group-desc {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  font-style: italic;
  margin-left: auto;
}

/* Bot mode icon in table */
.bot-mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(20, 184, 255, 0.15);
  color: var(--accent);
  font-size: 0.7rem;
  margin-right: 0.5rem;
}

/* Alert styles for bots exceeding daily loss cap */
.bot-row-alert {
  background: linear-gradient(90deg, rgba(255, 77, 77, 0.15) 0%, rgba(255, 77, 77, 0.05) 100%) !important;
  border-left: 3px solid #ff4d4f !important;
}

.bot-row-alert:hover {
  background: rgba(255, 77, 77, 0.2) !important;
}

.alert-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  animation: pulse-alert 2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulse-alert {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.4); }
  50% { opacity: 0.85; box-shadow: 0 0 8px 2px rgba(255, 77, 77, 0.3); }
}

/* Heartbeat indicator */
.heartbeat-indicator {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
}
.heartbeat-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-muted, #555);
  flex-shrink: 0;
  transition: background 0.4s ease;
}
.heartbeat-dot.hb-alive {
  background: #22c55e;
  animation: hb-pulse 1.5s ease-in-out infinite;
}
.heartbeat-dot.hb-warn {
  background: #f59e0b;
  animation: hb-pulse-warn 2s ease-in-out infinite;
}
.heartbeat-dot.hb-dead {
  background: #ef4444;
  animation: none;
}
@keyframes hb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50% { box-shadow: 0 0 10px 4px rgba(34,197,94,0.35); }
}
@keyframes hb-pulse-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50% { box-shadow: 0 0 8px 3px rgba(245,158,11,0.3); }
}

/* Experimental category style */
.bot-group-experimental {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.25) 0%, rgba(249, 115, 22, 0.08) 100%);
  border-left: 4px solid #f97316;
}

/* Responsive for group headers */
@media (max-width: 768px) {
  .group-header-content {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .group-label {
    min-width: auto;
    flex: 1 1 100%;
  }
  
  .group-desc {
    display: none;
  }
  
  .group-pnl {
    min-width: auto;
  }
}

/* ============================================
   Specialized Pages (AsterDEX / Diagnostic / Shield)
   ============================================ */

.asterdex-live-page .hero-subtitle {
  max-width: 760px;
}

.asterdex-layout {
  display: grid;
  gap: 1.25rem;
}

.asterdex-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.asterdex-filter {
  background: linear-gradient(150deg, rgba(12, 18, 35, 0.85), rgba(8, 14, 28, 0.9));
  border: 1px solid rgba(20, 184, 255, 0.2);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}

.asterdex-filter label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.asterdex-filter input {
  width: 100%;
  border: 1px solid rgba(20, 184, 255, 0.25);
  background: rgba(5, 11, 24, 0.7);
  color: var(--text-main);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  font-family: 'Inter', sans-serif;
}

.asterdex-filter input:focus-visible {
  outline: none;
  border-color: rgba(20, 184, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(20, 184, 255, 0.18);
}

.asterdex-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.asterdex-card {
  border-radius: 14px;
  border: 1px solid rgba(20, 184, 255, 0.16);
  background: linear-gradient(160deg, rgba(8, 14, 30, 0.95), rgba(5, 10, 22, 0.88));
  padding: 0.85rem 0.95rem;
  box-shadow: 0 12px 30px rgba(0, 16, 44, 0.28);
}

.asterdex-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.asterdex-card .value {
  font-size: 1.25rem;
  color: var(--accent-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.asterdex-card .sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

.asterdex-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.asterdex-alerts .alert {
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 77, 79, 0.4);
  background: rgba(255, 77, 79, 0.08);
  color: #ff9a9b;
}

.asterdex-table-wrap {
  border-radius: 18px;
  border: 1px solid rgba(20, 184, 255, 0.2);
  background: linear-gradient(170deg, rgba(9, 14, 28, 0.95), rgba(5, 10, 22, 0.9));
  overflow: hidden;
}

.asterdex-table-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(20, 184, 255, 0.16);
}

.asterdex-table-header h2 {
  margin: 0;
  font-size: 1rem;
}

.asterdex-table-scroll {
  max-height: 70vh;
  overflow: auto;
}

.asterdex-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.79rem;
}

.asterdex-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(8, 13, 27, 0.95);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.67rem;
  padding: 0.62rem 0.5rem;
  border-bottom: 1px solid rgba(20, 184, 255, 0.14);
}

.asterdex-table thead th:nth-child(1),
.asterdex-table tbody td:nth-child(1) { width: 130px; }
.asterdex-table thead th:nth-child(2),
.asterdex-table tbody td:nth-child(2) { width: 90px; }
.asterdex-table thead th:nth-child(3),
.asterdex-table tbody td:nth-child(3) { width: 80px; }
.asterdex-table thead th:nth-child(4),
.asterdex-table tbody td:nth-child(4) { width: 90px; }
.asterdex-table thead th:nth-child(5),
.asterdex-table tbody td:nth-child(5) { width: 150px; }
.asterdex-table thead th:nth-child(6),
.asterdex-table tbody td:nth-child(6) { width: 70px; }
.asterdex-table thead th:nth-child(7),
.asterdex-table tbody td:nth-child(7) { width: 70px; }
.asterdex-table thead th:nth-child(8),
.asterdex-table tbody td:nth-child(8) { width: 80px; }
.asterdex-table thead th:nth-child(9),
.asterdex-table tbody td:nth-child(9) { width: 150px; }
.asterdex-table thead th:nth-child(10),
.asterdex-table tbody td:nth-child(10) { width: 110px; }
.asterdex-table thead th:nth-child(11),
.asterdex-table tbody td:nth-child(11) { width: 130px; }
.asterdex-table thead th:nth-child(12),
.asterdex-table tbody td:nth-child(12) { width: 220px; }

.asterdex-table tbody td {
  padding: 0.56rem 0.5rem;
  border-bottom: 1px solid rgba(20, 184, 255, 0.08);
  color: var(--text-soft);
}

.asterdex-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.01);
}

.diagnostic-layout {
  display: grid;
  gap: 1rem;
}

.diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.diag-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(20, 184, 255, 0.28);
  background: rgba(5, 11, 24, 0.68);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.58rem 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.76rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.diag-btn:hover {
  border-color: rgba(20, 184, 255, 0.65);
  transform: translateY(-1px);
}

.diag-results {
  display: grid;
  gap: 0.75rem;
}

.diag-test {
  border-radius: 14px;
  border: 1px solid rgba(20, 184, 255, 0.2);
  background: linear-gradient(160deg, rgba(9, 14, 28, 0.95), rgba(6, 11, 24, 0.9));
  padding: 0.85rem 0.95rem;
}

.diag-test.success {
  border-left: 4px solid rgba(34, 214, 122, 0.8);
}

.diag-test.warning {
  border-left: 4px solid rgba(245, 158, 11, 0.85);
}

.diag-test.error {
  border-left: 4px solid rgba(255, 77, 79, 0.85);
}

.diag-test h2 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.diag-status {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.diag-test pre {
  margin: 0.65rem 0 0;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: rgba(3, 7, 16, 0.85);
  border: 1px solid rgba(20, 184, 255, 0.14);
  color: #a9ddff;
  font-size: 0.73rem;
  overflow: auto;
  max-height: 220px;
  word-break: break-word;
}

.diag-intro {
  border-left: 4px solid rgba(245, 158, 11, 0.8);
}

.diag-block {
  border-radius: 14px;
  border: 1px solid rgba(20, 184, 255, 0.2);
  background: linear-gradient(160deg, rgba(9, 14, 28, 0.92), rgba(6, 11, 24, 0.88));
  padding: 0.85rem 0.95rem;
}

.diag-block h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.diag-help {
  margin: 0.32rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.diag-summary-grid {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.diag-summary-card {
  border-radius: 12px;
  border: 1px solid rgba(20, 184, 255, 0.22);
  background: rgba(5, 12, 26, 0.72);
  padding: 0.62rem 0.72rem;
}

.diag-summary-card.ok {
  border-left: 4px solid rgba(34, 214, 122, 0.8);
}

.diag-summary-card.warn {
  border-left: 4px solid rgba(245, 158, 11, 0.85);
}

.diag-summary-card.bad {
  border-left: 4px solid rgba(255, 77, 79, 0.85);
}

.diag-summary-title {
  font-size: 0.67rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.diag-summary-value {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.diag-summary-sub {
  margin-top: 0.22rem;
  font-size: 0.72rem;
  color: var(--text-soft);
}

.diag-vps-grid {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.65rem;
}

.diag-vps-card {
  border-radius: 12px;
  border: 1px solid rgba(20, 184, 255, 0.22);
  background: rgba(5, 12, 26, 0.72);
  padding: 0.68rem 0.74rem;
}

.diag-vps-card.success {
  border-left: 4px solid rgba(34, 214, 122, 0.8);
}

.diag-vps-card.warning {
  border-left: 4px solid rgba(245, 158, 11, 0.85);
}

.diag-vps-card.error {
  border-left: 4px solid rgba(255, 77, 79, 0.85);
}

.diag-vps-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.diag-kv {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.17rem 0;
  border-bottom: 1px solid rgba(20, 184, 255, 0.09);
  font-size: 0.75rem;
}

.diag-kv:last-child {
  border-bottom: 0;
}

.diag-kv span {
  color: var(--text-muted);
}

.diag-kv strong {
  color: var(--text-main);
  font-family: "Orbitron", monospace;
  font-size: 0.73rem;
  text-align: right;
}

.diag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-soft);
  padding: 0.1rem 0.44rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.diag-badge.ok {
  border-color: rgba(34, 214, 122, 0.5);
  color: var(--positive);
  background: rgba(34, 214, 122, 0.14);
}

.diag-badge.warn {
  border-color: rgba(245, 158, 11, 0.55);
  color: var(--stopped);
  background: rgba(245, 158, 11, 0.14);
}

.diag-badge.bad {
  border-color: rgba(255, 77, 79, 0.55);
  color: var(--negative);
  background: rgba(255, 77, 79, 0.14);
}

.diag-badge.unk {
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
}

.diag-flow-grid {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.52rem;
  overflow-x: auto;
}

.diag-flow-row {
  border-radius: 12px;
  border: 1px solid rgba(20, 184, 255, 0.18);
  background: rgba(5, 12, 26, 0.68);
  padding: 0.55rem;
  display: grid;
  grid-template-columns: 104px repeat(8, minmax(96px, 1fr));
  gap: 0.44rem;
}

.diag-flow-row.diag-flow-global {
  grid-template-columns: 104px repeat(3, minmax(130px, 1fr));
}

.diag-flow-vps {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(20, 184, 255, 0.25);
  background: rgba(20, 184, 255, 0.08);
  color: var(--accent-soft);
  font-family: "Orbitron", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.diag-flow-item {
  border-radius: 10px;
  border: 1px solid rgba(20, 184, 255, 0.13);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.34rem 0.42rem;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
}

.diag-flow-item span {
  color: var(--text-muted);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diag-flow-item strong {
  color: var(--text-main);
  font-family: "Orbitron", monospace;
  font-size: 0.73rem;
}

.diag-actions-grid {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.65rem;
}

.diag-action-group {
  border-radius: 12px;
  border: 1px solid rgba(20, 184, 255, 0.2);
  background: rgba(5, 12, 26, 0.68);
  padding: 0.62rem 0.68rem;
}

.diag-action-group h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.diag-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 0.44rem;
}

.diag-action-btn {
  border-radius: 10px;
  border: 1px solid rgba(20, 184, 255, 0.28);
  background: rgba(20, 184, 255, 0.1);
  color: var(--text-main);
  padding: 0.48rem 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.diag-action-btn:hover:not(:disabled) {
  border-color: rgba(20, 184, 255, 0.65);
  transform: translateY(-1px);
}

.diag-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.diag-conn-summary-grid {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.diag-conn-timeline-wrap {
  margin-top: 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(20, 184, 255, 0.16);
  background: rgba(5, 12, 26, 0.62);
  padding: 0.6rem 0.7rem;
}

.diag-conn-graph-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.diag-conn-range {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.diag-conn-range-btn {
  border: 1px solid rgba(20, 184, 255, 0.24);
  background: rgba(12, 24, 42, 0.6);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.diag-conn-range-btn:hover {
  border-color: rgba(20, 184, 255, 0.55);
  color: var(--text-main);
}

.diag-conn-range-btn.is-active {
  border-color: rgba(20, 184, 255, 0.85);
  color: var(--text-main);
  background: rgba(20, 184, 255, 0.2);
}

.diag-conn-graph-head strong {
  color: var(--text-main);
  font-size: 0.77rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diag-conn-meta {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.diag-conn-graph {
  margin-top: 0.45rem;
  border-radius: 10px;
  border: 1px solid rgba(20, 184, 255, 0.14);
  background: radial-gradient(circle at 30% 25%, rgba(20, 184, 255, 0.08), rgba(7, 12, 22, 0.92));
  min-height: 146px;
  overflow: hidden;
}

.diag-conn-graph-empty {
  min-height: 146px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.diag-conn-svg {
  width: 100%;
  height: 146px;
  display: block;
}

.diag-conn-svg .grid {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.diag-conn-svg .downtime {
  fill: rgba(245, 158, 11, 0.18);
}

.diag-conn-svg .line-disc {
  fill: none;
  stroke: rgba(255, 77, 79, 0.9);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diag-conn-svg .line-reco {
  fill: none;
  stroke: rgba(34, 214, 122, 0.92);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diag-conn-legend {
  margin-top: 0.38rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
}

.diag-legend-item {
  color: var(--text-soft);
  font-size: 0.66rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.diag-legend-item::before {
  content: "";
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.6);
}

.diag-legend-item.disc::before {
  background: rgba(255, 77, 79, 0.9);
}

.diag-legend-item.reco::before {
  background: rgba(34, 214, 122, 0.92);
}

.diag-legend-item.down::before {
  height: 6px;
  background: rgba(245, 158, 11, 0.52);
}

.diag-conn-table-wrap {
  margin-top: 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(20, 184, 255, 0.18);
  background: rgba(4, 9, 19, 0.7);
  overflow-x: auto;
}

.diag-conn-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.diag-conn-table th,
.diag-conn-table td {
  padding: 0.55rem 0.58rem;
  border-bottom: 1px solid rgba(20, 184, 255, 0.1);
  text-align: left;
  font-size: 0.72rem;
}

.diag-conn-table th {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.64rem;
  background: rgba(20, 184, 255, 0.06);
}

.diag-conn-table td {
  color: var(--text-soft);
  white-space: nowrap;
}

.diag-conn-row.ok td:first-child {
  border-left: 3px solid rgba(34, 214, 122, 0.7);
}

.diag-conn-row.warn td:first-child {
  border-left: 3px solid rgba(245, 158, 11, 0.8);
}

.diag-conn-row.bad td:first-child {
  border-left: 3px solid rgba(255, 77, 79, 0.82);
}

.diag-conn-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.015);
}

.diag-conn-empty td {
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 1024px) {
  .diag-flow-row {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .diag-flow-row.diag-flow-global {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .diag-flow-vps {
    grid-column: 1 / -1;
    min-height: 34px;
  }
}

@media (max-width: 640px) {
  .diag-action-buttons {
    grid-template-columns: 1fr;
  }

  .diag-conn-graph-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .diag-conn-range {
    margin-left: 0;
  }
}

.shield-layout {
  display: grid;
  gap: 1rem;
}

.shield-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 107, 53, 0.22);
  background: linear-gradient(150deg, rgba(35, 12, 8, 0.78), rgba(14, 10, 20, 0.9));
  padding: 0.8rem 1rem;
}

.shield-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.48);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.green {
  background: #22d67a;
  box-shadow: 0 0 8px rgba(34, 214, 122, 0.5);
}

.status-dot.red {
  background: #ff4d4f;
  box-shadow: 0 0 8px rgba(255, 77, 79, 0.48);
}

.status-dot.amber {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.48);
}

.kill-btn {
  margin-left: auto;
  border: 1px solid rgba(255, 77, 79, 0.6);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.9), rgba(69, 10, 10, 0.9));
  color: #ffd8d8;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.kill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.shield-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.shield-card {
  border-radius: 14px;
  border: 1px solid rgba(20, 184, 255, 0.16);
  background: linear-gradient(160deg, rgba(9, 14, 28, 0.95), rgba(6, 11, 24, 0.9));
  padding: 0.9rem 0.95rem;
}

.shield-card h3 {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.metric-row:last-child {
  border-bottom: none;
}

.shield-wide {
  grid-column: span 2;
}

.trades-list,
.alerts-list {
  max-height: 230px;
  overflow-y: auto;
  display: grid;
  gap: 0.45rem;
}

.alert-item {
  border-radius: 10px;
  border-left: 3px solid rgba(255, 77, 79, 0.7);
  background: rgba(255, 77, 79, 0.1);
  color: #ffc2c3;
  padding: 0.45rem 0.55rem;
  font-size: 0.76rem;
}

.shield-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-top: 0.25rem;
}

@media (max-width: 1180px) {
  .shield-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shield-wide {
    grid-column: span 2;
  }
}

@media (max-width: 840px) {
  .asterdex-table {
    font-size: 0.74rem;
  }

  .shield-grid {
    grid-template-columns: 1fr;
  }

  .shield-wide {
    grid-column: span 1;
  }

  .kill-btn {
    margin-left: 0;
  }
}

/* ============================================================
   PASS DE NETTOYAGE UI 2024-10 — plus lisible/pro, garde la fusée
   Ces overrides harmonisent les couleurs, les espacements et les boutons
   sans modifier la structure HTML existante.
   ============================================================ */
:root {
  --surface-1: rgba(8, 12, 26, 0.92);
  --surface-2: rgba(12, 18, 36, 0.86);
  --surface-3: rgba(255, 255, 255, 0.03);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

body {
  background:
    radial-gradient(140% 120% at 18% 8%, rgba(20, 184, 255, 0.12), transparent 50%),
    radial-gradient(160% 140% at 82% 0%, rgba(124, 58, 237, 0.08), transparent 60%),
    linear-gradient(160deg, var(--bg-gradient-start), var(--bg-gradient-end));
}

main {
  width: min(1500px, 96vw);
}

.hero {
  background: linear-gradient(135deg, rgba(10, 16, 34, 0.94), rgba(5, 10, 24, 0.9));
  border: 1px solid rgba(20, 184, 255, 0.2);
  box-shadow: 0 32px 80px rgba(0, 6, 20, 0.45);
  border-radius: var(--radius-lg);
}

.hero::before {
  background: radial-gradient(circle at 12% 18%, rgba(20, 184, 255, 0.15), transparent 50%);
}

.hero-rocket {
  filter: drop-shadow(0 20px 35px rgba(0, 8, 26, 0.6));
}

.hero-subtitle {
  max-width: 720px;
  color: rgba(226, 232, 240, 0.82);
}

.primary-actions {
  margin: clamp(2.1rem, 3.6vw, 3rem) 0 clamp(2.3rem, 4vw, 3.2rem);
  grid-template-columns: 1fr;
  row-gap: 1rem;
}

.primary-actions nav {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
}

.nav-link {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid rgba(20, 184, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.nav-link:hover {
  border-color: rgba(20, 184, 255, 0.4);
}

.nav-link.is-active {
  background: linear-gradient(135deg, rgba(20, 184, 255, 0.16), rgba(20, 184, 255, 0.08));
  border-color: rgba(20, 184, 255, 0.6);
}

.page-toolbar {
  width: 100%;
  justify-content: flex-start;
  gap: 0.65rem;
}

.toolbar-btn {
  background: var(--surface-2);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 28px rgba(0, 6, 18, 0.35);
}

.bots-filter-bar {
  background: var(--surface-2);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 40px rgba(0, 6, 20, 0.32);
  border-radius: var(--radius-md);
}

.filter-input,
.filter-select {
  background: var(--surface-1);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: var(--text-soft);
}

.filter-btn {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(148, 163, 184, 0.24);
}

.filter-btn.is-active {
  background: rgba(20, 184, 255, 0.16);
  border-color: rgba(20, 184, 255, 0.6);
}

.panel {
  background: var(--surface-1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 26px 60px rgba(0, 6, 18, 0.4);
  border-radius: var(--radius-lg);
}

.panel::after {
  display: none;
}

.panel-header {
  margin-bottom: 1.2rem;
}

.panel-title {
  color: var(--text-main);
}

.table-wrapper {
  background: var(--surface-1);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 22px 55px rgba(0, 6, 18, 0.42);
}

.table-wrapper--bots {
  background: linear-gradient(180deg, rgba(9, 14, 28, 0.96), rgba(6, 10, 24, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.2);
}

thead {
  background: rgba(13, 18, 32, 0.96);
}

tbody tr {
  background: rgba(10, 14, 26, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

tbody tr:nth-child(even) {
  background: rgba(12, 18, 32, 0.94);
}

tbody tr:hover {
  background: rgba(20, 184, 255, 0.12);
  box-shadow: 0 14px 30px rgba(0, 8, 24, 0.42);
}

.table--bots .cell-bot,
.table--bots .cell-strategy,
.table--bots .cell-pair {
  max-width: 260px;
  white-space: nowrap;
}

.bot-group-header:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

.bot-group-title {
  color: var(--text-main);
}

.series-toggle {
  background: var(--surface-2);
  border-color: rgba(148, 163, 184, 0.2);
}

.series-toggle__btn.is-active {
  background: rgba(20, 184, 255, 0.18);
  border-color: rgba(20, 184, 255, 0.55);
}

.status-indicator {
  background: rgba(148, 163, 184, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.bot-drawer__panel {
  background: var(--surface-1);
}

.bot-search__panel {
  background: var(--surface-1);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.diag-btn,
.kill-btn,
.toolbar-btn,
.filter-btn,
.series-toggle__btn {
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Mode clair : on réduit les contrastes saturés pour rester lisible */
body[data-theme='light'] .hero,
body[data-theme='light'] .panel,
body[data-theme='light'] .table-wrapper,
body[data-theme='light'] .bots-filter-bar {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.14);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

body[data-theme='light'] thead {
  background: #eef2ff;
}

body[data-theme='light'] tbody tr {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.18);
}

body[data-theme='light'] tbody tr:nth-child(even) {
  background: #f1f5f9;
}

body[data-theme='light'] tbody tr:hover {
  background: #e0f2fe;
}

