.market-mode {
  background:
    radial-gradient(circle at 12% 5%, rgba(22, 205, 175, .13), transparent 28rem),
    radial-gradient(circle at 88% 22%, rgba(77, 117, 255, .14), transparent 32rem),
    #050810;
}

.market-mode .shell {
  width: min(1500px, calc(100% - 32px));
}

.market-mode .topbar {
  background: rgba(7, 12, 22, .86);
  border-color: rgba(77, 231, 196, .2);
}

.market-mode .nav-primary,
.market-mode #download { display: none !important; }

@media (min-width: 641px) {
  .market-mode .nav-actions a[data-home-only] { display: inline-flex !important; }
}

.market-board {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  color: #ecf7f4;
}

.market-board-head,
.market-kpis article,
.market-assets,
.market-chart-panel,
.market-breadth-panel,
.market-table-panel,
.market-news-panel {
  border: 1px solid rgba(90, 220, 194, .16);
  background: rgba(6, 14, 24, .84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 18px 48px rgba(0, 0, 0, .24);
}

.market-board-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 48px);
  overflow: hidden;
  position: relative;
}

.market-board-head::after {
  content: "";
  position: absolute;
  right: -5%;
  bottom: -5rem;
  width: 34rem;
  height: 13rem;
  border: 1px solid rgba(71, 236, 202, .12);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(48, 230, 179, .08);
  transform: rotate(-9deg);
  pointer-events: none;
}

.market-board-head h1 {
  margin: 8px 0 10px;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1;
  letter-spacing: -.045em;
}

.market-board-head p:last-child {
  max-width: 680px;
  margin: 0;
  color: #8da5ac;
  line-height: 1.7;
}

.market-board .eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #63e9c7;
}

.market-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27ecaa;
  box-shadow: 0 0 0 5px rgba(39, 236, 170, .1), 0 0 18px #27ecaa;
  animation: marketPulse 1.8s ease-in-out infinite;
}

.market-sync {
  min-width: 210px;
  display: grid;
  justify-items: end;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.market-sync > span { color: #73f2d0; font-weight: 700; }
.market-sync small { color: #789198; }
.market-sync button,
.market-asset-tabs button,
.market-interval-tabs button {
  border: 1px solid rgba(89, 226, 196, .24);
  color: #b8ccc8;
  background: rgba(44, 214, 177, .06);
  cursor: pointer;
}

.market-sync button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 7px;
}

.market-sync button:hover,
.market-sync button:focus-visible,
.market-asset-tabs button:hover,
.market-asset-tabs button:focus-visible,
.market-asset-tabs button.is-active,
.market-interval-tabs button:hover,
.market-interval-tabs button:focus-visible,
.market-interval-tabs button.is-active {
  border-color: #42e3ba;
  color: #eafff9;
  background: rgba(52, 221, 181, .14);
  outline: none;
}

.market-sync button:disabled { opacity: .55; cursor: wait; }

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

.market-kpis article {
  min-height: 126px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.market-kpis article::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, #2de5b7, transparent 72%);
}

.market-kpis small,
.market-kpis span,
.market-section-title small,
.market-section-title > span { color: #789198; }
.market-kpis strong { display: block; margin: 12px 0 5px; font: 800 clamp(26px, 3vw, 38px)/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-kpis span { font-size: 12px; }

.market-assets,
.market-chart-panel,
.market-breadth-panel,
.market-table-panel,
.market-news-panel { padding: 22px; }

.market-section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.market-section-title h2 { margin: 4px 0 0; font-size: 19px; }
.market-section-title small { font: 700 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
.market-section-title > span { font-size: 12px; }

.core-asset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.market-asset-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(128, 174, 173, .14);
  background: linear-gradient(145deg, rgba(31, 79, 77, .15), rgba(9, 15, 26, .78));
}

.market-asset-card header,
.market-asset-card p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.market-asset-card header { color: #92aaa8; }
.market-asset-card header strong { color: #effaf7; }
.market-asset-card > strong { display: block; margin: 15px 0 8px; font: 800 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-asset-card p { margin: 0; font-size: 12px; }
.market-asset-card .asset-range { display: block; height: 3px; margin-top: 14px; background: #17252d; overflow: hidden; }
.market-asset-card .asset-range i { display: block; height: 100%; background: linear-gradient(90deg, #318cff, #31e7ae); }

.is-up { color: #37e9ad !important; }
.is-down { color: #ff5976 !important; }
.is-flat { color: #9bacb4 !important; }

.market-board-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(250px, .85fr);
  gap: 12px;
}

.market-chart-controls { display: grid; gap: 6px; justify-items: end; }
.market-asset-tabs,
.market-interval-tabs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.market-asset-tabs button,
.market-interval-tabs button { min-width: 47px; min-height: 32px; border-radius: 5px; font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-interval-tabs button { min-width: 39px; min-height: 27px; color: #71888a; }
.market-chart-stats { display: flex; align-items: baseline; gap: 14px; min-height: 38px; }
.market-chart-stats strong { font: 800 28px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-chart-stats small { margin-left: auto; color: #647a82; }
.market-chart-ohlc { min-height: 20px; color: #789197; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.live-market-chart { display: block; width: 100%; min-height: 270px; margin-top: 5px; }
.live-chart-grid { fill: none; stroke: rgba(137, 171, 174, .1); stroke-width: 1; }
.market-candle-wick { stroke-width: 1.2; }
.market-candle-body { rx: 1; }
.market-candle-up { fill: #28dda8; stroke: #28dda8; }
.market-candle-down { fill: #fa526f; stroke: #fa526f; }
.market-volume-up { fill: rgba(40, 221, 168, .28); }
.market-volume-down { fill: rgba(250, 82, 111, .25); }
.market-candle-live { animation: candleLive 1.25s ease-in-out infinite alternate; }
.current-price-line { opacity: 0; stroke: rgba(235, 246, 243, .34); stroke-width: 1; stroke-dasharray: 4 4; }
.current-price-line.is-visible { opacity: 1; }
.market-price-axis { fill: #789096; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-chart-times { display: flex; justify-content: space-between; color: #61767e; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }

.market-breadth-panel { display: flex; flex-direction: column; }
.breadth-ring {
  width: 150px;
  aspect-ratio: 1;
  margin: 12px auto 26px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background: radial-gradient(circle closest-side, #08101b 72%, transparent 73%), conic-gradient(#2de5b7 var(--breadth, 0%), #18242d 0);
}
.breadth-ring strong { font: 800 27px ui-monospace, SFMono-Regular, Menlo, monospace; }
.breadth-ring span { color: #789198; font-size: 11px; }
.breadth-bars { display: grid; grid-template-columns: 1fr; gap: 7px; }
.breadth-bars p { display: flex; justify-content: space-between; margin: 3px 0 0; color: #8fa6ab; font-size: 12px; }
.breadth-bars i { height: 4px; background: #17242d; overflow: hidden; }
.breadth-bars b { display: block; height: 100%; background: #35dda9; }
.breadth-bars i:nth-of-type(2) b { background: #819096; }
.breadth-bars i:nth-of-type(3) b { background: #fa5571; }

.market-lower-grid { grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); }
.market-table-wrap { overflow-x: auto; }
.market-table-panel table { width: 100%; border-collapse: collapse; min-width: 700px; }
.market-table-panel th,
.market-table-panel td { padding: 13px 10px; border-bottom: 1px solid rgba(129, 172, 170, .11); text-align: right; white-space: nowrap; }
.market-table-panel th:first-child,
.market-table-panel td:first-child { text-align: left; }
.market-table-panel th { color: #667d84; font-size: 10px; letter-spacing: .08em; }
.market-table-panel td { color: #b9cac8; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-table-panel td:first-child { color: #edf8f4; font-weight: 800; }
.market-type { display: inline-block; margin-left: 7px; padding: 2px 5px; color: #5bd7b8; border: 1px solid rgba(74, 225, 188, .2); font-size: 9px; }

.market-news-list { list-style: none; padding: 0; margin: 0; max-height: 485px; overflow: auto; }
.market-news-list li { position: relative; padding: 0 0 17px 20px; border-left: 1px solid rgba(78, 225, 191, .19); }
.market-news-list li::before { content: ""; position: absolute; left: -4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: #35dcae; box-shadow: 0 0 10px rgba(53, 220, 174, .7); }
.market-news-list time { color: #6d868b; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.market-news-list strong { display: block; margin: 7px 0; color: #e4f0ed; font-size: 14px; line-height: 1.45; }
.market-news-list span { color: #75a59a; font-size: 11px; }
.market-empty { color: #758c91; padding: 24px 0; }
.market-disclaimer { margin: 0; color: #667a82; text-align: center; font-size: 12px; }

@keyframes marketPulse { 50% { opacity: .48; transform: scale(.76); } }
@keyframes candleLive { to { opacity: .58; } }

@media (max-width: 980px) {
  .market-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .core-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .core-asset-grid > :last-child { grid-column: span 2; }
  .market-board-grid,
  .market-lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .market-mode .shell { width: min(100% - 16px, 1500px); }
  .market-board-head { display: grid; align-items: start; padding: 24px 18px; }
  .market-sync { min-width: 0; width: 100%; justify-items: start; }
  .market-sync button { width: 100%; }
  .market-kpis { gap: 8px; }
  .market-kpis article { min-height: 110px; padding: 16px; }
  .market-kpis strong { font-size: 23px; }
  .market-assets,
  .market-chart-panel,
  .market-breadth-panel,
  .market-table-panel,
  .market-news-panel { padding: 16px; }
  .core-asset-grid { grid-template-columns: 1fr; }
  .core-asset-grid > :last-child { grid-column: auto; }
  .market-section-title { align-items: start; }
  .market-section-title > span { display: none; }
  .market-chart-controls { justify-items: start; }
  .market-asset-tabs,
  .market-interval-tabs { justify-content: flex-start; }
  .live-market-chart { min-height: 210px; }
  .market-chart-stats { flex-wrap: wrap; }
  .market-chart-stats small { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .market-live-dot,
  .market-candle-live { animation: none; }
}
