:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b24;
  --panel-2: #1b2430;
  --text: #edf3fb;
  --muted: #95a3b5;
  --line: #2a3545;
  --blue: #55c7f7;
  --green: #43d787;
  --red: #ff6b78;
  --yellow: #f3c969;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

a {
  color: inherit;
}

button,
.button {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  background: var(--blue);
  color: #071019;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

button:hover,
.button:hover {
  filter: brightness(1.08);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #0f151d;
  color: var(--text);
  font: inherit;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

label input,
label textarea,
label select {
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 17, 23, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar nav a {
  text-decoration: none;
  color: var(--muted);
}

.link-button {
  background: transparent;
  color: var(--muted);
  padding: 0;
  min-height: auto;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 64px;
}

.panel,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.stats,
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stats div,
.meta-grid div {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stats span,
.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stats strong,
.meta-grid strong {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #1c2632;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.status.pending {
  background: rgba(243, 201, 105, 0.14);
  color: var(--yellow);
}

.status.accepted {
  background: rgba(67, 215, 135, 0.14);
  color: var(--green);
}

.status.rejected {
  background: rgba(255, 107, 120, 0.14);
  color: var(--red);
}

.answers {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.answers article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #111821;
}

.answers h3 {
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--muted);
}

.answers p {
  margin: 0;
  white-space: pre-wrap;
}

.actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.reject-form {
  display: flex;
  gap: 10px;
  flex: 1;
  min-width: 280px;
}

.ghost {
  background: #202a36;
  color: var(--text);
}

.compact {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.success {
  background: var(--green);
}

.danger {
  background: var(--red);
}

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.alert.success {
  background: rgba(67, 215, 135, 0.12);
  color: var(--green);
}

.alert.error {
  background: rgba(255, 107, 120, 0.12);
  color: var(--red);
}

.form-grid {
  display: grid;
  gap: 16px;
}

.check {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 10px;
}

.check input {
  width: auto;
}

.questions {
  display: grid;
  gap: 12px;
}

.editor {
  display: grid;
  gap: 10px;
}

.format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.format-toolbar button {
  min-height: 34px;
  padding: 7px 10px;
  background: #202a36;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 800;
}

.question-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 180px 150px 110px;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #111821;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
}

.login-card form {
  display: grid;
  gap: 16px;
}

.back {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--muted);
  text-decoration: none;
}

.audit-line {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.audit-line span,
.audit-line em {
  color: var(--muted);
  font-style: normal;
}

.message-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.user-list,
.message-stream {
  display: grid;
  gap: 12px;
}

.user-row,
.message-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111821;
  padding: 14px;
}

.user-row.active {
  border-color: var(--blue);
}

.user-row a {
  display: grid;
  gap: 5px;
  text-decoration: none;
}

.user-row span,
.user-row small,
.user-row em,
.message-line span,
.message-line small {
  color: var(--muted);
  font-style: normal;
}

.inline-block-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.message-line header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.message-line p {
  margin: 0 0 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-line.out {
  background: #14212c;
}

.empty {
  text-align: center;
  color: var(--muted);
}

@media (max-width: 820px) {
  .topbar,
  .panel-head,
  .head-actions,
  .actions,
  .reject-form {
    align-items: stretch;
    flex-direction: column;
  }

  .stats,
  .meta-grid,
  .question-row,
  .message-layout,
  .inline-block-form {
    grid-template-columns: 1fr;
  }

  .topbar nav {
    flex-wrap: wrap;
  }
}
