.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }

.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }

.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.auth-panel-login {
  width: min(621px, 94vw);
  padding: 24px;
}

.login-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  align-items: stretch;
}

.login-option-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
}

.login-option-title {
  font-size: 18px;
  margin: 0;
}

.login-option-card .panel-subtitle {
  margin: 0;
}

.login-option-card .action-row {
  margin-top: auto;
}

.login-option-card .action-btn {
  width: 100%;
}

.login-email-form {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
  margin-top: 12px;
}

.login-email-form + .login-email-form {
  margin-top: 12px;
}

.span-full {
  grid-column: 1 / -1;
}

.is-hidden {
  display: none;
}

.table-muted {
  color: var(--muted-2);
  text-align: center;
  padding: 12px 0;
}

.data-table tr.trade-row-long {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--good) 12%, transparent),
    transparent 72%
  );
}

.data-table tr.trade-row-short {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--bad) 11%, transparent),
    transparent 72%
  );
}

.data-table tr.trade-row-long:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--good) 14%, transparent),
    rgba(18, 224, 208, 0.03)
  );
}

.data-table tr.trade-row-short:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--bad) 13%, transparent),
    rgba(18, 224, 208, 0.03)
  );
}

.analytics-stats {
  gap: 16px;
}

.analytics-stats .stat-card {
  position: relative;
  overflow: hidden;
  padding: 12px 16px;
  border: 1px solid var(--stat-card-border);
  background: var(--stat-card-bg);
  box-shadow: var(--stat-card-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(6px);
  opacity: 0;
  animation: dashCardIn 0.5s ease forwards;
  --stat-accent: var(--accent);
  --stat-glow: rgba(73, 180, 255, 0.4);
}

.analytics-stats .stat-card:nth-child(2) {
  --stat-accent: var(--good);
  --stat-glow: rgba(53, 211, 145, 0.35);
  animation-delay: 0.04s;
}

.analytics-stats .stat-card:nth-child(3) {
  --stat-accent: var(--warn);
  --stat-glow: rgba(242, 198, 107, 0.35);
  animation-delay: 0.08s;
}

.analytics-stats .stat-card:nth-child(4) {
  --stat-accent: var(--accent-soft);
  --stat-glow: rgba(73, 180, 255, 0.25);
  animation-delay: 0.12s;
}

.analytics-stats .stat-card::before {
  content: "";
  position: absolute;
  inset: -30% -20% auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--stat-glow), transparent 65%);
  opacity: 0.65;
  pointer-events: none;
}

.analytics-stats .stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--stat-accent), rgba(255, 255, 255, 0));
  opacity: 0.9;
  pointer-events: none;
}

.analytics-stats .stat-card:hover {
  border-color: var(--stat-card-border-hover);
}

.analytics-stats .stat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.16em;
}

.analytics-stats .stat-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--stat-accent);
  box-shadow: 0 0 12px var(--stat-glow);
}

.analytics-stats .stat-value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.analytics-stats .stat-value:not(.text-mono) {
  font-family: var(--font-display);
}

@keyframes dashCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .analytics-stats .stat-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.panel-grid {
  display: grid;
  gap: 18px;
}

.terminal-frame {
  height: 42vh;
  min-height: 42vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
  display: flex;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.terminal-controls {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.terminal-actions {
  margin-top: 12px;
  gap: 10px;
}

.terminal-frame #tradingview_chart {
  height: 100% !important;
  width: 100% !important;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.terminal-frame #tradingview_chart > div {
  width: 100% !important;
  height: 100% !important;
}

.terminal-frame #tradingview_chart iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  inset: 0;
}

#realizedChart,
#botRealizedChart {
  width: 100%;
  min-height: 174px;
}

.analytics-hero {
  position: relative;
  overflow: visible;
  z-index: 20;
}

.analytics-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--analytics-hero-glow);
  pointer-events: none;
}

.analytics-hero > * {
  position: relative;
  z-index: 1;
}

.analytics-hero > .panel-header {
  z-index: 30;
}

.analytics-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: var(--chip-active-shadow);
}

.filter-chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.analytics-reset-wrap {
  position: relative;
  margin-left: auto;
  z-index: 31;
}

.analytics-reset-pill {
  white-space: nowrap;
}

.analytics-reset-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 260px;
  border-radius: 14px;
  border: 1px solid rgba(120, 170, 255, 0.28);
  background: #0b1220;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
  padding: 8px;
  overflow: hidden;
  pointer-events: auto;
}

.analytics-reset-menu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 224px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  pointer-events: auto;
}

.analytics-reset-option {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(120, 170, 255, 0.18);
  border-radius: 10px;
  background: #1a273a;
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.analytics-reset-option:hover {
  border-color: rgba(120, 170, 255, 0.5);
  background: #22344e;
}

.analytics-reset-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

:root[data-theme="light"] .analytics-reset-menu {
  border-color: rgba(148, 163, 184, 0.45);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

:root[data-theme="light"] .analytics-reset-option {
  border-color: rgba(148, 163, 184, 0.34);
  background: #f8faff;
}

:root[data-theme="light"] .analytics-reset-option:hover {
  border-color: rgba(59, 130, 246, 0.55);
  background: #eef5ff;
}

@media (max-width: 760px) {
  .analytics-reset-menu {
    min-width: 220px;
    max-width: min(88vw, 320px);
  }
}

.analytics-grid .panel {
  display: flex;
  flex-direction: column;
}

.chart-wrap {
  position: relative;
  min-height: 240px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 160px !important;
}

.pnl-chart-wrap {
  position: relative;
  height: 139px;
  overflow: hidden;
}

.pnl-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none;
}

.pnl-chart-navigator {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008)),
    rgba(8, 13, 22, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 22px rgba(0, 0, 0, 0.24);
}

.pnl-chart-navigator__ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.pnl-chart-navigator__range-btn {
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
}

.pnl-chart-navigator__range-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transform: translateY(-1px);
}

.pnl-chart-navigator__range-btn:focus-visible {
  outline: none;
  border-color: rgba(73, 180, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(73, 180, 255, 0.18);
}

.pnl-chart-navigator__range-btn[data-active="1"] {
  border-color: rgba(73, 180, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(73, 180, 255, 0.22), rgba(73, 180, 255, 0.08)),
    rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.pnl-chart-navigator__range-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.pnl-chart-navigator__label {
  flex: 0 1 auto;
  margin-left: auto;
  min-width: 72px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 900px) {
  .pnl-chart-wrap {
    height: 200px;
  }
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

body {
  background: var(--body-bg);
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  padding: 18px;
}

.docs-sidebar-header {
  margin-bottom: 14px;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.docs-group {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.docs-group:first-child {
  border-top: none;
  padding-top: 0;
}

.docs-group summary {
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-group summary::-webkit-details-marker {
  display: none;
}

.docs-group summary::before {
  content: "▸";
  font-size: 12px;
  transition: transform 0.2s ease;
}

.docs-group[open] summary::before {
  transform: rotate(90deg);
}

.docs-link {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
}

.docs-link:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

.docs-link.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: var(--chip-active-shadow-soft);
}

.docs-content h1 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 10px;
}

.docs-content h2 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 22px 0 8px;
}

.docs-content h3 {
  font-size: 15px;
  margin: 18px 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.docs-content p {
  color: var(--muted);
  line-height: 1.6;
}

.docs-content ul {
  margin: 8px 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.docs-content li {
  margin-bottom: 6px;
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.docs-content pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.docs-callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
}

@media (max-width: 980px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .hide-mobile { display: none; }
}

.gap-xs {
  gap: 4px;
}

.ec-page {
  display: grid;
  gap: 18px;
}

.ec-hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(112, 196, 255, 0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(22, 132, 107, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(10, 18, 32, 0.96), rgba(8, 13, 24, 0.99));
}

.ec-hero__copy {
  max-width: 760px;
}

.ec-kicker {
  margin-bottom: 8px;
  color: #8fd6ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ec-summary-strip {
  margin-top: 20px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ec-summary-pill {
  border: 1px solid rgba(126, 159, 204, 0.14);
  border-radius: 15px;
  padding: 12px 14px 13px;
  background: rgba(9, 18, 33, 0.52);
  display: grid;
  gap: 4px;
}

.ec-summary-pill strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.ec-summary-pill__label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ec-disclaimer {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ec-toolbar-panel {
  position: sticky;
  top: 78px;
  z-index: 6;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
  background: rgba(7, 12, 22, 0.86);
}

.ec-toolbar {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.ec-filter {
  display: grid;
  gap: 7px;
}

.ec-filter--toggle {
  align-content: start;
}

.ec-filter--search {
  grid-column: span 2;
}

.ec-filter__label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ec-filter select,
.ec-filter input {
  min-height: 40px;
}

.ec-more-filters {
  grid-column: 1 / -2;
  border: 1px solid rgba(128, 155, 198, 0.12);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(9, 16, 27, 0.72);
}

.ec-more-filters summary {
  cursor: pointer;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ec-more-filters[open] summary {
  margin-bottom: 12px;
}

.ec-more-filters__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ec-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.ec-toggle.is-active {
  border-color: rgba(74, 188, 255, 0.5);
  background: rgba(74, 188, 255, 0.12);
}

.ec-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.82fr);
  align-items: start;
}

.ec-main,
.ec-rail {
  min-width: 0;
}

.ec-section-panel,
.ec-rail-panel {
  overflow: hidden;
}

.ec-section-panel__header {
  align-items: start;
}

.ec-main {
  display: grid;
  gap: 18px;
}

.ec-card-grid {
  display: grid;
  gap: 12px;
}

.ec-card-grid--hero {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ec-card-list,
.ec-brief-list,
.ec-rail-list,
.ec-context-detail-list,
.ec-source-list,
.ec-selected-event__context {
  display: grid;
  gap: 10px;
}

.ec-card {
  width: 100%;
  border: 1px solid rgba(128, 155, 198, 0.14);
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(13, 22, 38, 0.97), rgba(9, 15, 28, 0.99));
  display: grid;
  gap: 10px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ec-card:hover,
.ec-card:focus {
  transform: translateY(-1px);
  border-color: rgba(101, 171, 243, 0.34);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  outline: none;
}

.ec-card--hero {
  min-height: 208px;
}

.ec-card__head,
.ec-context-row__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ec-card__signal,
.ec-card__tag-row,
.ec-selected-event__badges,
.ec-selected-event__markets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ec-card__time {
  display: grid;
  justify-items: end;
  color: var(--muted);
  font-size: 12px;
}

.ec-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.ec-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.ec-card__brief {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.ec-card__brief-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ec-card__brief--watch {
  color: var(--muted-2);
}

.ec-brief-item,
.ec-source-row {
  width: 100%;
  border: 1px solid rgba(128, 155, 198, 0.12);
  border-radius: 15px;
  padding: 12px 14px;
  background: rgba(10, 18, 31, 0.78);
  display: grid;
  gap: 5px;
  text-align: left;
  color: var(--text);
}

.ec-brief-item {
  cursor: pointer;
}

.ec-brief-item__title,
.ec-source-row__title {
  font-weight: 600;
}

.ec-brief-item__meta,
.ec-brief-item__note,
.ec-source-row__meta {
  color: var(--muted);
  font-size: 12px;
}

.ec-feed-footer {
  margin-top: 18px;
}

.ec-badge {
  color: var(--text);
}

.ec-badge--neutral {
  border-color: rgba(101, 171, 243, 0.42);
  color: #9dc6ff;
}

.ec-badge--impact-high {
  border-color: rgba(244, 120, 120, 0.42);
  color: #ffb1b1;
}

.ec-badge--impact-medium {
  border-color: rgba(249, 193, 96, 0.44);
  color: #ffd991;
}

.ec-badge--status-live {
  border-color: rgba(111, 214, 168, 0.45);
  color: #9be9be;
}

.ec-badge--status-upcoming {
  border-color: rgba(136, 193, 255, 0.42);
  color: #a8d1ff;
}

.ec-badge--warn {
  border-color: rgba(248, 202, 122, 0.48);
  color: #ffd889;
}

.ec-badge--soft {
  border-color: rgba(125, 142, 176, 0.34);
  color: #c5d1e7;
}

.ec-badge--family-crypto {
  border-color: rgba(91, 218, 144, 0.4);
  color: #8ce7b0;
}

.ec-badge--family-stocks {
  border-color: rgba(96, 162, 255, 0.4);
  color: #9dc6ff;
}

.ec-badge--family-indices {
  border-color: rgba(255, 137, 191, 0.34);
  color: #ffb4d7;
}

.ec-badge--family-forex {
  border-color: rgba(253, 213, 108, 0.4);
  color: #ffe199;
}

.ec-badge--family-commodities {
  border-color: rgba(255, 167, 95, 0.38);
  color: #ffc08e;
}

.ec-rail {
  display: grid;
  gap: 18px;
}

.ec-context-row {
  border: 1px solid rgba(128, 155, 198, 0.12);
  border-radius: 16px;
  padding: 14px;
  background: rgba(11, 19, 32, 0.84);
}

.ec-context-row__grid,
.ec-detail-grid {
  margin-top: 12px;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--muted);
  font-size: 12px;
}

.ec-context-row__grid strong,
.ec-detail-grid strong {
  color: var(--text);
}

.ec-empty-state {
  border: 1px dashed rgba(128, 155, 198, 0.18);
  border-radius: 16px;
  padding: 16px;
  color: var(--muted);
  background: rgba(10, 18, 31, 0.46);
}

.ec-empty-state--compact {
  padding: 12px 14px;
  font-size: 13px;
}

.ec-selected-event {
  display: grid;
  gap: 12px;
}

.ec-selected-event__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ec-selected-event__title {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.2;
}

.ec-selected-event__text {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.ec-source-row a {
  color: var(--text);
  text-decoration: none;
}

.ec-source-row a:hover {
  text-decoration: underline;
}

.ec-drawer__panel {
  max-width: 1040px;
}

.ec-drawer__body {
  display: grid;
  gap: 18px;
}

.ec-detail-section + .ec-detail-section {
  margin-top: 8px;
}

.ec-detail-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(10, 18, 31, 0.92);
  border: 1px solid rgba(128, 155, 198, 0.12);
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
}

.ec-detail-metric .metric-value {
  line-height: 1.45;
  word-break: break-word;
}

@media (max-width: 1220px) {
  .ec-summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ec-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ec-more-filters,
  .ec-toolbar__actions {
    grid-column: 1 / -1;
  }

  .ec-more-filters__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ec-filter--search {
    grid-column: span 4;
  }

  .ec-layout {
    grid-template-columns: 1fr;
  }

  .ec-card-grid--hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .ec-hero {
    padding: 22px;
  }

  .ec-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ec-toolbar-panel {
    top: 68px;
  }

  .ec-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ec-filter--search {
    grid-column: span 2;
  }

  .ec-more-filters {
    grid-column: 1 / -1;
  }

  .ec-more-filters__grid {
    grid-template-columns: 1fr;
  }

  .ec-toolbar__actions {
    justify-content: flex-start;
  }

  .ec-card__head,
  .ec-card__meta-row,
  .ec-context-row__head,
  .ec-selected-event__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ec-card__time {
    justify-items: start;
  }

  .ec-detail-grid,
  .ec-context-row__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ec-summary-strip,
  .ec-toolbar {
    grid-template-columns: 1fr;
  }

  .ec-filter--search {
    grid-column: auto;
  }

  .ec-card {
    padding: 16px;
  }

  .ec-card__title {
    font-size: 19px;
  }
}

.strategy-list {
  display: grid;
  gap: 16px;
}

.panel-header--spread {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.strategy-card {
  display: grid;
  gap: 14px;
}

.strategy-card__header,
.strategy-card__actions,
.strategy-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.strategy-card__header {
  justify-content: space-between;
}

.strategy-builder-card {
  padding: 18px;
}

.strategy-rule-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.strategy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.strategy-chip--muted {
  opacity: 0.8;
}

.strategy-json-preview,
.strategy-json-display {
  min-height: 220px;
  font-family: "JetBrains Mono", monospace;
  white-space: pre-wrap;
}

.bot-next-move-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bot-next-move-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    var(--card-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.bot-next-move-label,
.bot-next-move-value {
  min-width: 0;
}

.bot-next-move-label {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
}

.bot-next-move-value {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

.bot-next-move-chip--active,
.bot-next-move-chip--waiting {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background:
    linear-gradient(180deg, rgba(86, 153, 255, 0.08), rgba(86, 153, 255, 0.03)),
    var(--card-bg);
}

.bot-next-move-chip--managing {
  border-color: color-mix(in srgb, var(--good) 26%, var(--line));
  background:
    linear-gradient(180deg, rgba(53, 211, 145, 0.09), rgba(53, 211, 145, 0.03)),
    var(--card-bg);
}

.bot-next-move-chip--cooldown {
  border-color: color-mix(in srgb, var(--warn) 28%, var(--line));
  background:
    linear-gradient(180deg, rgba(255, 175, 90, 0.09), rgba(255, 175, 90, 0.03)),
    var(--card-bg);
}

.bot-next-move-chip--paused,
.bot-next-move-chip--unavailable {
  border-color: color-mix(in srgb, var(--muted) 40%, var(--line));
  background:
    linear-gradient(180deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.025)),
    var(--card-bg);
}

.bot-next-move-chip--blocked,
.bot-next-move-chip--error {
  border-color: color-mix(in srgb, var(--bad) 34%, var(--line));
  background:
    linear-gradient(180deg, rgba(255, 107, 107, 0.10), rgba(255, 107, 107, 0.035)),
    var(--card-bg);
}

@media (max-width: 720px) {
  .bot-next-move-chip {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
