: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: #5e191e;
  --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));
  margin: auto;
  padding: 1rem 0;
}

.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;
}

.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;
}

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

.flash-error {
  background: rgba(209, 75, 75, 0.13);
  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-top: 0;
  color: #7f91a4;
}

.auth-card .eyebrow {
  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 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;
}

.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: #5e191e;
  color: #7f91a4;
}

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

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

.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;
}

.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;
}

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: 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-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: #5e191e;
}

.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-main {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
}

.queue-label {
  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);
  }
}

.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-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;
    margin-left: auto;
    justify-content: end;
  }

  .control-link,
  .control-link:visited {
    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;
  }

  .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;
  }
}
