:root {
  --bg: #080d16;
  --bg-soft: #0d1421;
  --panel: #111a2a;
  --panel-2: #162134;
  --line: #1f2c42;
  --line-soft: #182437;
  --text: #e9effb;
  --muted: #8397b6;
  --up: #21d99b;
  --down: #ff5a76;
  --neutral: #91a3c1;
  --accent: #6aa8ff;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(58, 122, 255, 0.16), transparent 60%),
    radial-gradient(900px 480px at 92% 0%, rgba(33, 217, 155, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 20px 40px;
}

/* ------------------------------------------------------------ top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(33, 217, 155, 0.2), rgba(106, 168, 255, 0.18));
  border: 1px solid rgba(106, 168, 255, 0.28);
  color: var(--up);
}

.logo svg {
  width: 21px;
  height: 21px;
}

h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.status {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(17, 26, 42, 0.85);
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 550;
  white-space: nowrap;
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neutral);
}

.pill.open {
  color: #b6f7e1;
  border-color: rgba(33, 217, 155, 0.34);
  background: rgba(33, 217, 155, 0.09);
}

.pill.open .dot {
  background: var(--up);
  animation: pulse 2s infinite;
}

.pill.closed,
.pill.error {
  color: #ffd6dd;
  border-color: rgba(255, 90, 118, 0.3);
  background: rgba(255, 90, 118, 0.08);
}

.pill.closed .dot,
.pill.error .dot {
  background: var(--down);
}

.updated {
  font-size: 12.5px;
  color: var(--muted);
}

.updated time {
  font-family: var(--mono);
  color: #b7c7e3;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(33, 217, 155, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(33, 217, 155, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(33, 217, 155, 0);
  }
}

/* ------------------------------------------------------------ summary */

.summary {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  min-height: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--muted);
}

.chip strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chip.up strong {
  color: var(--up);
}

.chip.down strong {
  color: var(--down);
}

.chip.warn {
  border-color: rgba(255, 190, 90, 0.3);
  color: #ffd79a;
}

.chip.warn strong {
  color: #ffd79a;
}

/* ------------------------------------------------------------ controls */

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.search {
  position: relative;
  flex: 1 1 320px;
  min-width: 240px;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 10px 14px 10px 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}

.search input::placeholder {
  color: #6d7f9d;
}

.search input:focus {
  border-color: rgba(106, 168, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(106, 168, 255, 0.12);
}

.filters {
  display: inline-flex;
  padding: 4px;
  gap: 3px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.filter {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.filter:hover {
  color: var(--text);
}

.filter[aria-pressed="true"] {
  background: rgba(106, 168, 255, 0.16);
  color: #cfe2ff;
  box-shadow: inset 0 0 0 1px rgba(106, 168, 255, 0.32);
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.sort select {
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 9px;
  cursor: pointer;
}

/* ------------------------------------------------------------ table */

.table-wrap {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 33, 52, 0.75), rgba(13, 20, 33, 0.9));
  overflow: hidden;
}

table.quotes {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8fa3c2;
  background: #101a2b;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th.num,
td.num {
  text-align: right;
}

.col-num {
  width: 46px;
  color: #6d7f9d;
}

tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

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

tbody tr:hover td {
  background: rgba(106, 168, 255, 0.055);
}

td.col-num {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #63769a;
}

.sym-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sym {
  font-weight: 650;
  letter-spacing: 0.015em;
  font-size: 13px;
}

.exch {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1px solid rgba(125, 143, 171, 0.35);
  color: #8fa3c0;
}

.exch.bse {
  color: #e8b44c;
  border-color: rgba(232, 180, 76, 0.4);
}

.company {
  display: block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
}

td.price {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
}

td.price.flash-up {
  animation: flashUp 1s ease-out;
}

td.price.flash-down {
  animation: flashDown 1s ease-out;
}

@keyframes flashUp {
  0% {
    color: var(--up);
    background: rgba(33, 217, 155, 0.16);
  }
  100% {
    color: var(--text);
    background: transparent;
  }
}

@keyframes flashDown {
  0% {
    color: var(--down);
    background: rgba(255, 90, 118, 0.16);
  }
  100% {
    color: var(--text);
    background: transparent;
  }
}

td.chg,
td.pct {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
}

td.up {
  color: var(--up);
}

td.down {
  color: var(--down);
}

td.flat {
  color: var(--neutral);
}

td.range,
td.vol {
  font-family: var(--mono);
  font-size: 12px;
  color: #a9bad5;
}

td.na {
  color: #566a8c;
}

tr.missing td {
  color: #6b7d9c;
}

.missing-note {
  font-size: 11px;
  color: #7d8fab;
  font-style: italic;
  white-space: normal;
}

.loading,
.empty {
  padding: 26px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------ misc */

.showing {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tbody tr[hidden] {
  display: none;
}

.page-foot {
  margin-top: 20px;
  font-size: 11.5px;
  color: #64769a;
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .shell {
    padding: 18px 12px 30px;
  }
  .hide-sm,
  .hide-md {
    display: none;
  }
  .company {
    max-width: 190px;
  }
  .controls {
    gap: 9px;
  }
  .filters {
    width: 100%;
    justify-content: space-between;
  }
  .sort {
    width: 100%;
  }
  .sort select {
    flex: 1;
  }
}
