:root {
  --bg: #0b1020; --surface: #141b33; --raise: #1b2445; --line: #26305a;
  --fg: #eef1fb; --muted: #9aa4c2; --accent: #ffd400; --accent-ink: #0b1020;
  --blue: #3d6bff; --good: #3ddc84; --warn: #ffb547; --bad: #ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
main, header, footer { max-width: 760px; margin: 0 auto; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 8px; letter-spacing: .08em; }
.bolt { color: var(--accent); font-size: 1.3rem; }
h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.15; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--bad); margin: 0; }
.error:empty { display: none; }
button, .secondary, .primary { font: inherit; cursor: pointer; border-radius: 10px; }
.primary { width: 100%; padding: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.secondary { display: inline-block; padding: 10px 14px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 600; }
.ghost { background: none; border: 1px solid var(--line); color: var(--muted); padding: 6px 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
input { font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }

.tabs { display: flex; gap: 4px; background: var(--surface); padding: 4px; border-radius: 12px; margin: 16px 0; }
.tabs button { flex: 1; border: 0; padding: 9px 6px; background: none; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--raise); color: var(--fg); }

.beta { background: var(--raise); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 8px; font-size: .9rem; }
.filters { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--line); background: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: .88rem; }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }

.cards, .watch { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.card h2 { font-size: 1rem; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.card .meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .8rem; color: var(--muted); }
.card .desc { grid-column: 1 / -1; margin: 4px 0 0; white-space: pre-line; font-size: .92rem; color: #d5dbef; overflow-wrap: anywhere; }
.card .fields { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.card .fields li { background: var(--raise); border-radius: 6px; padding: 2px 8px; font-size: .8rem; }
.card img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--raise); }
.card .open { grid-column: 1 / -1; justify-self: start; margin-top: 8px; padding: 8px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 8px; text-decoration: none; }
.badge { border-radius: 4px; padding: 0 6px; font-weight: 700; font-size: .72rem; letter-spacing: .04em; }
.badge.lead { background: #3a2f0b; color: var(--warn); }
.badge.cat { background: var(--raise); color: var(--fg); }

.watch li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.watch .name { overflow-wrap: anywhere; }
.watch a { color: var(--fg); }
.pill { flex: none; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.pill.in { background: #123a26; color: var(--good); }
.pill.out { background: var(--raise); color: var(--muted); }

.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 1.6rem; }
.status ul { grid-column: 1 / -1; margin: 0; padding-left: 1.2em; color: var(--muted); }

.join { margin: 28px 0 8px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.join p { margin: 0; }
footer { padding: 24px 0 40px; }
[hidden] { display: none !important; }
