:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --border: #2a2e38;
  --text: #e6e8eb;
  --muted: #8a90a0;
  --accent: #6aa9ff;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

nav.top {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
nav.top .brand { font-weight: 600; margin-right: 1rem; }
nav.top a { color: var(--accent); text-decoration: none; }
nav.top a:hover { text-decoration: underline; }
nav.top button.link {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
}

section.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 4rem;
}

h1 { font-weight: 600; }
h2 { margin-top: 0; }

button.primary {
  background: var(--accent);
  color: #0a0e14;
  border: 0;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }
button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }

table.reports {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}
table.reports th, table.reports td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
table.reports th {
  background: #22262f;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.reports tr:last-child td { border-bottom: 0; }
table.reports td.mono { font-family: ui-monospace, monospace; font-size: 0.85rem; color: var(--muted); }
table.reports a { color: var(--accent); }

pre.json {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 4px;
  overflow: auto;
  max-height: 70vh;
  font-size: 0.85rem;
}

.detail-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.detail-summary .field { display: flex; gap: 1rem; padding: 0.25rem 0; border-bottom: 1px solid var(--border); }
.detail-summary .field:last-child { border-bottom: 0; }
.detail-summary .field .label { width: 9rem; color: var(--muted); font-size: 0.85rem; }
.detail-summary .field .value { font-family: ui-monospace, monospace; font-size: 0.85rem; word-break: break-all; }

.ban-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
}
.ban-form h3 { margin: 0 0 0.5rem; }
.ban-form label { display: block; margin-bottom: 0.5rem; color: var(--muted); font-size: 0.85rem; }
.ban-form textarea, .ban-form input[type="text"], .ban-form select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem;
  margin-top: 0.25rem;
  font: inherit;
}
.ban-form .row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.ban-form .row input[type="text"] { width: auto; flex: 1 1 12rem; }
.ban-form .status { color: var(--muted); font-size: 0.85rem; }

button.danger {
  background: var(--danger);
  color: #fff;
  border: 0;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
button.danger:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: default; }

.muted { color: var(--muted); font-size: 0.85rem; }

details { margin-top: 1rem; }
details summary { cursor: pointer; color: var(--muted); padding: 0.25rem 0; }

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.chat-bubble {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  max-width: 90%;
}
.chat-bubble .chat-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.chat-bubble .chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-reporter { border-color: var(--accent); align-self: flex-start; }
.chat-reported { border-color: var(--danger); align-self: flex-end; background: #2a1212; }
.chat-other { opacity: 0.75; align-self: flex-start; }

pre.error {
  background: #2a1212;
  border: 1px solid var(--danger);
  padding: 1rem;
  border-radius: 4px;
  color: var(--danger);
  white-space: pre-wrap;
}
