:root {
  color-scheme: dark;
  --bg: #080d0f;
  --panel: rgba(17, 25, 27, 0.94);
  --text: #edf7f6;
  --muted: #95a8aa;
  --line: rgba(109, 237, 223, 0.16);
  --accent: #35d6c4;
  --accent-2: #f2b84b;
  --rise: #ff5a66;
  --fall: #35c486;
  --warn: #f2b84b;
  --mouse-x: 50vw;
  --mouse-y: 22vh;
  --cursor-glow: rgba(53, 214, 196, 0.22);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7fb;
  --panel: rgba(255, 255, 255, 0.94);
  --text: #122126;
  --muted: #667784;
  --line: rgba(25, 128, 150, 0.16);
  --accent: #1677ff;
  --accent-2: #f2b84b;
  --rise: #d9363e;
  --fall: #138a52;
  --warn: #8a5a00;
  --cursor-glow: rgba(22, 119, 255, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(53, 214, 196, 0.16), transparent 30vw),
    radial-gradient(circle at 84% 16%, rgba(242, 184, 75, 0.12), transparent 28vw),
    linear-gradient(135deg, #050a10 0%, #081519 52%, #15120d 100%);
  color: var(--text);
}

:root[data-theme="light"] body {
  background:
    radial-gradient(circle at 18% 8%, rgba(22, 119, 255, 0.14), transparent 30vw),
    radial-gradient(circle at 84% 14%, rgba(242, 184, 75, 0.14), transparent 28vw),
    linear-gradient(135deg, #f7fbff 0%, #eef6ff 52%, #fff9ec 100%);
}

:root[data-bg="liquid"] body {
  background:
    radial-gradient(circle at 16% 14%, rgba(53, 214, 196, 0.2), transparent 30vw),
    radial-gradient(circle at 82% 10%, rgba(114, 92, 255, 0.15), transparent 28vw),
    radial-gradient(circle at 72% 82%, rgba(242, 184, 75, 0.12), transparent 32vw),
    linear-gradient(135deg, #050a10 0%, #081519 52%, #15120d 100%);
}

:root[data-bg="aurora"] body {
  background:
    linear-gradient(112deg, transparent 0%, rgba(53, 214, 196, 0.22) 20%, transparent 42%, rgba(242, 184, 75, 0.12) 68%, transparent 88%),
    radial-gradient(circle at 12% 18%, rgba(34, 197, 94, 0.14), transparent 30vw),
    linear-gradient(135deg, #050b12 0%, #0b121a 50%, #11130f 100%);
}

:root[data-bg="holo"] body {
  background:
    radial-gradient(circle at 12% 16%, rgba(34, 211, 238, 0.18), transparent 28vw),
    radial-gradient(circle at 82% 18%, rgba(168, 85, 247, 0.16), transparent 30vw),
    radial-gradient(circle at 58% 88%, rgba(244, 114, 182, 0.12), transparent 30vw),
    linear-gradient(135deg, #070914 0%, #0a1220 46%, #11130f 100%);
}

:root[data-bg="nebula"] body {
  background:
    radial-gradient(circle at 20% 12%, rgba(53, 214, 196, 0.16), transparent 26vw),
    radial-gradient(circle at 70% 22%, rgba(59, 130, 246, 0.16), transparent 32vw),
    radial-gradient(circle at 48% 76%, rgba(242, 184, 75, 0.1), transparent 34vw),
    linear-gradient(135deg, #030711 0%, #071017 48%, #0d1117 100%);
}

:root[data-bg="heat"] body {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 90, 102, 0.17), transparent 30vw),
    radial-gradient(circle at 78% 16%, rgba(53, 196, 134, 0.16), transparent 30vw),
    radial-gradient(circle at 62% 82%, rgba(242, 184, 75, 0.12), transparent 32vw),
    linear-gradient(135deg, #070b0c 0%, #101516 52%, #16100f 100%);
}

:root[data-theme="light"][data-bg="liquid"] body {
  background:
    radial-gradient(circle at 16% 14%, rgba(22, 119, 255, 0.18), transparent 30vw),
    radial-gradient(circle at 82% 10%, rgba(53, 214, 196, 0.14), transparent 28vw),
    radial-gradient(circle at 72% 82%, rgba(242, 184, 75, 0.16), transparent 32vw),
    linear-gradient(135deg, #f7fbff 0%, #eef6ff 52%, #fff9ec 100%);
}

:root[data-theme="light"][data-bg="aurora"] body {
  background:
    linear-gradient(112deg, transparent 0%, rgba(22, 119, 255, 0.18) 20%, transparent 42%, rgba(242, 184, 75, 0.14) 68%, transparent 88%),
    radial-gradient(circle at 12% 18%, rgba(53, 214, 196, 0.12), transparent 30vw),
    linear-gradient(135deg, #f8fbff 0%, #eff7ff 52%, #fff9ec 100%);
}

:root[data-theme="light"][data-bg="holo"] body {
  background:
    radial-gradient(circle at 12% 16%, rgba(34, 211, 238, 0.16), transparent 28vw),
    radial-gradient(circle at 82% 18%, rgba(168, 85, 247, 0.14), transparent 30vw),
    radial-gradient(circle at 58% 88%, rgba(244, 114, 182, 0.12), transparent 30vw),
    linear-gradient(135deg, #f7fbff 0%, #eef5ff 52%, #fff9ec 100%);
}

:root[data-theme="light"][data-bg="nebula"] body {
  background:
    radial-gradient(circle at 20% 12%, rgba(22, 119, 255, 0.14), transparent 26vw),
    radial-gradient(circle at 70% 22%, rgba(53, 214, 196, 0.14), transparent 32vw),
    radial-gradient(circle at 48% 76%, rgba(242, 184, 75, 0.12), transparent 34vw),
    linear-gradient(135deg, #f8fbff 0%, #edf5ff 50%, #fffaf0 100%);
}

:root[data-theme="light"][data-bg="heat"] body {
  background:
    radial-gradient(circle at 18% 18%, rgba(217, 54, 62, 0.13), transparent 30vw),
    radial-gradient(circle at 78% 16%, rgba(19, 138, 82, 0.13), transparent 30vw),
    radial-gradient(circle at 62% 82%, rgba(242, 184, 75, 0.14), transparent 32vw),
    linear-gradient(135deg, #f8fbff 0%, #eff7ff 52%, #fff9ec 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), var(--cursor-glow), transparent 260px);
  opacity: 0.9;
  transition: opacity 180ms ease;
}

body::after {
  content: none;
}

.topbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, auto) minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 236px;
  padding: 34px clamp(18px, 4vw, 56px) 28px;
  border-bottom: 1px solid rgba(53, 214, 196, 0.22);
  background:
    linear-gradient(90deg, transparent, rgba(53, 214, 196, 0.14) 50%, transparent),
    linear-gradient(180deg, rgba(12, 24, 26, 0.95) 0%, rgba(7, 13, 16, 0.94) 100%);
  overflow: hidden;
}

:root[data-theme="light"] .topbar {
  border-bottom-color: rgba(22, 119, 255, 0.2);
  background:
    linear-gradient(90deg, transparent, rgba(22, 119, 255, 0.12) 50%, transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(237, 246, 255, 0.94) 100%);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 820;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(53, 214, 196, 0.28);
}

:root[data-theme="light"] h1 {
  text-shadow: 0 8px 28px rgba(22, 119, 255, 0.12);
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.ticker-tape {
  width: min(1120px, calc(100vw - 36px));
  min-height: 42px;
  margin: 14px auto 0;
  border: 1px solid rgba(53, 214, 196, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(5, 12, 15, 0.94), rgba(5, 18, 20, 0.74), rgba(5, 12, 15, 0.94));
  box-shadow: inset 0 0 24px rgba(53, 214, 196, 0.08), 0 0 28px rgba(53, 214, 196, 0.1);
  overflow: hidden;
}

:root[data-theme="light"] .ticker-tape {
  border-color: rgba(22, 119, 255, 0.18);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 255, 0.82), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 0 24px rgba(22, 119, 255, 0.05), 0 12px 26px rgba(22, 119, 255, 0.08);
}

.ticker-track {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  padding: 4px;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  border: 1px solid transparent;
  border-right-color: rgba(53, 214, 196, 0.14);
  padding: 5px 12px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.ticker-item:last-child {
  border-right-color: transparent;
}

.ticker-item strong {
  color: var(--accent);
  font-weight: 840;
}

.ticker-item em {
  color: var(--text);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.ticker-item b {
  color: var(--muted);
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.ticker-item[data-direction="up"] b {
  color: var(--rise);
}

.ticker-item[data-direction="down"] b {
  color: var(--fall);
}

.ticker-empty {
  display: block;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
}

.brand-block,
.top-actions,
main {
  position: relative;
  z-index: 1;
}

.brand-block {
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.top-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
  max-width: 460px;
}

.top-actions span,
.badge {
  flex: 0 0 auto;
  border: 1px solid rgba(53, 214, 196, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(10, 20, 22, 0.72);
  color: #dffdf9;
  font-size: 13px;
  box-shadow: inset 0 0 18px rgba(53, 214, 196, 0.08);
}

:root[data-theme="light"] .top-actions span,
:root[data-theme="light"] .badge {
  border-color: rgba(22, 119, 255, 0.2);
  background: rgba(255, 255, 255, 0.78);
  color: #123047;
  box-shadow: inset 0 0 18px rgba(22, 119, 255, 0.06);
}

.style-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 5px;
  border: 1px solid rgba(53, 214, 196, 0.18);
  border-radius: 999px;
  background: rgba(5, 12, 15, 0.38);
  box-shadow: inset 0 0 24px rgba(53, 214, 196, 0.06);
}

.style-chip {
  min-width: 58px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.style-chip:hover {
  color: var(--text);
  border-color: rgba(53, 214, 196, 0.34);
}

.style-chip[data-active="true"] {
  border-color: rgba(53, 214, 196, 0.58);
  background: linear-gradient(180deg, rgba(53, 214, 196, 0.24), rgba(53, 214, 196, 0.08));
  color: #effffb;
  box-shadow: 0 0 18px rgba(53, 214, 196, 0.16);
}

:root[data-theme="light"] .style-switcher {
  border-color: rgba(22, 119, 255, 0.16);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 24px rgba(22, 119, 255, 0.05);
}

:root[data-theme="light"] .style-chip[data-active="true"] {
  border-color: rgba(22, 119, 255, 0.34);
  background: linear-gradient(180deg, rgba(22, 119, 255, 0.18), rgba(22, 119, 255, 0.06));
  color: #123047;
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.1);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(53, 214, 196, 0.35);
  border-radius: 50%;
  background: rgba(10, 20, 22, 0.72);
  color: var(--accent);
  cursor: pointer;
  box-shadow: inset 0 0 18px rgba(53, 214, 196, 0.08);
}

.theme-toggle:hover {
  border-color: rgba(53, 214, 196, 0.72);
}

.theme-icon::before {
  content: "\263e";
  font-size: 20px;
  line-height: 1;
}

:root[data-theme="light"] .theme-toggle {
  border-color: rgba(22, 119, 255, 0.2);
  background: #eaf2ff;
  color: #1677ff;
}

:root[data-theme="light"] .theme-icon::before {
  content: "\2600";
}

main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 26px clamp(14px, 3vw, 36px) 46px;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(242, 184, 75, 0.42);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(52, 39, 16, 0.72);
  color: #ffe2a3;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 0 0 1px rgba(242, 184, 75, 0.06);
}

:root[data-theme="light"] .notice {
  border-color: rgba(242, 184, 75, 0.34);
  background: rgba(255, 249, 230, 0.9);
  color: #7a4f00;
}

.quote-panel {
  margin-bottom: 16px;
}

.quote-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.quote-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(53, 214, 196, 0.28);
  border-radius: 6px;
  padding: 0 13px;
  background: rgba(5, 10, 12, 0.72);
  color: var(--text);
  font: inherit;
  outline: none;
}

:root[data-theme="light"] .quote-form input {
  border-color: rgba(22, 119, 255, 0.18);
  background: rgba(255, 255, 255, 0.88);
}

.quote-form input:focus {
  border-color: rgba(53, 214, 196, 0.78);
  box-shadow: 0 0 0 3px rgba(53, 214, 196, 0.12);
}

.quote-form button {
  min-width: 98px;
  min-height: 44px;
  border: 1px solid rgba(53, 214, 196, 0.55);
  border-radius: 6px;
  background: linear-gradient(180deg, #35d6c4, #189e91);
  color: #041112;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

:root[data-theme="light"] .quote-form button {
  border-color: rgba(22, 119, 255, 0.42);
  background: linear-gradient(180deg, #55a4ff, #1677ff);
  color: #ffffff;
}

.quote-results {
  min-height: 58px;
}

.quote-list {
  display: grid;
}

.quote-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.quote-row:last-child {
  border-bottom: 0;
}

.quote-main,
.quote-meta {
  min-width: 0;
}

.quote-main strong {
  display: block;
  font-size: 16px;
}

.quote-detail-link {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.quote-detail-link small {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.quote-main span,
.quote-meta,
.quote-note {
  color: var(--muted);
  font-size: 12px;
}

.quote-price {
  text-align: right;
}

.quote-price b {
  display: block;
  color: #ffffff;
  font-size: 22px;
}

.quote-confirm {
  min-width: 86px;
  margin-top: 8px;
  border: 1px solid rgba(53, 214, 196, 0.5);
  border-radius: 5px;
  padding: 4px 9px;
  background: rgba(53, 214, 196, 0.1);
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.quote-confirm:hover,
.quote-confirm:focus-visible {
  background: rgba(53, 214, 196, 0.18);
  outline: none;
}

.quote-confirm:disabled {
  cursor: progress;
  opacity: 0.7;
}

:root[data-theme="light"] .quote-confirm {
  border-color: rgba(22, 119, 255, 0.32);
  background: rgba(22, 119, 255, 0.08);
  color: #1677ff;
}

.quote-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.quote-note {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
}

.opportunity-panel {
  grid-column: 1 / -1;
  margin-top: 14px;
}

.opportunity-disclaimer {
  margin: 0;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.opportunity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.opportunity-item {
  min-width: 0;
  padding: 15px 16px;
  background: var(--panel);
}

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

.opportunity-head strong,
.opportunity-head span {
  display: block;
}

.opportunity-head strong {
  color: var(--text);
  font-size: 16px;
}

.opportunity-head span,
.opportunity-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.opportunity-target {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  text-align: right;
}

.opportunity-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.opportunity-metrics span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 7px;
  color: var(--muted);
  font-size: 11px;
}

.opportunity-evidence {
  display: grid;
  gap: 7px;
}

.opportunity-evidence a {
  color: inherit;
  text-decoration: none;
}

.opportunity-evidence a:hover strong,
.opportunity-evidence a:focus-visible strong {
  color: var(--accent);
  text-decoration: underline;
  outline: none;
}

.opportunity-evidence span,
.opportunity-evidence strong {
  display: block;
}

.opportunity-evidence span {
  color: var(--muted);
  font-size: 11px;
}

.opportunity-evidence strong {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .opportunity-list {
    grid-template-columns: 1fr;
  }

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

  .opportunity-target {
    text-align: left;
  }
}

.watchlist-panel {
  margin-bottom: 16px;
}

.watchlist-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
}

.watchlist-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 12px;
  align-items: start;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.watchlist-main,
.watchlist-price {
  min-width: 0;
}

.watchlist-main strong,
.watchlist-main .watchlist-stock-link {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-link {
  color: inherit;
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.stock-link:hover,
.stock-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  outline: none;
}

.quote-source {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.sector-leader-link {
  font-weight: 700;
}

.watchlist-main span,
.watchlist-item time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.watchlist-price {
  text-align: right;
}

.watchlist-price b {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.watchlist-price span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 820;
}

.watchlist-remove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 90, 102, 0.28);
  border-radius: 50%;
  background: rgba(66, 22, 28, 0.2);
  color: #ff6b7a;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.watchlist-remove:hover {
  border-color: rgba(255, 90, 102, 0.58);
  background: rgba(255, 90, 102, 0.12);
}

.watchlist-remove:disabled {
  cursor: progress;
  opacity: 0.55;
}

:root[data-theme="light"] .watchlist-remove {
  border-color: rgba(217, 54, 62, 0.2);
  background: rgba(255, 241, 240, 0.82);
  color: #d9363e;
}

.watchlist-item time {
  grid-column: 1 / -1;
}

.breadth-panel {
  grid-column: 1 / -1;
}

.breadth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.breadth-card {
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 18px 20px;
}

.breadth-card:last-child {
  border-right: 0;
}

.breadth-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.breadth-title strong {
  font-size: 18px;
  font-weight: 820;
}

.breadth-title span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

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

.breadth-stats span {
  min-width: 0;
  border: 1px solid rgba(53, 214, 196, 0.12);
  border-radius: 8px;
  padding: 10px 8px;
  background: rgba(5, 12, 15, 0.2);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

:root[data-theme="light"] .breadth-stats span {
  border-color: rgba(22, 119, 255, 0.12);
  background: rgba(255, 255, 255, 0.45);
}

.breadth-stats b {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.breadth-stats b.rise {
  color: var(--rise);
}

.breadth-stats b.fall {
  color: var(--fall);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.split {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
  gap: 16px;
  margin-top: 16px;
}

.market-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}

.news-panel {
  grid-column: 1 / -1;
}

.hk-leaders-panel {
  grid-column: 1 / -1;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

:root[data-theme="light"] .panel {
  box-shadow: 0 18px 44px rgba(32, 58, 92, 0.12);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 56%, var(--accent-2));
  opacity: 0.75;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(53, 214, 196, 0.08), transparent);
}

:root[data-theme="light"] .panel-head {
  background: linear-gradient(180deg, rgba(22, 119, 255, 0.08), transparent);
}

.panel-head time {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  max-width: 180px;
  overflow-wrap: anywhere;
}

.error {
  margin: 12px 16px 0;
  border: 1px solid rgba(255, 90, 102, 0.22);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(66, 22, 28, 0.65);
  color: #ffb3b9;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

:root[data-theme="light"] .error {
  border-color: rgba(217, 54, 62, 0.2);
  background: rgba(255, 241, 240, 0.92);
  color: #a61d24;
}

.table-wrap {
  overflow-x: auto;
}

.ranking-panel .ranking-scroll {
  max-height: 420px;
  overflow: hidden;
}

.ranking-panel table {
  table-layout: fixed;
}

.ranking-table-head {
  position: relative;
  z-index: 3;
  border-bottom: 0;
  background: var(--panel);
  overflow: hidden;
}

.ranking-table-head th {
  background: var(--panel);
}

.ranking-panel th,
.ranking-panel td {
  border-bottom: 0;
}

.ranking-panel tbody {
  will-change: transform;
}

.ranking-panel th:first-child,
.ranking-panel td:first-child {
  width: 44px;
}

.ranking-panel th:nth-child(2),
.ranking-panel td:nth-child(2) {
  width: 32%;
}

.ranking-panel th:nth-child(3),
.ranking-panel td:nth-child(3) {
  width: 22%;
}

.ranking-panel th:nth-child(4),
.ranking-panel td:nth-child(4),
.ranking-panel th:nth-child(5),
.ranking-panel td:nth-child(5) {
  width: 18%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="light"] th {
  background: rgba(22, 119, 255, 0.045);
}

td:first-child {
  color: var(--accent);
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover,
.sector-item:hover,
.news-item:hover {
  background: rgba(53, 214, 196, 0.055);
}

:root[data-theme="light"] tbody tr:hover,
:root[data-theme="light"] .sector-item:hover,
:root[data-theme="light"] .news-item:hover {
  background: rgba(22, 119, 255, 0.055);
}

.rise {
  color: var(--rise);
  font-weight: 820;
}

.mobile-rise {
  display: none;
}

.fall {
  color: var(--fall);
  font-weight: 820;
}

.sector-list,
.news-list {
  display: grid;
  gap: 0;
}

.news-viewport {
  position: relative;
  height: min(760px, 72vh);
  max-height: 760px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(53, 214, 196, 0.42) transparent;
  scrollbar-width: thin;
}

.news-viewport::before,
.news-viewport::after {
  content: none;
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  height: 34px;
  pointer-events: none;
}

.news-viewport::before {
  top: 0;
  background: linear-gradient(180deg, var(--panel), transparent);
}

.news-viewport::after {
  bottom: 0;
  background: linear-gradient(0deg, var(--panel), transparent);
}

.news-track {
  transform: none !important;
}

.news-viewport::-webkit-scrollbar {
  width: 8px;
}

.news-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(53, 214, 196, 0.36);
}

:root[data-theme="light"] .news-viewport::-webkit-scrollbar-thumb {
  background: rgba(22, 119, 255, 0.32);
}

.sector-item,
.news-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.news-item {
  display: grid;
  grid-template-columns: minmax(92px, 0.22fr) minmax(0, 1fr) minmax(82px, auto);
  align-items: start;
}

.sector-item:last-child,
.news-item:last-child {
  border-bottom: 0;
}

.sector-item div,
.news-item {
  min-width: 0;
}

.sector-item strong,
.news-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sector-item span,
.news-item span,
.news-item time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.news-item span,
.news-item time {
  margin-top: 0;
  line-height: 1.35;
}

.news-item span {
  overflow-wrap: normal;
}

.news-item strong {
  display: block;
  max-height: calc(1.45em * 3);
  line-height: 1.45;
  overflow: hidden;
  white-space: normal;
}

.news-item time {
  text-align: right;
}

.sector-item b {
  flex: 0 0 auto;
  color: var(--rise);
}

.hk-leaders-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

.hk-topic-card {
  border: 1px solid rgba(53, 214, 196, 0.14);
  border-radius: 8px;
  background: rgba(5, 12, 15, 0.18);
  overflow: hidden;
}

:root[data-theme="light"] .hk-topic-card {
  border-color: rgba(22, 119, 255, 0.14);
  background: rgba(255, 255, 255, 0.5);
}

.hk-topic-head {
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line);
}

.hk-topic-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
}

.hk-topic-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.hk-leader-list {
  display: grid;
}

.hk-topic-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.leader-column {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.leader-column:last-child {
  border-right: 0;
}

.leader-column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(53, 214, 196, 0.045);
}

:root[data-theme="light"] .leader-column-title {
  background: rgba(22, 119, 255, 0.045);
}

.leader-column-title strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-column-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.hk-leader-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(78px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.hk-leader-row:last-child {
  border-bottom: 0;
}

.hk-leader-row > b {
  color: var(--accent);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.hk-leader-main {
  min-width: 0;
}

.hk-leader-main strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-leader-main span,
.hk-leader-main em,
.hk-leader-main small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hk-leader-main em {
  margin-top: 2px;
}

.hk-leader-main small {
  margin-top: 2px;
  opacity: 0.78;
}

.hk-leader-quote {
  text-align: right;
}

.hk-leader-quote strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.hk-leader-quote span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.hk-leader-quote span.rise {
  color: var(--rise);
}

.hk-leader-quote span.fall {
  color: var(--fall);
}

.topic-verify-note {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 9px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sector-panel .sector-list {
  max-height: 620px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sector-panel .sector-list::-webkit-scrollbar {
  width: 8px;
}

.sector-panel .sector-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(53, 214, 196, 0.28);
}

:root[data-theme="light"] .sector-panel .sector-list::-webkit-scrollbar-thumb {
  background: rgba(22, 119, 255, 0.22);
}

.empty {
  padding: 18px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .grid,
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    min-height: 256px;
    text-align: center;
  }

  .brand-block,
  .top-actions {
    grid-column: 1;
    width: 100%;
  }

  .top-actions {
    justify-self: center;
    justify-content: center;
  }
}

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

  .news-panel {
    grid-column: auto;
  }

  .news-viewport {
    height: min(620px, 68vh);
    max-height: 620px;
  }

  .sector-panel .sector-list {
    max-height: none;
    overflow-y: visible;
  }

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

  .topbar {
    display: flex;
    min-height: 300px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .brand-block,
  .top-actions {
    width: 100%;
  }

  .top-actions {
    justify-content: center;
    max-width: 340px;
  }

  .style-switcher {
    width: min(100%, 330px);
    border-radius: 20px;
  }

  .ticker-tape {
    width: min(100%, 360px);
  }

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

  .ticker-item {
    border-right-color: transparent;
    border-bottom: 1px solid rgba(53, 214, 196, 0.12);
    gap: 6px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .ticker-item:last-child,
  .ticker-item:nth-last-child(2):nth-child(odd) {
    border-bottom-color: transparent;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .top-actions span,
  .badge {
    padding: 7px 10px;
    font-size: 12px;
  }

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

  .breadth-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .breadth-card:last-child {
    border-bottom: 0;
  }

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

  th,
  td {
    padding: 7px 2px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  table {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 10.5px;
  }

  thead {
    display: none;
  }

  tbody {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    max-width: 100%;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  tbody td {
    border-bottom: 0;
  }

  tbody td:nth-child(3),
  tbody td:nth-child(4),
  tbody td:nth-child(5) {
    display: none;
  }

  .mobile-rise {
    display: block;
    margin-top: 3px;
    color: var(--rise);
    font-weight: 820;
  }

  .panel-head {
    flex-direction: column;
  }

  .panel-head time {
    max-width: none;
    text-align: left;
  }

  .quote-form,
  .quote-row,
  .watchlist-item {
    grid-template-columns: 1fr;
  }

  .quote-price,
  .watchlist-price {
    text-align: left;
  }

  .watchlist-remove {
    justify-self: start;
  }

  .hk-leaders-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .hk-topic-columns {
    grid-template-columns: 1fr;
  }

  .leader-column {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .leader-column:last-child {
    border-bottom: 0;
  }

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

  .leader-column-title span {
    white-space: normal;
  }

  .hk-leader-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .hk-leader-quote {
    grid-column: 2;
    text-align: left;
  }

  .news-item {
    grid-template-columns: 1fr;
  }

  .news-item time {
    text-align: left;
  }
}

/* Reading comfort refresh: calmer surfaces, clearer hierarchy, denser navigation. */
:root {
  --panel: rgba(13, 21, 24, 0.96);
  --panel-soft: rgba(19, 30, 34, 0.9);
  --line: rgba(134, 232, 220, 0.13);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  scroll-behavior: smooth;
}

:root[data-theme="light"] {
  --bg: #f4f7fa;
  --panel: rgba(255, 255, 255, 0.97);
  --panel-soft: rgba(247, 250, 253, 0.96);
  --text: #18252b;
  --muted: #667782;
  --line: rgba(38, 89, 110, 0.12);
  --shadow: 0 10px 30px rgba(30, 55, 75, 0.08);
}

body {
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.topbar {
  min-height: 210px;
  padding-top: 26px;
  padding-bottom: 22px;
}

h1 {
  font-size: clamp(38px, 4.2vw, 54px);
  line-height: 1.08;
}

h2 {
  font-size: 19px;
  line-height: 1.35;
}

.eyebrow {
  margin-bottom: 5px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.ticker-tape {
  min-height: 40px;
  margin-top: 12px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .ticker-tape {
  box-shadow: 0 8px 24px rgba(30, 69, 98, 0.07);
}

.ticker-item {
  gap: 7px;
  min-height: 30px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.style-switcher {
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 8px;
}

.style-chip {
  min-width: 54px;
  border-radius: 5px;
  padding: 5px 10px;
}

.top-actions span {
  padding: 6px 10px;
  font-size: 12px;
}

.top-actions {
  position: absolute;
  top: 24px;
  right: clamp(18px, 4vw, 56px);
  grid-column: auto;
  justify-self: auto;
  width: auto;
  max-width: none;
}

main {
  width: min(1540px, 100%);
  padding-top: 16px;
}

.section-nav {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 18, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  overflow-x: auto;
  scrollbar-width: none;
  backdrop-filter: blur(16px);
}

.section-nav::-webkit-scrollbar {
  display: none;
}

:root[data-theme="light"] .section-nav {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(35, 65, 85, 0.09);
}

.section-nav a {
  flex: 0 0 auto;
  border-radius: 5px;
  padding: 7px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  background: rgba(53, 214, 196, 0.1);
  color: var(--text);
  outline: none;
}

:root[data-theme="light"] .section-nav a:hover,
:root[data-theme="light"] .section-nav a:focus-visible {
  background: rgba(22, 119, 255, 0.08);
}

#quote-section,
#watchlist-section,
#breadth-section,
#rankings-section,
#sectors-section,
#leaders-section,
#news-section {
  scroll-margin-top: 72px;
}

.notice {
  margin-bottom: 14px;
  padding: 10px 13px;
  font-size: 13px;
}

.panel {
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.panel::before {
  height: 2px;
  opacity: 0.65;
}

.panel-head {
  align-items: center;
  min-height: 70px;
  padding: 15px 17px 14px;
  background: rgba(53, 214, 196, 0.035);
}

:root[data-theme="light"] .panel-head {
  background: rgba(22, 119, 255, 0.025);
}

.panel-head time {
  line-height: 1.45;
}

.quote-panel,
.watchlist-panel,
.breadth-panel {
  margin-bottom: 14px;
}

.quote-form {
  padding: 14px 16px;
}

.quote-form input,
.quote-form button {
  min-height: 46px;
}

.quote-form button {
  transition: filter 160ms ease, transform 160ms ease;
}

.quote-form button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.quote-results {
  min-height: 54px;
}

.watchlist-list {
  gap: 1px;
  background: var(--line);
}

.watchlist-item {
  border: 0;
  background: var(--panel);
}

.breadth-card {
  padding: 16px 18px;
}

.breadth-stats {
  gap: 8px;
}

.breadth-stats span {
  padding: 9px 6px;
  border-radius: 6px;
}

.breadth-stats b {
  font-size: 21px;
  line-height: 1.2;
}

.grid,
.market-panels {
  gap: 14px;
}

.market-panels {
  margin-top: 14px;
}

.ranking-panel .ranking-scroll {
  max-height: 456px;
}

.ranking-table-head {
  background: var(--panel-soft);
}

.ranking-table-head th {
  background: transparent;
}

table {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 11px 12px;
}

th {
  color: #82919a;
  font-size: 11px;
  text-transform: uppercase;
}

.ranking-panel tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.018);
}

:root[data-theme="light"] .ranking-panel tbody tr:nth-child(even) {
  background: rgba(25, 72, 96, 0.025);
}

.ranking-panel td:nth-child(2) {
  color: var(--text);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-panel td:nth-child(3),
.ranking-panel td:nth-child(4) {
  color: var(--muted);
}

.sector-item {
  align-items: center;
  min-height: 62px;
  padding: 12px 16px;
}

.sector-item strong {
  color: var(--text);
  line-height: 1.4;
}

.sector-item span {
  line-height: 1.45;
}

.hk-leaders-grid {
  gap: 12px;
  padding: 14px;
}

.hk-topic-card {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.012);
}

:root[data-theme="light"] .hk-topic-card {
  border-color: var(--line);
  background: #ffffff;
}

.hk-topic-head {
  padding: 14px 16px 12px;
  background: var(--panel-soft);
}

.hk-topic-head h3 {
  font-size: 17px;
}

.hk-topic-head p {
  font-size: 13px;
}

.leader-column-title {
  padding: 10px 15px;
}

.hk-leader-row {
  min-height: 86px;
  padding: 11px 15px;
}

.hk-leader-main strong {
  font-size: 15px;
}

.hk-leader-main span,
.hk-leader-main em,
.hk-leader-main small {
  line-height: 1.45;
}

.hk-leader-quote strong {
  font-size: 16px;
}

.topic-verify-note {
  background: var(--panel-soft);
}

.news-viewport {
  height: min(700px, 70vh);
  max-height: 700px;
}

.news-item {
  grid-template-columns: minmax(110px, 0.18fr) minmax(0, 1fr) 152px;
  align-items: center;
  min-height: 62px;
  padding: 12px 17px;
}

.news-item strong {
  display: -webkit-box;
  max-height: calc(1.55em * 2);
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-item span {
  color: var(--accent);
  font-weight: 700;
}

.news-item time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.news-item:hover strong {
  color: var(--accent);
}

@media (max-width: 1100px) {
  .top-actions {
    top: 18px;
    right: 18px;
    width: auto;
  }

  .top-actions span {
    display: none;
  }

  .topbar {
    min-height: 220px;
  }

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

  .ranking-panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 268px;
    padding: 24px 14px 20px;
  }

  h1 {
    font-size: 38px;
  }

  .top-actions span {
    display: none;
  }

  main {
    padding: 10px 10px 34px;
  }

  .section-nav {
    top: 6px;
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 10px;
  }

  .section-nav a {
    padding: 7px 11px;
    font-size: 12px;
  }

  .rankings,
  .market-panels {
    grid-template-columns: 1fr;
  }

  .ranking-panel:last-child {
    grid-column: auto;
  }

  .panel-head {
    min-height: 66px;
    padding: 13px 14px;
  }

  .panel-head time {
    margin-top: 2px;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .ranking-panel tbody tr {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    min-height: 48px;
  }

  .ranking-panel tbody td {
    font-size: 13px;
  }

  .mobile-rise {
    font-size: 12px;
  }

  .quote-form {
    grid-template-columns: 1fr auto;
    padding: 12px;
  }

  .quote-form button {
    min-width: 76px;
  }

  .breadth-card {
    padding: 14px;
  }

  .breadth-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .breadth-stats span {
    padding: 8px 3px;
    font-size: 11px;
  }

  .breadth-stats b {
    font-size: 17px;
  }

  .hk-leaders-grid {
    padding: 10px;
  }

  .hk-leader-row {
    min-height: 0;
  }

  .news-viewport {
    height: min(620px, 68vh);
  }

  .news-item {
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
    min-height: 76px;
    padding: 12px 14px;
  }

  .news-item span {
    grid-column: 1;
  }

  .news-item time {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .news-item strong {
    grid-column: 1 / -1;
    max-height: calc(1.55em * 3);
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 430px) {
  .ticker-tape {
    width: 100%;
  }

  .style-switcher {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .style-chip {
    min-width: 0;
    padding-inline: 5px;
  }

  .quote-form {
    grid-template-columns: 1fr;
  }

  .quote-form button {
    width: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Industry leader cards: one market list at a time keeps the long-form panel compact. */
.hk-leaders-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.hk-topic-card {
  display: flex;
  flex-direction: column;
}

.hk-market-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 10px 12px 0;
}

.hk-market-tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.hk-market-tabs button[aria-selected="true"] {
  border-color: rgba(53, 214, 196, 0.55);
  background: rgba(53, 214, 196, 0.11);
  color: var(--text);
}

:root[data-theme="light"] .hk-market-tabs button[aria-selected="true"] {
  border-color: rgba(22, 119, 255, 0.4);
  background: rgba(22, 119, 255, 0.08);
}

.hk-market-tabs button:hover,
.hk-market-tabs button:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}

.hk-market-pane[hidden] {
  display: none;
}

.hk-market-hint {
  margin: 0;
  padding: 9px 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.hk-market-pane .leader-column {
  border-right: 0;
}

.hk-market-pane .hk-leader-row {
  min-height: 78px;
}

.hk-leader-row {
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.hk-leader-row:hover,
.hk-leader-row:focus-visible {
  background: rgba(53, 214, 196, 0.06);
  box-shadow: inset 3px 0 0 var(--accent);
  outline: none;
}

:root[data-theme="light"] .hk-leader-row:hover,
:root[data-theme="light"] .hk-leader-row:focus-visible {
  background: rgba(22, 119, 255, 0.05);
}

.hk-leader-row:hover .hk-leader-main strong,
.hk-leader-row:focus-visible .hk-leader-main strong {
  color: var(--accent);
}

@media (max-width: 900px) {
  .hk-leaders-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hk-market-tabs {
    padding: 9px 10px 0;
  }

  .hk-market-hint {
    padding: 8px 12px;
  }
}
