/* TapeBlitz design tokens — the single source of colour, radius and type.
 *
 * Every page loads this and uses ONLY these variables. A hex literal anywhere
 * else is a bug: it is how the old dashboard ended up with three different
 * greens and a cyan that belonged to no palette.
 *
 * Numbers, tickers and contracts are monospace; prose is sans. That is not
 * decoration — a column of right-aligned monospace figures is scannable and a
 * column of proportional ones is not.
 */
:root{
  --bg:#101216; --surface:#171b21; --surface-2:#14171c; --surface-3:#232830;
  --border:#262b33; --border-strong:#2f353e;
  --text:#e8e6e1; --text-2:#a3a9b1; --text-3:#8a9098; --text-4:#6f767f;
  --accent:#e8b04b; --accent-hover:#f5cd7f; --on-accent:#141413;
  --pos:#5cc28e; --pos-fill:#2f7a55; --pos-badge-bg:#1c3a2b; --pos-badge-fg:#7fd8a8;
  --neg:#e8894a; --neg-badge-bg:#3a2218; --neg-badge-fg:#f0a57a;
  --warn-badge-bg:#3a2e14; --warn-badge-fg:#f0c56a; --warn-text:#e8cf96;
  --info:#4f8fe0; --info-fg:#8fbcf5;
  --chart-ma10:#e86aa0; --chart-ma21:#5fd0e0; --chart-ma50:#4f8fe0;
  --chart-ma200:#e8c84b; --chart-rs:#9b8cf0; --chart-spy:#6f767f;
  --chart-up:#5cc28e; --chart-down:#e8894a;
  --radius:10px; --radius-sm:6px;
  --font-sans:'IBM Plex Sans',system-ui,sans-serif;
  --font-mono:'IBM Plex Mono',ui-monospace,monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.mono { font-family: var(--font-mono); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }

/* ---- nav ---------------------------------------------------------------- */
#hdr {
  position: sticky; top: 0; z-index: 100; background: var(--bg);
  border-bottom: 1px solid var(--border); padding: 0 20px; min-height: 56px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
#logo {
  font-family: var(--font-mono); font-weight: 600; font-size: 16px;
  letter-spacing: .08em; color: var(--accent); text-decoration: none;
}
#hdr nav { display: flex; gap: 4px; align-items: center; }
#hdr nav a {
  padding: 10px 16px; border-radius: var(--radius-sm); color: var(--text-2);
  font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap;
  min-height: 44px; display: flex; align-items: center;
}
#hdr nav a:hover { color: var(--text); background: var(--surface); }
#hdr nav a.on { background: var(--surface-3); color: var(--text); font-weight: 600; }
#asof { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); }

/* ---- search ------------------------------------------------------------- */
#searchWrap { position: relative; flex-grow: 1; max-width: 340px; }
#search {
  width: 100%; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-sans); font-size: 13px;
}
#search::placeholder { color: var(--text-4); }
#search:focus { outline: none; border-color: var(--accent); }
#searchOut {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 4px; z-index: 300; max-height: 320px;
  overflow-y: auto;
}
#searchOut.on { display: block; }
#searchOut a {
  display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px;
  color: var(--text); border-radius: var(--radius-sm); font-size: 13px; min-height: 40px;
  align-items: center;
}
#searchOut a:hover, #searchOut a.sel { background: var(--surface-3); color: var(--accent); }
#searchOut .sym { font-family: var(--font-mono); font-weight: 600; }
#searchOut .nm { color: var(--text-3); font-size: 12px; overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; }

/* ---- shared furniture --------------------------------------------------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 20px 40px; }
.card { background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 18px 20px; }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 600; }

.badge { font-size: 12px; font-weight: 600; padding: 4px 10px;
         border-radius: var(--radius-sm); white-space: nowrap; }
.badge.good { background: var(--pos-badge-bg); color: var(--pos-badge-fg); }
.badge.bad  { background: var(--neg-badge-bg); color: var(--neg-badge-fg); }
.badge.warn { background: var(--warn-badge-bg); color: var(--warn-badge-fg); }
.badge.info { background: rgba(79,143,224,.16); color: var(--info-fg); }

.tag { font-size: 10px; font-weight: 600; padding: 2px 6px;
       border-radius: 4px; border: 1px solid var(--border-strong);
       color: var(--text-3); letter-spacing: .04em; }
.dirtag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px;
          border: 1px solid var(--pos); color: var(--pos); }
.dirtag.PUT { border-color: var(--neg); color: var(--neg); }

button, .btn {
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 14px; cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
button.primary, .btn.primary {
  border: 0; background: var(--accent); color: var(--on-accent); font-weight: 600;
}
button.primary:hover { background: var(--accent-hover); color: var(--on-accent); }

.toggle { display: flex; padding: 3px; background: var(--surface);
          border: 1px solid var(--border); border-radius: var(--radius-sm); }
.toggle button {
  min-height: 36px; padding: 0 14px; border: 0; background: transparent;
  color: var(--text-2); font-size: 13px; border-radius: var(--radius-sm);
}
.toggle button.on { background: var(--surface-3); color: var(--text); font-weight: 600; }

@media (max-width: 768px) {
  #hdr { padding: 10px 14px; gap: 12px; }
  #hdr nav { width: 100%; order: 4; overflow-x: auto; }
  #searchWrap { max-width: none; order: 3; width: 100%; }
  .wrap { padding: 18px 14px 32px; }
  h1 { font-size: 21px; }
}
