:root {
  --bg: #0b0f14;
  --bg-soft: #101720;
  --panel: #151d28;
  --panel-soft: #1d2938;
  --border: #2b3a4f;
  --text: #e8eef7;
  --muted: #9aa8ba;
  --accent: #d29922;
  --accent-soft: rgba(210, 153, 34, 0.18);
  --danger: #f85149;
  --ok: #3fb950;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(210, 153, 34, 0.12), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  padding: 24px;
  background: rgba(16, 23, 32, 0.95);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  min-height: 30px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 28px;
  text-shadow: 0 0 14px rgba(210, 153, 34, 0.16);
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav a,
.link-button {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sidebar nav a:hover,
.sidebar nav a.active,
.link-button:hover {
  color: var(--text);
  background: var(--panel-soft);
}

.sidebar form {
  margin-top: 24px;
}

.main {
  margin-left: 240px;
  min-height: 100vh;
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1, h2 {
  margin: 0 0 12px;
}

.kicker {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.grid,
.reward-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.panel,
.login-card,
.chat-message,
.result-box {
  background: rgba(21, 29, 40, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.panel {
  margin-top: 20px;
}

.card-label,
.chat-meta,
.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.card-value {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
  font-weight: 800;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #111;
  padding: 11px 15px;
  border-radius: 10px;
  border: 0;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.button.small {
  padding: 8px 12px;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.login-card {
  width: min(440px, 100%);
  text-align: center;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

input[type="search"] {
  width: min(420px, 100%);
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
}

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  animation: messageIn 160ms ease-out;
}

.chat-message.command {
  opacity: 0.72;
}

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

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

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

.result-box {
  white-space: pre-wrap;
  min-height: 48px;
  margin-top: 16px;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
    padding: 20px;
  }
}

.panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-subtitle {
  margin: 0;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.pagination-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
}

.compact-table td,
.compact-table th {
  padding: 8px 10px;
  font-size: 0.88rem;
  vertical-align: top;
}

.audit-table .truncate-cell,
.db-table .db-cell {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
}

.badge-info {
  color: #58a6ff;
  background: rgba(88, 166, 255, 0.14);
  border-color: rgba(88, 166, 255, 0.32);
}

.badge-success,
.badge-online {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.14);
  border-color: rgba(63, 185, 80, 0.32);
}

.badge-warning,
.badge-warn {
  color: #d29922;
  background: rgba(210, 153, 34, 0.16);
  border-color: rgba(210, 153, 34, 0.34);
}

.badge-error,
.badge-err {
  color: #f85149;
  background: rgba(248, 81, 73, 0.15);
  border-color: rgba(248, 81, 73, 0.34);
}

.badge-critical,
.badge-fatal {
  color: #ff7b72;
  background: rgba(255, 123, 114, 0.18);
  border-color: rgba(255, 123, 114, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 123, 114, 0.08);
}

.badge-debug,
.badge-trace {
  color: #a371f7;
  background: rgba(163, 113, 247, 0.14);
  border-color: rgba(163, 113, 247, 0.32);
}

.db-toolbar {
  align-items: end;
  flex-wrap: wrap;
}

.db-toolbar label {
  display: grid;
  gap: 6px;
}

.db-toolbar label[hidden],
[hidden] {
  display: none !important;
}

.db-table-info {
  margin: 8px 0 14px;
}

@media (max-width: 780px) {
  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-size-control {
    margin-left: 0;
  }
}

/* Admin/database navigation */
.nav-section {
  margin: 18px 0 6px;
  padding: 0 12px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-actions {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 20px;
}

.admin-action-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(21, 29, 40, 0.9);
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.admin-action-card:hover {
  border-color: var(--accent);
  background: rgba(29, 41, 56, 0.95);
}

.admin-action-card strong {
  font-size: 1.1rem;
}

.admin-action-card small,
.page-description {
  color: var(--muted);
}

.db-table .db-cell {
  max-width: 340px;
}

.compact-table th {
  white-space: nowrap;
}


.stats-registered-notice {
  margin: 0 0 20px;
  padding: 18px 20px;
  border: 1px solid rgba(210, 153, 34, 0.38);
  border-left: 5px solid var(--accent);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(210, 153, 34, 0.18), transparent 22rem),
    rgba(21, 29, 40, 0.96);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.stats-registered-notice-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(210, 153, 34, 0.18);
  border: 1px solid rgba(210, 153, 34, 0.34);
  color: #ffcf66;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-registered-notice h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.stats-registered-notice p {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}

/* Native select/dropdown readability fixes */
select {
  min-width: 180px;
}

select option {
  background: var(--bg-soft);
  color: var(--text);
}

.db-toolbar select {
  min-width: 260px;
  max-width: min(460px, 100vw - 64px);
}

.db-toolbar input[type="search"] {
  min-width: 260px;
}

.severity-cell {
  white-space: nowrap;
}

/* Custom DB table picker: replaces the native select dropdown */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.db-table-picker {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 280px;
}

.db-control-label {
  display: block;
}

.db-table-toggle {
  width: 320px;
  max-width: calc(100vw - 64px);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.db-table-toggle:hover,
.db-table-toggle[aria-expanded="true"] {
  border-color: var(--accent);
}

.db-table-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;
  width: 360px;
  max-width: calc(100vw - 64px);
  max-height: 520px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #101720;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
}

.db-table-filter {
  width: 100%;
  margin-bottom: 8px;
}

.db-table-options {
  max-height: 430px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  padding-right: 4px;
}

.db-table-option {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.db-table-option:hover,
.db-table-option.active {
  background: var(--panel-soft);
  border-color: var(--border);
}

.db-table-option.active {
  border-color: rgba(210, 153, 34, 0.6);
}

.db-table-option small {
  color: var(--muted);
  font-size: 0.75rem;
}

.db-table-empty {
  padding: 12px;
  color: var(--muted);
}

/* Dashboard status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.status-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 999px;
  background: #8b949e;
  box-shadow: 0 0 0 4px rgba(139, 148, 158, 0.12);
}

.status-online .status-dot {
  background: #3fb950;
  box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.14), 0 0 18px rgba(63, 185, 80, 0.32);
}

.status-offline .status-dot {
  background: #f85149;
  box-shadow: 0 0 0 4px rgba(248, 81, 73, 0.14), 0 0 18px rgba(248, 81, 73, 0.28);
}

.status-unknown .status-dot {
  background: #d29922;
  box-shadow: 0 0 0 4px rgba(210, 153, 34, 0.14), 0 0 18px rgba(210, 153, 34, 0.22);
}

.status-restarting .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16), 0 0 18px rgba(245, 158, 11, 0.34);
}

/* Dashboard redesign */
.dashboard-status-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.dashboard-card {
  min-height: 108px;
  display: grid;
  align-content: center;
}

.dashboard-card.primary-status {
  background:
    linear-gradient(135deg, rgba(63, 185, 80, 0.10), transparent 48%),
    rgba(21, 29, 40, 0.92);
}

.dashboard-card.restarting-status-card {
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.14), transparent 48%),
    rgba(21, 29, 40, 0.92);
}

.dashboard-card.players-status {
  background:
    linear-gradient(135deg, rgba(88, 166, 255, 0.10), transparent 48%),
    rgba(21, 29, 40, 0.92);
}

.dashboard-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.35fr 0.85fr;
  margin-top: 18px;
}

.dashboard-layout .panel {
  margin-top: 0;
}

.server-detail-list,
.tech-detail-list {
  display: grid;
  gap: 10px;
}

.server-detail-list {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.detail-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(43, 58, 79, 0.75);
  border-radius: 12px;
  background: rgba(16, 23, 32, 0.7);
}

.detail-row-placeholder {
  min-height: 68px;
  opacity: 0.78;
}

.detail-row-placeholder .detail-label,
.detail-row-placeholder .detail-value {
  min-height: 1.15rem;
}

.detail-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-value {
  font-weight: 800;
  word-break: break-word;
}

.detail-row-scum-time {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(88, 166, 255, 0.13), transparent 9rem),
    rgba(16, 23, 32, 0.74);
}

.detail-row-scum-time .detail-label {
  color: #b8d3f4;
}

.scum-game-clock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 31px;
}

.scum-game-clock-time {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.scum-game-clock-time.is-unavailable {
  color: var(--muted);
}

.scum-game-clock-phase {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 4px 10px;
  border: 1px solid rgba(88, 166, 255, 0.24);
  border-radius: 999px;
  background: rgba(88, 166, 255, 0.09);
  color: #c7ddf8;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ping-widget {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ping-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.ping-bar {
  width: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ping-bar:nth-child(1) { height: 7px; }
.ping-bar:nth-child(2) { height: 11px; }
.ping-bar:nth-child(3) { height: 15px; }
.ping-bar:nth-child(4) { height: 19px; }

.ping-excellent .ping-bar.is-active,
.ping-good .ping-bar.is-active {
  background: #3fb950;
  box-shadow: 0 0 12px rgba(63, 185, 80, 0.32);
}

.ping-fair .ping-bar.is-active {
  background: #d29922;
  box-shadow: 0 0 12px rgba(210, 153, 34, 0.30);
}

.ping-poor .ping-bar.is-active,
.ping-state-offline .ping-bar.is-active {
  background: #f85149;
  box-shadow: 0 0 12px rgba(248, 81, 73, 0.28);
}

.ping-main {
  font-size: 1rem;
}

.ping-quality {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.10);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title-row h2 {
  margin: 0;
}

@media (max-width: 1180px) {
  .dashboard-status-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .dashboard-status-grid,
  .server-detail-list {
    grid-template-columns: 1fr;
  }
}

/* Player reward area */
.profile-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-item {
  padding: 12px;
  border: 1px solid rgba(43, 58, 79, 0.75);
  border-radius: 12px;
  background: rgba(16, 23, 32, 0.68);
}

.profile-label {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 5px;
}

.profile-value {
  font-weight: 800;
}

.reward-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.reward-button {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reward-result-card {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(16, 23, 32, 0.78);
  overflow: hidden;
}

.reward-result-card.hidden {
  display: none;
}

.reward-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.reward-result-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.reward-result-body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.reward-token-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed rgba(210, 153, 34, 0.7);
  border-radius: 12px;
  background: rgba(210, 153, 34, 0.10);
}

.reward-token-code {
  font-family: Consolas, Monaco, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  font-weight: 900;
  word-break: break-all;
}

.reward-info-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.reward-info-item {
  padding: 11px 12px;
  border: 1px solid rgba(43, 58, 79, 0.75);
  border-radius: 11px;
  background: rgba(21, 29, 40, 0.82);
}

.reward-info-label {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.reward-info-value {
  font-weight: 800;
  white-space: pre-wrap;
}

.reward-message {
  padding: 12px;
  border-radius: 11px;
  background: rgba(21, 29, 40, 0.9);
  color: var(--text);
  white-space: pre-wrap;
}

.reward-result-card.result-ok .reward-result-title {
  color: #3fb950;
}

.reward-result-card.result-error .reward-result-title {
  color: #f85149;
}

.reward-result-card.result-cooldown .reward-result-title {
  color: #d29922;
}

/* Live Global Chat */
.chat-main {
  display: flex;
  flex-direction: column;
}

.chat-page-header {
  margin-bottom: 14px;
}

.page-description {
  margin-top: 6px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid rgba(63, 185, 80, 0.35);
  border-radius: 999px;
  color: var(--ok);
  background: rgba(63, 185, 80, 0.08);
  font-weight: 800;
}

.chat-app {
  height: calc(100vh - 150px);
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
}

.chat-topbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-topbar input[type="search"] {
  width: min(520px, 100%);
}

.chat-stream {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(21, 29, 40, 0.92), rgba(12, 17, 24, 0.92)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.chat-bubble {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  max-width: 880px;
  animation: messageIn 160ms ease-out;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(210,153,34,0.9), rgba(210,153,34,0.28));
  color: #111;
  font-weight: 900;
  font-size: 0.82rem;
  box-shadow: 0 0 0 3px rgba(210,153,34,0.11);
}

.chat-bubble-body {
  padding: 11px 13px;
  border-radius: 16px 16px 16px 4px;
  background: rgba(29, 41, 56, 0.86);
  border: 1px solid rgba(43, 58, 79, 0.9);
}

.chat-bubble-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 5px;
}

.chat-bubble-meta strong {
  color: #b7d4ff;
}

.chat-bubble-meta span::before,
.chat-bubble-meta time::before {
  content: "·";
  margin-right: 6px;
  color: var(--muted);
}

.chat-bubble-text {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chat-empty {
  margin: auto;
  color: var(--muted);
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(190px, 260px) 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(21, 29, 40, 0.9);
}

.chat-composer input[type="text"],
.chat-composer select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 12px;
}

.chat-composer .button {
  min-height: 46px;
}

.chat-send-result {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-send-result.success {
  color: var(--ok);
}

.chat-send-result.warning {
  color: var(--accent);
}

.chat-send-result.error {
  color: var(--danger);
}

.chat-readonly-note {
  padding: 10px 2px;
}

@media (max-width: 900px) {
  .chat-app {
    height: auto;
    min-height: 0;
  }

  .chat-stream {
    height: 60vh;
  }

  .chat-composer {
    grid-template-columns: 1fr;
  }
}

/* Chat send mode helper */
.chat-mode-help {
  margin: -4px 8px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.chat-mode-help::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--muted);
  vertical-align: middle;
}

.chat-mode-help.mode-blue::before {
  background: #58a6ff;
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.45);
}

.chat-mode-help.mode-yellow::before {
  background: #d29922;
  box-shadow: 0 0 12px rgba(210, 153, 34, 0.45);
}

.chat-mode-help.mode-orange::before {
  background: #f0883e;
  box-shadow: 0 0 12px rgba(240, 136, 62, 0.45);
}

.chat-mode-help.mode-red::before {
  background: #f85149;
  box-shadow: 0 0 12px rgba(248, 81, 73, 0.45);
}

.chat-mode-help.mode-neutral::before {
  background: #8b949e;
}

/* Permission/UI polish patch */
.account-link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(16, 23, 32, 0.62);
}

.account-node {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.account-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.account-icon-discord {
  background: linear-gradient(135deg, #5865f2, #3442d9);
  color: white;
}

.account-icon-steam {
  background: linear-gradient(135deg, #1b2838, #66c0f4);
  color: white;
}

.account-link-arrow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1.6rem;
  font-weight: 900;
}

.account-link-arrow.linked {
  color: var(--ok);
  border-color: rgba(63, 185, 80, 0.35);
  background: rgba(63, 185, 80, 0.1);
}

.account-link-arrow.not-linked {
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.35);
  background: rgba(248, 81, 73, 0.1);
}

.profile-small {
  font-size: 0.9rem;
  margin-top: 3px;
}

.online-players-table {
  min-width: 1180px;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 900px) {
  .account-link-card {
    grid-template-columns: 1fr;
  }

  .account-link-arrow {
    transform: rotate(90deg);
  }
}

/* Brand icons in Player Area */
.account-link-icons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.brand-discord {
  color: #ffffff;
  background: #5865f2;
  border-color: rgba(88, 101, 242, 0.75);
}

.brand-steam {
  color: #ffffff;
  background: linear-gradient(135deg, #1b2838, #66c0f4);
  border-color: rgba(102, 192, 244, 0.55);
}

.brand-arrow {
  color: var(--muted);
  font-weight: 900;
  font-size: 1.25rem;
}




.registration-column {
  text-align: center;
  white-space: nowrap;
}

.registration-status {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  user-select: none;
}

.registration-status.registered {
  color: #5ee889;
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.42);
}

.registration-status.not-registered {
  color: #ff7070;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.42);
}

.dashboard-copy-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 2800;
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 28px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(63, 185, 80, 0.52);
  border-radius: 12px;
  background: rgba(12, 20, 30, 0.97);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  color: #e9f1fb;
}

.dashboard-copy-toast[hidden] {
  display: none !important;
}

.dashboard-copy-toast-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(63, 185, 80, 0.16);
  color: #5ee889;
  font-weight: 900;
}

.dashboard-copy-toast-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-copy-toast-copy strong,
.dashboard-copy-toast-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-copy-toast-copy span {
  color: #9fb0c5;
  font-size: 0.86rem;
}

/* Online players table action polish */
.copy-steamid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  margin-left: 8px;
  padding: 4px 9px;
  border: 1px solid rgba(88, 166, 255, 0.35);
  border-radius: 8px;
  background: rgba(88, 166, 255, 0.12);
  color: #c8ddff;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}

.copy-steamid-button:hover,
.copy-steamid-button:focus {
  background: rgba(88, 166, 255, 0.22);
  border-color: rgba(88, 166, 255, 0.7);
  color: #ffffff;
  outline: none;
}

.source-badge {
  cursor: default;
  user-select: text;
}

.online-players-table th,
.online-players-table td {
  vertical-align: middle;
}

.online-players-table .table-actions {
  white-space: nowrap;
}

.copy-steamid-button,
.online-players-table .button.small {
  vertical-align: middle;
}

.player-action-rcon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: rgba(88, 166, 255, 0.55) !important;
  color: #ffffff !important;
}

.player-action-kick {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: rgba(245, 158, 11, 0.65) !important;
  color: #111827 !important;
}

.player-action-ban {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
  border-color: rgba(248, 81, 73, 0.75) !important;
  color: #ffffff !important;
}

.online-players-table .button.small {
  margin-right: 6px;
}

.catalog-field {
  position: relative;
}

.catalog-suggestions {
  position: absolute;
  z-index: 9999;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #31445d;
  border-radius: 12px;
  background: #0c141f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
  padding: 6px;
}

.catalog-option {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #f0f6fc;
  padding: 9px 10px;
  cursor: pointer;
  text-align: left;
}

.catalog-option:hover,
.catalog-option:focus {
  background: rgba(210, 153, 34, 0.16);
  outline: none;
}

.catalog-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-option code {
  color: #9fb6d8;
  font-size: 0.82rem;
}

.catalog-empty {
  padding: 12px;
  color: #9aa8ba;
}



/* Spawn catalog show button */
.catalog-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.catalog-field input {
  min-width: 0;
}

.catalog-show-button {
  border: 1px solid rgba(88, 166, 255, 0.35);
  border-radius: 10px;
  background: rgba(88, 166, 255, 0.12);
  color: #c8ddff;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.catalog-show-button:hover,
.catalog-show-button:focus {
  background: rgba(88, 166, 255, 0.24);
  outline: none;
}

.catalog-suggestions {
  grid-column: 1 / -1;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 99999;
}

/* Chat composer split mode patch */
.chat-composer {
  grid-template-columns: minmax(160px, 210px) minmax(170px, 230px) 1fr auto;
  align-items: end;
}

.composer-field {
  display: grid;
  gap: 6px;
}

.composer-field.disabled {
  opacity: 0.62;
}

.composer-field.disabled select {
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .chat-composer {
    grid-template-columns: 1fr 1fr;
  }

  .chat-composer input[type="text"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .chat-composer {
    grid-template-columns: 1fr;
  }

  .chat-composer input[type="text"] {
    grid-column: auto;
  }
}

.reward-token-hint {
  margin: 6px 0 10px;
  font-size: 0.86rem;
}

/* Public punishment pages */
.punishment-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.punishment-toolbar input[type="search"] {
  width: min(540px, 100%);
}

.punishment-table td {
  vertical-align: top;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

/* Auto restart settings */
.settings-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-weight: 700;
}

.settings-check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-form input[type="time"],
.settings-form input[type="text"],
.settings-form input[type="number"] {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 12px;
  color-scheme: dark;
}


.settings-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-form .settings-number-input {
  width: 110px;
}

.auto-next-announce-settings {
  padding: 12px;
  border: 1px solid rgba(43, 58, 79, 0.75);
  border-radius: 12px;
  background: rgba(16, 23, 32, 0.45);
}

.auto-next-announce-settings small {
  line-height: 1.4;
}

.info-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 12px;
  background: rgba(88, 166, 255, 0.08);
  color: var(--text);
}

.info-box code {
  display: inline-block;
  margin-top: 8px;
  color: #c8ddff;
  overflow-wrap: anywhere;
}

.settings-result {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
}

.settings-result.success {
  color: var(--ok);
}

.settings-result.error {
  color: var(--danger);
}

.settings-result.warning {
  color: var(--accent);
}

.chat-mode-help.mode-green::before {
  background: #3fb950;
  box-shadow: 0 0 12px rgba(63, 185, 80, 0.45);
}

/* Admin audit refresh */
.audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.audit-toolbar label,
.punishment-form label {
  display: grid;
  gap: 6px;
}

.audit-toolbar input[type="search"],
.audit-toolbar select,
.punishment-toolbar select,
.punishment-form input[type="text"],
.punishment-form input[type="number"],
.punishment-form input[type="datetime-local"],
.punishment-form select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 12px;
  color-scheme: dark;
}

.audit-message-cell {
  max-width: 420px;
  overflow-wrap: anywhere;
}

.audit-details-row td {
  background: rgba(88, 166, 255, 0.04);
}

.audit-details-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(88, 166, 255, 0.18);
  border-radius: 12px;
  background: rgba(12, 18, 28, 0.55);
}

.audit-details-box pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: #c8ddff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.button.secondary {
  background: rgba(88, 166, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(88, 166, 255, 0.28);
}

.button.warning {
  background: rgba(210, 153, 34, 0.18);
  color: #f0c36d;
  border: 1px solid rgba(210, 153, 34, 0.38);
}

/* Punishment management */
.punishment-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  margin: 12px auto 0;
  align-items: start;
}

.punishment-field,
.punishment-form .punishment-form-actions {
  grid-column: 1 / -1;
}

.punishment-form .punishment-check-row,
.punishment-form .punishment-form-actions {
  align-self: end;
}

.punishment-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.punishment-duration-parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.punishment-duration-parts > span {
  display: grid;
  gap: 4px;
}

.punishment-duration-parts input {
  width: 100%;
}

@media (min-width: 1100px) {
  .punishment-form--ban .punishment-field--action {
    grid-column: span 2;
  }

  .punishment-form--ban .punishment-field--steamid {
    grid-column: span 2;
  }

  .punishment-form--ban .punishment-field--player {
    grid-column: span 2;
  }

  .punishment-form--ban .punishment-field--reason {
    grid-column: span 3;
  }

  .punishment-form--ban .punishment-field--ban-duration {
    grid-column: span 3;
  }

  .punishment-form--silence .punishment-field--action {
    grid-column: span 2;
  }

  .punishment-form--silence .punishment-field--steamid {
    grid-column: span 3;
  }

  .punishment-form--silence .punishment-field--player {
    grid-column: span 3;
  }

  .punishment-form--silence .punishment-field--reason {
    grid-column: span 4;
  }

  .punishment-form--silence .punishment-field--silence-channel {
    grid-column: 3 / span 4;
    grid-row: 2;
  }

  .punishment-form--silence .punishment-field--silence-duration {
    grid-column: 7 / span 4;
    grid-row: 2;
  }

  .punishment-form--silence .punishment-form-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: center;
  }
}

@media (min-width: 1400px) {
  .punishment-form {
    max-width: 1500px;
  }
}

.punishment-toolbar {
  flex-wrap: wrap;
}

.punishment-toolbar select {
  min-width: 180px;
}

.punishment-table th:last-child,
.punishment-manage-cell {
  text-align: right;
}

.punishment-manage-cell {
  white-space: nowrap;
}

.punishment-manage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.punishment-edit-modal[hidden] {
  display: none;
}

.punishment-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.punishment-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
}

.punishment-edit-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}

.punishment-edit-header {
  align-items: flex-start;
}

.punishment-edit-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.punishment-edit-form label {
  display: grid;
  gap: 6px;
}

.punishment-edit-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.punishment-edit-form input,
.punishment-edit-form textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  color-scheme: dark;
}

.punishment-edit-form textarea {
  min-height: 120px;
  resize: vertical;
}

.punishment-edit-form input[readonly] {
  color: var(--muted);
  background: rgba(7, 12, 18, 0.48);
  cursor: default;
}

.punishment-edit-note {
  margin-top: 0;
}

.punishment-edit-result {
  margin-top: 0;
}

.punishment-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.card-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
}

@media (max-width: 780px) {
  .audit-toolbar,
  .punishment-toolbar,
  .punishment-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-toolbar input[type="search"],
  .audit-toolbar select,
  .punishment-toolbar input[type="search"],
  .punishment-toolbar select {
    width: 100%;
  }

  .punishment-edit-modal {
    padding: 12px;
  }

  .punishment-edit-dialog {
    max-height: calc(100vh - 24px);
  }

  .punishment-edit-readonly-grid {
    grid-template-columns: 1fr;
  }

  .punishment-duration-parts {
    grid-template-columns: 1fr;
  }

  .punishment-edit-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* DB Maintenance */
.db-maintenance-toolbar,
.db-maintenance-cleanup-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.db-maintenance-toolbar input[type="search"],
.db-maintenance-toolbar select,
.db-maintenance-cleanup-form select,
.db-maintenance-cleanup-form input[type="number"],
.db-maintenance-confirm-box input[type="text"] {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 12px;
  color-scheme: dark;
}

.db-maintenance-cleanup-form label,
.db-maintenance-confirm-box label {
  display: grid;
  gap: 6px;
}

.db-maintenance-cleanup-form select {
  min-width: min(520px, 100%);
}

.button.danger {
  background: rgba(248, 81, 73, 0.18);
  color: #ffb3ae;
  border: 1px solid rgba(248, 81, 73, 0.42);
}

.badge-muted {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
}

.db-maintenance-preview-grid {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 8px 16px;
  margin-top: 12px;
}

.db-maintenance-confirm-box {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(248, 81, 73, 0.28);
  border-radius: 12px;
  background: rgba(248, 81, 73, 0.06);
}

@media (max-width: 780px) {
  .db-maintenance-toolbar,
  .db-maintenance-cleanup-form,
  .db-maintenance-confirm-box {
    align-items: stretch;
    flex-direction: column;
  }

  .db-maintenance-toolbar input[type="search"],
  .db-maintenance-toolbar select,
  .db-maintenance-cleanup-form select,
  .db-maintenance-cleanup-form input[type="number"],
  .db-maintenance-confirm-box input[type="text"] {
    width: 100%;
  }
}

/* Error / access denied page */
.login-card.error-card {
  width: min(660px, 100%);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

/* Public Server Info page */
.hidden {
  display: none !important;
}

.server-info-header .page-description {
  max-width: 760px;
}

.server-info-hero {
  margin-bottom: 20px;
}

.server-info-hero-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.server-info-hero-title h2 {
  margin-bottom: 6px;
  font-size: clamp(1.7rem, 2.4vw, 2.5rem);
}

.server-info-hero-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.server-info-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.server-info-section-nav {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(16, 23, 32, 0.84);
}

.server-info-section-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.server-info-section-nav a:hover,
.server-info-section-nav a.active {
  color: var(--text);
  background: var(--panel-soft);
}

.server-info-sections {
  display: grid;
  gap: 18px;
}

.server-info-section-card {
  scroll-margin-top: 24px;
  margin-top: 0;
}

.server-info-field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.server-info-field {
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(43, 58, 79, 0.78);
  border-radius: 12px;
  background: rgba(16, 23, 32, 0.68);
}

.server-info-field-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.server-info-table-wrap {
  margin-top: 16px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid rgba(43, 58, 79, 0.78);
  border-radius: 12px;
}

.server-info-table th {
  position: sticky;
  top: 0;
  background: var(--bg-soft);
  z-index: 1;
}

#server-info-alert[data-type="success"] {
  border-color: rgba(63, 185, 80, 0.35);
  color: #9be9a8;
}

#server-info-alert[data-type="warning"] {
  border-color: rgba(210, 153, 34, 0.38);
  color: #f0d28a;
}

#server-info-alert[data-type="error"] {
  border-color: rgba(248, 81, 73, 0.36);
  color: #ffb4ad;
}

@media (max-width: 1180px) {
  .server-info-hero-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .server-info-layout {
    grid-template-columns: 1fr;
  }

  .server-info-section-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .server-info-hero-title {
    display: grid;
  }

  .server-info-hero-grid {
    grid-template-columns: 1fr;
  }
}

/* Simplified public Server Info page */
.server-info-main .page-header {
  margin-bottom: 22px;
}

.simple-server-info-hero {
  margin-bottom: 16px;
  padding: 22px;
  overflow: hidden;
  border-color: rgba(210, 153, 34, 0.28);
  background:
    radial-gradient(circle at top right, rgba(210, 153, 34, 0.14), transparent 26rem),
    rgba(21, 29, 40, 0.94);
}

.server-info-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.server-info-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.server-info-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #ffcf66;
  background: rgba(210, 153, 34, 0.16);
  border: 1px solid rgba(210, 153, 34, 0.34);
  box-shadow: 0 0 22px rgba(210, 153, 34, 0.1);
}

.server-info-hero-main .server-info-icon {
  width: 58px;
  height: 58px;
  font-size: 1.35rem;
}

.server-info-hero-main h2 {
  margin: 2px 0 4px;
  font-size: clamp(1.7rem, 2.6vw, 2.6rem);
  line-height: 1.05;
}

.server-info-welcome {
  margin: 0;
  max-width: 760px;
  line-height: 1.45;
}

.server-info-hero-details {
  display: grid;
  gap: 10px;
  min-width: min(100%, 360px);
  padding: 14px;
  border: 1px solid rgba(43, 58, 79, 0.78);
  border-radius: 14px;
  background: rgba(11, 15, 20, 0.34);
  color: var(--text);
  font-weight: 800;
}

.server-info-hero-details div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.server-info-hero-details i {
  width: 18px;
  color: var(--accent);
  text-align: center;
}

.server-info-summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 18px;
}

.server-info-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(21, 29, 40, 0.9);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.server-info-summary-card .detail-label,
.server-info-essential-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.server-info-summary-card .detail-value {
  margin-top: 4px;
  font-size: 1.08rem;
  font-weight: 900;
}

.server-info-simple-sections {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.server-info-simple-card {
  padding: 18px;
}


.server-info-wide-card {
  grid-column: 1 / -1;
}


.server-info-settings-table-wrap {
  max-height: none;
}

.server-info-settings-table {
  min-width: 620px;
}

.server-info-settings-table th:nth-child(2),
.server-info-settings-table td:nth-child(2) {
  white-space: nowrap;
  text-align: center;
}

.server-info-setting-value strong {
  color: var(--text);
  font-weight: 900;
}

.server-info-settings-table td:last-child {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.server-info-vehicle-table-wrap {
  max-height: none;
}

.server-info-vehicle-table {
  min-width: 760px;
}

.server-info-vehicle-table th,
.server-info-vehicle-table td {
  text-align: center;
}

.server-info-vehicle-table th:first-child,
.server-info-vehicle-table td:first-child {
  text-align: left;
}

.server-info-vehicle-category-row td {
  text-align: left !important;
  padding-top: 14px;
  padding-bottom: 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(245, 183, 0, 0.06);
  border-top: 1px solid rgba(245, 183, 0, 0.26);
  border-bottom: 1px solid rgba(245, 183, 0, 0.12);
}

.server-info-simple-card-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.server-info-simple-card-title h2 {
  margin: 0 0 4px;
  font-size: 1.22rem;
}

.server-info-simple-card-title .panel-subtitle {
  margin: 0;
  line-height: 1.4;
}

.server-info-essential-list {
  display: grid;
  gap: 8px;
}

.server-info-essential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(43, 58, 79, 0.62);
  border-radius: 11px;
  background: rgba(16, 23, 32, 0.58);
}

.server-info-essential-row strong {
  color: var(--text);
  text-align: right;
  font-size: 0.95rem;
}

@media (max-width: 1180px) {
  .server-info-hero-content {
    align-items: stretch;
    flex-direction: column;
  }

  .server-info-hero-details {
    min-width: 0;
  }

  .server-info-simple-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .simple-server-info-hero {
    padding: 16px;
  }

  .server-info-hero-main {
    align-items: flex-start;
  }

  .server-info-essential-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .server-info-essential-row strong {
    text-align: left;
  }
}

/* Reward contents summary */
.reward-contents-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(88, 166, 255, 0.28);
  border-radius: 12px;
  background: rgba(88, 166, 255, 0.08);
}

.reward-contents-title {
  font-weight: 900;
  color: #b7d4ff;
}

.reward-contents-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.reward-contents-list li {
  color: var(--text);
  font-weight: 700;
}

/* Auto restart multi schedule */
.auto-restart-form {
  max-width: 560px;
}

.auto-schedules {
  display: grid;
  gap: 10px;
}

.auto-schedule-row {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1fr) 42px;
  gap: 10px;
  align-items: center;
}

.auto-schedule-label {
  color: var(--text);
  font-weight: 800;
}

.settings-form .auto-schedule-time {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 12px;
  color-scheme: dark;
}

.round-add-button,
.round-icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(210, 153, 34, 0.44);
  background: rgba(210, 153, 34, 0.16);
  color: #f0c36d;
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
}

.round-add-button {
  margin-top: 2px;
}

.round-add-button:hover,
.round-icon-button:hover {
  background: rgba(210, 153, 34, 0.26);
}

.round-icon-button.danger {
  border-color: rgba(248, 81, 73, 0.42);
  background: rgba(248, 81, 73, 0.14);
  color: #ffb4ae;
}

.round-icon-button.danger:hover {
  background: rgba(248, 81, 73, 0.24);
}

.round-icon-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.card-hint {
  display: block;
  margin-top: 6px;
}

@media (max-width: 620px) {
  .auto-schedule-row {
    grid-template-columns: 1fr 42px;
  }

  .auto-schedule-label {
    grid-column: 1 / -1;
  }
}

/* Dashboard auto restart schedule */
.detail-row-wide {
  grid-column: 1 / -1;
}

.detail-row-restarts {
  background:
    radial-gradient(circle at top left, rgba(63, 185, 80, 0.14), transparent 18rem),
    linear-gradient(135deg, rgba(63, 185, 80, 0.08), rgba(16, 23, 32, 0.74) 56%),
    rgba(16, 23, 32, 0.78);
  border-color: rgba(63, 185, 80, 0.34);
  box-shadow:
    inset 4px 0 0 rgba(63, 185, 80, 0.62),
    0 0 0 1px rgba(63, 185, 80, 0.04);
}

.detail-row-restarts .detail-label {
  color: #b7f7c2;
}

.restart-summary {
  display: grid;
  gap: 12px;
}

.restart-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.restart-summary-mainline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text);
}

.restart-summary-state,
.restart-summary-zone,
.restart-summary-next {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.restart-summary-state {
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #d6fbe0;
  background: rgba(63, 185, 80, 0.15);
  border: 1px solid rgba(63, 185, 80, 0.34);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.restart-summary-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.13), 0 0 12px rgba(63, 185, 80, 0.32);
}

.restart-summary-next {
  color: #d9e9fb;
  font-size: 0.98rem;
  font-weight: 800;
}

.restart-summary-next strong {
  margin-left: 6px;
  color: #ffffff;
  font-size: 1.05rem;
}

.restart-summary-zone {
  padding: 4px 9px;
  border-radius: 999px;
  color: #bfeec8;
  border: 1px solid rgba(63, 185, 80, 0.24);
  background: rgba(8, 13, 20, 0.42);
  font-size: 0.82rem;
  font-weight: 800;
}

.restart-time-chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.restart-time-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #e8f7eb;
  background: rgba(63, 185, 80, 0.09);
  border: 1px solid rgba(63, 185, 80, 0.24);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.restart-time-chip.is-next {
  color: #06130a;
  background: linear-gradient(135deg, #3fb950, #79d88a);
  border-color: rgba(121, 216, 138, 0.92);
  box-shadow:
    0 0 0 3px rgba(63, 185, 80, 0.14),
    0 0 18px rgba(63, 185, 80, 0.18);
}

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

.restart-summary-muted .restart-summary-state {
  color: #d7e1ee;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
}

.restart-summary-muted .restart-summary-state::before {
  background: #8b949e;
  box-shadow: 0 0 0 4px rgba(139, 148, 158, 0.12);
}

.restart-summary-note code {
  display: inline-flex;
  margin: 0 2px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(63, 185, 80, 0.10);
  border: 1px solid rgba(63, 185, 80, 0.18);
}

/* Player stats page */
.stats-summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 20px;
}

.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
}

.stats-toolbar input[type="search"] {
  width: min(540px, 100%);
}

.stats-table-wrap {
  position: relative;
  overflow: auto;
  max-width: 100%;
  border: 1px solid rgba(139, 148, 158, 0.18);
  border-radius: 12px;
  background: rgba(8, 13, 20, 0.32);
  scrollbar-color: rgba(210, 153, 34, 0.56) rgba(8, 13, 20, 0.72);
  scrollbar-width: thin;
}

.stats-table-wrap::-webkit-scrollbar {
  height: 12px;
}

.stats-table-wrap::-webkit-scrollbar-track {
  background: rgba(8, 13, 20, 0.72);
}

.stats-table-wrap::-webkit-scrollbar-thumb {
  border: 3px solid rgba(8, 13, 20, 0.72);
  border-radius: 999px;
  background: rgba(210, 153, 34, 0.56);
}

.stats-table {
  min-width: 2620px;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.stats-table th,
.stats-table td {
  box-sizing: border-box;
  vertical-align: middle;
}

.stats-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.018);
}

.stats-table tbody tr:hover td {
  background: rgba(88, 166, 255, 0.065);
}

.stats-table thead th {
  position: sticky;
  z-index: 4;
  background: #111a26;
  box-shadow: 0 1px 0 var(--border);
}

.stats-group-row th {
  top: 0;
  height: 30px;
  padding: 6px 10px;
  color: #dce7f5;
  border-bottom: 1px solid rgba(139, 148, 158, 0.24);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-align: center;
  text-transform: uppercase;
}

.stats-column-row th {
  top: 30px;
  height: 54px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.stats-group-player {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.16), #111a26) !important;
}

.stats-group-economy {
  background: linear-gradient(180deg, rgba(210, 153, 34, 0.17), #111a26) !important;
}

.stats-group-combat {
  background: linear-gradient(180deg, rgba(248, 81, 73, 0.13), #111a26) !important;
}

.stats-group-activity {
  background: linear-gradient(180deg, rgba(63, 185, 80, 0.14), #111a26) !important;
}

.stats-group-start-economy,
.stats-group-start-combat,
.stats-group-start-activity {
  border-left: 2px solid rgba(210, 153, 34, 0.32) !important;
}

.stats-sort-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}

.stats-number-header .stats-sort-button {
  justify-content: flex-end;
  text-align: right;
}

.stats-sort-button:hover,
.stats-sort-button.active {
  color: var(--text);
}

.stats-column-row th.is-sorted {
  background: rgba(210, 153, 34, 0.12);
}

.stats-sort-indicator {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.85rem;
}

.stats-table .stats-col-name {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
}

.stats-table tbody .stats-col-name,
.stats-table thead .stats-col-name {
  position: sticky;
  left: 0;
}

.stats-table thead .stats-col-name {
  z-index: 7;
  background: #111a26;
}

.stats-table tbody .stats-col-name {
  z-index: 2;
  background: #101923;
  box-shadow: 1px 0 0 rgba(139, 148, 158, 0.22);
}

.stats-table tbody tr:nth-child(even) .stats-col-name {
  background: #121c28;
}

.stats-table tbody tr:hover .stats-col-name {
  background: #172536;
}

.stats-table .stats-col-status {
  width: 88px;
}

.stats-table .stats-col-squad {
  width: 135px;
}

.stats-table .stats-col-playtime {
  width: 112px;
  white-space: nowrap;
}

.stats-table td {
  font-variant-numeric: tabular-nums;
}

.stats-number-header {
  min-width: 98px;
}

.stats-date-header {
  min-width: 126px;
}

.stats-number-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.stats-date-cell {
  width: 126px;
  min-width: 126px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: normal;
}

.stats-next-update-cell {
  width: 104px;
  min-width: 104px;
  font-variant-numeric: tabular-nums;
}

.stats-next-update-header {
  text-align: right;
}

.stats-next-update-countdown {
  color: var(--text);
  letter-spacing: 0.03em;
}

.stats-small {
  margin-top: 3px;
  font-size: 0.78rem;
}

@media (max-width: 780px) {
  .stats-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-toolbar input[type="search"],
  .stats-toolbar select {
    width: 100%;
  }
}

.stats-player-link {
  color: var(--text);
  text-decoration: none;
}

.stats-player-link:hover {
  color: var(--accent);
  text-decoration: underline;
}


/* Sidebar inline groups */
.sidebar-group {
  display: block;
}

.sidebar-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.sidebar-group-summary::-webkit-details-marker {
  display: none;
}

.sidebar-group-summary:hover,
.sidebar-group-summary.active {
  color: var(--text);
  background: var(--panel-soft);
}

.sidebar-group-chevron {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  font-size: 1.08rem;
  line-height: 1;
  font-weight: 900;
  transition: transform 0.15s ease;
}

.sidebar-group[open] .sidebar-group-chevron {
  transform: rotate(180deg);
}

.sidebar-subnav {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(210, 153, 34, 0.34);
}

.sidebar nav .sidebar-subnav a {
  padding: 8px 10px;
  font-size: 0.92rem;
}

/* Server info guide pages */
.server-guide-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-color: rgba(210, 153, 34, 0.28);
  background:
    radial-gradient(circle at top right, rgba(210, 153, 34, 0.14), transparent 24rem),
    rgba(21, 29, 40, 0.94);
}

.server-guide-hero h2 {
  margin-bottom: 6px;
}

.server-guide-hero .muted {
  margin: 0;
  line-height: 1.5;
}

.server-guide-hero-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  color: #ffcf66;
  background: rgba(210, 153, 34, 0.16);
  border: 1px solid rgba(210, 153, 34, 0.34);
  font-size: 1.35rem;
}

.server-guide-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.server-guide-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.server-guide-full {
  margin-bottom: 16px;
}

.server-guide-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-guide-card-title h2 {
  margin: 0;
  font-size: 1.18rem;
}

.server-guide-card-title i {
  color: var(--accent);
}

.server-guide-list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.server-guide-list.compact {
  gap: 6px;
  font-size: 0.94rem;
}

.server-guide-list li,
.reward-guide-items li,
.daily-guide-day li {
  line-height: 1.4;
}

.server-guide-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 12px;
  background: rgba(88, 166, 255, 0.08);
}

.reward-guide-command {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(210, 153, 34, 0.3);
  border-radius: 12px;
  background: rgba(210, 153, 34, 0.09);
}

.reward-guide-command span,
.reward-guide-facts span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reward-guide-command code {
  color: var(--text);
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.reward-guide-facts {
  display: grid;
  gap: 10px;
}

.reward-guide-facts div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(43, 58, 79, 0.72);
  border-radius: 11px;
  background: rgba(16, 23, 32, 0.58);
}

.reward-guide-facts strong {
  line-height: 1.35;
}

.reward-guide-details,
.daily-guide-day {
  border-radius: 12px;
  overflow: hidden;
}

.reward-guide-details {
  border: 1px solid rgba(88, 166, 255, 0.42);
  background: rgba(88, 166, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.04);
}

.daily-guide-day {
  border: 1px solid rgba(210, 153, 34, 0.44);
  background: rgba(210, 153, 34, 0.08);
}

.reward-guide-details summary,
.daily-guide-day summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.02rem;
}

.reward-guide-details summary {
  color: #dbeafe;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.22), rgba(88, 166, 255, 0.08));
}

.daily-guide-day summary {
  color: #ffcf66;
  background: linear-gradient(135deg, rgba(210, 153, 34, 0.20), rgba(210, 153, 34, 0.07));
}

.reward-guide-details summary::marker,
.daily-guide-day summary::marker {
  font-size: 1.35rem;
  line-height: 1;
}

.reward-guide-details summary::marker {
  color: #58a6ff;
}

.daily-guide-day summary::marker {
  color: #ffcf66;
}

.reward-guide-details[open] summary {
  border-bottom: 1px solid rgba(88, 166, 255, 0.24);
}

.daily-guide-day[open] summary {
  border-bottom: 1px solid rgba(210, 153, 34, 0.24);
}

.reward-guide-items,
.daily-guide-day ul {
  margin: 0;
  padding: 0 16px 14px 34px;
  display: grid;
  gap: 6px;
}

.daily-guide-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.daily-guide-day p {
  margin: 0;
  padding: 0 14px 14px;
}


/* Rules guide page */
.rules-guide-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.rules-guide-card {
  gap: 12px;
}

.rules-guide-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rules-guide-number {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #0f1720;
  background: #ffcf66;
  font-weight: 950;
}

.rules-guide-heading h2 {
  margin: 0;
  font-size: 1.16rem;
}

.rules-guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rules-guide-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(210, 153, 34, 0.32);
  border-radius: 999px;
  color: #ffcf66;
  background: rgba(210, 153, 34, 0.09);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rules-guide-warning {
  border-color: rgba(248, 81, 73, 0.32);
  background:
    radial-gradient(circle at top right, rgba(248, 81, 73, 0.12), transparent 24rem),
    rgba(21, 29, 40, 0.94);
}

.rules-guide-warning .server-guide-card-title i {
  color: var(--danger);
}

@media (max-width: 980px) {
  .server-guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .server-guide-hero {
    align-items: flex-start;
    padding: 16px;
  }
}


/* Server map page */
.server-map-panel {
  padding: 0;
  overflow: hidden;
}

.server-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 23, 32, 0.72);
}

.server-map-toolbar h2 {
  margin: 0 0 4px;
}

.server-map-toolbar p {
  margin: 0;
}

.server-map-frame {
  padding: 16px;
  overflow: auto;
  background:
    radial-gradient(circle at top left, rgba(88, 166, 255, 0.10), transparent 24rem),
    rgba(11, 15, 20, 0.64);
}

.server-map-image {
  display: block;
  width: 100%;
  max-width: 1200px;
  height: auto;
  margin: 0 auto;
  border: 1px solid rgba(43, 58, 79, 0.9);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  background: var(--bg-soft);
}

.server-map-error {
  margin: 16px;
}

@media (max-width: 760px) {
  .server-map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .server-map-frame {
    padding: 10px;
  }
}

.squads-table {
  min-width: 980px;
}

/* Squad stats table refinements */
.squads-table {
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
}

.squads-table tbody.squad-group tr:first-child td {
  border-top: 2px solid rgba(210, 153, 34, 0.34);
}

.squads-table tbody.squad-group:nth-of-type(even) td {
  background: rgba(16, 23, 32, 0.34);
}

.squads-table .squad-name-cell {
  min-width: 170px;
  vertical-align: top;
}

.squads-table .squad-score-cell {
  font-weight: 800;
}

/* Vehicle stats page */
.stats-vehicles-table {
  min-width: 720px;
}

.stats-vehicles-table th:not(:first-child),
.stats-vehicles-table td.stats-number-cell {
  text-align: center;
}

.stats-vehicle-category-row td {
  padding-top: 14px;
  color: var(--accent);
  background: rgba(210, 153, 34, 0.08);
  border-top: 1px solid rgba(210, 153, 34, 0.22);
  border-bottom: 1px solid rgba(210, 153, 34, 0.16);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


.stats-vehicle-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}

.stats-vehicle-tab-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(210, 153, 34, 0.34);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(16, 23, 32, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.stats-vehicle-tab-button:hover {
  color: var(--text);
  border-color: rgba(210, 153, 34, 0.72);
  background: rgba(210, 153, 34, 0.13);
  transform: translateY(-1px);
}

.stats-vehicle-tab-button.active,
.stats-vehicle-tab-button[aria-selected="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(210, 153, 34, 0.24), rgba(210, 153, 34, 0.13));
}

.stats-vehicle-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--bg);
  background: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.stats-vehicle-tab-panel[hidden] {
  display: none;
}

.stats-vehicle-tab-panel:not(.active) {
  display: none;
}

.stats-vehicle-tab-panel.active {
  display: block;
}

.stats-owned-count-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 4px 9px;
  border: 1px solid rgba(210, 153, 34, 0.34);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(210, 153, 34, 0.12);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.stats-owned-count-button:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(210, 153, 34, 0.22);
}

.stats-vehicle-status {
  margin: 10px 0 14px;
  font-size: 0.84rem;
}

.vehicle-owner-modal[hidden] {
  display: none;
}

.vehicle-owner-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.vehicle-owner-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
}

.vehicle-owner-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
}

.stats-owned-vehicles-detail-table {
  min-width: 620px;
}

body.modal-open {
  overflow: hidden;
}

/* Vehicle stats owner summary tables */
.stats-vehicle-extra-panel {
  margin-top: 18px;
}

.stats-vehicle-owner-summary-table {
  min-width: 520px;
}

.stats-vehicle-owner-summary-table th:last-child,
.stats-vehicle-owner-summary-table td.stats-number-cell {
  text-align: center;
}

/* Manage Rewards */
.manage-rewards-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.manage-rewards-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.manage-rewards-toolbar label {
  display: grid;
  gap: 6px;
  flex: 1 1 360px;
}

.manage-rewards-toolbar input[type="search"] {
  width: 100%;
  min-height: 44px;
}

.manage-rewards-page-size-field {
  flex: 0 0 150px !important;
}

.manage-rewards-page-size-field select {
  min-height: 44px;
}

.manage-rewards-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.manage-rewards-pagination[hidden] {
  display: none;
}

.manage-rewards-page-summary {
  font-size: 0.84rem;
}

.manage-rewards-page-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.manage-rewards-page-label {
  min-width: 92px;
  text-align: center;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.manage-rewards-page-controls .button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.manage-rewards-table {
  min-width: 1460px;
}

.manage-rewards-table td {
  vertical-align: top;
}

.manage-rewards-table td:nth-child(1),
.manage-rewards-table td:nth-child(2) {
  min-width: 190px;
}

.manage-rewards-table td:nth-child(4),
.manage-rewards-table td:nth-child(6),
.manage-rewards-table td:nth-child(7) {
  min-width: 165px;
}

.manage-rewards-table td:nth-child(5) {
  min-width: 270px;
}

.manage-rewards-character-link {
  color: #8fc5ff;
  text-decoration: none;
}

.manage-rewards-character-link:hover {
  text-decoration: underline;
}

.manage-rewards-status-detail {
  min-height: 34px;
  margin: 7px 0 9px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.manage-rewards-daily-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.manage-rewards-day-input {
  width: 72px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: var(--bg-soft);
  color-scheme: dark;
}

.manage-rewards-table .button.small {
  padding: 7px 9px;
  font-size: 0.78rem;
}

@media (max-width: 780px) {
  .manage-rewards-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manage-rewards-page-size-field {
    flex: 1 1 150px !important;
  }

  .manage-rewards-pagination {
    align-items: stretch;
  }

  .manage-rewards-page-summary,
  .manage-rewards-page-controls {
    width: 100%;
  }

  .manage-rewards-page-controls {
    justify-content: flex-start;
  }
}

/* Server events page */
.server-events-grid {
  display: grid;
  gap: 18px;
}

.server-event-group {
  margin-top: 0;
}

.server-event-subsection {
  margin-top: 18px;
}

.server-event-subsection h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.server-events-table {
  min-width: 820px;
}

.server-events-table th:nth-child(1),
.server-events-table td:nth-child(1) {
  width: 90px;
}

.server-events-table th:nth-child(2),
.server-events-table td:nth-child(2) {
  width: 110px;
}

.server-events-table th:nth-child(3),
.server-events-table td:nth-child(3),
.server-events-table th:nth-child(4),
.server-events-table td:nth-child(4) {
  width: 190px;
}

.status-pill.online,
.status-pill.offline {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill.online {
  color: #8ff0a4;
  background: rgba(63, 185, 80, 0.14);
  border: 1px solid rgba(63, 185, 80, 0.28);
}

.status-pill.offline {
  color: #c7d2e2;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.20);
}

.empty-state.compact {
  padding: 10px 12px;
  font-size: 0.9rem;
}

/* Progressive dashboard loading */
.dashboard-skeleton-card {
  position: relative;
  overflow: hidden;
}

.dashboard-skeleton-line {
  display: block;
  width: 64%;
  height: 1rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(139, 148, 158, 0.12) 0%,
    rgba(139, 148, 158, 0.26) 45%,
    rgba(139, 148, 158, 0.12) 100%
  );
  background-size: 220% 100%;
  animation: dashboardSkeletonPulse 1.35s ease-in-out infinite;
}

.dashboard-skeleton-line-status {
  width: 58%;
  height: 1.55rem;
  margin-top: 10px;
}

.dashboard-skeleton-line-wide {
  width: 88%;
}

.dashboard-skeleton-table .dashboard-skeleton-line {
  min-width: 90px;
}

@keyframes dashboardSkeletonPulse {
  0% { background-position: 100% 0; }
  100% { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-skeleton-line {
    animation: none;
  }
}

/* Keep the stats viewport stable while applying a new sort. */
.stats-table-wrap.is-refreshing {
  cursor: progress;
}

.stats-table-wrap.is-refreshing::after {
  content: "Updating…";
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 12;
  padding: 5px 9px;
  border: 1px solid rgba(210, 153, 34, 0.28);
  border-radius: 999px;
  color: var(--text);
  background: rgba(17, 26, 38, 0.94);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
  font-size: 0.74rem;
  font-weight: 800;
  pointer-events: none;
}

.stats-table-wrap.is-refreshing .stats-table {
  opacity: 0.72;
  transition: opacity 120ms ease;
}

.stats-initial-loading {
  min-height: 180px;
  display: grid;
  place-items: center;
}

/* Manage Gift Keys */
.manage-keys-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.manage-keys-create-panel {
  overflow: visible;
}

.manage-keys-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.manage-keys-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.manage-keys-field > span,
.manage-keys-option-field > span {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
}

.manage-keys-field-wide {
  grid-column: 1 / -1;
}

.manage-keys-field input,
.manage-keys-field select,
.manage-keys-option-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  color-scheme: dark;
}

.manage-keys-command-info {
  margin-top: 16px;
  line-height: 1.55;
}

.manage-keys-reward-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.manage-keys-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.manage-keys-section-heading h3 {
  margin: 0 0 4px;
}

.manage-keys-section-heading p {
  margin: 0;
}

.manage-keys-row-list {
  display: grid;
  gap: 12px;
}

.manage-keys-reward-row {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(9, 14, 21, 0.32);
}

.manage-keys-row-main {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 100px auto;
  gap: 12px;
  align-items: end;
}

.manage-keys-item-select-field {
  min-width: 0;
}

.manage-keys-count-field {
  width: 100px;
}

.manage-keys-options-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.manage-keys-options-grid-vehicle {
  grid-template-columns: repeat(2, minmax(190px, 1fr));
}

.manage-keys-option-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.manage-keys-option-input-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.manage-keys-option-input-row input {
  flex: 1 1 auto;
}

.manage-keys-option-input-row .button {
  flex: 0 0 auto;
}

.manage-keys-create-actions,
.manage-keys-created-command-row,
.manage-keys-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.manage-keys-create-actions {
  margin-top: 20px;
}

.manage-keys-created-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.manage-keys-created-card[hidden] {
  display: none;
}

.manage-keys-created-command-row {
  margin-top: 7px;
}

.manage-keys-created-command-row code {
  display: inline-block;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.95rem;
}

.manage-keys-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.manage-keys-toolbar label {
  display: grid;
  gap: 6px;
  flex: 1 1 360px;
}

.manage-keys-toolbar input[type="search"] {
  width: 100%;
  min-height: 44px;
}

.manage-keys-table {
  min-width: 1380px;
}

.manage-keys-table td {
  vertical-align: top;
}

.manage-keys-table td:nth-child(1) {
  min-width: 180px;
}

.manage-keys-table td:nth-child(2) {
  min-width: 200px;
}

.manage-keys-table td:nth-child(3) {
  min-width: 360px;
}

.manage-keys-table td:nth-child(4),
.manage-keys-table td:nth-child(5),
.manage-keys-table td:nth-child(6) {
  min-width: 170px;
}

.manage-keys-code {
  font-size: 0.9rem;
  font-weight: 800;
}

.manage-keys-row-actions {
  margin-top: 8px;
}

.manage-keys-status-detail {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.manage-keys-reward-line + .manage-keys-reward-line {
  margin-top: 7px;
}

.manage-keys-reward-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.manage-keys-reward-options code {
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .manage-keys-meta-grid,
  .manage-keys-options-grid,
  .manage-keys-options-grid-vehicle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manage-keys-row-main {
    grid-template-columns: minmax(0, 1fr) 90px;
  }

  .manage-keys-row-main .gift-key-remove-row {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .manage-keys-summary-grid,
  .manage-keys-meta-grid,
  .manage-keys-options-grid,
  .manage-keys-options-grid-vehicle,
  .manage-keys-row-main {
    grid-template-columns: 1fr;
  }

  .manage-keys-count-field {
    width: auto;
  }

  .manage-keys-section-heading {
    flex-direction: column;
  }
}

/* Global account menu + personal profile */
.main > .page-header {
  position: relative;
  padding-right: 300px;
}

/* Header controls that belong visually to the account area.
   Keep their right edge aligned with the global account menu and place them
   directly underneath it instead of leaving them floating in the page header. */
.page-header-under-account {
  position: absolute;
  top: 54px;
  right: 0;
  z-index: 20;
  margin: 0;
}

.live-map-header-actions.page-header-under-account {
  justify-content: flex-end;
}

.global-account-menu {
  position: absolute;
  top: 22px;
  right: 32px;
  z-index: 1400;
  width: min(280px, calc(100vw - 28px));
}

.global-account-menu > summary {
  list-style: none;
}

.global-account-menu > summary::-webkit-details-marker {
  display: none;
}

.global-account-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px 6px 7px;
  border: 1px solid rgba(43, 58, 79, 0.95);
  border-radius: 14px;
  background: rgba(16, 23, 32, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  user-select: none;
}

.global-account-summary:hover,
.global-account-menu[open] .global-account-summary {
  border-color: rgba(210, 153, 34, 0.55);
  background: rgba(21, 29, 40, 0.98);
}

.global-account-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, #5865f2, #3442d9);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.18);
}

.global-account-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.global-account-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.global-account-copy strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-account-role,
.profile-access-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.global-account-role.role-root,
.profile-access-badge.access-root,
.profile-access-level.access-root {
  color: #ffd66b;
}

.global-account-role.role-admin,
.profile-access-badge.access-admin,
.profile-access-level.access-admin {
  color: #e3aa2f;
}

.global-account-role.role-moderator,
.profile-access-badge.access-moderator,
.profile-access-level.access-moderator {
  color: #67d878;
}

.global-account-role.role-vip,
.profile-access-badge.access-vip {
  color: #78b7ff;
}

.global-account-role.role-root,
.profile-access-badge.access-root {
  border-color: rgba(255, 214, 107, 0.34);
  background: rgba(255, 214, 107, 0.10);
}

.global-account-role.role-admin,
.profile-access-badge.access-admin {
  border-color: rgba(227, 170, 47, 0.34);
  background: rgba(227, 170, 47, 0.10);
}

.global-account-role.role-moderator,
.profile-access-badge.access-moderator {
  border-color: rgba(103, 216, 120, 0.34);
  background: rgba(103, 216, 120, 0.10);
}

.global-account-role.role-vip,
.profile-access-badge.access-vip {
  border-color: rgba(120, 183, 255, 0.34);
  background: rgba(120, 183, 255, 0.10);
}

.global-account-chevron {
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 120ms ease;
}

.global-account-menu[open] .global-account-chevron {
  transform: rotate(180deg);
}

.global-account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(16, 23, 32, 0.99);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.global-account-identity {
  display: grid;
  gap: 3px;
  padding: 14px;
  border-bottom: 1px solid rgba(43, 58, 79, 0.8);
}

.global-account-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-account-links {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.global-account-links a,
.global-account-logout {
  width: 100%;
  display: block;
  padding: 10px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.global-account-links a:hover,
.global-account-logout:hover {
  background: var(--panel-soft);
}

.global-account-logout-form {
  margin: 0;
  padding: 8px;
  border-top: 1px solid rgba(43, 58, 79, 0.8);
}

.global-account-logout {
  color: #ff908b;
}

.profile-page-main {
  max-width: 1500px;
}

.profile-hero-panel {
  margin-top: 0;
  padding: 22px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar-large {
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(88, 101, 242, 0.65);
  border-radius: 24px;
  background: linear-gradient(135deg, #5865f2, #3442d9);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 900;
  box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.10);
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.profile-hero-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-hero-name-row h2 {
  margin: 0;
}

.profile-link-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 7px;
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.profile-link-status.is-linked {
  color: #79dc8a;
}

.profile-link-status.is-linked .profile-status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.12);
}

.profile-link-status.is-unlinked {
  color: #e8b34c;
}

.profile-link-status.is-unlinked .profile-status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(210, 153, 34, 0.12);
}

.profile-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 20px;
}

.profile-section-panel {
  min-width: 0;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-detail-card,
.profile-access-level-card,
.profile-role-row {
  border: 1px solid rgba(43, 58, 79, 0.82);
  background: rgba(16, 23, 32, 0.64);
}

.profile-detail-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 13px;
  border-radius: 12px;
}

.profile-detail-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-detail-card-wide {
  grid-column: 1 / -1;
}

.profile-detail-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-detail-note {
  font-size: 0.78rem;
}

.profile-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.profile-value-ok {
  color: #79dc8a;
}

.profile-value-warning {
  color: #e8b34c;
}

.profile-access-level-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
}

.profile-access-level {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.profile-role-section {
  margin-top: 17px;
}

.profile-role-section-title {
  margin-bottom: 8px;
  color: #dce7f5;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.profile-role-list {
  display: grid;
  gap: 7px;
}

.profile-role-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 10px;
}

.profile-role-check {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #79dc8a;
  background: rgba(63, 185, 80, 0.11);
  font-size: 0.78rem;
  font-weight: 900;
}

.profile-role-name {
  font-weight: 800;
}

.profile-role-source {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.profile-role-source.is-inherited {
  color: #a9c7e8;
  background: rgba(88, 166, 255, 0.10);
  border: 1px solid rgba(88, 166, 255, 0.20);
}

.profile-role-source.is-direct {
  color: #d4b566;
  background: rgba(210, 153, 34, 0.09);
  border: 1px solid rgba(210, 153, 34, 0.20);
}

.profile-empty-role {
  padding: 10px 2px;
}

.profile-shortcuts-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.profile-shortcuts-panel h2 {
  margin-bottom: 4px;
}

@media (max-width: 1100px) {
  .main > .page-header {
    padding-right: 0;
    padding-top: 58px;
  }

  .page-header-under-account {
    position: static;
    margin-left: auto;
    align-self: flex-start;
  }

  .global-account-menu {
    top: 14px;
    right: 18px;
  }

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

@media (max-width: 620px) {
  .global-account-menu {
    width: min(244px, calc(100vw - 24px));
    top: 10px;
    right: 12px;
  }

  .global-account-summary {
    min-height: 44px;
  }

  .global-account-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .global-account-copy strong {
    max-width: 110px;
  }

  .profile-hero {
    align-items: flex-start;
  }

  .profile-avatar-large {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    border-radius: 18px;
  }

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

  .profile-detail-card-wide {
    grid-column: auto;
  }

  .profile-shortcuts-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-shortcuts-panel .button {
    text-align: center;
  }
}

/* Chat command visibility */
.chat-filter-control {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.chat-filter-control select {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 9px 12px;
  color-scheme: dark;
}

.chat-bubble-command .chat-bubble-body {
  border-color: rgba(210, 153, 34, 0.48);
  background: rgba(210, 153, 34, 0.08);
}

.chat-command-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(210, 153, 34, 0.45);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(210, 153, 34, 0.1);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.chat-bubble-meta .chat-command-badge::before {
  content: none;
  margin: 0;
}

/* ROOT Safe Restart */
.safe-restart-cards {
  margin-bottom: 18px;
}

.safe-restart-panel {
  max-width: 980px;
}

.safe-restart-warning {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 14px;
  background: rgba(248, 81, 73, 0.08);
}

.safe-restart-warning strong {
  color: #ffb3ae;
}

.safe-restart-warning p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.safe-restart-warning code {
  color: var(--text);
}

.safe-restart-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.safe-restart-actions .button.danger {
  min-height: 46px;
}

@media (max-width: 900px) {
  .chat-topbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .chat-filter-control {
    width: 100%;
  }

  .chat-filter-control select {
    width: 100%;
  }
}

/* ROOT Bot Settings */
.bot-settings-intro,
.bot-settings-panel {
  margin-top: 18px;
}

.bot-settings-file-meta code {
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid #2b425b;
  border-radius: 10px;
  background: #0d151f;
  color: #c8d7e7;
  font-size: 12px;
}

.bot-settings-reload-hint {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-top: 14px;
}

.bot-settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.bot-settings-toolbar-left {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bot-settings-editor {
  margin-top: 14px;
}

.bot-settings-tree {
  display: grid;
  gap: 12px;
}

.bot-settings-object {
  border: 1px solid #293c52;
  border-radius: 12px;
  background: #111b27;
  overflow: hidden;
}

.bot-settings-object > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-weight: 800;
  color: #edf4fb;
  background: #121e2b;
  border-bottom: 1px solid transparent;
}

.bot-settings-object[open] > summary {
  border-bottom-color: #293c52;
}

.bot-settings-object > summary::-webkit-details-marker {
  display: none;
}

.bot-settings-object > summary::after {
  content: "▾";
  color: #d89b18;
  font-size: 12px;
}

.bot-settings-object:not([open]) > summary::after {
  transform: rotate(-90deg);
}

.bot-settings-object > summary small {
  margin-left: auto;
  color: #8fa3b8;
  font-weight: 500;
}

.bot-settings-object-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.bot-settings-object-body .bot-settings-object {
  background: #0f1823;
}

.bot-settings-field {
  display: grid;
  gap: 6px;
}

.bot-settings-field-label {
  font-size: 12px;
  color: #9fc8ee;
  font-weight: 700;
}

.bot-settings-field input[type="text"],
.bot-settings-field input[type="password"],
.bot-settings-field input[type="number"],
.bot-settings-ini-editor,
.bot-settings-json-editor {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #2d435c;
  border-radius: 10px;
  background: #0c141e;
  color: #f3f7fb;
  padding: 10px 12px;
  font: inherit;
}

.bot-settings-field input:focus,
.bot-settings-ini-editor:focus,
.bot-settings-json-editor:focus {
  outline: 2px solid #d89b18;
  outline-offset: 1px;
}

.bot-settings-field-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #24384e;
  border-radius: 10px;
  background: #0d1620;
}

.bot-settings-field-checkbox .bot-settings-field-label {
  min-width: 180px;
}

.bot-settings-field-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: #d89b18;
}

.bot-settings-secret-hint {
  line-height: 1.35;
}

.bot-settings-array-item {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #2d435c;
  border-radius: 10px;
  background: #0c151f;
}

.bot-settings-icon-button {
  justify-self: end;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 2px 4px;
  font: inherit;
  font-size: 12px;
}

.danger-text {
  color: #ff8a8a;
}

.bot-settings-add-button {
  justify-self: start;
}

.bot-settings-empty {
  padding: 8px 0;
}

.bot-settings-json-editor,
.bot-settings-ini-editor {
  min-height: 360px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
}

.bot-settings-json-editor {
  min-height: 620px;
}

.bot-settings-advanced-warning {
  margin-bottom: 12px;
}

.bot-settings-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bot-settings-access-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #293c52;
  border-radius: 12px;
  background: #101a26;
}

.bot-settings-access-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.bot-settings-access-title > div {
  display: grid;
  gap: 3px;
}

.bot-settings-access-title small {
  color: #8fa3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.bot-settings-access-card .bot-settings-ini-editor {
  min-height: 260px;
}

.sidebar-subnav-settings a {
  font-size: 13px;
}

@media (max-width: 1100px) {
  .bot-settings-access-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .bot-settings-toolbar,
  .bot-settings-file-meta,
  .bot-settings-access-title {
    align-items: stretch;
  }

  .bot-settings-toolbar {
    flex-direction: column;
  }

  .bot-settings-toolbar-left {
    width: 100%;
  }

  .bot-settings-toolbar .button {
    width: 100%;
  }

  .bot-settings-field-checkbox {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

/* ROOT Reward Pack Manager */
.pack-manager {
  display: grid;
  gap: 16px;
}

.pack-category-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pack-category-tab,
.pack-selector-item,
.daily-day-tab,
.pack-catalog-result {
  border: 1px solid #2b4057;
  background: #0f1823;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.pack-category-tab {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 12px;
}

.pack-category-tab strong {
  font-size: 14px;
}

.pack-category-tab small,
.pack-selector-header small,
.pack-selector-item small,
.daily-day-tab small {
  color: #8fa3b8;
  font-size: 11px;
}

.pack-category-tab.active,
.pack-selector-item.active,
.daily-day-tab.active {
  border-color: rgba(216, 155, 24, 0.75);
  background: rgba(216, 155, 24, 0.1);
  box-shadow: inset 0 0 0 1px rgba(216, 155, 24, 0.15);
}

.pack-manager-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.pack-selector,
.daily-selector-wrap,
.pack-editor-content,
.pack-preview-card,
.pack-reward-block,
.pack-empty-state {
  border: 1px solid #293c52;
  border-radius: 12px;
  background: #101a26;
}

.pack-selector {
  position: sticky;
  top: 14px;
  overflow: hidden;
}

.pack-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #293c52;
}

.pack-selector-header > div {
  display: grid;
  gap: 3px;
}

.pack-selector-list {
  display: grid;
  gap: 7px;
  padding: 10px;
  max-height: 620px;
  overflow: auto;
}

.pack-selector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  text-align: left;
}

.pack-selector-item > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pack-selector-item strong,
.pack-selector-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-selector-empty,
.pack-empty-state,
.pack-empty-rewards,
.pack-catalog-empty {
  padding: 16px;
}

.pack-empty-state {
  display: grid;
  gap: 5px;
}

.pack-active-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(77, 196, 98, 0.4);
  border-radius: 999px;
  background: rgba(77, 196, 98, 0.1);
  color: #77db87;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.pack-manager-main {
  min-width: 0;
}

.pack-editor-content {
  padding: 14px;
}

.pack-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.pack-editor-head h2,
.pack-reward-block h3,
.pack-preview-card h3 {
  margin: 3px 0 4px;
}

.pack-editor-head code,
.pack-reward-row-head code {
  color: #9db0c4;
  font-size: 11px;
}

.pack-editor-actions,
.pack-reward-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pack-editor-actions {
  justify-content: flex-end;
}

.pack-meta-grid,
.reward-value-grid,
.pack-reward-fields {
  display: grid;
  gap: 10px;
}

.pack-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.reward-value-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pack-reward-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pack-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.pack-field-label {
  color: #9fc8ee;
  font-size: 12px;
  font-weight: 700;
}

.pack-field input,
.pack-field select {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid #2d435c;
  border-radius: 9px;
  background: #0c141e;
  color: #f3f7fb;
  padding: 8px 10px;
  font: inherit;
  color-scheme: dark;
}

.pack-field input:focus,
.pack-field select:focus {
  outline: 2px solid #d89b18;
  outline-offset: 1px;
}

.pack-field input[readonly] {
  color: #9db0c4;
  background: #0e1721;
}

.pack-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 14px;
  align-items: start;
}

.reward-builder {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.pack-reward-block {
  padding: 12px;
}

.pack-reward-block-head {
  margin-bottom: 10px;
}

.pack-reward-block-head p {
  margin: 2px 0 0;
  font-size: 12px;
}

.pack-reward-list {
  display: grid;
  gap: 9px;
}

.pack-reward-row {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid #263b51;
  border-radius: 10px;
  background: #0c151f;
}

.pack-reward-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pack-reward-row-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pack-reward-row-head strong,
.pack-reward-row-head code {
  overflow-wrap: anywhere;
}

.pack-remove-button,
.pack-modal-close {
  border: 0;
  background: transparent;
  color: #ff9292;
  cursor: pointer;
  font: inherit;
}

.pack-remove-button {
  font-size: 12px;
}

.pack-location-grid {
  display: contents;
}

.pack-advanced-options {
  border-top: 1px dashed #2a4057;
  padding-top: 9px;
}

.pack-advanced-options summary {
  cursor: pointer;
  color: #9fc8ee;
  font-size: 12px;
  font-weight: 700;
}

.pack-advanced-grid {
  margin-top: 10px;
}

.pack-preview-card {
  position: sticky;
  top: 14px;
  padding: 13px;
}

.pack-preview-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: #dfe9f3;
}

.daily-selector-wrap {
  overflow: hidden;
}

.daily-day-tabs {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
}

.daily-day-tab {
  display: grid;
  gap: 2px;
  flex: 0 0 118px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 9px;
  text-align: left;
}

.daily-day-tab.outside-range {
  opacity: 0.62;
}

.pack-catalog-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 11, 0.78);
  backdrop-filter: blur(4px);
}

.pack-catalog-modal {
  width: min(760px, 96vw);
  max-height: min(760px, 90vh);
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #35506d;
  border-radius: 14px;
  background: #101a26;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.pack-catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pack-catalog-header h3 {
  margin: 2px 0 0;
}

.pack-modal-close {
  color: #c9d6e3;
  font-size: 27px;
  line-height: 1;
}

.pack-catalog-results {
  display: grid;
  gap: 7px;
  max-height: 520px;
  overflow-y: auto;
}

.pack-catalog-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  text-align: left;
}

.pack-catalog-result:hover {
  border-color: #d89b18;
  background: rgba(216, 155, 24, 0.08);
}

.pack-catalog-result > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pack-catalog-result small {
  color: #8fa3b8;
  overflow-wrap: anywhere;
}

.pack-catalog-result em {
  color: #d89b18;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .pack-category-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pack-builder-layout {
    grid-template-columns: 1fr;
  }

  .pack-preview-card {
    position: static;
  }
}

@media (max-width: 920px) {
  .pack-manager-layout {
    grid-template-columns: 1fr;
  }

  .pack-selector {
    position: static;
  }

  .pack-selector-list {
    max-height: 260px;
  }

  .pack-meta-grid,
  .reward-value-grid,
  .pack-reward-fields {
    grid-template-columns: 1fr;
  }

  .pack-location-grid {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .pack-category-tabs {
    grid-template-columns: 1fr;
  }

  .pack-editor-head,
  .pack-selector-header,
  .pack-reward-row-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pack-editor-actions .button,
  .pack-selector-header .button {
    width: 100%;
  }
}

/* ROOT Bot Settings UX v2 */
.bot-settings-guide {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #2d435c;
  border-radius: 12px;
  background: #0e1823;
}

.bot-settings-guide > div {
  display: grid;
  gap: 5px;
}

.bot-settings-guide strong {
  color: #f3f7fb;
}

.bot-settings-guide span,
.bot-settings-guide small {
  color: #9db0c4;
  line-height: 1.45;
}

.bot-settings-guide code,
.bot-settings-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.bot-settings-object > summary {
  align-items: flex-start;
}

.bot-settings-summary-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.bot-settings-summary-copy > strong {
  color: #edf4fb;
}

.bot-settings-summary-copy > small {
  color: #8fa3b8;
  font-weight: 500;
  line-height: 1.35;
}

.bot-settings-summary-meta {
  flex: 0 0 auto;
  margin-left: auto;
  color: #8fa3b8;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.bot-settings-section > summary {
  padding: 15px 16px;
  background: #13202e;
}

.bot-settings-section > summary .bot-settings-summary-copy > strong {
  font-size: 15px;
}

.bot-settings-section > .bot-settings-object-body {
  padding: 16px;
}

.bot-settings-field {
  padding: 10px 12px;
  border: 1px solid #23364a;
  border-radius: 10px;
  background: #0c151f;
}

.bot-settings-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.bot-settings-path {
  color: #6f859b;
  font-size: 10px;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-align: right;
}

.bot-settings-field-help {
  color: #8fa3b8;
  font-size: 11px;
  line-height: 1.4;
}

.bot-settings-field-checkbox {
  display: grid;
  align-items: initial;
  min-height: 0;
}

.bot-settings-field-checkbox .bot-settings-field-label {
  min-width: 0;
}

.bot-settings-checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  min-height: 34px;
}

.bot-settings-checkbox-state {
  color: #e7eef6;
  font-weight: 700;
}

/* Reward Pack Manager UX v2 */
.pack-manager-guide,
.pack-active-control {
  border: 1px solid #2a4057;
  border-radius: 12px;
  background: #0d1721;
}

.pack-manager-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 14px;
  padding: 14px 16px;
}

.pack-manager-guide > div,
.pack-active-control > div:first-child {
  display: grid;
  gap: 5px;
}

.pack-manager-guide strong,
.pack-active-control strong {
  color: #f3f7fb;
}

.pack-manager-guide span,
.pack-active-control small {
  color: #93a8bc;
  font-size: 12px;
  line-height: 1.4;
}

.pack-manager-guide-backup {
  padding-left: 14px;
  border-left: 1px solid #293c52;
}

.pack-active-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
}

.pack-active-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 9px;
  min-width: min(520px, 48%);
}

.pack-active-select,
.pack-cycle-input {
  min-height: 40px;
  border: 1px solid #2d435c;
  border-radius: 9px;
  background: #0c141e;
  color: #f3f7fb;
  padding: 8px 10px;
  font: inherit;
  color-scheme: dark;
}

.pack-active-select {
  min-width: 280px;
  flex: 1 1 360px;
}

.pack-active-badge.pending {
  border-color: rgba(216, 155, 24, 0.5);
  background: rgba(216, 155, 24, 0.12);
  color: #f0bd4c;
}

.pack-editor-content {
  padding: 16px;
}

.pack-builder-layout {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
}

.pack-reward-row.compact {
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.pack-reward-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.pack-reward-identity strong,
.pack-reward-identity code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-reward-identity code {
  color: #8499ad;
  font-size: 10px;
}

.pack-reward-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pack-reward-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #2b4057;
  border-radius: 999px;
  background: #111e2a;
  color: #b9c9d8;
  font-size: 10px;
  font-weight: 700;
}

.pack-reward-compact-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pack-entry-modal {
  width: min(760px, 96vw);
  max-height: min(820px, 92vh);
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow-y: auto;
  border: 1px solid #35506d;
  border-radius: 14px;
  background: #101a26;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.pack-entry-modal code {
  color: #8ea3b7;
  font-size: 11px;
}

.pack-entry-form,
.pack-entry-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pack-entry-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #293c52;
  border-radius: 10px;
  background: #0d1620;
}

.pack-entry-section-title {
  display: grid;
  gap: 3px;
}

.pack-entry-section-title small,
.pack-entry-advanced summary small {
  color: #8fa3b8;
  font-size: 11px;
}

.pack-entry-advanced summary {
  cursor: pointer;
  display: grid;
  gap: 3px;
  list-style: none;
}

.pack-entry-advanced-grid {
  margin-top: 10px;
}

.pack-entry-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

@media (max-width: 980px) {
  .pack-manager-guide {
    grid-template-columns: 1fr;
  }

  .pack-manager-guide-backup {
    padding-left: 0;
    padding-top: 12px;
    border-left: 0;
    border-top: 1px solid #293c52;
  }

  .pack-active-control {
    align-items: stretch;
    flex-direction: column;
  }

  .pack-active-actions {
    min-width: 0;
    width: 100%;
    justify-content: stretch;
  }

  .pack-active-select {
    min-width: 0;
  }

  .pack-reward-row.compact {
    grid-template-columns: 1fr;
  }

  .pack-reward-compact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .bot-settings-guide,
  .bot-settings-field-head,
  .pack-active-actions,
  .pack-entry-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .bot-settings-path {
    text-align: left;
  }

  .pack-entry-form,
  .pack-entry-advanced-grid {
    grid-template-columns: 1fr;
  }
}

.pack-meta-grid.pack-meta-simple {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.pack-technical-details {
  min-width: 190px;
  padding: 9px 11px;
  border: 1px solid #2a4057;
  border-radius: 9px;
  background: #0d1620;
}

.pack-technical-details summary {
  cursor: pointer;
  color: #9fc8ee;
  font-size: 12px;
  font-weight: 700;
}

.pack-technical-details > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 9px;
  margin-top: 9px;
  color: #8fa3b8;
  font-size: 11px;
}

.pack-technical-details code {
  color: #c2d0df;
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  .pack-meta-grid.pack-meta-simple {
    grid-template-columns: 1fr;
  }
}

.pack-create-help {
  padding: 10px 12px;
  border: 1px solid #2a4057;
  border-radius: 9px;
  background: #0d1620;
  color: #9db0c4;
  font-size: 12px;
  line-height: 1.45;
}

/* ROOT Bot Messages */
.bot-messages-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.bot-messages-settings-panel,
.bot-messages-list-panel {
  margin-top: 18px;
}

.bot-messages-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.bot-messages-toggle-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 17, 26, 0.35);
  cursor: pointer;
}

.bot-messages-toggle-card input,
.bot-message-enabled-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.bot-messages-toggle-card span,
.bot-message-enabled-toggle span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bot-messages-toggle-card small,
.bot-message-enabled-toggle small {
  color: var(--muted);
  font-weight: 400;
}

.bot-messages-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bot-messages-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.bot-messages-field input,
.bot-messages-field textarea,
.bot-messages-field select,
.bot-message-color-select-wrap select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-deep, #0d1722);
  color: var(--text);
  font: inherit;
}

.bot-messages-field input,
.bot-messages-field select,
.bot-message-color-select-wrap select {
  min-height: 42px;
  padding: 9px 11px;
}

.bot-messages-field textarea {
  min-height: 70px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.4;
}

.bot-messages-field input:focus,
.bot-messages-field textarea:focus,
.bot-messages-field select:focus,
.bot-message-color-select-wrap select:focus {
  outline: none;
  border-color: #3a78b6;
  box-shadow: 0 0 0 2px rgba(58, 120, 182, 0.15);
}

.bot-messages-info-box {
  margin-top: 16px;
}

.bot-messages-list-title-row {
  align-items: center;
}

.bot-messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.bot-messages-empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(8, 17, 26, 0.25);
}

.bot-message-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 17, 26, 0.35);
}

.bot-message-order {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-right: 1px solid var(--border);
  padding-right: 14px;
}

.bot-message-number {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.bot-message-order-buttons {
  display: flex;
  gap: 6px;
}

.button.tiny {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.bot-message-main {
  min-width: 0;
}

.bot-message-options-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr);
  gap: 14px;
  margin-top: 12px;
  align-items: end;
}

.bot-message-color-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.bot-message-color-select-wrap select {
  padding-left: 36px;
}

.bot-message-color-dot {
  position: absolute;
  z-index: 1;
  left: 13px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #d1885e;
  pointer-events: none;
}

.bot-message-color-select-wrap.color-white .bot-message-color-dot { background: #f4f4f4; }
.bot-message-color-select-wrap.color-blue .bot-message-color-dot { background: #5aa9ff; }
.bot-message-color-select-wrap.color-green .bot-message-color-dot { background: #4fd66b; }
.bot-message-color-select-wrap.color-yellow .bot-message-color-dot { background: #f3c84b; }
.bot-message-color-select-wrap.color-orange .bot-message-color-dot { background: #d1885e; }
.bot-message-color-select-wrap.color-red .bot-message-color-dot { background: #ef5b5b; }

.bot-message-enabled-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(13, 23, 34, 0.65);
  cursor: pointer;
}

.bot-message-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.bot-messages-savebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.bot-messages-savebar .settings-result {
  flex: 1 1 auto;
  margin: 0;
}

.bot-messages-save-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

@media (max-width: 1200px) {
  .bot-messages-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .bot-messages-settings-grid,
  .bot-message-options-row {
    grid-template-columns: 1fr;
  }

  .bot-message-card {
    grid-template-columns: 1fr;
  }

  .bot-message-order {
    flex-direction: row;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 10px;
  }

  .bot-message-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 620px) {
  .bot-messages-status-grid {
    grid-template-columns: 1fr;
  }

  .bot-messages-savebar {
    flex-direction: column;
    align-items: stretch;
  }

  .bot-messages-save-actions {
    justify-content: flex-end;
  }
}
