﻿:root {
  color-scheme: dark;
  --bg: #071015;
  --chrome: #0b151b;
  --chrome-2: #0f1c23;
  --surface: #f7fafc;
  --surface-2: #ffffff;
  --surface-3: #edf3f6;
  --text: #102027;
  --muted: #697981;
  --inverse: #eef7f8;
  --inverse-muted: #91a6ad;
  --border: #dce6ea;
  --chrome-border: #1d323a;
  --emerald: #11b981;
  --emerald-2: #087f5b;
  --cyan: #22c7dc;
  --amber: #d99116;
  --red: #d94c4c;
  --shadow: 0 18px 45px rgba(6, 16, 20, 0.16);
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f6f7;
  --chrome: #ffffff;
  --chrome-2: #edf5f6;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #eef5f7;
  --text: #102027;
  --muted: #667982;
  --inverse: #102027;
  --inverse-muted: #657a82;
  --border: #d8e5e9;
  --chrome-border: #d8e5e9;
  --shadow: 0 18px 45px rgba(15, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 18px;
  overflow-y: auto;
  background: var(--chrome);
  color: var(--inverse);
  border-right: 1px solid var(--chrome-border);
}

.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: #0e2a2e;
  color: var(--cyan);
  border: 1px solid #1f4a50;
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 800;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--inverse-muted);
  font-size: 11px;
  line-height: 1.35;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--inverse-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.is-active {
  color: var(--inverse);
  background: var(--chrome-2);
  outline: none;
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--emerald);
}

.nav-item svg {
  width: 21px;
  height: 21px;
}

.nav-item path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.designer-credit {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--chrome-2);
  border: 1px solid var(--chrome-border);
}

.designer-credit span,
.designer-credit strong {
  display: block;
}

.designer-credit span {
  color: var(--inverse-muted);
  font-size: 11px;
  line-height: 1.4;
}

.designer-credit strong {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--inverse);
}

.main {
  min-width: 0;
  padding: 22px;
  background: var(--surface-3);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-label,
.section-label {
  margin: 0 0 5px;
  color: var(--emerald-2);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  font-weight: 850;
}

h2 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 19px;
  line-height: 1.2;
  font-weight: 800;
}

.topbar-actions,
.tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill,
.last-refresh,
.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 4px rgba(17, 185, 129, 0.15);
}

.icon-button,
.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.primary-button {
  padding: 0 14px;
  background: var(--text);
  color: #ffffff;
}

.secondary-button {
  width: 100%;
  padding: 0 14px;
  background: #102027;
  color: #ffffff;
}

.ghost-button {
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.icon-button svg,
.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

.icon-button path,
.primary-button path,
.secondary-button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button.is-loading svg {
  animation: spin 900ms linear infinite;
}

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

.metric-card,
.panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 126px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.metric-card span,
.detail-price span,
.indicator-grid span,
.allocation-row span,
.score-breakdown span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.positive {
  color: var(--emerald-2) !important;
}

.negative {
  color: var(--red) !important;
}

.neutral {
  color: var(--amber) !important;
}

.sparkline {
  width: 112px;
  height: 52px;
}

.sparkline path {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 4;
  stroke-linecap: round;
}

.score-ring {
  --size: 68px;
  width: var(--size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--emerald) calc(var(--score) * 1%), #dce8eb 0);
}

.score-ring span {
  display: grid;
  place-items: center;
  width: 50px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.refresh-meter {
  width: 66px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8eb;
}

.refresh-meter span {
  display: block;
  width: 64%;
  height: 100%;
  background: var(--cyan);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.right-rail {
  display: grid;
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header.compact {
  margin-bottom: 14px;
}

.search {
  display: grid;
  grid-template-columns: 18px minmax(160px, 220px);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.search svg {
  width: 17px;
  height: 17px;
}

.search path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.segment {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.segment button {
  min-width: 64px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.segment button.is-active {
  background: var(--text);
  color: #ffffff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 11px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}


th:nth-child(1),
td:nth-child(1) {
  width: 32%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 13%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 15%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 9%;
}

th:nth-child(5),
td:nth-child(5) {
  width: 9%;
  text-align: center;
}

th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7) {
  width: 11%;
}

tbody tr {
  transition: background 180ms ease;
}

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(34, 199, 220, 0.08);
}

.instrument {
  display: grid;
  gap: 3px;
}

.instrument strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instrument span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.type-chip,
.signal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.type-chip {
  background: var(--surface-3);
  color: var(--muted);
}

.signal-chip.buy,
.signal-badge.buy {
  background: rgba(17, 185, 129, 0.14);
  color: var(--emerald-2);
}

.signal-chip.hold,
.signal-badge.hold {
  background: rgba(217, 145, 22, 0.14);
  color: var(--amber);
}

.signal-chip.watch,
.signal-badge.watch {
  background: rgba(34, 199, 220, 0.14);
  color: #128599;
}

.row-button {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
}

.signal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 850;
}

.detail-price {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: end;
  margin-bottom: 15px;
}

.detail-price strong {
  grid-column: 1 / 2;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.detail-price small {
  justify-self: end;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 13px;
  font-weight: 850;
}

.indicator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.indicator-grid div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.indicator-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
}

.score-breakdown {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.score-breakdown div {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

meter {
  width: 100%;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: #dce8eb;
}

meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: #dce8eb;
}

meter::-webkit-meter-optimum-value {
  border-radius: 999px;
  background: var(--emerald);
}

meter::-moz-meter-bar {
  border-radius: 999px;
  background: var(--emerald);
}

.portfolio-value {
  color: var(--text);
  font-size: 18px;
}

.allocation-list {
  display: grid;
  gap: 13px;
}

.allocation-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
}

.allocation-track {
  height: 10px;
  border-radius: 999px;
  background: #dce8eb;
  overflow: hidden;
}

.allocation-track span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--color);
}

.allocation-row strong {
  color: var(--text);
  font-size: 13px;
  text-align: right;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.9fr;
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.alert-list,
.log-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.alert-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.alert-item:last-child,
.log-list li:last-child {
  border-bottom: 0;
}

.alert-level {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--level-color);
}

.alert-item strong,
.log-list strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.alert-item span,
.log-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.alert-item button {
  width: 34px;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
}

.log-list {
  list-style: none;
}

.log-list li {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.log-time {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 850;
}

.data-map {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.data-map span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    min-width: max-content;
  }

  .designer-credit {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .tools {
    width: 100%;
    justify-content: flex-start;
  }

  .right-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 112px;
  }

  .panel {
    padding: 15px;
  }

  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    grid-template-columns: 18px minmax(0, 1fr);
    width: 100%;
  }

  .segment {
    width: 100%;
  }

  .segment button {
    flex: 1;
  }

  .status-pill,
  .last-refresh,
  .sync-state,
  .primary-button,
  .ghost-button {
    flex: 1 1 auto;
  }

  .score-breakdown div,
  .allocation-row {
    grid-template-columns: 1fr;
  }

  .allocation-row strong {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Premium market terminal refresh */
:root {
  --bg: #07100f;
  --chrome: #071311;
  --chrome-2: #10201d;
  --surface: #f5f8f7;
  --surface-2: #ffffff;
  --surface-3: #eef3f1;
  --text: #12201d;
  --muted: #6b7d77;
  --inverse: #f2faf7;
  --inverse-muted: #91a9a1;
  --border: #dce7e3;
  --chrome-border: rgba(177, 224, 208, 0.12);
  --emerald: #34d399;
  --emerald-2: #087f5b;
  --cyan: #4fd1c5;
  --amber: #d99a2b;
  --red: #dc5b67;
  --shadow: 0 12px 34px rgba(18, 42, 35, 0.08);
  --shadow-hover: 0 20px 44px rgba(18, 42, 35, 0.13);
  --radius: 18px;
  --radius-sm: 11px;
}

body {
  background:
    radial-gradient(circle at 5% 0%, rgba(52, 211, 153, 0.08), transparent 22rem),
    var(--bg);
}

.sidebar {
  padding: 28px 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(52, 211, 153, 0.11), transparent 18rem),
    var(--chrome);
}

.brand-mark {
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.2), rgba(79, 209, 197, 0.06));
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

.nav-list { gap: 8px; }
.nav-item { min-height: 46px; padding: 0 14px; border-radius: 12px; transition: 180ms ease; }
.nav-item:hover { transform: translateX(3px); }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.17), rgba(52, 211, 153, 0.04));
  box-shadow: inset 3px 0 0 var(--emerald);
}
.designer-credit {
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.1), rgba(255,255,255,.02));
  border-radius: 14px;
}

.main { padding: 30px; }
.topbar { margin-bottom: 24px; }
h1 { font-size: clamp(27px, 3vw, 38px); letter-spacing: -0.04em; }
.page-label, .section-label { letter-spacing: .1em; }
.status-pill, .last-refresh, .sync-state { min-height: 40px; border-radius: 999px; }
.icon-button, .primary-button, .secondary-button, .ghost-button { min-height: 42px; border-radius: 12px; transition: 180ms ease; }
.primary-button {
  padding-inline: 18px;
  background: linear-gradient(135deg, #0d2822, #163d33);
  box-shadow: 0 8px 18px rgba(9, 48, 37, .18);
}
button:hover, .hero-primary:hover, .hero-link:hover { transform: translateY(-1px); }

.market-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: 330px;
  margin-bottom: 18px;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  border-radius: 24px;
  color: #f3fbf8;
  background:
    radial-gradient(circle at 88% 12%, rgba(52, 211, 153, .18), transparent 24rem),
    linear-gradient(120deg, #071813 0%, #0c2821 58%, #0b211c 100%);
  box-shadow: 0 22px 50px rgba(7, 30, 24, .2);
}
.market-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -80px;
  bottom: -170px;
  width: 420px;
  aspect-ratio: 1;
  border: 1px solid rgba(52, 211, 153, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(52,211,153,.035), 0 0 0 110px rgba(52,211,153,.025);
}
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; color: #9ddac5; font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow span { width: 7px; aspect-ratio: 1; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 5px rgba(52,211,153,.12); }
.market-hero h2 { max-width: 620px; color: inherit; font-size: clamp(34px, 5vw, 62px); line-height: .98; letter-spacing: -.055em; }
.market-hero h2 em { color: var(--emerald); font-style: normal; }
.hero-copy > p { max-width: 550px; margin: 20px 0 24px; color: #a9c2ba; font-size: 15px; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; }
.hero-primary, .hero-link { display: inline-flex; align-items: center; min-height: 45px; font-size: 13px; font-weight: 850; text-decoration: none; transition: 180ms ease; }
.hero-primary { padding: 0 18px; border-radius: 12px; background: var(--emerald); color: #062119; box-shadow: 0 10px 24px rgba(52,211,153,.2); }
.hero-link { gap: 8px; color: #d9eee7; }
.hero-link span { color: var(--emerald); font-size: 18px; }

.hero-pulse { padding: 23px; border: 1px solid rgba(178,231,213,.16); border-radius: 18px; background: rgba(255,255,255,.055); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); backdrop-filter: blur(10px); }
.pulse-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.pulse-head span { color: #8ca9a0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.pulse-head strong { color: #c9f5e5; font-size: 12px; }
.breadth-bar { display: flex; gap: 3px; height: 8px; overflow: hidden; border-radius: 99px; }
.breadth-bar span { display: block; }
.advance { background: var(--emerald); } .neutral-width { background: #9cadab; } .decline { background: #d76670; }
.breadth-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 15px; }
.breadth-legend span { color: #88a198; font-size: 10px; }
.breadth-legend strong { display: block; margin: 6px 0 2px; color: #effaf6; font-size: 18px; }
.breadth-legend i { display: inline-block; width: 6px; aspect-ratio: 1; margin-right: 5px; border-radius: 50%; }
.breadth-legend .up { background: var(--emerald); } .breadth-legend .flat { background: #9cadab; } .breadth-legend .down { background: #d76670; }
.hero-verdict { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.verdict-icon { display: grid; place-items: center; width: 38px; aspect-ratio: 1; border-radius: 11px; color: var(--emerald); background: rgba(52,211,153,.12); font-size: 20px; }
.hero-verdict small, .hero-verdict strong { display: block; }
.hero-verdict small { margin-bottom: 3px; color: #819b92; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.hero-verdict strong { color: #eaf8f3; font-size: 12px; }

.metrics { gap: 16px; margin-bottom: 16px; }
.metric-card, .panel { border-color: rgba(32,70,58,.11); box-shadow: var(--shadow); }
.metric-card { min-height: 138px; padding: 21px; border-radius: 18px; transition: 200ms ease; }
.metric-card:hover, .panel:hover { border-color: rgba(31,141,106,.23); box-shadow: var(--shadow-hover); }
.metric-card strong { letter-spacing: -.04em; }
.sparkline path { stroke-width: 3; filter: drop-shadow(0 5px 5px rgba(52,211,153,.25)); }
.panel { padding: 22px; border-radius: 18px; transition: box-shadow 200ms ease, border-color 200ms ease; }
.content-grid, .right-rail, .bottom-grid { gap: 16px; }
.bottom-grid { margin-top: 16px; }
.search { min-height: 42px; border-radius: 12px; background: var(--surface-3); }
.segment { border-radius: 12px; }
.table-wrap { margin-inline: -6px; }
tbody tr { transition: background 150ms ease, transform 150ms ease; }
tbody tr:hover { transform: translateX(2px); }
.signal-panel { background: linear-gradient(160deg, #fff 65%, #f0faf6); }
.secondary-button { background: linear-gradient(135deg, #0c2922, #17483a); }
.data-map span { min-height: 35px; border-radius: 9px; }
.data-map span.is-connected { color: #087f5b; background: #e9f9f2; border-color: #bcebd9; }
.data-map span.is-connected::before { content: ""; width: 7px; aspect-ratio: 1; margin-right: 7px; border-radius: 50%; background: var(--emerald); }

[data-theme="dark"] .main { background: #edf3f1; }
[data-theme="dark"] .signal-panel { background: linear-gradient(160deg, #fff 65%, #f0faf6); }

@media (max-width: 1180px) {
  .market-hero { grid-template-columns: 1fr; }
  .hero-pulse { max-width: 620px; }
}
@media (max-width: 860px) {
  .sidebar { gap: 18px; padding: 16px; }
  .main { padding: 18px; }
  .market-hero { min-height: auto; padding: 30px 24px; border-radius: 20px; }
}
@media (max-width: 620px) {
  .main { padding: 12px; }
  .topbar-actions .last-refresh { order: 4; width: 100%; }
  .market-hero { padding: 28px 20px; }
  .market-hero h2 { font-size: 39px; }
  .hero-pulse { padding: 18px; }
  .breadth-legend strong { font-size: 16px; }
  .metric-card { min-height: 120px; }
  .topbar-actions .status-pill, .topbar-actions .primary-button { flex: 1; }
}

.market-price strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}
.quote-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--emerald-2);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.quote-source::before {
  content: "";
  width: 5px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--emerald);
}
.quote-source.is-fallback { color: var(--amber); }
.quote-source.is-fallback::before { background: var(--amber); }

.status-dot.is-closed {
  background: #94a3a0;
  box-shadow: 0 0 0 4px rgba(148, 163, 160, 0.15);
}
