:root {
  color-scheme: dark;
  --bg: #07111f;
  --card: #10203a;
  --card-2: #0c1830;
  --cyan: #8ee7ff;
  --text: #e7f2fb;
  --muted: #9aafc4;
  --line: rgba(142, 231, 255, 0.16);
  --nav: #0b1730;
}

* { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 420px at 70% -10%, rgba(70, 140, 220, 0.28), transparent 60%),
    linear-gradient(180deg, #0a1830 0%, var(--bg) 42%);
  color: var(--text);
  font: 16px/1.5 Manrope, "Segoe UI", sans-serif;
}

img, video, canvas, svg, iframe {
  max-width: 100%;
  height: auto;
}

p, li, td, th, figcaption {
  overflow-wrap: break-word;
}

.glow {
  pointer-events: none;
  position: fixed;
  z-index: 0;
  inset: auto 8% 12% auto;
  width: min(280px, 40vw);
  height: min(280px, 40vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 210, 255, 0.16), transparent 68%);
}

.top, main { position: relative; z-index: 1; }
.top { z-index: 2; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1.25rem clamp(1rem, 3vw, 1.5rem) 0;
}

.logo {
  justify-self: start;
  max-width: 100%;
  display: inline-block;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 1.25rem;
  background: linear-gradient(180deg, #dff6ff 0%, #5ecfff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pill {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  gap: 0.25rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.35rem;
  background: var(--nav);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.pill > .menu,
.pill > a {
  flex: 0 0 auto;
}

.pill > .menu {
  display: flex;
  align-items: center;
}

.pill a {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
}

.pill a.on,
.pill a:hover,
.menu.open .menu-trigger {
  color: var(--text);
  background: rgba(142, 231, 255, 0.1);
}

.menu { position: relative; }

.menu-list {
  display: none;
  position: absolute;
  z-index: 6;
  top: calc(100% + 0.45rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 12.5rem;
  padding: 0.35rem;
  background: var(--nav);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

.menu-list::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.55rem;
}

.menu:hover .menu-list,
.menu:focus-within .menu-list,
.menu.open .menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.menu-list a {
  text-align: center;
  white-space: nowrap;
}

.top form,
.top > .settings { margin: 0; justify-self: end; }

.settings .menu-list {
  left: auto;
  right: 0;
  transform: none;
}

.settings .menu-list a,
.settings .menu-list button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  text-align: center;
  font: 700 0.78rem/1.2 Manrope, "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.settings .menu-list a.on,
.settings .menu-list a:hover,
.settings .menu-list button:hover {
  color: var(--text);
  background: rgba(142, 231, 255, 0.1);
}

.profile th {
  width: 11rem;
  color: var(--muted);
  font-weight: 700;
}

.profile td { color: var(--text); }

.profile form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.profile input {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(142, 231, 255, 0.08);
  color: var(--text);
  font: 500 1rem/1.2 Manrope, "Segoe UI", sans-serif;
}

.profile input:focus {
  outline: 1px solid rgba(142, 231, 255, 0.45);
}

.profile p { margin: 0.6rem 0 0; }

.cta {
  justify-self: end;
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  background: linear-gradient(180deg, #e7f9ff 0%, #7adfff 100%);
  color: #062033;
  font: 700 0.95rem/1 Manrope, "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

main {
  width: min(68rem, calc(100% - 2rem));
  min-width: 0;
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  gap: 1.5rem;
}

body.wide main {
  width: min(140rem, calc(100% - 2rem));
}

.site-foot {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  margin-top: auto;
  padding: 0 clamp(1rem, 3vw, 1.5rem) 1.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-foot p { margin: 0; }

.site-links {
  display: flex;
  flex-flow: row nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}

.site-links a {
  display: inline-flex;
  flex: 0 0 2.75rem;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  overflow: hidden;
}

.site-links a:hover,
.site-links a:focus-visible {
  background: rgba(142, 231, 255, 0.1);
}

.site-links img {
  display: block;
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  max-width: 1.65rem;
  max-height: 1.65rem;
  object-fit: contain;
}

.video {
  position: relative;
  width: min(100%, 48rem);
  aspect-ratio: 16 / 9;
  margin-top: 0.5rem;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 1.4rem;
}

.hero, .section, .tile, .grid > * { min-width: 0; }

h1 {
  margin: 0 0 1rem;
  max-width: 100%;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.25;
  letter-spacing: -0.04em;
  font-weight: 800;
  background: linear-gradient(180deg, #f4fcff 10%, #7adfff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-head h1 { margin: 0; }

.page-head .cta { flex: 0 0 auto; margin-left: auto; }

.head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
}

.page-head .head-actions .cta { margin-left: 0; }

.vol-rising,
.vol-falling,
.z-pos,
.z-neg {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 0.3rem;
  font-weight: 800;
  line-height: 1.3;
}

.vol-rising {
  background: rgba(57, 255, 20, 0.8);
  color: #ffffff;
}

.vol-falling,
.z-neg {
  background: rgba(255, 42, 42, 0.8);
  color: #ffffff;
}

.z-pos {
  background: rgba(57, 255, 20, 0.8);
  color: #ffffff;
}

.vol-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.vol-side {
  min-width: 0;
  overflow-x: auto;
}

.vol-side h2 { margin: 0 0 0.75rem; }

.vol-side .bars {
  width: max-content;
  min-width: 100%;
}

.vol-side .bars th,
.vol-side .bars td { white-space: nowrap; }

.vol-side h2 .vol-rising,
.vol-side h2 .vol-falling,
.vol-side h2 .z-pos,
.vol-side h2 .z-neg {
  padding: 0.2rem 0.7rem;
}

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

.update-popup { width: min(42rem, calc(100vw - 2rem)); }

.update-dates {
  max-height: min(24rem, 50vh);
  overflow: auto;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.update-dates label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.7rem;
  color: var(--text);
}

.update-dates label:has(input:checked) {
  background: rgba(142, 231, 255, 0.12);
}

.update-log {
  max-height: min(24rem, 50vh);
  overflow: auto;
  margin: 0 0 1rem;
  white-space: pre-wrap;
  color: var(--muted);
  font: 0.82rem/1.45 Consolas, "Courier New", monospace;
}

.hero h1 {
  font-size: clamp(1.7rem, 4.6vw, 3.15rem);
  line-height: 1.3;
  padding-bottom: 0.15em;
  margin-bottom: 1.35rem;
}

.hero .cta { margin-top: 0.35rem; }

.lead { color: var(--text); max-width: 40rem; }

p { margin: 0 0 1rem; color: var(--muted); }

.hero form { margin-top: 1.5rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th, td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

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

.popup {
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: #10203a;
  color: var(--text);
}

.popup::backdrop {
  background: rgba(4, 10, 20, 0.72);
}

.popup h2 {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.popup .cta { margin-top: 0.5rem; }

.tile {
  height: auto;
  padding: 1.4rem;
  border-radius: 1.4rem;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
}

.tile h2 {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.symbol-finder-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 0.25rem;
  padding: 0.85rem 0;
  background: #07111f;
}

.symbol-search {
  flex: 1 1 16rem;
  min-width: 0;
  margin: 0;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(142, 231, 255, 0.08);
  color: var(--text);
  font: 500 1rem/1.2 Manrope, "Segoe UI", sans-serif;
}

.symbol-search:focus {
  outline: 1px solid rgba(142, 231, 255, 0.45);
}

.symbol-finder-bar p {
  margin: 0;
  white-space: nowrap;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.symbol-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.symbol-list li {
  margin: 0;
}

.symbol-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0.15rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.symbol-list a:hover .symbol-name,
.symbol-list a:focus .symbol-name {
  color: var(--cyan);
}

.bars {
  width: 100%;
  border-collapse: collapse;
}

.bars th,
.bars td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bars th:first-child,
.bars td:first-child {
  text-align: left;
}

.bars thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #07111f;
  vertical-align: middle;
}

.col-head {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.bars th:not(:first-child) .col-head {
  width: 100%;
  justify-content: flex-end;
}

.col-name {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sort-arrows {
  display: inline-flex;
  flex-direction: column;
  gap: 0.12rem;
}

.sort {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 0.95rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sort::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 0.28rem solid transparent;
  border-right: 0.28rem solid transparent;
}

.sort[data-dir="asc"]::before { border-bottom: 0.38rem solid var(--muted); }

.sort[data-dir="desc"]::before { border-top: 0.38rem solid var(--muted); }

.sort.on[data-dir="asc"]::before { border-bottom-color: var(--cyan); }

.sort.on[data-dir="desc"]::before { border-top-color: var(--cyan); }

.sort:focus { outline: 1px solid rgba(142, 231, 255, 0.45); }

#bar-count {
  margin: 0 0 0.75rem;
}

.head-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(142, 231, 255, 0.08);
  text-decoration: none;
}

.back::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.2rem;
  border-left: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  transform: rotate(45deg);
}

.back:hover { background: rgba(142, 231, 255, 0.16); }

.head-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kind-filter {
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(142, 231, 255, 0.08);
  color: var(--text);
  color-scheme: light;
  font: 600 0.85rem/1.2 Manrope, "Segoe UI", sans-serif;
}

.kind-filter option {
  color: #10203a;
  background: #ffffff;
}

.kind-filter:focus {
  outline: 1px solid rgba(142, 231, 255, 0.45);
}

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

.chain td {
  font-variant-numeric: tabular-nums;
}

.chain tr.atm td {
  color: var(--cyan);
}

.chain td.up {
  color: #3dd68c;
}

.chain td.down {
  color: #ff6b6b;
}

.chain th.strike,
.chain td.strike {
  text-align: center;
  font-weight: 700;
}

.symbol-name {
  color: var(--text);
  font-weight: 600;
}

.symbol-kind {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .top {
    justify-content: center;
    padding-top: 1rem;
  }
  .logo, .cta, .top form, .top > .settings { justify-self: center; }
  .pill { margin-left: 0; margin-right: 0; }
  main { padding-top: 2.25rem; }
}

@media (max-width: 700px) {
  .pill a { padding: 0.7rem 0.95rem; }
  .cta { min-height: 44px; }
  h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); }
}
