body {
  background: var(--ink);
  color: #eceaf5;
  min-height: 100vh;
}

/* ---------- login gate ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 22rem;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  padding: 2rem 1.75rem;
}

.login-card .on-air {
  margin-bottom: 1rem;
}

.login-card h1 {
  font-size: 1.15rem;
  margin: 0 0 1.4rem;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--ink-line);
  background: #0e1122;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

.login-card button {
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  border: none;
  background: var(--signal);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.login-card .err {
  color: var(--signal);
  font-size: 0.82rem;
  margin-top: 0.7rem;
  min-height: 1.1em;
}

/* ---------- shell ---------- */
.shell {
  display: none;
  grid-template-columns: 17rem 1fr;
  min-height: 100vh;
}

.shell.active {
  display: grid;
}

.sidebar {
  border-right: 1px solid var(--ink-line);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand .name {
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.room-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow-y: auto;
}

.room-list li button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--mist);
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.room-list li button:hover {
  background: rgba(255, 255, 255, 0.04);
}

.room-list li button.active {
  background: rgba(255, 93, 58, 0.12);
  color: #fff;
}

.room-list .code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  opacity: 0.7;
}

.new-room-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink-line);
}

.new-room-form input {
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--ink-line);
  background: #0e1122;
  color: #fff;
  font-size: 0.85rem;
}

.new-room-form button {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: none;
  color: var(--mist);
  cursor: pointer;
  font-size: 0.85rem;
}

.new-room-form button:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.new-room-form select {
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--ink-line);
  background: #0e1122;
  color: #fff;
  font-size: 0.85rem;
}

/* ---------- theme toggle (shared: sidebar form + room header) ---------- */
.theme-toggle {
  display: flex;
  gap: 0.4rem;
}

.theme-toggle button {
  flex: 1;
  padding: 0.55rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--ink-line);
  background: #0e1122;
  color: var(--mist);
  cursor: pointer;
  font-size: 0.82rem;
}

.theme-toggle button.active {
  background: rgba(255, 93, 58, 0.14);
  border-color: rgba(255, 93, 58, 0.4);
  color: #fff;
}

/* Self-contained preview of the join/broadcast look — admin.html itself
   always stays dark control-room chrome, so without this, toggling theme
   here has no visible effect on the page the admin is looking at. Themed
   via its own [data-theme] rather than the document's, so it doesn't leak
   into the rest of the dashboard. */
.appearance-preview {
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.appearance-preview[data-theme="dark"] {
  background: var(--ink);
  color: #f3f2f8;
  border: 1px solid var(--ink-line);
}

.appearance-preview[data-theme="light"] {
  background: var(--paper);
  color: var(--paper-ink);
  border: 1px solid var(--paper-line);
}

/* ---------- room settings tab ---------- */
.settings-form,
.settings-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 28rem;
  margin-bottom: 2rem;
}

.settings-form label,
.settings-block label {
  font-size: 0.8rem;
  color: var(--mist);
}

.settings-form input,
.settings-form textarea {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--ink-line);
  background: var(--ink-soft);
  color: #fff;
  font-size: 0.9rem;
  resize: vertical;
}

.settings-form button {
  align-self: flex-start;
}

.settings-block select {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--ink-line);
  background: var(--ink-soft);
  color: #fff;
  font-size: 0.85rem;
}

.status-line {
  min-height: 1.2rem;
  font-size: 0.82rem;
  color: var(--mist);
}

.status-line.error {
  color: var(--signal);
}

/* ---------- main ---------- */
.main {
  padding: 1.75rem 2.25rem 2.5rem;
  overflow-y: auto;
  max-height: 100vh;
}

.no-room {
  color: var(--mist);
  padding-top: 4rem;
  text-align: center;
}

.room-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ink-line);
  margin-bottom: 1.5rem;
}

.room-header h1 {
  font-size: 1.3rem;
  margin: 0 0 0.3rem;
  font-weight: 650;
}

.room-header .topic {
  color: var(--mist);
  font-size: 0.9rem;
  margin: 0;
  max-width: 48ch;
}

.room-header .meta {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--mist);
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  flex: none;
}

.qr-box {
  background: #fff;
  padding: 0.5rem;
  border-radius: 8px;
  width: 108px;
  height: 108px;
}

.pill-btn {
  border: 1px solid var(--ink-line);
  background: var(--ink-soft);
  color: #eceaf5;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.pill-btn.danger {
  border-color: rgba(255, 93, 58, 0.4);
  color: var(--signal);
}

.pill-btn.on {
  background: var(--jade-dim);
  border-color: rgba(34, 179, 120, 0.4);
  color: var(--jade);
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--ink-line);
  margin-bottom: 1.25rem;
}

.tabs button {
  background: none;
  border: none;
  color: var(--mist);
  font-size: 0.88rem;
  padding: 0 0 0.75rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tabs button.active {
  color: #fff;
  border-bottom-color: var(--signal);
}

.tabs .count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
  margin-left: 0.3rem;
}

/* ---------- queue ---------- */
.queue {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.msg-card {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  animation: drop 0.3s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg-card .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.msg-card .nickname {
  font-weight: 600;
  font-size: 0.85rem;
}

.msg-card time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mist);
}

.msg-card .content {
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 0.7rem;
}

.msg-card .ai-line {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mist);
  margin-bottom: 0.8rem;
}

.msg-card .ai-line .score {
  color: var(--amber);
}

.msg-card .actions {
  display: flex;
  gap: 0.6rem;
}

.btn-approve,
.btn-reject {
  flex: 1;
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease;
}

.btn-approve:active,
.btn-reject:active {
  transform: scale(0.97);
}

.btn-approve {
  background: var(--jade-dim);
  color: var(--jade);
  border-color: rgba(34, 179, 120, 0.35);
}

.btn-reject {
  background: rgba(255, 255, 255, 0.04);
  color: var(--mist);
  border-color: var(--ink-line);
}

.approved-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--ink-line);
  font-size: 0.9rem;
}

.approved-row .nickname {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--mist);
}

.approved-row .pill-btn {
  flex: none;
}

.empty-queue {
  color: var(--mist);
  text-align: center;
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

/* ---------- team ---------- */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.8rem;
}

.mod-card {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.mod-name {
  font-size: 0.8rem;
  color: var(--mist);
  margin-bottom: 0.5rem;
}

.mod-code {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  font-weight: 600;
}

/* ---------- audit log ---------- */
.audit-list {
  display: flex;
  flex-direction: column;
}

.audit-row {
  display: grid;
  grid-template-columns: 6rem 8rem 7rem 1fr;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--ink-line);
  font-size: 0.85rem;
}

.audit-row time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--mist);
}

.audit-actor {
  font-weight: 600;
}

.audit-action {
  font-size: 0.78rem;
  font-weight: 600;
}

.audit-action-approve {
  color: var(--jade);
}

.audit-action-unapprove,
.audit-action-reject {
  color: var(--signal);
}

.audit-action-room_open,
.audit-action-room_close {
  color: var(--amber);
}

.audit-detail {
  color: var(--mist);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- summary ---------- */
.summary-box {
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  padding: 1.5rem;
}

.summary-box p {
  line-height: 1.7;
  font-size: 0.98rem;
}

.theme-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.theme-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ink-line);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
