.finance-shell {
  overflow-x: hidden;
  min-height: 100vh;
  background:
    linear-gradient(var(--hero-start) 0, var(--hero-end) 220px),
    var(--background);
}

.finance-layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 24px 64px;
}

.finance-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.hero-copy p:last-child {
  max-width: 48em;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.market-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.market-meta > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  box-shadow: var(--card-shadow);
  padding: 0 10px;
  white-space: nowrap;
}

.status-pill {
  gap: 7px;
  color: var(--text-secondary);
  font-weight: 650;
}

.status-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.status-pill.is-live {
  color: var(--success);
}

.status-pill.is-live span {
  background: var(--success);
}

.index-section,
.stocks-section {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.stocks-section {
  width: 100%;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 11px;
}

.section-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-head span {
  color: var(--text-tertiary);
  font-size: 12px;
  white-space: nowrap;
}

.section-head.compact {
  margin-top: 4px;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.index-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  color: var(--text-primary);
  padding: 16px;
  text-decoration: none;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

.index-card:hover {
  border-color: var(--text-tertiary);
  background: var(--surface-elevated);
  transform: translateY(-1px);
}

.index-card-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.symbol {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted-background);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0 8px;
}

.index-card h3 {
  margin: 20px 0 2px;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.index-card p {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.index-price {
  margin-top: 18px;
  color: var(--text-primary);
  font-size: clamp(28px, 4vw, 42px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
}

.delta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.delta-row strong {
  font-weight: 700;
}

.index-card-head > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delta-row span,
.stock-change > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stock-change {
  display: flex;
  justify-content: center;
}

.delta-row svg,
.stock-change > span svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.quote-time {
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.is-up .delta-row,
.is-up .stock-change {
  color: var(--success);
}

.is-down .delta-row,
.is-down .stock-change {
  color: var(--danger);
}

.sparkline {
  width: 100%;
  height: 54px;
  margin-top: 20px;
}

.sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.index-card.is-up .sparkline {
  color: var(--success);
}

.index-card.is-down .sparkline {
  color: var(--danger);
}

.stock-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.stock-row {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.3fr)
    minmax(90px, 0.72fr)
    minmax(82px, 0.66fr)
    minmax(96px, 0.74fr)
    minmax(98px, 0.68fr)
    minmax(150px, 1fr);
  column-gap: 16px;
  align-items: center;
  min-height: 50px;
  border-top: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 8px 16px;
  text-decoration: none;
  transition: background-color 120ms ease;
}

.stock-row:first-child {
  border-top: 0;
}

a.stock-row:hover {
  background: var(--muted-background);
}

.stock-row-head {
  min-height: 38px;
  background: var(--muted-background);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 650;
}

.stock-row-head span:nth-child(2),
.stock-row-head span:nth-child(3),
.stock-row-head span:nth-child(4),
.stock-row-head span:nth-child(5) {
  text-align: center;
}

.stock-row-head span:nth-child(6) {
  padding-left: 4px;
}

.stock-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.stock-name strong {
  min-width: 48px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.stock-name small {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-price,
.stock-delta,
.stock-change,
.stock-date {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.stock-delta,
.stock-date {
  color: var(--text-secondary);
}

.stock-spark {
  display: block;
  justify-self: stretch;
  min-width: 0;
}

.stock-spark svg {
  display: block;
  width: 100%;
  height: 34px;
  overflow: visible;
}

.spark-area {
  fill: currentColor;
  opacity: 0.075;
}

.spark-guide {
  stroke: var(--border-light);
  stroke-linecap: round;
  stroke-width: 0.8;
  opacity: 0.68;
}

.spark-midline {
  stroke: currentColor;
  stroke-dasharray: 1 5;
  stroke-linecap: round;
  stroke-width: 0.9;
  opacity: 0.22;
}

.spark-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
  vector-effect: non-scaling-stroke;
}

.spark-dot {
  fill: var(--surface);
  stroke: currentColor;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.stock-row.is-up .stock-spark {
  color: var(--success);
}

.stock-row.is-up .stock-delta {
  color: var(--success);
}

.stock-row.is-down .stock-spark {
  color: var(--danger);
}

.stock-row.is-down .stock-delta {
  color: var(--danger);
}

.finance-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  border-top: 1px solid var(--border-light);
  color: var(--text-tertiary);
  font-size: 12px;
  padding-top: 16px;
}

.finance-foot strong {
  color: var(--text-secondary);
  font-weight: 650;
}

.empty-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  color: var(--text-secondary);
  padding: 22px;
}

@media (max-width: 900px) {
  .finance-hero {
    grid-template-columns: 1fr;
  }

  .market-meta {
    justify-content: flex-start;
  }

  .index-grid {
    grid-template-columns: 1fr;
  }

  .stock-row {
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(86px, max-content));
    gap: 10px 14px;
  }

  .stock-row-head {
    display: none;
  }

  .stock-spark {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .stock-price,
  .stock-delta,
  .stock-change,
  .stock-date {
    text-align: right;
  }

  .stock-change {
    justify-content: flex-end;
  }

  .stock-change > span {
    justify-content: flex-end;
  }

  .stock-spark svg {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .finance-layout {
    padding: 26px 16px 48px;
  }

  .section-head,
  .finance-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .stock-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    min-height: 64px;
  }

  .stock-name {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    grid-column: 1 / -1;
  }

  .index-card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .index-card-head > span:last-child {
    max-width: 100%;
    text-align: left;
  }

  .stock-price,
  .stock-delta,
  .stock-change,
  .stock-date {
    text-align: left;
  }

  .stock-change {
    justify-content: flex-start;
  }

  .stock-change > span {
    justify-content: flex-start;
  }
}
