/* One skin, four pages.
 *
 * The pages are standalone HTML with no template step, so each carried its own
 * copy of the token block below -- the same fifteen colours written out four
 * times, which drifted the moment one page grew a shade the others did not.
 * A <link> is allowed from a file:// URL for the same reason a <script src> is,
 * so the tokens live here and the pages keep only what is genuinely theirs.
 *
 * Everything here is a default. A page's own <style> block is parsed after this
 * file and wins on a tie, and nav.js and call.js inject theirs later still.
 */
:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --ink: #17181a;
  --muted: #6b7076;
  --line: #e2e2de;
  --accent: #1f6feb;
  --bull: #0f7b41;
  --bull-bg: #e6f4ec;
  --bear: #ba2d2d;
  --bear-bg: #fbeaea;
  --flat: #6b7076;
  --flat-bg: #eeeeeb;
  --quote: #f2f2ef;
  /* Chart-only, but defined here with the rest: a colour that exists on one
     page and nowhere else is exactly what this file is for. */
  --price: #4a4f55;
  --grid: #ececE8;
  --band: rgba(31, 111, 235, 0.09);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416;
    --panel: #1b1d20;
    --ink: #e9e9e6;
    --muted: #9aa0a6;
    --line: #2c2f33;
    --accent: #5b9dff;
    --bull: #55d68d;
    --bull-bg: #16301f;
    --bear: #ff8080;
    --bear-bg: #331a1a;
    --flat: #9aa0a6;
    --flat-bg: #26292d;
    --quote: #16181b;
    --price: #b7bcc2;
    --grid: #24272b;
    --band: rgba(91, 157, 255, 0.14);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* The column. Pages that wrap everything in one .wrap and pages that centre a
   header and a main separately both land on the same measure. */
.wrap, header, main { max-width: 1100px; margin: 0 auto; }
.wrap { padding: 0 20px; }
header { padding: 28px 20px 18px; }
main { padding: 18px 20px 60px; }

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
.sub { color: var(--muted); font-size: 13px; }
h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); margin: 26px 0 10px; font-weight: 600;
}
a { color: var(--accent); }

/* The filter row, sticky under the nav bar. --navh is set by nav.js; the
   fallback keeps this honest on a page that has not loaded it yet. */
.toolbar {
  position: sticky; top: var(--navh, 0px); z-index: 10;
  background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 20px;
}
.toolbar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
input[type=search], select {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; max-width: 100%;
}
input[type=search] { flex: 1 1 220px; min-width: 160px; }
select { max-width: 260px; }
input[type=search]:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button.reset {
  font: inherit; color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 11px; cursor: pointer;
}
button.reset:hover { color: var(--ink); border-color: var(--muted); }

/* A grid of name chips -- symbols on the home page, speakers on both it and
   the speaker index. */
.grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.chip {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; color: var(--ink);
}
.chip:hover { border-color: var(--accent); }
.chip .name { font-weight: 600; }
.chip .name.sym {
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.chip .of { font-size: 12px; color: var(--muted); text-align: right; }

.count { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.count b { color: var(--ink); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* Chunked lists end in this rather than loading two thousand cards at once. */
.more {
  display: block; width: 100%; margin-top: 8px; padding: 11px;
  font: inherit; color: var(--accent); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}

/* Phone: the filters go on one sideways-scrolling row rather than wrapping
   onto two lines and pushing the content down. */
@media (max-width: 700px) {
  .toolbar { padding: 6px 10px; }
  .toolbar-inner { flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .toolbar-inner::-webkit-scrollbar { display: none; }
  .toolbar-inner > * { flex: 0 0 auto; }
  .toolbar select, .toolbar button { font-size: 12.5px; padding: 6px 8px; }
  main { padding: 10px 10px 28px; }
  .wrap { padding: 0 12px; }
  h2 { margin: 16px 0 8px; }
  .count { margin-bottom: 9px; font-size: 12.5px; }
}
