* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #0f1117;
  color: #e4e4e7;
  line-height: 1.5;
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

h1 { font-size: 1.5rem; font-weight: 600; }

.header-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.header-check {
  font-size: 0.8rem;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.hint {
  font-size: 0.85rem;
  color: #a1a1aa;
  margin: -0.75rem 0 1.25rem;
}

input, button {
  font: inherit;
  border-radius: 6px;
  border: 1px solid #3f3f46;
  padding: 0.4rem 0.75rem;
  background: #18181b;
  color: inherit;
}

button { cursor: pointer; }
button:hover { background: #27272a; }

.btn-primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.btn-primary:hover { background: #2563eb; }

.tester {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.tester h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #fafafa;
}

.tester textarea {
  width: 100%;
  resize: vertical;
  min-height: 4rem;
  margin-bottom: 0.75rem;
  font: inherit;
  border-radius: 6px;
  border: 1px solid #3f3f46;
  padding: 0.6rem 0.75rem;
  background: #0f1117;
  color: inherit;
}

.tester-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tester-save {
  font-size: 0.85rem;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.test-result {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #27272a;
}

.test-result.hidden { display: none; }

.test-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #27272a;
}
.test-item:last-child { border-bottom: none; }

.test-item-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.test-item-nick {
  color: #93c5fd;
  font-weight: 600;
}

.test-item-text {
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.test-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #3f3f46;
}

.test-summary h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #a1a1aa;
}

.test-result .verdict {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.test-result .verdict.ok { color: #22c55e; }
.test-result .verdict.bad { color: #ef4444; }

.test-scores {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.score-row {
  display: grid;
  grid-template-columns: 110px 1fr 48px;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.score-bar {
  height: 8px;
  background: #27272a;
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.2s;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 1rem;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fafafa;
}

.stat-card .label {
  font-size: 0.8rem;
  color: #a1a1aa;
  margin-top: 0.25rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.filters label { font-size: 0.85rem; color: #a1a1aa; }

.tabs { margin-left: auto; display: flex; gap: 0.25rem; }

.tab {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}
.tab.active {
  background: #3f3f46;
  border-color: #52525b;
}

.msg {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.msg.toxic { border-left: 3px solid #ef4444; }
.msg.ok { border-left: 3px solid #22c55e; }
.msg.labeled { opacity: 0.85; }

.msg-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: #a1a1aa;
}

.msg-text { font-size: 1rem; margin-bottom: 0.75rem; word-break: break-word; }

.msg-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-toxic {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fecaca;
  font-size: 0.8rem;
}
.btn-toxic:hover { background: #991b1b; }

.btn-safe {
  background: #14532d;
  border-color: #166534;
  color: #bbf7d0;
  font-size: 0.8rem;
}
.btn-safe:hover { background: #166534; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-toxic { background: #7f1d1d; color: #fecaca; }
.badge-ok { background: #14532d; color: #bbf7d0; }
.badge-labeled { background: #1e3a5f; color: #93c5fd; }

.cat-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }

.btn-cat {
  font-size: 0.8rem;
  background: transparent;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #a1a1aa;
}

#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  display: none;
  z-index: 100;
}
#toast.show { display: block; }

table.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.85rem;
}
table.stats-table th, table.stats-table td {
  text-align: left;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #27272a;
}
table.stats-table th { color: #a1a1aa; font-weight: 500; }
