/* Tickergent. Green and red carry the meaning, always together with an arrow and a word. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #14181f;
  --muted: #5b6470;
  --border: #e5e8ec;
  --field: #f1f3f6;
  --ink: #14181f;
  --on-ink: #ffffff;

  --up: #12803f;          /* solid green, white text on it: 5:1 */
  --up-bg: #e9f7ef;
  --up-bd: #9fd6b5;
  --up-text: #0b6130;
  --up-pill: #d3f0de;

  --down: #c4262e;        /* solid red, white text on it: 5.6:1 */
  --down-bg: #fdecec;
  --down-bd: #f0aaaa;
  --down-text: #9d1c23;
  --down-pill: #fbdada;

  --mix: #4b5563;
  --mix-bg: #f1f2f4;
  --mix-bd: #d3d7dd;
  --badge: #eef2ff;
  --badge-text: #3730a3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #171b21;
    --text: #e8ebf0;
    --muted: #a0aab8;
    --border: #2a303a;
    --field: #1d232b;
    --ink: #e8ebf0;
    --on-ink: #0f1216;

    --up-bg: #0f2c1b;
    --up-bd: #1f6a3d;
    --up-text: #5be08d;
    --up-pill: #123a22;

    --down-bg: #331618;
    --down-bd: #7d2a2e;
    --down-text: #ff8b84;
    --down-pill: #461c1f;

    --mix: #5d6877;
    --mix-bg: #1d222a;
    --mix-bd: #333b47;
    --badge: #23264a;
    --badge-text: #c7d2fe;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; line-height: 1.15; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }
.error { color: var(--down-text); margin: 8px 0; }

/* ---- top bar ---------------------------------------------------------- */
.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; }
.mark { display: inline-flex; gap: 3px; }
.mark i { width: 10px; height: 22px; border-radius: 4px; background: var(--up); }
.mark i + i { background: var(--down); margin-top: 6px; }
.back { margin-left: auto; color: var(--muted); font-size: 0.9375rem; }
.back:hover { color: var(--text); }

.search {
  position: relative; flex: 1 1 320px; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--field); border-radius: 14px; padding: 0 16px; min-height: 48px; color: var(--muted);
}
.search input {
  flex: 1; min-height: 44px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 0.9375rem; outline: none;
}
.search:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; }
.results:empty { display: none; }
.hits {
  list-style: none; margin: 0; padding: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.hit {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px;
  padding: 8px 16px; border: 0; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.hit:hover, .hit:focus-visible { background: var(--field); }
.hit .name { color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit .add { font-size: 0.875rem; font-weight: 700; }
.msg { margin: 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }

/* ---- dashboard -------------------------------------------------------- */
.page-title { font-size: 1.75rem; margin: 32px 0 8px; }
.lede { margin: 0 0 20px; color: var(--muted); max-width: 640px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin: 20px 0 32px; }

.tile {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  min-height: 220px; padding: 20px; border-radius: 18px;
  background: var(--surface); border: 1.5px solid var(--border);
}
.tile.up { background: var(--up-bg); border-color: var(--up-bd); }
.tile.down { background: var(--down-bg); border-color: var(--down-bd); }
.tile.mix { background: var(--mix-bg); border-color: var(--mix-bd); }
.tile .tk { font-size: 1.875rem; font-weight: 700; line-height: 1.1; }
.tile .nm { font-size: 0.875rem; color: var(--muted); margin-top: 2px; }
.tile .line { margin: 0; flex-grow: 1; line-height: 1.4; }
.tile-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8125rem; color: var(--muted); }
.more { font-weight: 700; color: var(--text); }
.more::after { content: ""; position: absolute; inset: 0; border-radius: 18px; } /* whole tile is the link */
.tile:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10); }
.tile .x {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px;
  border: 0; background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; border-radius: 12px;
}
.tile .x:hover { color: var(--text); background: rgba(127, 127, 127, 0.15); }
.tile.add {
  order: 9999; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  background: transparent; border: 2px dashed var(--border); color: var(--muted); font: inherit;
}
.tile.add:hover { color: var(--text); border-color: var(--muted); box-shadow: none; }
.plus { font-size: 2rem; line-height: 1; }
.small { font-size: 0.8125rem; margin: 0; }

.state {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 6px 12px; border-radius: 999px; background: var(--mix); color: #fff;
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.up > .state, .up .state { background: var(--up); }
.down > .state, .down .state { background: var(--down); }
.none > .state, .none .state { background: var(--mix); }
.none { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 10px; border-radius: 8px; font-size: 0.8125rem; font-weight: 500;
  background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(0, 0, 0, 0.08); color: var(--muted);
}
.chip.g { color: var(--up-text); }
.chip.r { color: var(--down-text); }
@media (prefers-color-scheme: dark) { .chip { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.12); } }

/* ---- deep dive -------------------------------------------------------- */
.hero { background: var(--mix-bg); border-bottom: 1px solid var(--mix-bd); }
.hero.up { background: var(--up-bg); border-color: var(--up-bd); }
.hero.down { background: var(--down-bg); border-color: var(--down-bd); }
.hero-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 28px; padding-bottom: 28px; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero-tk { font-size: 2.75rem; }
.hero-sub { margin: 8px 0 0; color: var(--muted); }
.btn {
  min-height: 44px; padding: 10px 18px; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--on-ink);
}
.keep { background: var(--surface); color: var(--text); border-color: var(--border); display: inline-flex; align-items: center; }
.keep.done, .keep:disabled { color: var(--muted); cursor: default; }

.deep { display: flex; flex-direction: column; gap: 20px; padding-top: 28px; padding-bottom: 12px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.panel h2 { font-size: 1.25rem; margin-bottom: 10px; }
.lede-sm { margin: 0 0 14px; font-size: 1.0625rem; }
.small-top { margin: -4px 0 16px; font-size: 0.8125rem; }
.soon { border-style: dashed; }
.soon p { margin: 0; }

.bw { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.bw > div { border-radius: 14px; padding: 16px; }
.bw ul { margin: 0; padding-left: 18px; line-height: 1.55; }
.bw p { margin: 0; }
.bw-h { font-weight: 700; margin-bottom: 8px; }
.better { background: var(--up-bg); }
.better .bw-h { color: var(--up-text); }
.worse { background: var(--down-bg); }
.worse .bw-h { color: var(--down-text); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 22px; }
.charts figure { margin: 0; }
.charts figcaption { font-size: 0.8125rem; font-weight: 700; margin-bottom: 8px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; border-bottom: 1.5px solid var(--border); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bar-val { font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.bar-fill { width: 100%; border-radius: 6px 6px 0 0; background: var(--mix); }
.bar-fill.g { background: var(--up); }
.bar-fill.r { background: var(--down); }
.bar-axis { display: flex; gap: 10px; margin-top: 6px; font-size: 0.75rem; color: var(--muted); }
.bar-axis span { flex: 1; text-align: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 0.9375rem; }
th { text-align: left; color: var(--muted); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 8px 10px; }
td { padding: 14px 10px; border-top: 1px solid var(--border); vertical-align: top; }
td small { display: block; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.pill.pos { background: var(--up-pill); color: var(--up-text); }
.pill.neg { background: var(--down-pill); color: var(--down-text); }
.badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--badge); color: var(--badge-text); font-size: 0.6875rem; }
.note { margin: 0; }

.foot { padding-top: 12px; padding-bottom: 40px; color: var(--muted); font-size: 0.8125rem; }
.foot p { margin: 0; max-width: 760px; }

@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .bar { padding: 12px 16px; }
  .hero-tk { font-size: 2.25rem; }
}
