/* ONE STOCK legacy visual rules from ebffced, adapted to the V2 controls below. */
:root {
  color-scheme: dark;
  --page: #02070b;
  --panel: #071016;
  --panel-strong: #0a151c;
  --panel-hover: rgba(17, 39, 48, 0.78);
  --line: rgba(126, 145, 164, 0.36);
  --line-strong: rgba(150, 170, 200, 0.22);
  --text: #eef5f7;
  --muted: #8799a5;
  --font-ui: "Segoe UI", system-ui, sans-serif;
  --font-data: "Cascadia Mono", Consolas, monospace;
  --accent-primary: #80A5EB;
  --accent-primary-soft: rgba(128, 165, 235, 0.12);
  --accent-primary-faint: rgba(128, 165, 235, 0.08);
  --accent-primary-border: rgba(128, 165, 235, 0.60);
  --accent-primary-glow: rgba(128, 165, 235, 0.35);
  --cyan: #10e0c0;
  --pink: #ef76f6;
  --violet: #ad84ff;
  --orange: #d47438;
  --green: #19e58f;
  --green-soft: rgba(25, 229, 143, 0.09);
  --red: #ff4d5f;
  --red-soft: rgba(255, 77, 95, 0.105);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background: var(--page) url("/assets/chrystall.png")
    top center / cover fixed no-repeat;
  color: var(--text);
  font-family: var(--font-ui);
  letter-spacing: 0;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: rgba(1, 4, 6, 0.64);
  content: "";
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
.scanner-row {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
}

.worksxxx-brand-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  margin: 0;
  object-fit: contain;
  object-position: center;
  transform: scale(1.15);
  transform-origin: center;
  translate: 0 5px;
  pointer-events: none;
}

.stock-splashes-card,
.stock-listings-card {
  position: relative;
  z-index: 90;
  grid-area: splashes;
  min-width: 0;
  min-height: 172px;
  max-height: none;
  display: flex;
  flex-direction: column;
  padding: 8px 10px 7px;
  overflow: hidden;
  border: 1px solid rgba(150, 170, 200, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 85% 18%, rgba(116, 66, 200, 0.11), transparent 42%),
    linear-gradient(135deg, rgba(18, 24, 36, 0.82), rgba(5, 8, 14, 0.72));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(150, 170, 200, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.043);
  backdrop-filter: blur(16px);
}

.stock-splashes-header {
  flex: 0 0 auto;
  min-height: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 24px;
  align-items: center;
  gap: 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.stock-splashes-header > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.splash-sound-toggle {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(110, 130, 150, 0.42);
  border-radius: 6px;
  background: rgba(5, 10, 16, 0.72);
  color: #8296a3;
  cursor: pointer;
}

.splash-sound-toggle span {
  width: 13px;
  height: 13px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4Zm12.5 3a4.5 4.5 0 0 0-2-3.74v7.48a4.5 4.5 0 0 0 2-3.74Zm-2-8.77v2.06a8 8 0 0 1 0 13.42v2.06a10 10 0 0 0 0-17.54Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.splash-sound-toggle[aria-pressed="true"] {
  border-color: rgba(50, 215, 196, 0.68);
  color: var(--green);
  box-shadow: 0 0 12px rgba(50, 215, 196, 0.15);
}

.stock-splash-events {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(116, 66, 200, 0.65) transparent;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.stock-splash-events::-webkit-scrollbar {
  width: 5px;
}

.stock-splash-events::-webkit-scrollbar-track {
  background: transparent;
}

.stock-splash-events::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(116, 66, 200, 0.48);
}

.stock-splash-events:hover::-webkit-scrollbar-thumb {
  background: rgba(116, 66, 200, 0.72);
}

.stock-splash-empty {
  height: 100%;
  display: grid;
  place-items: center;
  margin: 0;
  color: #71858f;
  font-size: 9px;
  text-align: center;
}

.stock-splash-event {
  width: 100%;
  min-height: 25px;
  display: block;
  padding: 2px 2px;
  border: 0;
  border-bottom: 1px solid rgba(126, 145, 164, 0.14);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.stock-splash-event:hover,
.stock-splash-event:focus-visible {
  background: rgba(116, 66, 200, 0.1);
  outline: none;
}

.stock-splash-event__primary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 5px;
  font-size: 10px;
  line-height: 1.15;
}

.stock-splash-event__direction,
.stock-splash-event__percent {
  color: var(--green);
  font-weight: 700;
}

.stock-splash-event--down .stock-splash-event__direction,
.stock-splash-event--down .stock-splash-event__percent {
  color: var(--red);
}

.stock-splash-event__ticker {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-splash-event__identity {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stock-splash-event__tv-price {
  flex-shrink: 0;
  color: #60aaff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stock-splash-event__tv-price.is-unavailable { color: var(--muted); }

.stock-splash-event__duration {
  color: #7f929c;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.stock-splash-event__secondary {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  color: #72858d;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.section-kicker {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: .035em;
}

.exchange-selector-band {
  position: relative;
  z-index: 20;
  width: 100%;
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(126, 145, 164, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(30, 39, 52, 0.2), rgba(6, 11, 17, 0.2)),
    rgba(5, 10, 15, 0.72);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.027);
  backdrop-filter: blur(14px);
}

.control {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.control span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.control input,
.control select {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid rgba(74, 86, 101, 0.7);
  border-radius: 6px;
  outline: none;
  background: rgba(8, 14, 22, 0.94);
  color: var(--text);
  font-size: 12px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.control input:focus,
.control select:focus {
  border-color: var(--accent-primary-border);
  box-shadow: 0 0 0 2px var(--accent-primary-soft);
}

.control input::placeholder {
  color: #60737b;
}

.venue-search input {
  height: 45px;
}

.scanner-table-shell {
  --scanner-row-height: 48px;
  --cell-padding-inline: clamp(9px, 1.25vw, 16px);
  overflow-anchor: none;
  container-name: stock-table;
  container-type: inline-size;
  margin-top: 14px;
  height: calc(100dvh - 326px);
  min-height: 450px;
  max-height: 790px;
  overflow: auto;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(140, 155, 175, 0.35) rgba(255, 255, 255, 0.03);
  scrollbar-width: thin;
  border: 1px solid rgba(126, 145, 164, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(30, 39, 52, 0.2), rgba(6, 11, 17, 0.2)),
    rgba(5, 10, 15, 0.72);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.26),
    inset 0 0 0 1px rgba(255, 255, 255, 0.027);
  backdrop-filter: blur(17px);
}

.scanner-table-shell::-webkit-scrollbar {
  width: 9px;
}

.scanner-table-shell::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.scanner-table-shell::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(140, 155, 175, 0.35);
}

.scanner-footer {
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 8px 4px 0;
  padding: 8px 8px 0;
  border-top: 1px solid rgba(126, 145, 164, 0.18);
  color: #72858d;
  font-size: 9px;
  font-weight: 750;
}

.scanner-table-shell > table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.scanner-table-shell > table > :is(thead, tbody) > tr > :is(th, td) {
  min-width: 0;
  height: var(--scanner-row-height, 48px);
  padding: 0 var(--cell-padding-inline);
  overflow: hidden;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scanner-table-shell > table > thead > tr > th {
  position: sticky;
  z-index: 4;
  top: 0;
  height: 45px;
  background:
    linear-gradient(180deg, rgba(13, 20, 31, 0.98), rgba(8, 13, 20, 0.98));
  color: rgba(164, 180, 193, 0.94);
  font-size: 11px;
  font-weight: 650;
}

.scanner-table-shell > table > thead > tr > th::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: rgba(92, 112, 130, 0.2);
  content: "";
}

.scanner-row {
  background:
    linear-gradient(
      90deg,
      rgba(17, 25, 34, 0.24),
      rgba(7, 13, 19, 0.25) 46%,
      rgba(4, 9, 14, 0.23)
    );
  transition:
    background 120ms ease,
    box-shadow 120ms ease;
}

.scanner-row--striped {
  background:
    linear-gradient(
      90deg,
      rgba(19, 28, 38, 0.28),
      rgba(8, 15, 22, 0.27) 46%,
      rgba(4, 9, 14, 0.24)
    );
}

.scanner-row:hover,
.scanner-row:focus-visible {
  outline: none;
  background:
    linear-gradient(
      90deg,
      rgba(128, 165, 235, 0.20),
      rgba(13, 17, 25, 0.32) 48%,
      rgba(5, 10, 15, 0.28)
    );
  box-shadow: inset 3px 0 var(--accent-primary-border);
}

.scanner-row:focus {
  background:
    linear-gradient(90deg, rgba(128, 165, 235, 0.20), rgba(13, 17, 25, 0.38));
  box-shadow: inset 3px 0 var(--accent-primary);
}

.venue-cell {
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.venue-badge {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.venue-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  object-fit: contain;
}

.symbol-cell {
  color: #d2e1e4;
  font-family: var(--font-data);
  font-size: 12px;
  white-space: nowrap;
}

.symbol-cell__content {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.symbol-cell__symbol {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-cell {
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.stock-name-content {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  vertical-align: middle;
}

.market-badge {
  display: inline-flex;
  min-width: 0;
  height: 17px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 5px;
  border: 1px solid #38515b;
  border-radius: 3px;
  background: #15242a;
  color: #9fb2b8;
  font-family: var(--font-data);
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
}

.market-badge--nasdaq {
  border-color: rgba(46, 224, 241, 0.65);
  background: rgba(46, 224, 241, 0.1);
  color: var(--cyan);
}

.market-badge--tse {
  border-color: rgba(244, 91, 230, 0.7);
  background: rgba(244, 91, 230, 0.12);
  color: #ff79ef;
}

.market-badge--nyse {
  border-color: rgba(255, 169, 77, 0.68);
  background: rgba(255, 169, 77, 0.1);
  color: #ffb567;
}

.market-badge--hkex {
  border-color: rgba(172, 127, 255, 0.68);
  background: rgba(172, 127, 255, 0.11);
  color: #c7a7ff;
}

.number-cell {
  color: rgba(230, 237, 242, 0.9);
  font-family: var(--font-data);
  font-size: 12px;
}

.gap-cell {
  border-bottom-color: rgba(148, 163, 184, 0.22);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
}

.gap-cell--green {
  box-shadow: inset 3px 0 var(--green);
  background: var(--green-soft);
  color: var(--green);
  text-shadow: 0 0 12px rgba(25, 229, 143, 0.24);
}

.gap-cell--red {
  box-shadow: inset 3px 0 var(--red);
  background: var(--red-soft);
  color: var(--red);
  text-shadow: 0 0 12px rgba(255, 77, 95, 0.22);
}

.gap-cell--neutral {
  color: var(--muted);
}

.history-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(126, 145, 164, 0.34);
  border-radius: 5px;
  background: rgba(12, 20, 29, 0.9);
  color: #d4dee2;
  font: 650 16px/1 var(--font-ui);
  letter-spacing: 0.04em;
  cursor: pointer;
}

.history-dialog-close:hover,
.history-dialog-close:focus-visible {
  border-color: var(--accent-primary-border);
  color: var(--accent-primary);
}

/* Layout and states for the V2 table. */
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--accent-primary); outline-offset: 2px; }
.page-shell {
  display: flex;
  flex-direction: column;
  width: min(1680px, calc(100% - clamp(28px, 9.6vw, 124px)));
  height: 100dvh;
  padding: 9px 0 16px;
}
.page-shell > :not(.scanner-table-shell) { flex-shrink: 0; }
.scanner-hero {
  /* The legacy logo track was 250px plus 64px reserved before the metrics. */
  --brand-track: clamp(205px, 17.4vw, 314px);
  --hero-height: clamp(123px, 8.4vw, 144px);
  display: grid;
  grid-template: "brand listings session splashes" var(--hero-height) /
    var(--brand-track) minmax(224px, .75fr) minmax(160px, .91fr) minmax(176px, .91fr);
  gap: 12px;
  align-items: stretch;
}
.brand-stage { grid-area: brand; position: relative; min-width: 0; margin: 0; }
.worksxxx-brand-image {
  left: -6px;
  right: auto;
  width: min(79.62%, 250px);
  transform: scale(1.28);
  transform-origin: left center;
}
.stock-listings-card { grid-area: listings; min-height: 0; }
.stock-listings-header {
  display: flex; flex: none; align-items: center; justify-content: space-between;
  gap: 5px; min-height: 28px; padding-bottom: 4px; border-bottom: 1px solid var(--line);
}
.stock-listings-header h2 { margin: 0; white-space: nowrap; }
.listings-history-button {
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px;
  background: #101923; color: #b7c8ec; font: 700 9px var(--font-ui); white-space: nowrap; cursor: pointer;
}
.listings-history-button:hover, .listings-history-button:focus-visible { border-color: var(--accent-primary-border); }
.listings-feed:empty { display: none; }
.listing-row { display: flex; align-items: center; gap: 3px; min-width: 0; border-bottom: 1px solid var(--line); }
.listing-open {
  display: grid; flex: 1; grid-template-columns: minmax(48px, .75fr) minmax(48px, .64fr) minmax(0, 1fr);
  gap: 7px; align-items: center; min-width: 0; min-height: 26px; padding: 2px 3px; border: 0; border-radius: 4px;
  background: transparent; color: var(--text); font: 700 10px var(--font-ui); text-align: left; cursor: pointer;
}
.listing-open:not(:disabled):hover, .listing-open:focus-visible { background: #172230; }
.listing-open:disabled { color: var(--muted); cursor: default; }
.listing-time { color: #a7b6c0; font: 600 10px var(--font-data); white-space: nowrap; }
.listing-open .venue-badge { gap: 4px; white-space: nowrap; }
.listing-open .venue-icon { width: 14px; height: 14px; }
.listing-symbol { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-row .contract-copy { margin-inline: 0 2px; }
.listings-modal {
  width: min(660px, calc(100vw - 32px)); max-height: min(720px, calc(100dvh - 40px));
  padding: 0; border: 1px solid rgba(150, 170, 200, .3); border-radius: 14px;
  background: linear-gradient(135deg, #121b2a, #080d15); color: var(--text); box-shadow: 0 28px 80px #000b;
}
.listings-modal[open] { display: flex; flex-direction: column; }
.listings-modal::backdrop { background: #050810a3; backdrop-filter: blur(4px); }
.listings-modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.listings-modal-header h2 { margin: 0; font-size: clamp(12px, 2.4vw, 17px); }
.listings-modal-state { margin: 10px 16px 0; color: #a7b6c0; font-size: 11px; }
.listings-modal-content { overflow: auto; padding: 8px 16px 16px; scrollbar-width: thin; }
.listings-modal-content .listing-open { min-height: 34px; font-size: 11px; }
.splash-history-modal {
  --splash-columns: minmax(112px, 1.15fr) minmax(54px, .7fr) minmax(72px, 1fr) minmax(62px, .7fr) minmax(78px, .8fr) minmax(85px, 1fr) minmax(85px, 1fr);
  width: min(880px, calc(100vw - 32px));
  height: min(660px, calc(100dvh - 40px));
}
.splash-history-controls {
  display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 125px); gap: 8px; padding: 10px 16px;
}
.splash-history-controls .control :is(input, select) { height: 32px; }
.splash-history-modal .listings-modal-state { margin: 0 16px 8px; }
.splash-history-columns {
  display: grid; grid-template-columns: var(--splash-columns); gap: 8px;
  margin: 0 16px; padding: 5px 37px 6px 5px; border-bottom: 1px solid var(--line);
  color: #a7b6c0; font-size: 10px; white-space: nowrap;
}
.splash-history-columns > :nth-last-child(-n+2) { text-align: right; }
.splash-history-content { flex: 1; min-height: 0; overflow-anchor: none; padding-top: 0; }
.splash-history-row { gap: 7px; }
.splash-history-row .contract-copy { flex-basis: 24px; width: 24px; height: 24px; }
.splash-history-content .splash-history-open {
  grid-template-columns: var(--splash-columns); min-height: 38px; gap: 8px; padding: 4px 5px;
}
.splash-history-open time, .splash-history-motion, .splash-history-price { font: 600 10px var(--font-data); }
.splash-history-motion { color: var(--green); white-space: nowrap; }
.splash-history-open.stock-splash-event--down .splash-history-motion { color: var(--red); }
.splash-history-prices { display: contents; }
.splash-history-price { text-align: right; white-space: nowrap; }
.splash-history-price.is-unavailable { color: var(--muted); }
.market-session-card {
  grid-area: session;
  min-width: 0;
  padding: 9px 11px 7px;
  border: 1px solid rgba(150, 170, 200, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 85% 18%, rgba(135, 160, 190, 0.075), transparent 42%),
    linear-gradient(135deg, rgba(18, 24, 36, 0.8), rgba(5, 8, 14, 0.68));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(150, 170, 200, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.043);
  backdrop-filter: blur(16px);
}
.market-session-card h2 { margin: 0; text-transform: uppercase; }
/* Session colors, legend and clock from the legacy Scanner. */
.session-heading strong {
  display: block; margin-top: 2px; overflow: hidden; color: var(--violet); font-size: 16px;
  font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap;
}
.market-session-card[data-session="PREMARKET"] strong { color: var(--orange); }
.market-session-card[data-session="MAIN"] strong { color: var(--cyan); }
.market-session-card[data-session="POSTMARKET"] strong { color: var(--pink); }
.market-session-card:is([data-session="WEEKEND"], [data-session="HOLIDAY"], [data-session="CLOSED"], [data-session="UNKNOWN"]) strong { color: var(--muted); }
#session-note {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  margin: 3px 0 0; overflow: hidden; color: #a7b6c0; font-size: 10px; line-height: 1.3;
}
.session-time-row {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 2px 10px; margin: 4px 0 3px; padding-top: 4px; border-top: 1px solid var(--line);
  color: #a7b6c0; font-size: 10px; line-height: 1.25;
}
.session-time-row span { font-weight: 600; }
.session-time-row time { color: #c9d8dc; font-variant-numeric: tabular-nums; white-space: nowrap; }
.session-legend { display: flex; justify-content: space-between; gap: 4px; margin: 5px 0 4px; }
.session-legend span {
  position: relative; min-width: 0; padding-left: 9px; overflow: hidden;
  color: #a7b6c0; font-size: 9px; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap;
}
.session-legend span::before {
  position: absolute; top: 50%; left: 0; width: 5px; height: 5px; border-radius: 50%;
  background: var(--phase-color); content: ""; transform: translateY(-50%);
}
.session-legend span.is-active { color: var(--text); }
.session-legend [data-session-key="NIGHT"], .session-segment--night { --phase-color: var(--violet); }
.session-legend [data-session-key="PREMARKET"], .session-segment--premarket { --phase-color: var(--orange); }
.session-legend [data-session-key="MAIN"], .session-segment--main { --phase-color: var(--cyan); }
.session-legend [data-session-key="POSTMARKET"], .session-segment--postmarket { --phase-color: var(--pink); }
.session-track { position: relative; display: flex; height: 7px; border-radius: 4px; background: #111a1f; }
.session-segment { height: 100%; color: var(--phase-color); background: currentColor; opacity: .43; }
.session-segment + .session-segment { border-left: 1px solid rgba(255,255,255,.72); }
.session-segment.is-active { opacity: 1; box-shadow: 0 0 12px currentColor; }
.session-segment--night { border-radius: 4px 0 0 4px; }
.session-segment--postmarket { border-radius: 0 4px 4px 0; }
.session-marker {
  position: absolute; top: 50%; width: 3px; height: 14px; border: 1px solid #fff; border-radius: 2px;
  background: #fff; box-shadow: 0 0 9px rgba(255,255,255,.72); transform: translate(-50%,-50%);
}
.session-scale { position: relative; height: 15px; color: #a7b6c0; font-size: 9px; font-variant-numeric: tabular-nums; }
.session-scale span { position: absolute; top: 6px; left: var(--tick-at); transform: translateX(-50%); line-height: 1; white-space: nowrap; }
.session-scale span::before { position: absolute; top: -6px; left: 50%; width: 1px; height: 4px; background: #82949b; content: ""; }
.session-scale .session-scale__start, .session-scale .session-scale__end { transform: none; }
.session-scale .session-scale__end { left: auto; right: 0; }
.session-scale .session-scale__start::before { left: 0; }
.session-scale .session-scale__end::before { left: auto; right: 0; }
.stock-splashes-card { min-height: 0; container: stock-splashes / inline-size; }
.stock-splashes-header h2 { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.splash-source-label, #splash-mode { color: var(--muted); font-size: 9px; font-weight: 600; white-space: nowrap; }
.splash-history-button { height: 24px; }
@container stock-splashes (width < 255px) {
  .stock-splashes-header { grid-template-columns: minmax(0, 1fr) auto 24px; gap: 4px; }
  .splash-source-label { display: none; }
  .splash-history-button { padding-inline: 4px; font-size: 8px; }
}
.stock-splash-event__primary { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.stock-splash-event__secondary { font-size: 9px; }
.exchange-selector-band { grid-template-columns: minmax(210px, 260px) auto minmax(110px, 8%) minmax(0, 1fr); }
.venue-pill {
  display: inline-flex; height: 45px; align-items: center; justify-content: center; padding: 5px;
  border: 1px solid var(--accent-primary-border); border-radius: 7px;
  background: linear-gradient(135deg, rgba(51, 72, 107, .37), rgba(8, 14, 22, .82));
  color: #b7c8ec; font-size: 11px; font-weight: 700; cursor: pointer;
}
.venue-buttons { display: flex; min-width: 0; gap: 8px; }
.venue-buttons .venue-pill { flex: 1 0 72px; }
.venue-pill[aria-pressed="false"] { background: #0c131d; border-color: var(--line); }
.venue-pill .venue-icon { transform: translateX(-8px); }
.watchlist-filter {
  height: 45px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px;
  background: #0c131d; color: var(--text); font: 700 10px var(--font-ui); white-space: nowrap; cursor: pointer;
}
.watchlist-filter > span:first-child, .watchlist-star { color: #eab759; }
.watchlist-filter[aria-pressed="true"] { background: #1d273b; border-color: var(--accent-primary-border); }
.watchlist-filter:disabled, .watchlist-star:disabled { opacity: .48; cursor: default; }
.venue-pill-label { position: relative; padding-bottom: 11px; }
.venue-coverage {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  color: #a7b6c0; font-size: 9px; font-weight: 600; line-height: 10px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
#count { margin-left: auto; padding: 0 8px; color: var(--muted); font: 11px var(--font-data); }
.scanner-controls-tail { justify-self: end; display: flex; align-items: center; gap: 4px; min-width: 0; }
.account-menu { position: relative; }
.account-trigger {
  display: flex; align-items: center; gap: 6px; max-width: 145px; min-height: 28px;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: #101923; color: #b7c8db; font-size: 11px; font-weight: 650; cursor: pointer;
  list-style: none;
}
.account-trigger::-webkit-details-marker { display: none; }
.account-trigger:hover, .account-menu[open] .account-trigger, .account-menu-panel > button:hover {
  border-color: var(--accent-primary-border); background: #172230;
}
#account-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-icon { position: relative; display: block; flex: 0 0 12px; height: 12px; }
.account-icon::before, .account-icon::after { position: absolute; content: ''; border: 1px solid currentColor; }
.account-icon::before { top: 0; left: 3px; width: 4px; height: 4px; border-radius: 50%; }
.account-icon::after { inset: 6px 0 0; border-radius: 7px 7px 3px 3px; }
.account-menu-panel {
  position: absolute; z-index: 1; inset: calc(100% + 6px) 0 auto auto; width: 176px;
  padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: #101923;
  box-shadow: 0 8px 26px #000b; font-size: 11px;
}
.account-menu-panel > strong { display: block; padding: 5px 7px 7px; overflow-wrap: anywhere; }
.account-menu-panel > button {
  display: block; width: 100%; padding: 6px; border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: #b7c8db; text-align: start; cursor: pointer;
}
.account-menu-panel > .auth-status { margin: 4px 6px; }
.account-menu-panel > .auth-status:empty { display: none; }
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: min(390px, 100%); padding: 22px clamp(18px, 4vw, 36px) 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(135deg, #121b2af7, #080d15f7); box-shadow: 0 24px 70px #000a;
}
.auth-brand { display: block; width: min(280px, 100%); margin: 0 auto 6px; }
.auth-card h1 { margin: 6px 0 20px; font-size: 17px; text-align: center; }
.auth-form { display: grid; gap: 12px; }
.auth-form .control span { color: #b7c8db; font-size: 11px; font-weight: 650; }
.auth-form .control input { height: 40px; font-size: 14px; }
.auth-primary {
  min-height: 38px; margin-top: 3px; border: 1px solid var(--accent-primary-border); border-radius: 6px;
  background: #1c2b43; color: #e2edff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.auth-primary:hover { background: #243a5a; }
.auth-primary:disabled, .account-menu-panel > button:disabled { opacity: .6; cursor: wait; }
.auth-status { min-height: 1.4em; margin: 0; color: #d7bca6; font-size: 11px; }
@media (max-width: 540px) {
  .account-trigger { padding-inline: 5px; }
  #account-name, .scanner-controls-tail:has(.account-menu:not([hidden])) > #count { display: none; }
}
.scanner-table-shell { --scanner-row-height: 35px; flex: 1 1 0; margin-top: 10px; height: auto; min-height: 320px; max-height: none; }
.scanner-table-shell > table { min-width: 780px; }
.venue-col { width: 11%; }
.ticker-col { width: 17%; }
.price-col { width: 14%; }
.funding-col { width: 13%; }
.gap-col { width: 15%; }
.scanner-table-shell > table > thead > tr > th { height: 33px; }
.scanner-table-shell > table > :is(thead, tbody) > tr > :is(th, td):nth-child(n + 4) { text-align: right; }
.scanner-table-shell > table > thead > tr > th small { color: var(--muted); font-size: 9px; }
.scanner-row > td > small { display: block; color: var(--muted); font: 9px var(--font-ui); }
.scanner-row > td > small.warning { color: #dfab6d; }
.gap-subscription {
  padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.stock-short-name { overflow: hidden; text-overflow: ellipsis; }
.contract-copy, .watchlist-star, .tradingview-open-button {
  display: inline-grid; place-items: center; vertical-align: middle; flex: none;
  width: 17px; height: 17px; padding: 0; border: 1px solid transparent; border-radius: 4px;
  background: transparent; font: 700 13px/1 var(--font-ui); cursor: pointer;
}
.contract-copy { position: relative; margin-inline-start: 4px; color: var(--muted); }
.contract-copy svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.3; }
.watchlist-star svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.watchlist-star[aria-pressed="true"] svg { fill: currentColor; }
.contract-copy[data-feedback] svg { visibility: hidden; }
.contract-copy[data-feedback]::after { position: absolute; inset: 0; display: grid; place-items: center; content: '✓'; color: #70efd0; }
.contract-copy[data-feedback="error"]::after { content: '!'; color: #f58790; }
.tradingview-open-button { border-color: #324652; color: #a3bcc9; font-size: 11px; text-decoration: none; }
.contract-copy:hover, .watchlist-star:hover, .tradingview-open-button:hover { border-color: var(--accent-primary-border); background: #172230; }
.funding-sort { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.funding-sort span { color: var(--muted); }
.funding-cell { font: 700 11px var(--font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.funding-cell, .scanner-row > .funding-cell > small { color: var(--funding-tone, var(--muted)); }
.funding-cell--favorable, .funding-tone--favorable { --funding-tone: #43dfbc; }
.funding-cell--unfavorable, .funding-tone--unfavorable { --funding-tone: #dcab78; }
.funding-cell--imminent, .funding-tone--imminent { --funding-tone: #ff8291; }
.funding-rate { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: help; }
.funding-rate:disabled { cursor: inherit; }
.funding-rate:focus-visible { outline: 1px solid var(--accent-primary); outline-offset: 3px; border-radius: 2px; }
.scanner-row > .funding-cell > small { font-family: var(--font-data); }
.funding-tooltip {
  position: fixed; z-index: 101; width: max-content; max-width: min(310px, calc(100vw - 16px));
  padding: 8px 10px; border: 1px solid #546377; border-inline-start: 3px solid var(--funding-tone, var(--muted));
  border-radius: 7px; background: #080e17f5; box-shadow: 0 12px 28px #000b;
  color: var(--text); font: 500 11px/1.45 var(--font-ui); text-align: left;
}
.funding-tooltip > strong { color: var(--funding-tone, var(--text)); }
.funding-tooltip > span { display: block; color: #b3c3cf; }
.funding-tooltip > :nth-child(2) { margin-top: 4px; }
.market-badge { height: 16px; }
.gap-subscription { text-decoration: underline dotted; text-underline-offset: 3px; }
.gap-market-data { color: #edbe83; }
.unavailable { color: var(--muted); }
.empty { margin: 0; padding: 20px; color: var(--muted); font-size: 12px; text-align: center; }
.scanner-footer > :last-child { grid-column: 2; justify-self: center; }
#status { color: var(--muted); }
.gap-help {
  position: fixed; z-index: 100; width: max-content; max-width: calc(100vw - 16px); padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 7px; background: #101923; box-shadow: 0 8px 26px #000b;
  color: var(--text); font-size: 11px; text-align: left;
}
.gap-help > :not([hidden]) { display: block; }
.gap-help > span { color: var(--muted); margin-top: 3px; }
.gap-help > a { color: var(--accent-primary); margin-top: 7px; }
@media (max-width: 1359px) {
  .market-session-card { padding-block: 7px 5px; }
  #session-note { -webkit-line-clamp: 1; }
  .session-time-row { gap: 1px 6px; margin: 3px 0; padding-top: 3px; font-size: 9px; line-height: 1.2; }
  .session-legend { margin: 4px 0 3px; }
}
@media (max-width: 940px) {
  .page-shell { width: calc(100% - 24px); }
  .scanner-hero { --brand-track: 184px; }
  .session-heading strong { font-size: 13px; line-height: 1.15; }
  .session-time-row { font-size: 8px; line-height: 1.2; }
  .session-legend span { font-size: 8px; }
  .session-scale { font-size: 8px; }
  .session-scale span:nth-last-child(3), .session-scale__late-end { transform: translateX(-100%); }
  .session-scale span:nth-last-child(3)::before, .session-scale__late-end::before { left: auto; right: 0; }
}
@media (max-width: 899px) {
  .page-shell { height: auto; min-height: 100dvh; }
  .scanner-hero { grid-template: "brand listings" 102px "session splashes" 100px / minmax(0,1fr) minmax(0,1fr); }
  .stock-listings-card { width: min(250px, 100%); justify-self: end; }
  .worksxxx-brand-image { left: 0; width: 100%; transform: none; translate: none; }
  .exchange-selector-band { grid-template-columns: minmax(0, 1fr) auto minmax(72px, auto) auto; }
  .venue-pill .venue-icon { transform: translateX(-3px); }
  .market-session-card { padding-block: 4px 3px; }
  .session-heading strong { margin-top: 1px; font-size: 12px; }
  #session-note { font-size: 8px; }
  .session-time-row { gap: 1px 5px; margin: 2px 0; padding-top: 2px; }
  .session-legend { margin: 2px 0; }
  .session-scale { height: 11px; }
  .session-scale span { top: 5px; }
  .scanner-table-shell { flex: none; height: 64dvh; }
}
@media (max-width: 730px) {
  .splash-history-columns { display: none; }
  .splash-history-content .splash-history-open {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr) minmax(0, .9fr);
    grid-template-areas: "time time motion" "venue ticker source" "prices prices prices";
    gap: 4px 6px;
  }
  .splash-history-open .listing-time { grid-area: time; }
  .splash-history-open .venue-badge { grid-area: venue; }
  .splash-history-open .listing-symbol { grid-area: ticker; }
  .splash-history-open .splash-history-motion { grid-area: motion; text-align: right; }
  .splash-history-source { grid-area: source; text-align: right; }
  .splash-history-prices { grid-area: prices; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; }
  .splash-history-tv::before { content: "TW "; }
  .splash-history-exchange::before { content: "Биржа "; }
}
@media (max-width: 520px) {
  .scanner-hero { grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); }
  .stock-listings-card { padding-inline: 6px; }
  .stock-listings-header h2, .listings-history-button { font-size: 8px; }
  .listing-open { grid-template-columns: minmax(43px, .75fr) minmax(41px, .64fr) minmax(0, 1fr); gap: 3px; }
  .listings-feed .listing-time { font-size: 8px; }
  .market-session-card { padding: 4px 6px; }
  .market-session-card h2 { font-size: 8px; }
  .session-heading strong { font-size: 12px; }
  #session-note, .session-time-row, .session-legend span { font-size: 7px; }
  .session-time-row { display: grid; gap: 1px; }
  .session-context-prefix { display: none; }
  .session-legend { margin-top: 2px; }
  .session-scale { font-size: 6px; }
  .session-scale .session-scale__end { font-size: 0; }
  .exchange-selector-band { gap: 7px; padding: 8px; }
  .watchlist-filter { padding-inline: 5px; font-size: 8px; }
  .scanner-table-shell { height: 60dvh; }
}
