:root {
  --canvas: #f5f6fa;
  --paper: #fff;
  --text: #191733;
  --muted: #5b5972;
  --edge: #dedfeb;
  --purple: #4933b9;
  --gain: #126144;
  --loss: #a8274d;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--purple); text-underline-offset: .2em; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; }
.shell { width: min(100% - 56px, 1336px); margin-inline: auto; }
.masthead { background: var(--paper); border-bottom: 1px solid var(--edge); }
.topbar { display: flex; align-items: center; gap: 30px; min-height: 73px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .27em; color: var(--text); font-size: 1.14rem; letter-spacing: -.055em; text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; margin-right: .47em; border-radius: 9px; font-weight: 800; color: white; background: var(--purple); }
.topbar nav { display: flex; gap: 25px; margin-right: auto; }
.topbar nav a { color: var(--muted); font-size: .92rem; text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }
.button { display: inline-block; white-space: nowrap; padding: .53rem .8rem; border: 1px solid transparent; border-radius: 8px; font-weight: 650; font-size: .875rem; text-decoration: none; cursor: pointer; }
.outline, .subtle { border-color: var(--edge); background: var(--paper); color: var(--text); }
.outline:hover, .subtle:hover { background: #edeaf9; }
.button:disabled { opacity: .5; cursor: default; }
.intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 14px; padding: 32px 0 20px; }
.intro h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.072em; line-height: 1.05; }
.intro p, .section-title p { margin: .5rem 0 0; color: var(--muted); }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 650; font-size: .875rem; }
.index-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.index-card { display: grid; align-content: start; padding: 17px 20px; background: #201a43; color: #fff; border-radius: 13px; min-width: 0; }
.index-card header { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 5px; }
.index-card h2 { color: #fff; font-size: 1rem; margin: 0; letter-spacing: -.018em; }
.index-card header p, .index-card footer { color: #d4cdec; font-size: .84rem; margin: 0; }
.index-quote { margin: .45rem 0 .35rem; display: flex; flex-wrap: wrap; gap: .4rem .7rem; align-items: center; font-variant-numeric: tabular-nums; }
.index-quote strong { font-size: clamp(1.45rem, 2.3vw, 2.05rem); letter-spacing: -.04em; }
.index-quote span { font-size: .9rem; font-weight: 680; }
.index-quote .positive { color: #88edbd; }
.index-quote .negative { color: #ff9dbb; }
.index-card canvas { width: 100%; height: 34px; margin: .1rem 0 .4rem; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 28px 0 10px; }
.section-title h2, .directory h2 { margin: 0; letter-spacing: -.035em; font-size: 1.45rem; }
.section-title p { font-size: .9rem; }
.mode { color: var(--text); border: 1px solid var(--edge); border-radius: 99px; font-weight: 680; white-space: nowrap; padding: .35rem .75rem; font-size: .84rem; background: var(--paper); }
.mode[data-live="true"] { background: #e1f5ea; color: var(--gain); border-color: #acd9c4; }
.status { font-size: .875rem; color: var(--muted); margin: 0 0 14px; }
.status a { margin-left: .35rem; }
.rankings { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 15px; }
.board { background: var(--paper); border: 1px solid var(--edge); border-radius: 13px; overflow: hidden; }
.board header { min-height: 71px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 13px 17px; border-bottom: 1px solid var(--edge); }
.board header h3 { font-size: 1.15rem; margin: 0; letter-spacing: -.024em; }
.board header p { font-size: .84rem; margin: 4px 0 0; color: var(--muted); }
.board header>span { color: var(--muted); font-size: .84rem; }
.gain { border-top: 3px solid #2c9b76; }
.loss { border-top: 3px solid #c9547a; }
.table-space { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; text-align: right; font-size: .88rem; }
th { font-size: .78rem; font-weight: 680; color: var(--muted); background: #f9f8fd; }
th, td { padding: .65rem .6rem; white-space: nowrap; }
th:first-child, td:first-child { color: var(--muted); text-align: center; padding-left: .9rem; }
th:nth-child(2), td:nth-child(2) { text-align: left; width: 100%; }
th:last-child, td:last-child { padding-right: .95rem; }
.column-sort { display: inline-flex; align-items: center; justify-content: end; gap: .35rem; min-height: 36px; padding: .25rem .35rem; margin: -.25rem -.35rem; color: inherit; font: inherit; background: none; border: 0; border-radius: 5px; cursor: pointer; }
.column-sort:hover, th[aria-sort] .column-sort { color: var(--purple); }
.sort-arrow { min-width: 1em; font-size: .95rem; text-align: center; }
tbody tr+tr { border-top: 1px solid #ededf4; }
tbody tr:hover { background: #faf9fe; }
.symbol { font-weight: 750; display: block; }
.company { display: block; max-width: 29ch; white-space: normal; line-height: 1.25; margin-top: 3px; color: var(--muted); font-size: .76rem; }
.change { font-weight: 700; }
.positive { color: var(--gain); }
.negative { color: var(--loss); }
.empty { padding: 20px 17px; color: var(--muted); font-size: .875rem; }
.directory { margin-top: 20px; }
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; }
.search input, .setup-panel input { border: 1px solid #bdbed4; border-radius: 8px; padding: .53rem .7rem; color: var(--text); background: white; }
.pagination { padding: 11px 16px; display: flex; align-items: center; justify-content: end; gap: 10px; border-top: 1px solid var(--edge); font-size: .85rem; color: var(--muted); }
.site-footer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; padding: 25px 0; color: var(--muted); font-size: .83rem; }
.site-footer a+a { margin-left: .7rem; }
.setup-wrap { max-width: 625px; margin: 42px auto; }
.setup-panel { padding: 26px; }
.setup-panel h1 { margin: 0; font-size: 2rem; letter-spacing: -.055em; }
.setup-panel p { line-height: 1.5; color: var(--muted); }
.setup-panel form { display: grid; gap: .65rem; }
.setup-panel input { width: 100%; }
.setup-panel label { margin-top: .3rem; font-weight: 620; }
.primary { justify-self: start; border: 0; border-radius: 8px; padding: .68rem 1rem; margin-top: .35rem; background: var(--purple); color: white; cursor: pointer; font-weight: 650; }
.status[data-tone="complete"] { color: var(--gain); }
@media (max-width: 840px) {
  .rankings { grid-template-columns: 1fr; }
  .index-card { padding: 13px; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 26px); }
  .topbar { min-height: 62px; gap: 7px; }
  .topbar nav { display: none; }
  .index-grid { grid-template-columns: 1fr; gap: 8px; }
  .index-card { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; }
  .index-card header { display: block; }
  .index-card header p { margin-top: 2px; }
  .index-card canvas, .index-card footer { grid-column: 1 / -1; }
  .index-quote { justify-content: end; }
  .clock { font-size: .8rem; }
  .board header { padding-inline: 12px; }
  .section-title { align-items: start; }
  th, td { padding-inline: .45rem; }
  .search, .search input { width: 100%; }
  .pagination { justify-content: space-between; }
}

.market-indices .index-card { min-height: 88px; gap: .35rem; align-content: center; text-decoration: none; }
.market-indices .index-card:hover { background: #332861; }
.market-indices .index-card span { color: #d4cdec; font-size: .85rem; }
.market-heading { flex-wrap: wrap; margin-bottom: 14px; }
.exchange-links, .market-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.market-controls { padding: 12px; border-bottom: 1px solid var(--edge); }
.market-controls button[aria-pressed="true"] { color: var(--purple); background: #eee9ff; border-color: #c9baf7; }
.public-screener iframe { display: block; width: 100%; height: 470px; border: 0; }
.widget-credit { margin: 0; padding: 10px 14px; border-top: 1px solid var(--edge); color: var(--muted); font-size: .82rem; }
@media (max-width: 560px) {
  .market-indices .index-card { grid-template-columns: 1fr; min-height: 58px; }
  .public-screener iframe { height: 430px; }
}
