html[data-scheme="dark"] .market-app {
  --market-page-bg: #0b0d12;
  --market-page-glow-a: rgba(41, 98, 255, 0.14);
  --market-page-glow-b: rgba(8, 153, 129, 0.1);
  --market-panel: #131722;
  --market-panel-strong: #151a23;
  --market-panel-soft: #1c2230;
  --market-border: rgba(255, 255, 255, 0.08);
  --market-border-strong: rgba(255, 255, 255, 0.14);
  --market-text: #d1d4dc;
  --market-muted: #8b8f9b;
  --market-bright: #f0f3fa;
  --market-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --market-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.22);
  --market-red-bg: linear-gradient(145deg, rgba(242, 54, 69, 0.18), rgba(242, 54, 69, 0.05));
  --market-green-bg: linear-gradient(145deg, rgba(8, 153, 129, 0.2), rgba(8, 153, 129, 0.06));
  --market-red: #f23645;
  --market-green: #089981;
  --market-blue: #5b8cff;
  --market-hero-border: linear-gradient(135deg, rgba(91, 140, 255, 0.55), rgba(8, 153, 129, 0.35));
}

html[data-scheme="light"] .market-app {
  --market-page-bg: #eef1f8;
  --market-page-glow-a: rgba(41, 98, 255, 0.1);
  --market-page-glow-b: rgba(8, 153, 129, 0.08);
  --market-panel: #ffffff;
  --market-panel-strong: #ffffff;
  --market-panel-soft: #f6f8fc;
  --market-border: rgba(19, 23, 34, 0.08);
  --market-border-strong: rgba(19, 23, 34, 0.12);
  --market-text: #131722;
  --market-muted: #6a6d78;
  --market-bright: #131722;
  --market-shadow: 0 18px 48px rgba(19, 23, 34, 0.08);
  --market-shadow-soft: 0 8px 24px rgba(19, 23, 34, 0.06);
  --market-red-bg: linear-gradient(145deg, rgba(242, 54, 69, 0.12), rgba(242, 54, 69, 0.03));
  --market-green-bg: linear-gradient(145deg, rgba(8, 153, 129, 0.12), rgba(8, 153, 129, 0.03));
  --market-red: #e53945;
  --market-green: #0a8f78;
  --market-blue: #2962ff;
  --market-hero-border: linear-gradient(135deg, rgba(41, 98, 255, 0.42), rgba(8, 153, 129, 0.28));
}

.market-app {
  height: auto;
  min-height: calc(100vh - var(--topbar-height, 48px));
  max-height: none;
  overflow: auto;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, var(--market-page-glow-a), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 0%, var(--market-page-glow-b), transparent 55%),
    var(--market-page-bg);
  color: var(--market-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
}

@supports (height: 100dvh) {
  .market-app {
    min-height: calc(100dvh - var(--topbar-height, 48px));
  }
}

.market-board {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px 20px 32px;
  box-sizing: border-box;
}

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

.market-board__eyebrow {
  margin: 0 0 8px;
  color: var(--market-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.market-board__header h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.08;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--market-bright);
}

.market-board__subtitle {
  margin: 8px 0 0;
  color: var(--market-muted);
  font-size: 15px;
  line-height: 1.45;
}

.market-board__status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--market-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--market-panel) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--market-shadow-soft);
  color: var(--market-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.market-board__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--market-muted);
  flex-shrink: 0;
}

.market-board__status[data-state="loading"] .market-board__status-dot {
  background: var(--market-blue);
  animation: market-pulse 1.4s ease-in-out infinite;
}

.market-board__status[data-state="ready"] .market-board__status-dot {
  background: var(--market-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--market-green) 24%, transparent);
}

.market-board__status[data-state="error"] .market-board__status-dot {
  background: var(--market-red);
}

@keyframes market-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}

.market-index-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.market-index-card {
  min-height: 108px;
  border: 1px solid var(--market-border);
  border-radius: 16px;
  padding: 14px 16px 16px;
  color: var(--market-bright);
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--market-shadow-soft);
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.market-index-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: transparent;
  transition: background 0.2s ease;
}

.market-index-card--up {
  background: var(--market-red-bg);
}

.market-index-card--up::before {
  background: linear-gradient(90deg, var(--market-red), color-mix(in srgb, var(--market-red) 40%, transparent));
}

.market-index-card--down {
  background: var(--market-green-bg);
}

.market-index-card--down::before {
  background: linear-gradient(90deg, var(--market-green), color-mix(in srgb, var(--market-green) 40%, transparent));
}

.market-index-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--market-blue) 42%, var(--market-border));
  box-shadow: var(--market-shadow);
}

.market-index-card.is-active {
  border-color: color-mix(in srgb, var(--market-blue) 72%, var(--market-border-strong));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--market-blue) 28%, transparent),
    var(--market-shadow);
}

.market-index-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-index-card__name {
  font-size: 13px;
  font-weight: 650;
  color: var(--market-muted);
}

.market-index-card__badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--market-panel-soft) 72%, transparent);
  border: 1px solid var(--market-border);
  color: var(--market-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.market-index-card__value {
  display: block;
  margin-top: 12px;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--market-bright);
}

.market-index-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.market-index-card--up .market-index-card__change,
.market-index-card--up .market-index-card__pct {
  color: var(--market-red);
}

.market-index-card--down .market-index-card__change,
.market-index-card--down .market-index-card__pct {
  color: var(--market-green);
}

.market-index-card__pct {
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.market-intel-grid {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

.market-summary-panel {
  display: flex;
  flex-direction: column;
  padding: 16px;
  box-sizing: border-box;
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--market-border);
  border-radius: 18px;
  background: var(--market-panel-strong);
  box-shadow: var(--market-shadow-soft);
}

.market-summary-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.market-summary-panel__header h2 {
  margin: 0;
  color: var(--market-bright);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.market-summary-panel__badge {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--market-border);
  background: var(--market-panel-soft);
  color: var(--market-muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

#market-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
}

.market-summary-card,
.market-summary-tile,
.market-summary-note {
  border: 1px solid var(--market-border);
  border-radius: 14px;
  background: var(--market-panel-soft);
}

.market-summary-card--hero {
  position: relative;
  border: none;
  background:
    linear-gradient(var(--market-panel-soft), var(--market-panel-soft)) padding-box,
    var(--market-hero-border) border-box;
  border: 1px solid transparent;
}

.market-summary-card {
  padding: 16px;
}

.market-summary-card__label,
.market-summary-card__foot,
.market-summary-tile span,
.market-summary-note span {
  color: var(--market-muted);
  font-size: 12px;
  font-weight: 600;
}

.market-summary-card__name {
  margin-top: 6px;
  color: var(--market-bright);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.market-summary-card__quote {
  margin-top: 12px;
  font-size: 30px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.market-summary-card__quote span {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  vertical-align: middle;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.market-summary-card__foot {
  margin-top: 12px;
}

.market-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.market-summary-tile {
  padding: 14px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.market-summary-tile:hover {
  border-color: var(--market-border-strong);
  transform: translateY(-1px);
}

.market-summary-tile strong {
  display: block;
  margin-top: 8px;
  color: var(--market-bright);
  font-size: 22px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.market-watch-list {
  margin-top: 2px;
  padding-top: 4px;
}

.market-watch-list__title {
  margin-bottom: 6px;
  padding: 0 4px;
  color: var(--market-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.market-watch-row {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--market-text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease, transform 0.16s ease;
}

.market-watch-row + .market-watch-row {
  margin-top: 2px;
}

.market-watch-row:hover {
  background: color-mix(in srgb, var(--market-panel-soft) 88%, transparent);
}

.market-watch-row.is-active {
  background: color-mix(in srgb, var(--market-blue) 12%, var(--market-panel-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--market-blue) 24%, transparent);
}

.market-watch-row__rank {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--market-panel-soft) 90%, transparent);
  color: var(--market-muted);
  font-size: 12px;
  font-weight: 700;
}

.market-watch-row__rank--top1 {
  background: linear-gradient(135deg, #f5c451, #d4a017);
  color: #3b2a00;
}

.market-watch-row__rank--top2 {
  background: linear-gradient(135deg, #d8dde6, #a8b0bd);
  color: #2a3140;
}

.market-watch-row__rank--top3 {
  background: linear-gradient(135deg, #e0a36a, #b87333);
  color: #3b2410;
}

.market-watch-row__name {
  font-weight: 650;
}

.market-watch-row__value {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.market-summary-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin-top: auto;
  padding: 14px;
}

.market-summary-note strong {
  color: var(--market-bright);
  font-size: 13px;
  font-weight: 700;
}

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

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

.limitup-hunter-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--market-red) 28%, var(--market-border));
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--market-red) 7%, transparent), transparent 34%),
    var(--market-panel-strong);
  box-shadow: var(--market-shadow-soft);
  box-sizing: border-box;
}

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

.limitup-hunter__header h2 {
  margin: 0;
  color: var(--market-bright);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.limitup-hunter__header p {
  margin: 7px 0 0;
  color: var(--market-muted);
  font-size: 12px;
  line-height: 1.4;
}

.limitup-hunter__badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--market-red) 24%, var(--market-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--market-red) 10%, var(--market-panel-soft));
  color: var(--market-red);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.limitup-hunter__badge.is-stale {
  border-color: color-mix(in srgb, #d4a017 32%, var(--market-border));
  background: color-mix(in srgb, #d4a017 12%, var(--market-panel-soft));
  color: #d4a017;
}

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

.limitup-hunter__metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--market-border);
  border-radius: 12px;
  background: var(--market-panel-soft);
}

.limitup-hunter__metric span {
  display: block;
  color: var(--market-muted);
  font-size: 12px;
  font-weight: 650;
}

.limitup-hunter__metric strong {
  display: block;
  margin-top: 8px;
  color: var(--market-bright);
  font-size: 20px;
  line-height: 1;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.limitup-hunter__layers {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.25fr;
  gap: 10px;
  min-width: 0;
}

.limitup-hunter__layer {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--market-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--market-panel-soft) 82%, transparent);
}

.limitup-hunter__layer-tag {
  margin-bottom: 6px;
  color: var(--market-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.limitup-hunter__layer-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--market-bright);
  font-size: 13px;
  font-weight: 750;
}

.limitup-hunter__layer-title strong {
  color: var(--market-red);
  font-weight: 800;
}

.limitup-hunter__layer p {
  margin: 9px 0 0;
  color: var(--market-muted);
  font-size: 12px;
  line-height: 1.6;
}

.limitup-hunter__sector-list,
.limitup-hunter__stock-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.limitup-hunter__sector {
  border-radius: 10px;
  background: color-mix(in srgb, var(--market-panel) 48%, transparent);
}

.limitup-hunter__sector[open] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--market-red) 18%, transparent);
}

.limitup-hunter__sector-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 34px 42px;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  color: var(--market-text);
  cursor: pointer;
  font-size: 12px;
  list-style: none;
}

.limitup-hunter__sector-row::-webkit-details-marker {
  display: none;
}

.limitup-hunter__sector-row::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--market-muted);
  transition: transform 0.16s ease, border-left-color 0.16s ease;
}

.limitup-hunter__sector[open] .limitup-hunter__sector-row::before {
  transform: rotate(90deg);
  border-left-color: var(--market-red);
}

.limitup-hunter__sector-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.limitup-hunter__sector-row strong {
  color: var(--market-red);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.limitup-hunter__sector-row em {
  justify-self: end;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--market-blue) 12%, transparent);
  color: var(--market-blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.limitup-hunter__sector-stocks {
  display: grid;
  gap: 4px;
  padding: 2px 8px 8px 28px;
}

.limitup-hunter__sector-stock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  color: var(--market-text);
  text-decoration: none;
  font-size: 12px;
}

.limitup-hunter__sector-stock:hover span,
.limitup-hunter__stock-row:hover strong {
  color: var(--market-red);
}

.limitup-hunter__sector-stock span,
.limitup-hunter__sector-stock small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limitup-hunter__sector-stock span {
  min-width: 0;
  font-weight: 650;
}

.limitup-hunter__sector-stock small {
  flex: 0 0 auto;
  color: var(--market-muted);
  font-size: 11px;
}

.limitup-hunter__stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--market-panel) 58%, transparent);
  color: inherit;
  text-decoration: none;
  transition: background 0.16s ease;
}

.limitup-hunter__stock-row:hover {
  background: color-mix(in srgb, var(--market-red) 9%, var(--market-panel));
}

.limitup-hunter__stock-row span {
  min-width: 0;
}

.limitup-hunter__stock-row strong,
.limitup-hunter__stock-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.limitup-hunter__stock-row strong {
  color: var(--market-bright);
  font-size: 12px;
  font-weight: 750;
}

.limitup-hunter__stock-row small {
  margin-top: 2px;
  color: var(--market-muted);
  font-size: 11px;
}

.limitup-hunter__stock-row em {
  color: var(--market-red);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.limitup-hunter__board {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--market-red) 28%, transparent);
  background: color-mix(in srgb, var(--market-red) 10%, transparent);
  color: var(--market-red);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.limitup-hunter__insight,
.limitup-hunter__empty {
  border: 1px solid var(--market-border);
  border-radius: 12px;
  background: var(--market-panel-soft);
}

.limitup-hunter__insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  color: var(--market-muted);
  font-size: 12px;
  line-height: 1.55;
}

.limitup-hunter__insight strong {
  flex: 0 0 auto;
  color: var(--market-red);
  font-weight: 800;
}

.limitup-hunter__empty {
  padding: 16px;
  color: var(--market-muted);
  font-size: 13px;
}

.limitup-hunter__empty.is-inline {
  padding: 8px;
  font-size: 12px;
}

.limitup-hunter__skeleton {
  min-height: 260px;
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--market-border-strong) 46%, transparent), transparent),
    var(--market-panel-soft);
  background-size: 240px 100%, 100% 100%;
  animation: limitup-skeleton 1.3s ease-in-out infinite;
}

.is-hot {
  color: var(--market-red) !important;
}

.is-watch {
  color: #d4a017 !important;
}

.is-cool {
  color: var(--market-blue) !important;
}

@keyframes limitup-skeleton {
  0% { background-position: -240px 0, 0 0; }
  100% { background-position: calc(100% + 240px) 0, 0 0; }
}

@media (max-width: 1320px) {
  .market-index-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .market-summary-panel {
    min-height: 380px;
  }

  .limitup-hunter__layers {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 720px) {
  .market-board {
    padding: 16px 14px 24px;
  }

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

  .market-board__status {
    width: 100%;
    justify-content: center;
  }

  .market-index-grid {
    grid-template-columns: 1fr;
  }

  .market-index-card {
    min-height: 100px;
  }

  .market-summary-grid {
    grid-template-columns: 1fr;
  }

  .limitup-hunter-panel {
    padding: 14px;
  }

  .limitup-hunter__header {
    flex-direction: column;
  }

  .limitup-hunter__badge {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  .limitup-hunter__metrics {
    grid-template-columns: 1fr 1fr;
  }

  .limitup-hunter__insight {
    flex-direction: column;
  }
}
