:root {
  --bg: #0e1116;
  --panel: #161b22;
  --border: #262c36;
  --text: #d8dee6;
  --muted: #7d8792;
  --ok: #3fb950;
  --bad: #f85149;
  --accent: #388bfd;
}
* { box-sizing: border-box; }
/* Author `display` rules (.gate/.btn) beat the UA [hidden]{display:none}, so the
   hidden attribute wouldn't hide them. Force it — else the gate never hides. */
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* auth gate */
.gate { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.gate-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 40px; text-align: center; }
.gate-card h1 { margin: 0 0 12px; }

/* header */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--panel);
}
header h1 { font-size: 16px; margin: 0; }
.header-right { display: flex; align-items: center; gap: 10px; }

main { padding: 20px; max-width: 1100px; margin: 0 auto; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.kv { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
td.k { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: normal; }
td.v { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; text-align: right; white-space: nowrap; padding-left: 20px; }
td.k .doc { color: var(--muted); font-size: 11px; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; margin-top: 3px; max-width: 640px; }

/* grouped, collapsible config domains */
.grp { border-top: 1px solid var(--border); }
.grp > summary { cursor: pointer; padding: 9px 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text); list-style-position: inside; }
.grp > summary:hover { color: var(--accent); }
.grp[open] > summary { color: var(--accent); }
.grp > table { margin: 0 0 6px 14px; }

/* live watchlist — scanner hits */
table.watch th { text-align: left; padding: 6px 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
table.watch td { font-size: 12.5px; }
td.w-time { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
td.w-sym { font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
td.w-px { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; white-space: nowrap; }
td.w-reason { color: var(--muted); }
.empty { padding: 4px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border); white-space: nowrap; }
.tag.sc-hod { color: #d29922; border-color: #6b4f14; }
.tag.sc-cont { color: var(--accent); border-color: #1f4d80; }
.tag.sc-comp { color: #a371f7; border-color: #4a2f7a; }
.tag.sc-run { color: var(--ok); border-color: #245b2c; }

input[type="search"] {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 6px 10px; min-width: 220px; font-size: 13px;
}

.btn { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 13px; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--muted); }

.pill { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.muted { color: var(--muted); }
