:root {
  color-scheme: light dark;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f6fb;
  color: #1b1f3b;
}

body {
  margin: 0;
  padding: 0;
}

#root {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hidden {
  display: none !important;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(15, 23, 42, 0.12);
  padding: 24px 28px;
  box-sizing: border-box;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.app-header h1 {
  margin: 0;
  font-size: 28px;
}

.app-header p {
  margin: 4px 0 0;
  color: #4b5563;
  font-size: 14px;
}

button {
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  background: #2563eb;
  color: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

button.secondary {
  background: #e5e7eb;
  color: #1f2937;
}

button.secondary:hover {
  box-shadow: none;
  transform: none;
}

label {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #1f2937;
}

input[type="number"],
input[type="text"],
textarea,
select {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #f9fafb;
  color: inherit;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
}

.cleanup-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status {
  margin-top: 12px;
  min-height: 24px;
  font-size: 14px;
  color: #2563eb;
}

.status.error {
  color: #dc2626;
}

.status.success {
  color: #047857;
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
}

.counts .count-item {
  background: #eef2ff;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: #1e3a8a;
}

.message-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.log {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
  background: #0b1020;
  color: #d6e4ff;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.log-line + .log-line {
  margin-top: 4px;
}

button.danger {
  background: #ef4444;
  color: white;
}
button.danger:hover {
  background: #dc2626;
}

.message-empty {
  color: #6b7280;
  font-size: 13px;
  margin: 0;
}

.message-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-card h4 {
  margin: 0;
  font-size: 16px;
}

.message-meta {
  font-size: 13px;
  color: #4b5563;
  margin: 4px 0 0;
}

.message-summary {
  font-size: 14px;
  margin: 0;
  color: #1f2937;
}

.message-reason {
  font-size: 12px;
  color: #6b7280;
}

.message-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.actions-row {
  display: flex;
  justify-content: flex-end;
}

.label-input {
  display: none;
}

.label-input.visible {
  display: flex;
}

.feedback-status {
  font-size: 13px;
  color: #047857;
  min-height: 18px;
}

.viewer-body {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.viewer-content pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-size: 13px;
}

.reply-box {
  border-top: 1px dashed #e5e7eb;
  padding-top: 10px;
}

#new-criterion-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.criteria-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.criterion-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.criterion-item.disabled {
  opacity: 0.6;
}

.criterion-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.criterion-meta {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hint {
  font-size: 13px;
  color: #6b7280;
}
