:root {
  color-scheme: dark;
  --bg: #070b0f;
  --bg-elevated: #0b1117;
  --panel: rgba(12, 19, 25, 0.9);
  --panel-solid: #0c1319;
  --panel-soft: #101820;
  --line: rgba(142, 165, 180, 0.14);
  --line-strong: rgba(142, 165, 180, 0.24);
  --text: #f2f6f4;
  --muted: #87949f;
  --muted-strong: #aab5bd;
  --up: #46e0ae;
  --up-soft: rgba(70, 224, 174, 0.12);
  --down: #ff617d;
  --down-soft: rgba(255, 97, 125, 0.12);
  --accent: #c6f36b;
  --accent-soft: rgba(198, 243, 107, 0.1);
  --gold: #f0c96b;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --font-sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "SF Mono", "Roboto Mono", Menlo, Monaco,
    Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
  color: var(--text);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 11, 15, 0.06), var(--bg) 86%);
  content: "";
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-glow {
  position: fixed;
  z-index: -2;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.22;
  pointer-events: none;
}

.page-glow--one {
  top: -28vw;
  left: 12vw;
  background: radial-gradient(circle, rgba(95, 202, 150, 0.5), transparent 68%);
}

.page-glow--two {
  top: 12vw;
  right: -32vw;
  background: radial-gradient(circle, rgba(115, 157, 255, 0.38), transparent 70%);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 74px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 15, 0.82);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand__mark,
.footer__mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(198, 243, 107, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(198, 243, 107, 0.18), rgba(198, 243, 107, 0.02)),
    var(--panel-solid);
  box-shadow: inset 0 0 16px rgba(198, 243, 107, 0.06);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1px;
}

.brand__mark sup,
.footer__mark sup {
  position: relative;
  top: -0.5em;
  margin-left: -1px;
  font-size: 8px;
  letter-spacing: -0.3px;
}

.brand__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand__copy strong {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.brand__copy small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.topnav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 26px;
  margin-left: 24px;
}

.topnav a {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  transition: color 180ms ease;
}

.topnav a::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.4);
  transition: 180ms ease;
}

.topnav a:hover,
.topnav a.is-active {
  color: var(--text);
}

.topnav a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.topbar__tools {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.market-clock {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.market-clock time {
  min-width: 60px;
  color: var(--text);
}

.market-clock small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 10px;
}

.market-clock__status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(135, 148, 159, 0.1);
}

.market-clock__status.is-open {
  background: var(--up);
  box-shadow: 0 0 0 4px rgba(70, 224, 174, 0.1), 0 0 14px rgba(70, 224, 174, 0.55);
  animation: statusPulse 2.4s ease-in-out infinite;
}

.market-clock__status.is-closed {
  background: var(--down);
  box-shadow: 0 0 0 4px rgba(255, 97, 125, 0.1);
}

.market-clock__divider {
  width: 1px;
  height: 14px;
  margin: 0 4px;
  background: var(--line-strong);
}

.refresh-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  user-select: none;
}

.refresh-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.refresh-switch__track {
  position: relative;
  display: inline-block;
  width: 29px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #111a21;
  transition: 180ms ease;
}

.refresh-switch__track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: 180ms ease;
}

.refresh-switch input:checked + .refresh-switch__track {
  border-color: rgba(198, 243, 107, 0.36);
  background: rgba(198, 243, 107, 0.12);
}

.refresh-switch input:checked + .refresh-switch__track::after {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(198, 243, 107, 0.5);
  transform: translateX(12px);
}

.refresh-switch input:focus-visible + .refresh-switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: 180ms ease;
}

.icon-button svg {
  width: 16px;
  fill: none;
  stroke: var(--muted-strong);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.icon-button:hover {
  border-color: rgba(198, 243, 107, 0.35);
  background: var(--accent-soft);
}

.icon-button:hover svg {
  stroke: var(--accent);
}

.icon-button.is-loading svg {
  animation: spin 800ms linear infinite;
}

.dashboard {
  width: min(1540px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 48%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  content: "";
  pointer-events: none;
}

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

.instrument-head,
.panel-heading,
.table-heading,
.chart-toolbar,
.chart-footer,
.quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.instrument-head h1,
.panel-heading h2,
.table-heading h2 {
  margin: 4px 0 0;
  font-weight: 560;
  letter-spacing: -0.025em;
}

.instrument-head h1 {
  font-size: clamp(24px, 2.2vw, 34px);
}

.eyebrow,
.section-kicker {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow__pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(198, 243, 107, 0.8);
}

.data-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.data-badge > span:first-child {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(240, 201, 107, 0.5);
}

.data-badge.is-live > span:first-child {
  background: var(--up);
  box-shadow: 0 0 8px rgba(70, 224, 174, 0.6);
}

.data-badge.is-snapshot > span:first-child {
  background: var(--muted);
  box-shadow: none;
}

.quote-row {
  align-items: flex-end;
  gap: 24px;
  margin-top: 24px;
}

.price-block {
  display: flex;
  align-items: flex-end;
  gap: 17px;
}

.price-block__main {
  display: flex;
  align-items: flex-start;
  color: var(--text);
  font-family: var(--font-mono);
}

.price-block__main .currency {
  margin-top: 10px;
  margin-right: 4px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
}

.price-block__main strong {
  font-size: clamp(44px, 5vw, 68px);
  font-weight: 520;
  letter-spacing: -0.065em;
  line-height: 0.93;
}

.price-change {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 105px;
  padding-bottom: 2px;
  font-family: var(--font-mono);
}

.price-change span:first-child {
  font-size: 15px;
}

.price-change span:last-child {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.is-positive {
  color: var(--up) !important;
}

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

.is-neutral {
  color: var(--muted-strong) !important;
}

.price-change.is-positive span:last-child {
  background: var(--up-soft);
}

.price-change.is-negative span:last-child {
  background: var(--down-soft);
}

.price-change.is-neutral span:last-child {
  background: rgba(255, 255, 255, 0.05);
}

.price-flash-up {
  animation: flashUp 650ms ease;
}

.price-flash-down {
  animation: flashDown 650ms ease;
}

.quote-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(95px, 1fr));
  gap: 18px;
  margin: 0;
}

.quote-stats div {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.quote-stats dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.quote-stats dd {
  margin: 0;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.chart-toolbar {
  margin-top: 27px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.chart-toolbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(198, 243, 107, 0.16);
  border-radius: 9px;
  background: rgba(198, 243, 107, 0.035);
}

.mode-tabs button {
  display: flex;
  min-width: 68px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  transition: 160ms ease;
}

.mode-tabs button i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.mode-tabs button:hover {
  color: var(--text);
}

.mode-tabs button.is-active {
  background: var(--accent);
  color: #10150f;
  font-weight: 650;
}

.mode-tabs button.is-active i {
  opacity: 1;
  box-shadow: 0 0 7px rgba(12, 20, 11, 0.5);
}

.range-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(142, 165, 180, 0.1);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.16);
}

.range-tabs.is-hidden {
  display: none;
}

.range-tabs button {
  min-width: 43px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  transition: 160ms ease;
}

.range-tabs button:hover {
  color: var(--text);
}

.range-tabs button.is-active {
  background: rgba(198, 243, 107, 0.12);
  color: var(--accent);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.legend-dot--ma20 {
  background: var(--gold);
}

.legend-dot--ma50 {
  background: #7da7ff;
}

.legend-dot--live {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(198, 243, 107, 0.7);
}

.legend-dot--average {
  background: var(--gold);
}

.legend-dot--previous {
  background: #7da7ff;
}

.chart-shell {
  position: relative;
  height: 392px;
  margin-top: 10px;
}

.candlestick-chart {
  width: 100%;
  height: 100%;
}

.ohlc-strip {
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 8px;
  display: flex;
  gap: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  pointer-events: none;
}

.ohlc-strip b {
  color: var(--muted-strong);
  font-weight: 500;
}

.chart-loading {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(12, 19, 25, 0.4), rgba(12, 19, 25, 0.82));
  transition: opacity 240ms ease;
}

.chart-loading span {
  width: 5px;
  height: 18px;
  border-radius: 4px;
  background: var(--accent);
  animation: loadingBars 900ms ease-in-out infinite;
}

.chart-loading span:nth-child(2) {
  animation-delay: 110ms;
}

.chart-loading span:nth-child(3) {
  animation-delay: 220ms;
}

.chart-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.session-bounds {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
  margin-top: -2px;
  padding: 0 3px;
  color: #707d87;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.session-bounds span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.session-bounds i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #7da7ff;
  box-shadow: 0 0 7px rgba(125, 167, 255, 0.5);
}

.session-bounds span:last-child i {
  background: #64717b;
  box-shadow: none;
}

.session-bounds.is-hidden {
  display: none;
}

.chart-footer {
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.chart-footer__note {
  margin-left: auto;
}

.side-column {
  display: grid;
  align-content: start;
  gap: 18px;
}

.weights-panel,
.breadth-panel {
  padding: 21px 21px 19px;
}

.panel-heading h2 {
  font-size: 18px;
}

.as-of,
.breadth-ratio {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.breadth-ratio {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-strong);
}

.weight-visual {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
}

.donut-wrap {
  position: relative;
  width: 126px;
  height: 126px;
  flex: 0 0 126px;
}

.donut {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.donut__track,
.donut__segment {
  fill: none;
  stroke-width: 16;
}

.donut__track {
  stroke: rgba(255, 255, 255, 0.045);
}

.donut__segment {
  cursor: pointer;
  transition: stroke-width 150ms ease, opacity 150ms ease;
}

.donut__segment:hover {
  stroke-width: 20;
}

.donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

.donut__center strong {
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 500;
}

.donut__center span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.weight-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weight-summary span {
  color: var(--muted);
  font-size: 10px;
}

.weight-summary strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.weight-summary small {
  max-width: 120px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.weight-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 16px;
}

.weight-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 5px;
  border: 0;
  border-bottom: 1px solid rgba(142, 165, 180, 0.07);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.weight-item:hover {
  background: rgba(255, 255, 255, 0.025);
}

.weight-item__rank {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.weight-item__name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.weight-item__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: 0 0 5px;
}

.weight-item__symbol {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.weight-item__bar {
  position: relative;
  height: 3px;
  flex: 1;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.weight-item__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.weight-item__metric {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
}

.weight-item__weight {
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
}

.weight-item__change {
  font-family: var(--font-mono);
  font-size: 8px;
}

.text-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 11px;
  padding: 9px 0 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  text-align: left;
  transition: color 150ms ease;
}

.text-link:hover {
  color: var(--accent);
}

.text-link span {
  font-family: var(--font-mono);
  font-size: 13px;
}

.breadth-bar {
  display: flex;
  height: 8px;
  gap: 2px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.breadth-bar span {
  height: 100%;
  transition: width 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.breadth-bar__up {
  background: linear-gradient(90deg, #2ba87f, var(--up));
}

.breadth-bar__flat {
  background: #62717c;
}

.breadth-bar__down {
  background: linear-gradient(90deg, var(--down), #d94b69);
}

.breadth-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.breadth-counts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
}

.breadth-counts span {
  color: var(--muted);
  font-size: 9px;
}

.breadth-counts strong {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
}

.breadth-counts .is-up strong {
  color: var(--up);
}

.breadth-counts .is-down strong {
  color: var(--down);
}

.breadth-counts .is-flat strong {
  color: var(--muted-strong);
}

.mover-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.mover-group__label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
}

.mover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  font-size: 10px;
}

.mover-row__symbol {
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-weight: 600;
}

.mover-row__change {
  font-family: var(--font-mono);
  font-size: 9px;
}

.pulse-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.pulse-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pulse-stats span {
  color: var(--muted);
  font-size: 9px;
}

.pulse-stats strong {
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.portfolio-panel {
  margin-top: 18px;
  padding: 23px 25px 25px;
}

.portfolio-panel::before {
  position: absolute;
  top: 0;
  left: 25px;
  width: 88px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  content: "";
}

.portfolio-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.portfolio-heading h2 {
  margin: 5px 0 0;
  font-size: 23px;
  font-weight: 560;
  letter-spacing: -0.025em;
}

.portfolio-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.portfolio-live {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(70, 224, 174, 0.16);
  border-radius: 7px;
  background: rgba(70, 224, 174, 0.05);
  color: var(--up);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.portfolio-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 8px rgba(70, 224, 174, 0.55);
  animation: statusPulse 2.4s ease-in-out infinite;
}

.portfolio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 300px;
  gap: 12px;
  margin-top: 20px;
}

.position-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 52%),
    rgba(8, 14, 19, 0.56);
}

.position-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  content: "";
  opacity: 0.7;
}

.position-card--spx::before {
  background: #7da7ff;
}

.position-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.position-card__name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.position-card__name > span {
  display: grid;
  min-width: 38px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(198, 243, 107, 0.2);
  border-radius: 7px;
  background: rgba(198, 243, 107, 0.06);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 650;
}

.position-card--spx .position-card__name > span {
  border-color: rgba(125, 167, 255, 0.22);
  background: rgba(125, 167, 255, 0.06);
  color: #7da7ff;
}

.position-card__name h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 520;
}

.position-quote {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 3px;
}

.position-quote strong {
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}

.position-quote span {
  font-family: var(--font-mono);
  font-size: 9px;
}

.amount-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 9px;
}

.amount-input {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.amount-input:focus-within {
  border-color: rgba(198, 243, 107, 0.4);
  box-shadow: 0 0 0 3px rgba(198, 243, 107, 0.05);
}

.amount-input i {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-style: normal;
}

.amount-input input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.amount-input input::placeholder {
  color: #43505a;
}

.amount-input input::-webkit-inner-spin-button,
.amount-input input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.position-profit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 12px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.position-profit > span {
  color: var(--muted);
  font-size: 9px;
}

.position-profit strong {
  grid-row: span 2;
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
}

.position-profit small {
  font-family: var(--font-mono);
  font-size: 9px;
}

.portfolio-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 18px;
  border: 1px solid rgba(198, 243, 107, 0.13);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, rgba(198, 243, 107, 0.08), transparent 48%),
    rgba(15, 22, 19, 0.48);
}

.portfolio-summary__total {
  margin-top: 11px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.portfolio-summary > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.portfolio-summary__profit {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.portfolio-summary__profit span {
  color: var(--muted);
  font-size: 9px;
}

.portfolio-summary__profit strong {
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
}

.allocation {
  margin-top: 17px;
}

.allocation__labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 8px;
}

.allocation__labels b {
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-weight: 500;
}

.allocation__bar {
  display: flex;
  height: 5px;
  gap: 2px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.allocation__bar span {
  height: 100%;
  transition: width 400ms ease;
}

.allocation__bar span:first-child {
  background: var(--accent);
}

.allocation__bar span:last-child {
  background: #7da7ff;
}

.portfolio-summary p {
  margin: auto 0 0;
  padding-top: 16px;
  color: #67747d;
  font-size: 8px;
  line-height: 1.65;
}

.table-panel {
  margin-top: 18px;
  padding: 23px 25px 0;
}

.table-heading {
  align-items: flex-end;
}

.table-heading h2 {
  font-size: 23px;
}

.table-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.table-heading__meta {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.live-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(70, 224, 174, 0.16);
  border-radius: 6px;
  background: rgba(70, 224, 174, 0.05);
  color: var(--up);
}

.live-chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--up);
  animation: statusPulse 2.4s ease-in-out infinite;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 21px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.filter-tabs {
  display: flex;
  gap: 4px;
}

.filter-tabs button {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  transition: 150ms ease;
}

.filter-tabs button span {
  margin-left: 3px;
  color: #65717a;
  font-family: var(--font-mono);
  font-size: 8px;
}

.filter-tabs button:hover {
  color: var(--text);
}

.filter-tabs button.is-active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  width: 225px;
  height: 33px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  transition: border-color 150ms ease;
}

.search-box:focus-within {
  border-color: rgba(198, 243, 107, 0.35);
}

.search-box svg {
  width: 13px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 10px;
}

.search-box input::placeholder {
  color: #5f6b74;
}

.search-box kbd {
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #59656e;
  font-family: var(--font-mono);
  font-size: 8px;
}

.select-wrap {
  display: flex;
  height: 33px;
  align-items: center;
  gap: 7px;
  padding: 0 6px 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 9px;
}

.select-wrap select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 9px;
}

.select-wrap option {
  background: var(--panel-solid);
}

.table-scroll {
  max-height: 610px;
  overflow: auto;
  scrollbar-color: #29343d transparent;
  scrollbar-width: thin;
}

.table-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.table-scroll::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #29343d;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  position: sticky;
  z-index: 2;
  top: 0;
  background: rgba(12, 19, 25, 0.96);
  backdrop-filter: blur(12px);
}

th {
  padding: 13px 13px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 450;
  letter-spacing: 0.05em;
  text-align: right;
}

th:nth-child(1) {
  width: 45px;
  text-align: center;
}

th:nth-child(2) {
  text-align: left;
}

td {
  padding: 11px 13px;
  border-bottom: 1px solid rgba(142, 165, 180, 0.065);
  color: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

tbody tr {
  transition: background 130ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

td:first-child {
  color: #56636c;
  text-align: center;
}

td:nth-child(2) {
  text-align: left;
}

.stock-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.stock-logo {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid rgba(142, 165, 180, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent),
    #0f171e;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}

.stock-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.stock-info strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.stock-info span {
  max-width: 290px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-cell {
  color: var(--text);
}

.change-pill {
  display: inline-flex;
  min-width: 58px;
  justify-content: flex-end;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 600;
}

.change-pill.is-positive {
  background: var(--up-soft);
}

.change-pill.is-negative {
  background: var(--down-soft);
}

.change-pill.is-neutral {
  background: rgba(255, 255, 255, 0.04);
}

.weight-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.weight-cell__bar {
  width: 62px;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.045);
}

.weight-cell__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d8f9f, var(--accent));
}

.weight-cell__number {
  min-width: 39px;
  color: var(--muted-strong);
}

.contribution.is-positive {
  color: var(--up);
}

.contribution.is-negative {
  color: var(--down);
}

.market-cap {
  color: var(--muted);
}

.table-empty {
  padding: 44px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 4px 0;
  color: #65717a;
  font-size: 9px;
}

.footer > div {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.footer__mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
}

.footer p {
  max-width: 880px;
  margin: 0;
  line-height: 1.7;
  text-align: right;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(18, 27, 35, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  color: var(--muted-strong);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.46;
  }
}

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

@keyframes loadingBars {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(0.6);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes flashUp {
  0% {
    color: var(--up);
    text-shadow: 0 0 18px rgba(70, 224, 174, 0.45);
  }
  100% {
    color: var(--text);
    text-shadow: none;
  }
}

@keyframes flashDown {
  0% {
    color: var(--down);
    text-shadow: 0 0 18px rgba(255, 97, 125, 0.45);
  }
  100% {
    color: var(--text);
    text-shadow: none;
  }
}

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

  .quote-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .quote-stats {
    width: 100%;
  }

  .chart-shell {
    height: 360px;
  }
}

@media (max-width: 980px) {
  .topnav {
    display: none;
  }

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

  .side-column {
    grid-template-columns: 1fr 1fr;
  }

  .chart-shell {
    height: 410px;
  }

  .table-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

  .portfolio-summary {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 64px;
    padding: 0 16px;
  }

  .brand {
    min-width: 0;
  }

  .brand__copy {
    display: none;
  }

  .market-clock__divider,
  .market-clock small,
  .refresh-switch span:last-child {
    display: none;
  }

  .topbar__tools {
    gap: 12px;
  }

  .dashboard {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .chart-panel {
    padding: 20px 16px 15px;
  }

  .price-block__main strong {
    font-size: 48px;
  }

  .quote-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .quote-stats div:last-child {
    display: none;
  }

  .chart-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .chart-toolbar__left {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .mode-tabs {
    width: 100%;
  }

  .mode-tabs button {
    flex: 1;
  }

  .chart-legend {
    display: none;
  }

  .range-tabs {
    width: 100%;
  }

  .range-tabs button {
    flex: 1;
  }

  .chart-shell {
    height: 340px;
  }

  .chart-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .chart-footer__note {
    margin-left: 0;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .portfolio-panel {
    padding: 20px 14px;
  }

  .portfolio-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

  .portfolio-summary {
    grid-column: auto;
  }

  .table-panel {
    padding: 20px 14px 0;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .table-actions {
    width: 100%;
  }

  .search-box {
    flex: 1;
    width: auto;
  }

  .table-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .select-wrap {
    justify-content: space-between;
  }

  .table-scroll {
    max-height: 520px;
  }

  th:nth-child(7),
  td:nth-child(7) {
    display: none;
  }

  th:nth-child(5),
  td:nth-child(5) {
    width: 88px;
  }

  .weight-cell__bar {
    display: none;
  }

  .stock-info span {
    max-width: 155px;
  }

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

  .footer p {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .market-clock {
    display: none;
  }

  .quote-row {
    margin-top: 20px;
  }

  .price-block {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .price-change {
    flex-direction: row;
    align-items: center;
  }

  .instrument-head {
    align-items: flex-start;
  }

  .data-badge {
    max-width: 110px;
    white-space: nowrap;
  }

  .chart-shell {
    height: 310px;
  }

  .ohlc-strip {
    gap: 8px;
  }

  .ohlc-strip span:nth-child(3) {
    display: none;
  }

  .filter-tabs button {
    padding: 7px 8px;
  }

  th:nth-child(1),
  td:nth-child(1),
  th:nth-child(6),
  td:nth-child(6) {
    display: none;
  }

  th,
  td {
    padding-right: 8px;
    padding-left: 8px;
  }

  .stock-logo {
    display: none;
  }

  .stock-info span {
    max-width: 120px;
  }
}

@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;
  }
}
