:root {
  --bg: #0b1020;
  --panel: #141b30;
  --panel-2: #1b2440;
  --text: #e8ecf8;
  --muted: #93a0bf;
  --accent: #4f8cff;
  --accent-2: #7aa7ff;
  --danger: #ff7a8a;
  --ok: #3ddc97;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px
           max(24px, env(safe-area-inset-bottom)) 16px;
}

.hidden { display: none !important; }
.center { min-height: 60dvh; display: grid; place-items: center; }
.muted { color: var(--muted); font-size: 0.875rem; }
.error { color: var(--danger); font-size: 0.875rem; min-height: 1.25rem; margin: 0.5rem 0 0; }

h1 { font-size: 1.375rem; margin: 0; letter-spacing: -0.01em; }

.card {
  width: 100%;
  max-width: 420px;
  margin: 12dvh auto 0;
  background: var(--panel);
  border: 1px solid #23304f;
  border-radius: var(--radius);
  padding: 24px;
}

#login h1 { margin-bottom: 4px; }
#login form { margin-top: 20px; display: grid; gap: 6px; }

label { font-size: 0.8125rem; color: var(--muted); margin-top: 8px; }

input, textarea {
  width: 100%;
  background: #0e1526;
  color: var(--text);
  border: 1px solid #2a3859;
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 96px; }

button {
  font: inherit;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.6; }
button.ghost {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid #2a3859;
  font-weight: 500;
  padding: 8px 12px;
  margin: 0;
  font-size: 0.8125rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 16px;
  border-bottom: 1px solid #1e2942;
  margin-bottom: 16px;
}
header .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

ul#report-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

li.report-item {
  background: var(--panel);
  border: 1px solid #1e2942;
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
}
li.report-item:active { background: var(--panel-2); }
li .row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
li .excerpt {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge {
  font-size: 0.6875rem;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  border: 1px solid #2a3859;
  color: var(--muted);
}
.badge.pending { color: #ffd479; border-color: #5a4a23; background: #241d0c; }
.badge.done { color: var(--ok); border-color: #1d4a37; background: #0d241b; }

#detail-view { display: grid; gap: 12px; }
#back-btn { justify-self: start; }

#key-panel { margin: 0 0 16px; max-width: none; }
#key-panel h2 { font-size: 1rem; margin: 0 0 6px; }
#key-panel .actions { margin-top: 8px; }

.bubble {
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid #1e2942;
  background: var(--panel);
}
.bubble.report { border-left: 3px solid var(--accent); }
.bubble.reply { background: #10233a; border-left: 3px solid var(--ok); margin-left: 12px; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }

#reply-form { display: grid; gap: 4px; }

@media (min-width: 720px) {
  body { max-width: 720px; margin: 0 auto; }
}
