:root {
  --bg: #0b0e13; --panel: #11151b; --raised: #1a2230; --line: #232a34; --line-soft: #1c232d; --line-strong: #3a4656;
  --text: #d7dde5; --muted: #8b96a5; --accent: #5b9cff; --up: #3fc5a8; --down: #f0764f; --warn: #ffa285;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Present for screen readers, invisible on screen. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--bg); font-weight: 600; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 8px; color: var(--bg); }
#main:focus { outline: none; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; }
a { color: #8fb8ff; } a:hover { color: #c2d8ff; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #8fb8ff; outline-offset: 2px; }
h1, h2, p { margin: 0; }
.boot { padding: 40px 20px; color: var(--muted); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); } .up { color: var(--up); } .down { color: var(--down); }
.small { font-size: 12px; }

/* header and menu */
.header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.header-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.menu { position: relative; }
.menu-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; color: var(--text); background: transparent; border: 1px solid #2c3541; border-radius: 8px; }
.menu-btn[aria-expanded="true"] { background: var(--raised); }
.menu-list { position: absolute; top: 52px; right: 0; z-index: 20; min-width: 190px; padding: 6px; display: flex; flex-direction: column; background: #171c24; border: 1px solid #2c3541; border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.menu-list a, .menu-list button { display: flex; align-items: center; min-height: 44px; padding: 0 14px; text-decoration: none; font-weight: 500; color: var(--text); background: transparent; border: 0; border-radius: 6px; text-align: left; }
.menu-list a:hover, .menu-list button:hover { background: var(--raised); color: var(--text); }
.menu-list .who { padding: 8px 14px 6px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.banner { padding: 8px 20px; background: #3a2a12; color: #ffd9a0; font-size: 13px; }
.stale { padding: 8px 12px; border-radius: 8px; background: #3a2a12; color: #ffd9a0; font-size: 13px; }

/* building blocks */
.page { max-width: 1180px; margin: 0 auto; padding: 24px 16px; display: flex; flex-direction: column; gap: 18px; }
.page h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.lede { color: var(--muted); max-width: 720px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.title2 { font-size: 16px; font-weight: 600; }
.btn { min-height: 44px; padding: 0 14px; color: var(--text); background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; font-weight: 500; }
.btn:hover { background: var(--raised); }
.btn-primary { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: #7db1ff; }
.btn-danger { color: var(--warn); border-color: #6b3a2c; }
.btn[aria-pressed="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.input { height: 44px; padding: 0 12px; color: var(--text); background: var(--bg); border: 1px solid #2c3541; border-radius: 8px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--text); background: var(--raised); }
.badge-accent { color: var(--bg); background: var(--accent); }
.badge-up { color: var(--bg); background: var(--up); }
.badge-down { color: var(--bg); background: var(--down); }
.note { font-size: 12px; color: var(--muted); }
.error { color: var(--warn); }
table { width: 100%; border-collapse: collapse; }
th { font-weight: 500; text-align: left; }
thead th { color: var(--muted); font-size: 12px; padding: 6px 8px; }
tbody td, tbody th { padding: 8px; border-top: 1px solid var(--line-soft); }
.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.scroll-x { overflow-x: auto; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-family: var(--mono); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line-soft); padding: 9px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: 90vw; padding: 10px 16px; background: #171c24; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }

/* dashboard */
.dash { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding: 16px 20px; max-width: 1680px; margin: 0 auto; }
.dash-watch { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; }
.dash-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.dash-side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.add-form { display: flex; gap: 8px; }
.add-form .input { flex: 1 1 auto; width: 0; }
.watch-rows { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-row { flex: 1 1 150px; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.watch-row.on { border-color: var(--accent); background: var(--raised); }
.watch-pick { flex: 1 1 auto; min-width: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 60px; padding: 8px 10px; text-align: left; color: var(--text); background: transparent; border: 0; }
.watch-x { flex: 0 0 36px; color: var(--muted); background: transparent; border: 0; border-left: 1px solid var(--line); font-size: 16px; }
.watch-x:hover { color: var(--warn); }
.sym-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sym-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; display: inline; }
.price { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.pills { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.pill { min-width: 44px; min-height: 44px; padding: 0 10px; font-weight: 600; color: var(--text); background: transparent; border: 0; border-radius: 7px; }
.pill[aria-pressed="true"] { color: var(--bg); background: var(--accent); }
.chart-card { padding: 0; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.chip { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 7px; }
.chip[aria-pressed="true"] { color: var(--text); background: var(--raised); border-color: var(--line-strong); }
.swatch { display: inline-block; width: 10px; height: 3px; border-radius: 2px; background: #4a5566; }
.chart-wrap { position: relative; }
.chart { height: 640px; }
.legend { position: absolute; top: 8px; left: 12px; right: 76px; z-index: 5; pointer-events: none; display: flex; flex-wrap: wrap; gap: 3px 12px; font-family: var(--mono); font-size: 12px; }
.legend span.item { background: rgba(17, 21, 27, .85); padding: 1px 4px; border-radius: 4px; }
.legend .full { flex: 1 1 100%; }
.osc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.rating-grid { display: flex; flex-wrap: wrap; gap: 20px 32px; }
.rating-grid > div { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rating-word { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.checks li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.checks .mark { flex: 0 0 44px; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.checks .what { flex: 1 1 200px; }
.checks .detail { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.level { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.level .name { flex: 0 0 92px; font-weight: 500; }
.level .val { flex: 1 1 auto; font-family: var(--mono); }
.tf-btn { min-width: 44px; min-height: 40px; padding: 0 8px; font-weight: 600; color: var(--text); background: transparent; border: 1px solid #2c3541; border-radius: 7px; }
.tf-btn[aria-pressed="true"] { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* alerts, screener, admin, sign-in */
.split { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.split > * { min-width: 0; }
.form-card { flex: 1 1 400px; display: flex; flex-direction: column; gap: 18px; padding: 18px; }
.side-col { flex: 1.2 1 420px; display: flex; flex-direction: column; gap: 20px; }
.option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 6px 12px; text-align: left; color: var(--text); background: transparent; border: 1px solid #2c3541; border-radius: 8px; }
.option[aria-pressed="true"] { background: var(--raised); border-color: var(--accent); }
.alert-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.alert-row .what { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.rowlink { cursor: pointer; } .rowlink:hover { background: var(--raised); }
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.signin-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; padding: 28px 24px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
.block { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; }

@media (max-width: 640px) {
  .dash { padding: 12px; }
  .chart { height: 520px; }
  .header { padding: 10px 12px; }
}
