:root {
  color-scheme: dark;
  --bg: #050b12;
  --panel: #08131d;
  --panel-2: #0b1824;
  --panel-3: #0e2030;
  --text: #e7eef8;
  --muted: #8ea0b7;
  --soft: #b9c6d8;
  --border: rgba(127, 153, 184, 0.18);
  --border-strong: rgba(127, 153, 184, 0.34);
  --buy: #22c55e;
  --sell: #ef4444;
  --wait: #d8e0ec;
  --amber: #fbbf24;
  --blue: #5b7cfa;
  --favorite: #f5b301;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.30);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(28, 86, 126, 0.22), transparent 32%),
    radial-gradient(circle at 86% 8%, rgba(34, 197, 94, 0.10), transparent 28%),
    linear-gradient(180deg, #07111b 0%, var(--bg) 100%);
}

button,
select,
input {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.terminal-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 24px;
  height: 100vh;
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  background: rgba(5, 12, 20, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.10);
  color: #f8d58a;
  font-weight: 900;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1;
  letter-spacing: 0;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  justify-content: start;
  border: 1px solid transparent;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
}

.nav-item.is-active {
  border-color: rgba(251, 191, 36, 0.18);
  background: rgba(251, 191, 36, 0.12);
  color: #f8d58a;
}

.nav-item.is-disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.label,
.updated-at,
.summary-card span,
.market-picker span {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-foot {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.78rem;
}

.sidebar-foot a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.sidebar-foot a:hover,
.sidebar-foot a.is-active {
  color: #f8d58a;
}

.terminal-main {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
}

.view-section {
  display: grid;
  gap: 14px;
}

.view-section:not(#marketView) {
  align-self: start;
}

.view-section[hidden] {
  display: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.topbar-copy {
  display: grid;
  gap: 4px;
}

.topbar-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-copy strong {
  font-size: 1.35rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.account-control {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.login-button,
.user-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid rgba(245, 179, 1, 0.42);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(245, 179, 1, 0.09);
  color: var(--favorite);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.login-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 4px 3px 3px;
  background: rgba(8, 19, 29, 0.72);
}

.user-chip[hidden] {
  display: none;
}

.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  object-fit: cover;
}

.user-chip span {
  max-width: 130px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip button {
  min-height: 28px;
  padding: 0 10px;
  border-color: var(--border-strong);
  background: transparent;
  color: var(--muted);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--buy);
  font-weight: 900;
}

.live-pill strong {
  font-size: inherit;
  font-weight: inherit;
  text-transform: uppercase;
}

.live-pill span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--buy);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.8);
}

.live-pill[data-status="loading"],
.live-pill[data-status="reconnecting"] {
  color: var(--amber);
}

.live-pill[data-status="loading"] span,
.live-pill[data-status="reconnecting"] span {
  background: var(--amber);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.72);
}

.live-pill[data-status="offline"] {
  color: var(--sell);
}

.live-pill[data-status="offline"] span {
  background: var(--sell);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.74);
}

.updated-at {
  white-space: nowrap;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) repeat(3, minmax(180px, 0.8fr));
  gap: 12px;
}

.primary-grid {
  display: grid;
}

.signal-panel,
.chart-panel,
.timeframe-panel,
.confluence-panel,
.summary-card,
.details article,
.timeframe-detail,
.detail-metrics article {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(14, 32, 48, 0.84), rgba(8, 19, 29, 0.92));
  box-shadow: var(--shadow);
}

.chart-panel,
.timeframe-panel,
.confluence-panel,
.summary-card,
.details article,
.timeframe-detail {
  overflow: hidden;
}

.signal-panel.is-updating::after,
.chart-panel.is-updating::after,
.timeframe-panel.is-updating::after,
.confluence-panel.is-updating::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(91, 124, 250, 0.9), transparent);
  animation: loadingSweep 1.15s ease-in-out infinite;
}

.signal-panel.is-updating .price,
.chart-panel.is-updating canvas,
.timeframe-panel.is-updating .timeframe-grid,
.confluence-panel.is-updating .confluence-grid {
  opacity: 0.78;
  transition: opacity 0.18s ease;
}

@keyframes loadingSweep {
  from { transform: translateX(0); }
  to { transform: translateX(350%); }
}

.price-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 220px;
  padding: 20px;
  border-left: 4px solid var(--buy);
  z-index: 5;
}

.price {
  margin: 0;
  width: 100%;
  min-width: 0;
  color: var(--buy);
  font-size: 54px;
  font-weight: 900;
  line-height: 0.95;
  white-space: nowrap;
}

.summary-card {
  display: grid;
  grid-template-rows: auto minmax(72px, auto) auto;
  align-content: start;
  gap: 9px;
  min-height: 150px;
  padding: 18px;
}

.summary-card strong {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.35em;
  color: var(--soft);
  font-size: clamp(1.5rem, 2.6vw, 2.35rem);
  line-height: 1;
}

.summary-card[data-action="BUY"] strong {
  color: var(--buy);
}

.summary-card[data-action="SELL"] strong {
  color: var(--sell);
}

.summary-card[data-action="WAIT"] strong {
  color: var(--amber);
}

.dominant-direction {
  font-size: 0.86em;
}

.dominant-direction[data-action="BUY"] {
  color: var(--buy);
}

.dominant-direction[data-action="SELL"] {
  color: var(--sell);
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.market-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  position: relative;
  min-width: 0;
}

.market-picker > span {
  grid-column: 1 / -1;
}

.asset-select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-color: var(--border-strong);
  padding: 0 38px 0 12px;
  background:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%),
    rgba(8, 19, 29, 0.78);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 10px) 50%,
    0 0;
  background-size: 8px 8px, 8px 8px, auto;
  background-repeat: no-repeat;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 850;
  text-align: left;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.price-panel .market-picker {
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 8px;
}

.price-panel .asset-select {
  min-height: 58px;
  border-color: transparent;
  padding-left: 0;
  background:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%),
    transparent;
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size: 10px 10px, 10px 10px, auto;
  background-repeat: no-repeat;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 950;
  line-height: 1;
}

.price-panel .asset-select:focus {
  outline: 0;
  border-color: transparent;
  box-shadow: none;
}

.price-panel .favorite-toggle {
  width: 52px;
  min-width: 52px;
  min-height: 52px;
  border-color: transparent;
  background: transparent;
  font-size: 2rem;
}

.price-panel .market-menu {
  width: min(420px, 100%);
}

.favorite-toggle {
  align-self: end;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  border-color: var(--border-strong);
  padding: 0;
  background: rgba(8, 19, 29, 0.78);
  color: var(--favorite);
  font-size: 1.25rem;
  line-height: 1;
}

.favorite-toggle:disabled {
  cursor: default;
  opacity: 1;
}

.market-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 8px);
  left: 0;
  width: min(320px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px;
  background: #07111b;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.44);
}

.market-menu[hidden] {
  display: none;
}

.market-menu input {
  width: 100%;
  min-height: 38px;
  margin-bottom: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
}

#symbolOptions {
  display: grid;
  max-height: 270px;
  overflow-y: auto;
}

.menu-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 7px 8px;
}

.menu-heading {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.market-menu .order-toggle {
  width: auto;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.market-menu .order-toggle[aria-pressed="true"] {
  background: var(--blue);
  color: #ffffff;
}

.symbol-option {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
}

.symbol-option.has-order {
  grid-template-columns: 32px 32px 1fr;
  cursor: grab;
  user-select: none;
}

.symbol-option.is-ordering {
  position: relative;
}

.symbol-option.is-dragging {
  opacity: 0.46;
}

.symbol-option.drop-before::before,
.symbol-option.drop-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue);
}

.symbol-option.drop-before::before { top: 0; }
.symbol-option.drop-after::after { bottom: 0; }

.market-menu button {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 0.94rem;
  font-weight: 850;
}

.market-menu .favorite-star {
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  text-align: center;
  font-size: 1rem;
}

.market-menu .favorite-star[aria-pressed="true"] {
  color: var(--favorite);
}

.market-menu .favorite-star:disabled {
  cursor: default;
}

.market-menu .drag-handle {
  min-height: 32px;
  padding: 0;
  color: var(--muted);
  text-align: center;
  cursor: inherit;
  touch-action: none;
  user-select: none;
}

.symbol-option.has-order:active,
.market-menu .drag-handle:active {
  cursor: grabbing;
}

.market-menu button:hover,
.market-menu button[aria-selected="true"] {
  background: rgba(91, 124, 250, 0.14);
}

.chart-panel {
  min-height: 410px;
  padding: 16px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.chart-head strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.timeframe-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.timeframe-tabs button {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.timeframe-tabs button[data-selected="true"] {
  border-color: rgba(91, 124, 250, 0.36);
  background: rgba(91, 124, 250, 0.18);
  color: #d7e0ff;
}

canvas {
  display: block;
  width: 100%;
  height: 330px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #06111a;
}

.timeframe-panel,
.confluence-panel,
.details article {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-source {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

h2 {
  margin: 5px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

.view-intro {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.help-button {
  display: inline-grid;
  place-items: center;
  align-self: center;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 900;
}

.help-button[aria-expanded="true"] {
  border-color: rgba(91, 124, 250, 0.4);
  background: rgba(91, 124, 250, 0.18);
  color: #d7e0ff;
}

.panel-help {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  line-height: 1.45;
}

.panel-help[hidden] {
  display: none;
}

.panel-help strong {
  color: var(--text);
}

.panel-help p {
  margin: 0;
  font-size: 0.92rem;
}

.panel-help ul {
  display: grid;
  gap: 3px;
  margin: 2px 0;
  padding-left: 18px;
  font-size: 0.9rem;
}

.timeframe-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.timeframe-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--wait);
  border-radius: 8px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.timeframe-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22);
}

.timeframe-card[data-selected="true"] {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}

.timeframe-card[data-action="BUY"] { border-top-color: var(--buy); }
.timeframe-card[data-action="SELL"] { border-top-color: var(--sell); }
.timeframe-card[data-action="WAIT"] { border-top-color: var(--wait); }
.timeframe-card[data-action="MIXED"] { border-top-color: var(--amber); }
.timeframe-card[data-action="BUY"] strong { color: var(--buy); }
.timeframe-card[data-action="SELL"] strong { color: var(--sell); }
.timeframe-card[data-action="WAIT"] strong { color: var(--wait); }

.timeframe-card span,
.confluence-card span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeframe-card strong,
.confluence-card strong {
  font-size: clamp(1rem, 1.5vw, 1.45rem);
  line-height: 1.05;
}

.timeframe-card p,
.confluence-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.timeframe-card p {
  font-size: 0.82rem;
}

.timeframe-card .timeframe-note {
  min-height: 2.1rem;
}

.timeframe-detail {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  border-left: 4px solid var(--wait);
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.timeframe-detail[hidden] {
  display: none;
}

.timeframe-detail[data-action="BUY"] { border-left-color: var(--buy); }
.timeframe-detail[data-action="SELL"] { border-left-color: var(--sell); }

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.detail-head strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.05;
}

.detail-head > span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
  white-space: nowrap;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-metrics article {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
}

.detail-metrics span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
}

.timeframe-wait {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 800;
}

.confluence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.confluence-card {
  display: grid;
  gap: 8px;
  min-height: 138px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--wait);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.confluence-card[data-action="BUY"] { border-top-color: var(--buy); }
.confluence-card[data-action="SELL"] { border-top-color: var(--sell); }
.confluence-card[data-action="WAIT"] { border-top-color: var(--wait); }
.confluence-card[data-action="MIXED"] { border-top-color: var(--amber); }
.confluence-card[data-action="BUY"] strong { color: var(--buy); }
.confluence-card[data-action="SELL"] strong { color: var(--sell); }
.confluence-card[data-action="WAIT"] strong { color: var(--wait); }
.confluence-card[data-action="MIXED"] strong { color: var(--amber); }

.details {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
}

ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

li {
  padding-left: 14px;
  border-left: 3px solid var(--blue);
  color: var(--soft);
  line-height: 1.5;
}

.opportunities-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.opportunities-list-large {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.opportunities-view,
.alerts-view,
.signals-view,
.watchlist-view,
.legal-view {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(14, 32, 48, 0.84), rgba(8, 19, 29, 0.92));
  box-shadow: var(--shadow);
}

.opportunities-view > .panel-source,
.alerts-view > .panel-source,
.signals-view > .panel-source,
.watchlist-view > .panel-source {
  display: none;
}

.alerts-list,
.signals-list,
.watchlist-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.legal-panel {
  display: grid;
  gap: 14px;
  max-width: 880px;
}

.legal-panel h2 {
  margin: 0;
}

.legal-panel p {
  margin: 0;
  color: var(--soft);
  font-size: 1rem;
  line-height: 1.62;
}

.signals-list.is-grouped {
  grid-template-columns: 1fr;
}

.signal-day-group {
  display: grid;
  gap: 10px;
}

.signal-day-group h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-day-group + .signal-day-group {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

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

.alert-card,
.signal-card,
.watchlist-card,
.score-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-items: start;
  gap: 10px;
  min-height: 190px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--amber);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.alert-card[data-action="BUY"],
.signal-card[data-action="BUY"],
.watchlist-card[data-action="BUY"] {
  border-top-color: var(--buy);
}

.alert-card[data-action="SELL"],
.signal-card[data-action="SELL"],
.watchlist-card[data-action="SELL"] {
  border-top-color: var(--sell);
}

.alert-card span,
.signal-card span,
.watchlist-card span,
.score-card span,
.alert-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alert-title-row,
.watchlist-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.alert-title-row strong,
.watchlist-title-row strong {
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1.1;
}

.alert-title-row b,
.watchlist-title-row b {
  font-size: 0.95rem;
  font-weight: 950;
}

.alert-card[data-action="BUY"] .alert-title-row b {
  color: var(--buy);
}

.alert-card[data-action="SELL"] .alert-title-row b {
  color: var(--sell);
}

.alert-card p,
.signal-card p,
.watchlist-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.watchlist-card[data-level="alert"] {
  background: rgba(34, 197, 94, 0.045);
}

.watchlist-card[data-level="forming"] {
  border-top-color: var(--amber);
}

.watchlist-card[data-level="neutral"] {
  border-top-color: var(--wait);
}

.watchlist-meta {
  font-weight: 850;
}

.alert-actions {
  justify-self: start;
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.alert-action-primary {
  border-color: rgba(245, 179, 1, 0.82);
  background: rgba(245, 179, 1, 0.16);
  color: var(--favorite);
}

.alert-action-primary:hover {
  background: rgba(245, 179, 1, 0.24);
  filter: brightness(1.08);
}

.alert-action-secondary:hover {
  border-color: var(--favorite);
  background: rgba(245, 179, 1, 0.12);
}

.signals-view {
  gap: 18px;
}

.signals-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.signals-tabs button {
  min-width: 104px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  cursor: pointer;
}

.signals-tabs button.is-active {
  color: var(--favorite);
  background: rgba(245, 179, 1, 0.12);
  box-shadow: inset 0 0 0 1px rgba(245, 179, 1, 0.3);
}

.signals-filters {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  flex-wrap: wrap;
}

.signals-filters[hidden] {
  display: none;
}

.signals-filters button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.signals-filters button.is-active {
  border-color: rgba(245, 179, 1, 0.75);
  color: var(--favorite);
  background: rgba(245, 179, 1, 0.13);
}

.signals-block {
  display: grid;
  gap: 10px;
}

.signals-block[hidden] {
  display: none;
}

.signals-block h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-card {
  min-height: 220px;
}

.signal-card[data-status="CLOSED"] {
  border-top-color: var(--wait);
}

.signal-card[data-pending="true"] {
  border-top-color: var(--favorite);
}

.signal-card[data-pending="true"] > span {
  color: var(--favorite);
}

.score-card {
  min-height: 150px;
  grid-template-rows: auto auto 1fr;
}

.score-card strong {
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.05;
}

.score-card p {
  margin: 0;
  color: var(--muted);
}

.score-card[data-tone="positive"] {
  border-top-color: var(--buy);
}

.score-card[data-tone="negative"] {
  border-top-color: var(--sell);
}

.score-card[data-tone="neutral"] {
  border-top-color: var(--wait);
}

.score-hero {
  grid-column: span 2;
  min-height: 190px;
}

.score-hero strong {
  font-size: clamp(2.6rem, 4.5vw, 4.6rem);
}

.score-metric strong {
  font-size: 1.3rem;
}

.score-table-card {
  grid-column: span 2;
  min-height: 190px;
}

.score-table {
  display: grid;
  gap: 8px;
}

.score-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.score-table > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.score-table strong,
.score-table span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.score-table strong {
  color: var(--text);
}

.score-table [data-tone="positive"] {
  color: var(--buy);
}

.score-table [data-tone="negative"] {
  color: var(--sell);
}

.opportunity-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-items: start;
  gap: 8px;
  min-height: 250px;
  max-height: 360px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.future-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.future-modules span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
  font-weight: 800;
}

.opportunity-card[data-status="active"] {
  border-left-color: var(--buy);
}

.opportunity-card[data-status="upcoming"] {
  border-left-color: var(--blue);
}

.opportunity-card span,
.opportunity-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.opportunity-card strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.22;
}

.opportunity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.opportunity-card p:not(.opportunity-meta) {
  align-self: start;
}

.opportunity-card a {
  justify-self: start;
  align-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--buy) 62%, var(--border-strong));
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(34, 197, 94, 0.12);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.05), 0 12px 28px rgba(34, 197, 94, 0.12);
  color: var(--buy);
  font-size: 0.8rem;
  font-weight: 900;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.opportunity-card a:hover {
  border-color: var(--buy);
  background: rgba(34, 197, 94, 0.2);
  transform: translateY(-1px);
}

.disclaimer {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .terminal-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-foot {
    grid-template-columns: repeat(4, max-content);
    align-items: center;
    gap: 12px;
  }

	  .overview-grid,
	  .timeframe-grid,
	  .confluence-grid,
	  .alerts-list,
	  .signals-list,
	  .score-grid,
	  .watchlist-list,
	  .details {
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }
}

@media (max-width: 760px) {
  .terminal-main {
    padding: 12px;
  }

  .topbar,
  .topbar-actions,
	  .overview-grid,
	  .timeframe-grid,
	  .confluence-grid,
	  .alerts-list,
	  .signals-list,
	  .score-grid,
	  .watchlist-list,
	  .details,
	  .detail-metrics {
	    grid-template-columns: 1fr;
  }

  .score-hero,
  .score-table-card {
    grid-column: span 1;
  }

  .score-table > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .topbar {
    display: grid;
  }

  .timeframe-tabs {
    justify-content: flex-start;
  }

  .price {
    font-size: 42px;
  }

  canvas {
    height: 280px;
  }
}
