:root {
  --bg: #0e1621;
  --bg-accent: #17212b;
  --surface: #17212b;
  --surface-strong: #1d2a36;
  --text: #7f91a4;
  --muted: #6f8399;
  --border: #22303d;
  --primary: #7f91a4;
  --primary-strong: #2e3842;
  --success: #223c3b;
  --danger: #8e676b;
  --shadow: none;
  --font-main: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
.button-link {
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  padding: 0.95rem 1.2rem;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

button:hover,
.button-link:hover {
  background: var(--primary-strong);
  transform: none;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #2a343d;
  font: inherit;
  color: var(--text);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 0.45rem;
}

.inline-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.inline-toggle input {
  width: auto;
}

.auth-body,
.shell-body {
  display: flex;
}

.auth-shell {
  width: min(520px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem 0 1.1rem;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
}

.auth-card,
.sidebar,
.chat-panel,
.directory-panel,
.table-card,
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.auth-card {
  border-radius: 28px;
  padding: 2rem;
  display: grid;
  gap: 1.25rem;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  color: #8ea3ba;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
}

.auth-back-link:hover {
  color: #fff;
}

.auth-back-strip {
  margin: -0.35rem -0.75rem 0.05rem;
  padding: 0 0.75rem 0.8rem;
  border-bottom: 1px solid #22303d;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.stack-form {
  display: grid;
  gap: 1rem;
}

.compact-form {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.demo-accounts {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(25, 88, 255, 0.08);
}

.demo-accounts code {
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

.auth-link {
  margin: 0;
}

.auth-footer {
  display: grid;
  gap: 0.18rem;
  justify-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0.03em;
}

.auth-footer p {
  margin: 0;
}

.auth-footer a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.auth-footer a:hover {
  color: #fff;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  font-weight: 600;
}

.flash-error {
  background: rgba(142, 103, 107, 0.16);
  color: var(--danger);
}

.flash-success {
  background: rgba(11, 141, 87, 0.13);
  color: var(--success);
}

.shell-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
}

.sidebar {
  border-radius: 24px;
  padding: 1.4rem;
  display: grid;
  align-content: start;
  gap: 1.25rem;
}

.side-nav {
  display: grid;
  gap: 0.45rem;
}

.side-nav a {
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  color: var(--text);
}

.side-nav a.active {
  background: rgba(25, 88, 255, 0.12);
  color: var(--primary);
  font-weight: 700;
}

.identity-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.role-badge,
.chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(25, 88, 255, 0.12);
  color: var(--primary);
}

.chip-success {
  background: rgba(11, 141, 87, 0.14);
  color: var(--success);
}

.chip-muted {
  background: rgba(99, 112, 139, 0.14);
  color: var(--muted);
}

.secondary-button {
  width: 100%;
  background: rgba(23, 32, 51, 0.08);
  color: var(--text);
}

.secondary-button:hover {
  background: rgba(23, 32, 51, 0.16);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 1.25rem;
}

.wide-content {
  display: grid;
  gap: 1.25rem;
}

.chat-panel,
.directory-panel,
.table-card,
.profile-card {
  border-radius: 24px;
  padding: 1.25rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-header h2,
.sidebar h1,
.auth-card h1 {
  margin: 0.25rem 0 0;
}

.status-box {
  text-align: right;
  color: var(--muted);
}

#socket-status[data-tone="success"] {
  color: var(--success);
}

#socket-status[data-tone="error"] {
  color: var(--danger);
}

#socket-status[data-tone="warn"] {
  color: #a36911;
}

.chat-feed {
  height: 52vh;
  overflow: auto;
  display: grid;
  gap: 0.8rem;
  padding-right: 0.2rem;
  margin-bottom: 1rem;
}

.message-card {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.message-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
}

.message-card header span {
  color: var(--muted);
  font-size: 0.88rem;
}

.message-card p {
  margin: 0;
  line-height: 1.5;
}

.message-card.public {
  border-left: 4px solid rgba(25, 88, 255, 0.45);
}

.message-card.private,
.message-card.private-sent {
  border-left: 4px solid rgba(11, 141, 87, 0.45);
}

.message-card.system {
  border-left: 4px solid rgba(99, 112, 139, 0.45);
}

.composer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.helper-card {
  align-content: start;
}

.helper-card p {
  margin: 0;
  line-height: 1.5;
}

.queue-state {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.queue-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.queue-list {
  display: grid;
  gap: 0.8rem;
}

.queue-list.empty {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.queue-entry {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.queue-entry.active {
  border-left: 4px solid rgba(25, 88, 255, 0.45);
}

.queue-entry.own {
  background: rgba(11, 141, 87, 0.12);
  border-color: rgba(11, 141, 87, 0.3);
}

.queue-entry-main {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.queue-entry-text {
  display: grid;
  gap: 0.2rem;
}

.queue-entry-text span {
  color: var(--muted);
}

.queue-position {
  display: inline-flex;
  min-width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(25, 88, 255, 0.12);
  color: var(--primary);
  font-weight: 700;
}

.queue-entry-meta,
.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.queue-action,
.queue-priority-select {
  width: auto;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.queue-priority-select {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
}

.queue-admin-form {
  margin-bottom: 1rem;
}

.queue-self-form {
  margin-bottom: 1rem;
}

.queue-self-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.section-divider {
  margin-top: 1.5rem;
}

.user-list {
  display: grid;
  gap: 0.8rem;
}

.user-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.user-card:hover {
  transform: translateY(-1px);
  border-color: rgba(25, 88, 255, 0.28);
}

.user-card.online {
  outline: 2px solid rgba(11, 141, 87, 0.24);
}

.user-card span {
  color: var(--muted);
}

.user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

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

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.profile-card {
  display: grid;
  gap: 1rem;
}

.wind-body {
  background: #0e1621;
}

.wind-app {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 52px 260px minmax(320px, 1fr);
  background: #0e1621;
}

.wind-nav,
.wind-side-panel,
.wind-chat-panel {
  min-height: 0;
}

.wind-nav {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #17212b;
  border-right: 1px solid #22303d;
}

.wind-brand {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.35rem;
  border-bottom: 1px solid #22303d;
}

.wind-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #2e3842;
  color: #7f91a4;
  font-size: 0.82rem;
  font-weight: 700;
}

.wind-brand-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7f91a4;
}

.wind-nav-list,
.wind-nav-footer {
  display: grid;
  gap: 0.2rem;
}

.wind-nav-footer {
  align-content: end;
  padding-bottom: 0.25rem;
}

.wind-profile-badge {
  display: grid;
  justify-items: center;
  padding: 0.75rem 0.2rem 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: #7f91a4;
  gap: 0.2rem;
}

.wind-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #7f91a4;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.wind-nav-button:hover,
.wind-nav-button.active {
  background: #2e3842;
  color: #fff;
}

.wind-logout-button {
  padding: 0;
}

.wind-side-panel {
  overflow: auto;
  border-right: 1px solid #22303d;
  background: #0e1621;
}

.wind-side-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  padding: 1rem 1rem 0.8rem;
}

.wind-side-header h1 {
  margin: 0.1rem 0 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #7f91a4;
}

.wind-side-kicker {
  margin: 0;
  color: #7f91a4;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.wind-status-stack {
  display: grid;
  justify-items: end;
  gap: 0.25rem;
  color: #7f91a4;
  font-size: 0.78rem;
}

.wind-side-card {
  margin: 0 0.75rem 0.75rem;
  padding: 0.85rem;
  border: 1px solid #22303d;
  background: #17212b;
}

.wind-side-card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.96rem;
  font-weight: 600;
  color: #7f91a4;
}

.wind-side-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.wind-side-card-header h2 {
  margin: 0;
}

.wind-compact-form {
  gap: 0.75rem;
}

.wind-inline-fields {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.7rem;
}

.wind-queue-card {
  padding: 0.75rem;
}

.wind-user-list {
  gap: 0.4rem;
}

.wind-chat-panel {
  display: grid;
  grid-template-rows: 52px minmax(0, 1fr) 52px;
  min-width: 0;
}

.wind-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
  background: #0e1621;
  border-bottom: 1px solid #22303d;
}

.wind-chat-title {
  display: grid;
  gap: 0.12rem;
}

.wind-chat-title strong {
  font-size: 1rem;
  color: #7f91a4;
}

.wind-chat-title span,
.wind-chat-meta {
  font-size: 0.82rem;
  color: #7f91a4;
}

.wind-chat-meta {
  display: grid;
  justify-items: end;
}

.wind-chat-feed {
  height: auto;
  margin: 0;
  padding: 0.8rem 1rem;
  background: #0e1621;
}

.wind-chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  align-items: center;
  gap: 0;
  background: #17212b;
  border-top: 1px solid #22303d;
}

.wind-chat-input-wrap {
  display: block;
  height: 100%;
}

.wind-chat-input-wrap textarea {
  width: 100%;
  min-height: 52px;
  max-height: 160px;
  padding: 0.95rem 1rem;
  border: 0;
  border-radius: 0;
  background: #17212b;
  color: #7f91a4;
  resize: none;
  overflow: auto;
}

.wind-chat-input-wrap textarea:focus {
  outline: none;
}

.wind-send-button {
  height: 100%;
  border-radius: 0;
  border-left: 1px solid #22303d;
  background: #17212b;
  color: #7f91a4;
  font-size: 0.92rem;
}

.wind-send-button:hover {
  background: #2e3842;
  color: #fff;
}

.message-card {
  padding: 0.4rem 0.55rem;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.message-card:hover {
  background: #17212b;
}

.message-card header span,
.message-card p,
.queue-entry-text span,
.user-card span {
  color: #7f91a4;
}

.message-card.public,
.message-card.private,
.message-card.private-sent,
.message-card.system {
  border-left: 0;
}

.queue-state {
  margin-bottom: 0;
}

.queue-list {
  gap: 0.35rem;
}

.queue-list.empty {
  padding: 0.5rem;
  border-radius: 0;
  background: #17212b;
  border: 1px solid #22303d;
}

.queue-entry {
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0;
  background: rgba(118, 122, 138, 0.5);
  border: 1px solid #22303d;
}

.queue-entry.active {
  border-left: 3px solid #7f91a4;
}

.queue-entry.own {
  background: #223c3b;
  border-color: #2c4a49;
}

.queue-position {
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 0;
  background: #2a343d;
  color: #7f91a4;
}

.queue-action,
.queue-priority-select,
.queue-self-actions .secondary-button {
  border-radius: 0;
}

.user-card {
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0;
  background: #17212b;
  border: 1px solid #22303d;
  cursor: default;
}

.user-card:hover {
  transform: none;
  border-color: #2e3842;
  background: #17212b;
}

.user-card.online {
  outline: none;
  background: #223c3b;
}

@media (max-width: 1080px) {
  .wind-app {
    grid-template-columns: 52px 220px minmax(0, 1fr);
  }

  .wind-inline-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .wind-app {
    position: static;
    min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(55vh, 1fr);
  }

  .wind-nav {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    align-items: stretch;
    border-right: 0;
    border-bottom: 1px solid #cfcfcf;
  }

  .wind-brand {
    grid-auto-flow: column;
    justify-items: start;
    align-items: center;
    padding: 0.65rem 0.8rem;
    border-bottom: 0;
    border-right: 1px solid #cfcfcf;
  }

  .wind-brand-name {
    writing-mode: initial;
    transform: none;
  }

  .wind-nav-list {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .wind-nav-footer {
    grid-auto-flow: column;
    align-items: center;
    padding: 0;
  }

  .wind-profile-badge {
    display: none;
  }

  .wind-side-panel {
    border-right: 0;
    border-bottom: 1px solid #dfdfdf;
    max-height: 44vh;
  }

  .wind-chat-panel {
    grid-template-rows: 48px minmax(0, 1fr) 52px;
    min-height: 56vh;
  }

  .wind-chat-header {
    padding: 0 0.75rem;
  }

  .wind-chat-title span,
  .wind-chat-meta span:last-child {
    display: none;
  }

  .wind-chat-feed {
    padding: 0.75rem;
  }

  .wind-chat-composer {
    grid-template-columns: minmax(0, 1fr) 76px;
    position: sticky;
    bottom: 0;
  }

  .queue-self-actions,
  .wind-inline-fields {
    grid-template-columns: 1fr;
  }
}

.auth-body {
  background: #0e1621;
  color: #7f91a4;
}

.auth-shell {
  width: min(460px, calc(100% - 2rem));
  padding: 1rem;
}

.auth-card {
  border-radius: 2px;
  padding: 1.2rem 1.6rem 1.6rem;
  background: #17212b;
  border-color: #22303d;
  gap: 0.9rem;
}

.auth-card h1 {
  margin: -0.15rem 0 0;
  color: #7f91a4;
}

.auth-card .eyebrow {
  margin-bottom: -0.2rem;
  color: #7f91a4;
  letter-spacing: 0.08em;
}

.auth-card input,
.auth-card textarea,
.auth-card select {
  background: #2a343d;
  border: 0;
  border-radius: 2px;
  color: #7f91a4;
  padding: 0.75rem 0.8rem;
}

.auth-card select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath fill='%237f91a4' d='M1.65.97 7 6.32 12.35.97 14 2.62 7 9.62 0 2.62z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 12px 7px;
  padding-right: 2.65rem;
}

.auth-card button,
.auth-card .button-link {
  border-radius: 2px;
  background: #2a343d;
  color: #7f91a4;
}

.auth-card button:hover,
.auth-card .button-link:hover {
  background: #2e3842;
  color: #fff;
}

.ban-details {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.25rem;
  padding: 1rem;
  background: #111a23;
  border: 1px solid #22303d;
  border-radius: 2px;
}

.ban-detail-row {
  display: grid;
  gap: 0.2rem;
}

.activation-code-row {
  justify-items: center;
  text-align: center;
}

.ban-detail-label {
  color: #6d7f95;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.activation-code-label {
  text-align: center;
}

.ban-detail-value {
  color: #9aa9bb;
  word-break: break-word;
}

.activation-code-button {
  width: 100%;
  max-width: 340px;
  padding: 0.95rem 1rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
  color: #d9e0ea;
  text-align: center;
}

.activation-code-box {
  width: 100%;
  max-width: 340px;
  padding: 0.95rem 1rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
  color: #d9e0ea;
  text-align: center;
}

.activation-code-button:hover:not(:disabled),
.activation-code-button:focus-visible {
  background: #1b2430;
  border-color: #304151;
}

.activation-code-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.activation-code-value {
  display: block;
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-align: center;
}

.activation-code-hint {
  margin: 0.25rem 0 0;
  color: #6d7f95;
  font-size: 0.88rem;
  text-align: center;
}

.activation-contacts {
  display: grid;
  gap: 0.5rem;
}

.activation-contacts-panel {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.35rem;
  margin-bottom: 1rem;
}

.activation-contact-link {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
  color: #d9e0ea;
}

.activation-contact-link:hover {
  background: #1b2430;
  color: #fff;
}

.demo-accounts {
  background: #17212b;
  border: 1px solid #22303d;
  border-radius: 2px;
}

.demo-accounts code {
  background: #2a343d;
  border-radius: 2px;
}

.auth-link a {
  color: #6d7f95;
}

.flash {
  border-radius: 2px;
  font-weight: 600;
}

.flash-error {
  background: #4b2a2d;
  color: #7f91a4;
}

.flash-success {
  background: #223c3b;
  color: #7f91a4;
}

.profile-page-body {
  min-height: 100vh;
  background: #0e1621;
}

.profile-page-shell {
  width: min(720px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 1.5rem;
}

.profile-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
  color: #7f91a4;
  font-size: 0.95rem;
  font-weight: 600;
}

.profile-back-link:hover {
  color: #fff;
}

.profile-settings-card {
  display: grid;
  gap: 1rem;
  padding: 1.1rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #17212b;
}

.profile-settings-header h1 {
  margin: 0;
  font-size: 1.45rem;
  color: #7f91a4;
}

.profile-settings-stack {
  display: grid;
  gap: 0.95rem;
}

.profile-toggle-form {
  background: #0e1621;
  border: 1px solid #22303d;
  border-radius: 2px;
}

.profile-toggle-form .secondary-button {
  width: 100%;
}

.profile-inline-toggle {
  gap: 0.85rem;
}

.profile-inline-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid #5d7287;
  border-radius: 0;
  background: #111a23;
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
}

.profile-inline-toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4.5 3.5 7 9 1' fill='none' stroke='%237f91a4' stroke-width='1.8' stroke-linecap='square' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 8px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.profile-inline-toggle input[type="checkbox"]:hover {
  border-color: #7f91a4;
}

.profile-inline-toggle input[type="checkbox"]:checked::before {
  opacity: 1;
  transform: scale(1);
}

.profile-inline-toggle input[type="checkbox"]:disabled {
  opacity: 0.6;
  cursor: wait;
}

.profile-inline-status {
  min-height: 1.1rem;
  margin: 0;
  font-size: 0.9rem;
}

.profile-inline-status-error {
  color: #b98286;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.profile-setting {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
}

.profile-setting p {
  margin: 0;
}

.profile-logout-form {
  margin: 0;
}

.profile-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 0.8rem 1rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
  color: #7f91a4;
  font-weight: 600;
}

.profile-action-link:hover {
  background: #2e3842;
  color: #fff;
}

.profile-logout-form .secondary-button {
  width: 100%;
}

.admin-edit-card {
  width: min(560px, calc(100% - 1.5rem));
}

.admin-edit-toggle {
  justify-content: flex-start;
  min-height: 46px;
  padding: 0.8rem 0.1rem;
  border-bottom: 1px solid #22303d;
}

.admin-edit-toggle:last-of-type {
  border-bottom: 0;
}

.admin-settings-subsection {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.4rem;
  padding: 0.9rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
}

.admin-settings-subsection .eyebrow {
  margin: 0;
}

.admin-settings-subsection input[type="number"]::-webkit-outer-spin-button,
.admin-settings-subsection input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.admin-settings-subsection input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.admin-edit-links {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.admin-edit-links a {
  color: #8ea3ba;
  font-weight: 600;
}

.admin-edit-links a:hover {
  color: #fff;
}

.admin-delete-details {
  display: grid;
  gap: 0.75rem;
}

.admin-delete-summary {
  list-style: none;
  color: #c79298;
  font-weight: 700;
  cursor: pointer;
}

.admin-delete-summary::-webkit-details-marker {
  display: none;
}

.admin-delete-summary:hover {
  color: #fff;
}

.admin-edit-danger-zone {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid #4a3136;
  border-radius: 2px;
  background: #20171a;
}

.admin-edit-danger-copy {
  display: grid;
  gap: 0.2rem;
}

.admin-edit-danger-copy strong {
  color: #d9e0ea;
}

.admin-edit-danger-copy span {
  color: #c3a5aa;
  font-size: 0.88rem;
  line-height: 1.45;
}

.admin-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 0 1rem;
  border: 1px solid #5d3c42;
  border-radius: 2px;
  background: #3f3134;
  color: #e0bcc1;
  font-weight: 700;
}

.admin-danger-button:hover {
  background: #4a383c;
  color: #fff;
}

.shell-grid {
  gap: 0.9rem;
  padding: 0.9rem;
}

.admin-shell {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 0.9rem;
  padding: 0.9rem;
  align-content: start;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #17212b;
}

.admin-topbar-main {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 auto;
}

.admin-topbar-brand {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.admin-topbar-main .eyebrow {
  margin: 0;
  white-space: nowrap;
}

.admin-topbar-main h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  white-space: nowrap;
}

.admin-top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.admin-top-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  border-radius: 2px;
  color: #7f91a4;
  text-decoration: none;
}

.admin-top-nav a.active,
.admin-top-nav a:hover {
  background: #2e3842;
  color: #fff;
}

.admin-topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.92rem;
}

.admin-topbar-user strong {
  color: #d9e0ea;
}

.admin-topbar-user .role-badge {
  margin: 0;
}

.admin-logout-button {
  width: auto;
  min-width: 0;
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  background: #3f3134;
  color: #c3a5aa;
}

.admin-logout-button:hover {
  background: #4a383c;
  color: #fff;
}

.admin-content {
  width: 100%;
  min-width: 0;
}

.sidebar,
.table-card,
.profile-card {
  border-radius: 2px;
  background: #17212b;
  border-color: #22303d;
  box-shadow: none;
}

.sidebar {
  background: #17212b;
}

.side-nav a {
  border-radius: 2px;
}

.side-nav a.active,
.side-nav a:hover {
  background: #2e3842;
  color: #fff;
}

.identity-card {
  border-radius: 2px;
  background: #0e1621;
  border: 1px solid #22303d;
}

.role-badge,
.chip {
  border-radius: 2px;
  background: rgba(118, 122, 138, 0.5);
  color: #7f91a4;
}

.chip-success {
  background: #223c3b;
  color: #7f91a4;
}

.chip-muted {
  background: #2a343d;
  color: #7f91a4;
}

.secondary-button {
  background: #2a343d;
  color: #7f91a4;
  border-radius: 2px;
}

.secondary-button:hover {
  background: #2e3842;
  color: #fff;
}

.profile-card {
  gap: 0.85rem;
}

.profile-card .compact-form {
  background: #0e1621;
  border: 1px solid #22303d;
  border-radius: 2px;
}

@media (max-width: 860px) {
  .profile-page-shell {
    width: min(100%, calc(100% - 1rem));
    padding: 0.75rem 0 1rem;
  }

  .profile-settings-card {
    padding: 0.9rem;
  }

  .profile-settings-grid {
    grid-template-columns: 1fr;
  }
}

.table-card {
  background: #17212b;
}

.data-table th {
  background: #2a343d;
  color: #7f91a4;
  font-weight: 600;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #22303d;
}

.data-table tbody tr:hover {
  background: #0e1621;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.table-card-header h3 {
  margin: 0;
  color: #d9e0ea;
  font-size: 1rem;
}

.log-search-bar {
  margin-bottom: 1rem;
}

.log-search-inline {
  position: relative;
  padding: 6px;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
}

.log-search-inline input {
  width: 100%;
  min-height: 52px;
  padding: 0 6.4rem 0 1.05rem;
  border: 0;
  border-radius: 3px;
  background: #0e1621;
  color: #d9e0ea;
  font-size: 1.05rem;
}

.log-search-inline input:focus {
  outline: none;
}

.log-search-inline:focus-within {
  box-shadow: inset 0 0 0 1px #6d8ad1;
}

.log-search-inline input::-webkit-search-decoration,
.log-search-inline input::-webkit-search-cancel-button,
.log-search-inline input::-webkit-search-results-button,
.log-search-inline input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.log-search-inline input::placeholder {
  color: #7f91a4;
}

.log-search-inline-compact {
  flex: 1 1 240px;
  min-width: 220px;
}

.log-search-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  min-width: 72px;
  padding: 0 0.9rem;
  border-radius: 2px;
  background: #2e3842;
  color: #8ea3ba;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.log-search-clear:hover {
  background: #394450;
  color: #fff;
}

.table-card-header a {
  color: #8ea3ba;
  text-decoration: none;
}

.table-card-header a:hover {
  color: #fff;
}

.log-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.log-filters input,
.log-filters select {
  min-height: 34px;
  padding: 0 0.7rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
  color: #d9e0ea;
}

.log-filters input::placeholder {
  color: #7f91a4;
}

.log-feed-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding-top: 0.8rem;
  color: #7f91a4;
}

.event-pill,
.event-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 0.55rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
  color: #8ea3ba;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.event-pill-banned {
  background: #3f3134;
  color: #c3a5aa;
}

.event-pill-pending {
  background: #403a2c;
  color: #ccb992;
}

.event-status-info {
  background: #1d2731;
}

.event-status-success {
  background: #203135;
}

.event-status-error {
  background: #4a3032;
}

.event-status-blocked {
  background: #443c2a;
}

.event-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 56px;
  padding: 0 0.55rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #1b2430;
  color: #8ea3ba;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.event-method-get {
  background: #1d2f47;
  color: #9cb3d1;
}

.event-method-post {
  background: #203a31;
  color: #98c3af;
}

.event-method-put,
.event-method-patch {
  background: #243449;
  color: #9db4ce;
}

.event-method-delete {
  background: #463133;
  color: #d3a5aa;
}

.event-method-options,
.event-method-head {
  background: #2d3138;
  color: #aeb7c2;
}

.event-method-socket {
  background: #2c2a3f;
  color: #b3add9;
}

.event-method-worker,
.event-method-server {
  background: #3a3221;
  color: #c6ba91;
}

.event-method-none {
  background: #1b2430;
  color: #7f91a4;
}

.event-response {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 56px;
  padding: 0 0.55rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #1b2430;
  color: #8ea3ba;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.event-response-2 {
  background: #203a31;
  color: #98c3af;
}

.event-response-3 {
  background: #243449;
  color: #9db4ce;
}

.event-response-4 {
  background: #463d2d;
  color: #d4c08f;
}

.event-response-5 {
  background: #463133;
  color: #d3a5aa;
}

.event-response-none {
  background: #1b2430;
  color: #7f91a4;
}

.data-table-logs td {
  vertical-align: top;
}

.data-table-logs-with-user th:nth-child(2),
.data-table-logs-with-user td:nth-child(2) {
  min-width: 180px;
  width: 180px;
}

.log-summary-cell {
  min-width: 205px;
}

.log-message-body {
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
  color: #d9e0ea;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-user-agent-cell {
  width: 52px;
  min-width: 52px;
  text-align: center;
}

.user-agent-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #1b2430;
  color: #8ea3ba;
}

.user-agent-trigger:hover {
  background: #2e3842;
  color: #fff;
}

.user-agent-trigger-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.user-agent-trigger-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.user-agent-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.user-agent-modal[hidden] {
  display: none !important;
}

.user-agent-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.user-agent-modal-card {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 2rem));
  padding: 1.1rem;
  border: 1px solid #22303d;
  border-radius: 14px;
  background: #17212b;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

.user-agent-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  color: #d9e0ea;
}

.user-agent-modal-title {
  display: grid;
  gap: 0.15rem;
}

.user-agent-modal-title span {
  color: #7f91a4;
  font-size: 0.82rem;
}

.user-agent-modal-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 2px;
  background: #2a343d;
  color: #7f91a4;
  font-size: 1rem;
}

.user-agent-modal-close:hover {
  background: #2e3842;
  color: #fff;
}

.user-agent-modal-body {
  margin: 0;
  padding: 0.85rem;
  overflow: auto;
  max-height: 60vh;
  border: 1px solid #22303d;
  border-radius: 10px;
  background: #0e1621;
  color: #8ea3ba;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: copy;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.user-agent-modal-body:hover {
  border-color: #3a4b5b;
  color: #d9e0ea;
}

.user-agent-modal-body[data-copied="true"] {
  border-color: #4e6b68;
  background: #132026;
  color: #d7efe9;
}

body.modal-open {
  overflow: hidden;
}

.admin-user-card {
  margin-bottom: 0.9rem;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.admin-user-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
  min-height: 38px;
  padding: 0 0.95rem;
}

.admin-user-lookup-form {
  display: block;
  margin-bottom: 1rem;
}

.admin-user-lookup-form input {
  min-width: 0;
}

.admin-lookup-inline {
  max-width: 100%;
}

.admin-lookup-inline input::placeholder {
  color: #7f91a4;
}

.admin-lookup-inline-error {
  border-color: #8e676b;
  box-shadow: inset 0 0 0 1px rgba(142, 103, 107, 0.35);
}

.admin-lookup-inline-error input::placeholder {
  color: #c8a5a8;
}

.admin-lookup-inline-success {
  border-color: #35534f;
  box-shadow: inset 0 0 0 1px rgba(53, 83, 79, 0.35);
}

.admin-lookup-inline-success input::placeholder {
  color: #9cb8b3;
}

.admin-lookup-submit {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  min-width: 88px;
  padding: 0 1rem;
  border-radius: 3px;
  background: #2e3842;
  color: #d9e0ea;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
}

.admin-lookup-submit:hover {
  background: #394450;
}

.admin-user-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-user-header h3 {
  margin: 0 0 0.2rem;
  color: #d9e0ea;
  font-size: 1.4rem;
}

.admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.admin-user-stat {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
}

.admin-user-stat strong {
  color: #d9e0ea;
}

.admin-user-stat-technical {
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.admin-queue-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(280px, 0.98fr) minmax(360px, 1.3fr);
  gap: 0.9rem;
  align-items: stretch;
}

.admin-queue-settings-card,
.admin-online-card,
.admin-live-queue-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  min-height: 100%;
}

.admin-queue-settings-form {
  display: grid;
  gap: 0.72rem;
}

.admin-queue-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.admin-queue-settings-form input[type="number"] {
  min-height: 44px;
  border-radius: 2px;
  background: #0e1621;
}

.admin-queue-priority-toggle {
  margin-top: 0.2rem;
}

.admin-online-list,
.admin-queue-list {
  display: grid;
  gap: 0.55rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.12rem;
}

.admin-online-list {
  align-content: start;
  grid-auto-rows: max-content;
  gap: 0.4rem;
}

.admin-queue-list {
  align-content: start;
  grid-auto-rows: max-content;
}

.admin-chat-log-list {
  max-height: 33rem;
  overflow: auto;
  padding-right: 0.12rem;
}

.admin-online-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.65rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
}

.admin-online-user:hover {
  background: #111b27;
}

.admin-online-user strong {
  color: #d9e0ea;
  font-size: 0.92rem;
  line-height: 1.15;
}

.admin-online-user span:not(.role-badge) {
  color: #7f91a4;
  font-size: 0.78rem;
  line-height: 1.15;
}

.admin-online-user .role-badge {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.admin-queue-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main meta"
    "controls controls";
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
}

.admin-queue-entry-active {
  background: #132824;
  border-color: #294c45;
}

.admin-queue-entry-main {
  grid-area: main;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.admin-queue-entry-main strong {
  color: #d9e0ea;
}

.admin-queue-entry-main p {
  margin: 0.18rem 0 0;
}

.admin-queue-entry-meta,
.admin-queue-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-queue-entry-meta {
  grid-area: meta;
  justify-content: flex-end;
}

.admin-queue-controls {
  grid-area: controls;
  justify-content: flex-start;
  padding-top: 0.55rem;
  border-top: 1px solid #17212b;
}

.admin-queue-controls .queue-action {
  min-height: 32px;
  min-width: 58px;
  width: auto;
  padding: 0 0.65rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #2a343d;
  color: #8ea3ba;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-queue-controls .queue-action-icon {
  min-width: 34px;
  padding: 0;
  font-size: 1rem;
}

.admin-queue-controls .queue-action:hover:not(:disabled) {
  background: #2e3842;
  color: #fff;
}

.admin-queue-controls .queue-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.admin-queue-controls .queue-action-danger {
  background: #3f3134;
  color: #c3a5aa;
}

.admin-chat-log-card {
  grid-column: 1 / -1;
}

.admin-chat-log-list {
  display: grid;
  gap: 0.55rem;
}

.admin-chat-log-entry {
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem;
  border: 1px solid #22303d;
  border-radius: 2px;
  background: #0e1621;
}

.admin-chat-log-entry-system {
  background: #132824;
  border-color: #294c45;
}

.admin-chat-log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.admin-chat-log-time {
  color: #7f91a4;
  font-size: 0.82rem;
}

.admin-chat-log-body {
  margin: 0;
  color: #d9e0ea;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-topbar-main {
    width: 100%;
  }

  .admin-topbar-brand {
    gap: 0.15rem;
  }

  .admin-top-nav {
    justify-content: flex-start;
    width: auto;
  }

  .admin-topbar-meta {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .admin-topbar-user {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .admin-user-header,
  .table-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-user-meta {
    justify-content: flex-start;
  }

  .admin-user-grid {
    grid-template-columns: 1fr;
  }

  .admin-queue-layout,
  .admin-queue-entry {
    grid-template-columns: 1fr;
  }

  .admin-chat-log-card {
    grid-column: auto;
  }

  .admin-queue-settings-card,
  .admin-online-card,
  .admin-live-queue-card {
    min-height: 0;
  }

  .admin-queue-entry-meta,
  .admin-queue-controls {
    justify-content: flex-start;
  }

  .admin-queue-entry {
    grid-template-areas:
      "main"
      "meta"
      "controls";
  }
}

body.chat-body {
  margin: 0;
  background: #0e1621;
  color: #7f91a4;
  font-family: Ubuntu, "Segoe UI", sans-serif;
  overflow: hidden;
}

body.chat-body .app-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 46px 220px minmax(266px, auto);
  width: 100%;
  height: 100%;
}

body.chat-body .app-shell > * {
  min-height: 0;
}

.mobile-tabs {
  display: none;
}

body.chat-body .control-rail {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #17212b;
  border-right: 1px solid #22303d;
  z-index: 4;
}

.control-group,
.control-group-bottom {
  display: grid;
  align-content: start;
}

.control-group-bottom {
  align-content: end;
}

.control-weekly-meter {
  display: grid;
  align-content: start;
  padding: 2px 0 0;
  border-top: 1px solid #22303d;
}

.control-weekly-meter[hidden] {
  display: none;
}

.control-weekly-counter {
  --weekly-meter-bg: rgba(34, 60, 59, 0.78);
  --weekly-meter-border: rgba(97, 168, 151, 0.45);
  --weekly-meter-text: rgba(215, 239, 233, 1);
  --weekly-meter-glow: 0.34;
  display: inline-grid;
  place-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--weekly-meter-bg);
  color: var(--weekly-meter-text);
  cursor: help;
  box-shadow: inset 0 0 0 1px var(--weekly-meter-border);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.control-weekly-counter:hover {
  filter: none;
}

.control-weekly-counter span {
  display: block;
  max-width: 100%;
  color: var(--weekly-meter-text);
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.88rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 255, 255, var(--weekly-meter-glow));
  -webkit-font-smoothing: none;
  font-smooth: never;
  white-space: nowrap;
  overflow: hidden;
}

.control-link,
.control-link:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #7f91a4;
  font-size: 0;
  border-radius: 0;
  border: 0;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.control-link:hover,
.control-link.active,
.control-logout .control-link:hover {
  background: #2e3842;
  color: #fff;
}

.control-link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.control-link[data-action-state="ready"] {
  background: rgba(34, 60, 59, 0.78);
  color: #d7efe9;
  box-shadow: inset 0 0 0 1px rgba(97, 168, 151, 0.45);
}

.control-link[data-action-state="ready"]:hover {
  background: #2a4a48;
  color: #fff;
}

.control-link[data-action-state="used"] {
  background: rgba(94, 25, 30, 0.38);
  color: #d0a4a8;
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(171, 90, 97, 0.4);
}

.control-link[data-action-state="used"]:disabled {
  opacity: 1;
}

.control-link[data-action-state="unavailable"] {
  background: transparent;
  color: #617386;
}

.control-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
}

.control-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.control-logout {
  margin-top: 0;
}

body.chat-body .queue-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-top: 0.5rem;
  background: #0e1621;
  border-right: 1px solid #22303d;
  text-align: center;
}

body.chat-body .queue-panel::-webkit-scrollbar,
.message-feed::-webkit-scrollbar {
  width: 0;
}

.panel-small {
  color: #6f8399;
  font-size: 0.82rem;
}

.section-title {
  margin: 0.2rem 0.55rem 0.3rem;
  padding: 0.2rem 0;
  color: #7f91a4;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flash-banner {
  margin: 0 0.55rem 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 2px;
  font-size: 0.9rem;
}

.flash-banner-error {
  background: #4b2a2d;
}

.flash-hidden {
  display: none;
}

.field-invalid {
  border: 2px solid #8e676b !important;
  box-shadow: inset 0 0 0 1px rgba(142, 103, 107, 0.35);
}

.flash-banner-success {
  background: #223c3b;
}

.queue-list,
.user-list {
  display: grid;
  gap: 0.18rem;
  margin: 0 0.5rem 0.6rem;
}

.queue-list.empty {
  padding: 0.55rem 0.5rem;
  background: rgba(118, 122, 138, 0.25);
  border: 0;
  border-radius: 2px;
}

.queue-row,
.user-row {
  padding: 0.45rem 0.5rem;
  border-radius: 2px;
  background: rgba(118, 122, 138, 0.5);
  color: #7f91a4;
  transition: background 0.2s ease, color 0.2s ease;
}

.queue-row:hover,
.user-row:hover,
.message-row:hover {
  background: #17212b;
  color: #fff;
}

.queue-row.active {
  background: #2e3842;
  color: #fff;
}

.queue-row.own {
  background: #223c3b;
}

.queue-row.critical-countdown,
.queue-row.critical-countdown:hover {
  animation: queue-critical-pulse 1s ease-in-out infinite;
}

.queue-row.critical-countdown .queue-label {
  display: inline-block;
  animation: queue-critical-text-pulse 1s ease-in-out infinite;
  transform-origin: center center;
  will-change: transform;
}

.queue-main {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
}

.queue-label {
  display: inline-block;
  font-weight: 600;
}

@keyframes queue-critical-pulse {
  0%,
  100% {
    background: rgba(34, 60, 59, 0.92);
    color: #d8efe9;
    box-shadow: inset 0 0 0 1px rgba(97, 168, 151, 0.55);
  }

  50% {
    background: rgba(94, 25, 30, 0.9);
    color: #ffd7da;
    box-shadow: inset 0 0 0 1px rgba(205, 101, 110, 0.55);
  }
}

@keyframes queue-critical-text-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.045);
  }
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.4rem;
}

.mini-button,
.mini-select {
  width: auto;
  min-height: 28px;
  padding: 0.25rem 0.45rem;
  border-radius: 2px;
  background: #2a343d;
  color: #7f91a4;
  border: 0;
}

.mini-button:hover,
.mini-select:hover {
  background: #2e3842;
  color: #fff;
}

.panel-form,
.self-box {
  display: grid;
  gap: 0.45rem;
  margin: 0 0.5rem 0.75rem;
}

.panel-form input,
.panel-form textarea,
.panel-form select,
.self-actions button,
.panel-form button {
  background: #2a343d;
  color: #7f91a4;
  border: 0;
  border-radius: 2px;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  font-size: 0.94rem;
}

.panel-form button,
.self-actions button {
  min-height: 38px;
}

.panel-form button:hover,
.self-actions button:hover {
  background: #2e3842;
  color: #fff;
}

.form-row,
.self-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.muted-button {
  background: #17212b;
}

body.chat-body .realtime-panel {
  display: flex;
  flex-direction: column;
  background: #0e1621;
  min-height: 0;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

.room-header {
  flex: 0 0 46px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 0.8rem;
  background: #0e1621;
  font-weight: 600;
  font-size: 18px;
  border-bottom: 1px solid #22303d;
}

.panel-title {
  display: grid;
  justify-items: end;
}

.panel-meta {
  display: inline-flex;
  align-items: center;
  gap: 0;
  justify-self: start;
  margin-left: 6px;
}

.online-count {
  display: inline-flex;
  align-items: center;
  min-width: 1ch;
  color: #7f91a4;
  font-size: 1em;
  font-weight: 600;
  line-height: 1;
  margin-left: -1px;
}

.status-indicator {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  color: #7f91a4;
}

.status-indicator[data-state="success"],
.status-indicator[data-state="error"] {
  color: #7f91a4;
}

.realtime-panel #socket-status[data-tone="success"],
.realtime-panel #socket-status[data-tone="error"],
.realtime-panel #socket-status[data-tone="warn"],
.realtime-panel #socket-status[data-tone="muted"],
.room-header #socket-status[data-tone="success"],
.room-header #socket-status[data-tone="error"],
.room-header #socket-status[data-tone="warn"],
.room-header #socket-status[data-tone="muted"] {
  color: #7f91a4;
}

.status-shield,
.status-spinner,
.status-error {
  display: none;
  align-items: center;
  justify-content: center;
}

.status-shield {
  width: 28px;
  height: 28px;
}

.status-shield svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.status-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(127, 145, 164, 0.28);
  border-top-color: #7f91a4;
  border-radius: 50%;
  animation: status-spin 0.8s linear infinite;
}

.status-error {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7f91a4;
  color: #17212b;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.status-indicator[data-state="success"] .status-shield {
  display: inline-flex;
}

.status-indicator[data-state="loading"] .status-spinner {
  display: inline-flex;
}

.status-indicator[data-state="error"] .status-error {
  display: inline-flex;
}

@keyframes status-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.message-feed {
  flex: 1 1 auto;
  padding: 12px 12px 12px 18px;
  overflow-y: auto;
  word-wrap: break-word;
  background: #0e1621;
  min-height: 0;
}

.message-row {
  padding: 4px 8px;
  border-radius: 2px;
  color: #7f91a4;
  line-height: 1.4;
  transition: background 0.2s ease, color 0.2s ease;
}

.message-row b {
  color: #c0cbd8;
}

.message-row.mentioned {
  background: rgba(46, 56, 66, 0.72);
  color: #d9e5f0;
  box-shadow: inset 2px 0 0 rgba(127, 145, 164, 0.8);
}

.message-author {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c0cbd8;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.message-author:hover {
  color: #ffffff;
  text-decoration: underline;
}

.message-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: center;
  flex: 0 0 auto;
  min-height: 46px;
  background: #17212b;
  border-top: 1px solid #22303d;
  overflow: hidden;
}

.message-input textarea {
  width: 100%;
  min-height: 32px;
  max-height: 92px;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: #17212b;
  color: #7f91a4;
  resize: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.25;
}

.message-input textarea:focus {
  outline: none;
}

.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-radius: 0;
  background: #17212b;
  color: #7f91a4;
  font-size: 24px;
}

.send-button:hover {
  background: #2e3842;
  color: #fff;
}

.send-icon {
  transform: translateX(1px);
}

@media (max-width: 860px) {
  body.chat-body {
    overflow: hidden;
  }

  body.chat-body .app-shell {
    position: fixed;
    inset: 0;
    height: 100dvh;
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: 46px 46px minmax(0, 1fr);
  }

  body.chat-body .control-rail {
    display: flex;
    align-items: stretch;
    grid-template-rows: none;
    border-right: 0;
    border-bottom: 1px solid #22303d;
  }

  .control-weekly-meter {
    display: grid;
    flex: 0 0 auto;
    align-content: stretch;
    padding: 2px 0 2px 2px;
    border-top: 0;
  }

  .control-group,
  .control-group-bottom {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 42px;
    align-items: stretch;
    gap: 2px;
    padding: 2px;
    box-sizing: border-box;
    height: 100%;
  }

  .control-group {
    flex: 1 1 auto;
    justify-content: start;
  }

  .control-group-bottom {
    flex: 0 0 auto;
    justify-content: end;
    padding-left: 0;
  }

  .control-link,
  .control-link:visited {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .control-weekly-counter {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #22303d;
    background: #17212b;
  }

  .mobile-tab {
    min-height: 46px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #7f91a4;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mobile-tab.active {
    background: #2e3842;
    color: #fff;
  }

  .mobile-tab.has-unread-mention {
    background: rgba(77, 43, 48, 0.58);
    color: #ead5d7;
    animation: mobile-mention-pulse 1.2s ease-in-out infinite;
  }

  .mobile-tab.has-unread-mention.active {
    animation: none;
  }

  .control-logout {
    margin-top: 0;
  }

  .control-link[data-action-state="ready"] {
    background: rgba(45, 69, 68, 0.72);
    color: #d9e8e3;
    box-shadow: inset 0 0 0 1px rgba(101, 150, 140, 0.34);
  }

  .control-link[data-action-state="used"] {
    background: rgba(77, 43, 48, 0.68);
    color: #d6bcc0;
    box-shadow: inset 0 0 0 1px rgba(149, 104, 112, 0.34);
  }

  .control-link[data-action-state="unavailable"] {
    background: transparent;
    color: #6a7b8d;
    box-shadow: none;
  }

  .control-link[data-action-state] .control-icon {
    transform: scale(1.04);
    transition: transform 0.2s ease;
  }

  .control-link[data-action-state="ready"] .control-icon {
    transform: scale(1.07);
  }

  .control-link[data-action-state="used"] .control-icon {
    transform: scale(1);
  }

  .control-link:disabled {
    opacity: 0.72;
  }

  body.chat-body .queue-panel {
    grid-row: 3;
    border-right: 0;
    border-bottom: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
  }

  .form-row,
  .self-actions {
    grid-template-columns: 1fr;
  }

  body.chat-body .realtime-panel {
    grid-row: 3;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  body.chat-body[data-mobile-panel='chat'] .queue-panel {
    display: none;
  }

  body.chat-body[data-mobile-panel='queue'] .realtime-panel {
    display: none;
  }

  .message-feed {
    padding-bottom: 8px;
  }

  .room-header {
    flex: 0 0 40px;
    min-height: 40px;
    font-size: 15px;
    line-height: 1;
    padding: 2px 0.55rem 1px;
  }

  .room-header .panel-title,
  .room-header .panel-meta {
    align-self: center;
  }
}

@keyframes mobile-mention-pulse {
  0%,
  100% {
    background: rgba(61, 37, 41, 0.52);
    color: #d9c6c8;
  }

  50% {
    background: rgba(77, 43, 48, 0.72);
    color: #f0dfe1;
  }
}
