:root {
  color-scheme: dark;
  --bg: #0c0f14;
  --bg-2: #12171f;
  --card: #151b24;
  --card-2: #1a222d;
  --border: #232c38;
  --text: #e8eef5;
  --muted: #8c9bad;
  --brand: #4ade80;
  --brand-dim: #1f7a45;
  --blue: #3b82f6;
  --red: #ef4444;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #16202c 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: #9ec5ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: rgba(18, 23, 31, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
header .brand {
  font-weight: 800; font-size: 18px; letter-spacing: .2px;
  display: flex; align-items: center; gap: 8px;
}
header .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
header nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
header nav .who { color: var(--muted); }

main { max-width: 1120px; margin: 32px auto 64px; padding: 0 20px; }
h1 { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 24px; font-size: 15px; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
h3 { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 22px 0 10px; }
.section-note { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}

/* stat tiles */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat {
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
}
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.stat .value.brand { color: var(--brand); }

/* badges */
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge.on { background: rgba(74, 222, 128, .13); color: var(--brand); }
.badge.off { background: rgba(239, 68, 68, .14); color: #fca5a5; }
.badge.neutral { background: rgba(140, 155, 173, .14); color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th { background: var(--card-2); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
tbody tr:last-child td { border-bottom: none; }
.empty { color: var(--muted); padding: 26px; text-align: center; font-size: 14px; }
tr.ev-deleted td { color: #f87171; }
tr.ev-deleted td.mono { color: #fca5a5; }

/* Discord-like chat log */
.chat { display: flex; flex-direction: column; gap: 2px; padding: 8px; background: #0b0e13; border: 1px solid var(--border); border-radius: 12px; max-height: 680px; overflow-y: auto; }
.msg { display: flex; gap: 12px; padding: 7px 10px; border-radius: 8px; }
.msg:hover { background: rgba(255, 255, 255, .02); }
.msg .avatar { width: 38px; height: 38px; border-radius: 50%; background: #3b3f6b; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.msg .avatar.bot { background: #4ade80; color: #06210f; }
.msg .body { min-width: 0; }
.msg .head { display: flex; align-items: baseline; gap: 8px; }
.msg .author { font-weight: 600; color: #c9d4e0; }
.msg .author.bot { color: #4ade80; }
.msg .time { font-size: 11px; color: var(--muted); }
.msg .content { color: #dfe6ee; white-space: pre-wrap; word-break: break-word; }
.msg .content a { color: #9ec5ff; }
.msg .content .mention { background: rgba(88, 101, 242, .25); color: #c7ccf7; border-radius: 4px; padding: 0 3px; }
.msg.input .content { color: #9fb0c0; }
.sys { text-align: center; color: var(--muted); font-size: 12px; padding: 5px; }
.sys.deleted { color: #f87171; }

/* forms */
input, button, select {
  font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: #0e131a; color: var(--text); outline: none;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
input::placeholder { color: #5c6b7c; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
button { background: var(--blue); border-color: var(--blue); cursor: pointer; font-weight: 600; transition: filter .15s; }
button:hover { filter: brightness(1.08); }
button.danger { background: var(--red); border-color: var(--red); }
button.ghost { background: transparent; color: var(--text); }
button.ghost:hover { background: rgba(255, 255, 255, .05); }
form.inline { display: inline; }
.grid-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.muted { color: var(--muted); }
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* login */
.login {
  max-width: 440px; margin: 14vh auto; text-align: center; padding: 0 20px;
}
.login .logo { font-size: 40px; }
.login h1 { font-size: 30px; margin-top: 10px; }
.login p { color: var(--muted); margin: 10px 0 26px; }
.login a.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; background: #5865F2; color: #fff; border-radius: 12px;
  font-weight: 700; box-shadow: 0 8px 20px rgba(88, 101, 242, .35);
}
.login a.btn:hover { text-decoration: none; filter: brightness(1.06); }
.login .fineprint { font-size: 12.5px; margin-top: 22px; }

@media (max-width: 620px) {
  header { padding: 14px 16px; }
  main { padding: 0 14px; }
  h1 { font-size: 23px; }
}
