:root {
  --bg: #0b0d12; --panel: #13161e; --panel2: #191d27; --line: #252a37; --text: #e8eaf0; --muted: #8b93a7;
  --accent: #7c5cff; --good: #2fd08a; --bad: #ff5d6c; --warn: #f5b84a; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
h1 span { color: var(--accent); }
h2 { font-size: 13px; margin: 0; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; margin: 0 0 10px; }
.err { color: var(--bad); font-size: 12px; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }
.warn { color: var(--warn); font-size: 12px; margin: 8px 0 0; }

input, textarea, button { font: inherit; color: inherit; }
input, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
button { background: var(--accent); border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
button:hover { filter: brightness(1.12); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
button.small { padding: 4px 10px; font-size: 12px; }

.login { max-width: 340px; margin: 18vh auto 0; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 10px; }
.login h1 { margin-bottom: 10px; }
.login label { font-size: 12px; color: var(--muted); }

header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(11,13,18,.92); backdrop-filter: blur(8px); z-index: 5; }
.head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); display: inline-block; }
.dot.up { background: var(--good); box-shadow: 0 0 0 4px rgba(47,208,138,.15); }
.mode { background: var(--panel2); border: 1px solid var(--line); color: var(--warn); letter-spacing: .06em; font-size: 12px; }
.mode.live { background: var(--bad); border-color: var(--bad); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding: 16px 20px 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.tile .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tile .v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .s { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.tile .s code { font-family: var(--mono); font-size: 11px; cursor: pointer; }

main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px 20px 40px; align-items: start; }
.col { display: grid; gap: 16px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }

.tweets { display: grid; gap: 10px; max-height: 760px; overflow-y: auto; }
.tweet { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; border-left: 3px solid var(--line); }
.tweet.launched { border-left-color: var(--good); }
.tweet.error { border-left-color: var(--bad); }
.tweet.held { border-left-color: var(--warn); }
.tweet.judging, .tweet.launching { border-left-color: var(--accent); }
.tweet-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tweet-top b { color: var(--text); font-size: 14px; }
.tweet-text { margin: 6px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.quoted { border-left: 2px solid var(--line); padding-left: 8px; margin: 0 0 8px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.verdict { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.chip { border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--muted); white-space: nowrap; }
.chip.good { background: rgba(47,208,138,.15); color: var(--good); }
.chip.bad { background: rgba(255,93,108,.15); color: var(--bad); }
.chip.warn { background: rgba(245,184,74,.15); color: var(--warn); }
.chip.accent { background: rgba(124,92,255,.18); color: #b3a2ff; }
.coin { font-family: var(--mono); font-weight: 600; }
.reason { color: var(--muted); font-size: 13px; margin-top: 6px; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td code { font-family: var(--mono); font-size: 12px; }

.watchlist { list-style: none; margin: 12px 0 0; padding: 0; max-height: 330px; overflow-y: auto; }
.watchlist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.watchlist li:last-child { border-bottom: 0; }
.watchlist .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watchlist input[type=checkbox] { width: auto; }
.watchlist .off { opacity: .45; }
.x { background: transparent; color: var(--muted); padding: 2px 8px; font-size: 16px; line-height: 1; }
.x:hover { color: var(--bad); }

.settings { display: grid; gap: 10px; }
.settings label { display: grid; grid-template-columns: 1fr 110px; align-items: center; gap: 10px; font-size: 13px; }
.settings label small { color: var(--muted); }
.settings label.check { display: flex; gap: 8px; }
.settings label.check input { width: auto; }
#testForm { display: grid; gap: 8px; }
.log { margin: 0; font: 11px/1.5 var(--mono); color: var(--muted); max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 980px) {
  main { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .tiles { padding: 16px 16px 0; }
  header { padding: 12px 16px; }
}
.photo { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); margin: 0 0 8px; }
.icon { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; border: 1px solid var(--line); }
td.up { color: var(--good); }
td.down { color: var(--bad); }
button.link { background: none; padding: 0; color: #b3a2ff; font-weight: 500; font-size: 12px; text-decoration: underline; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.wd { display: grid; gap: 8px; }
.wd label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.wd h2 { margin-bottom: 4px; }
.wd-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ok { color: var(--good); font-size: 12px; margin: 6px 0 0; overflow-wrap: anywhere; }
.ok:empty { display: none; }
a.coin { color: #b3a2ff; }
.ca { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; cursor: pointer; }
