:root {
  --accent: #005fb8;
  --accent-soft: rgba(0, 95, 184, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 232px;
  --topbar-h: 56px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", Consolas, "SF Mono", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #efe6d8;
  --bg-elev: #faf6ef;
  --bg-card: #ffffff;
  --bg-soft: #f3ede2;
  --sidebar-bg: #f7f1e7;
  --text: #26221c;
  --text-muted: #7a7365;
  --border: rgba(90, 78, 56, 0.16);
  --shadow: 0 2px 10px rgba(90, 78, 56, 0.10);
  --shadow-lg: 0 12px 34px rgba(60, 50, 30, 0.22);
  --ok: #1f9d62;
  --danger: #d64545;
  --input-bg: #ffffff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111418;
  --bg-elev: #161a20;
  --bg-card: #1b2027;
  --bg-soft: #20262e;
  --sidebar-bg: #0d1013;
  --text: #e6e6e6;
  --text-muted: #8b919b;
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.55);
  --ok: #35c07e;
  --danger: #ef5350;
  --input-bg: #11151a;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

html {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select {
  font-family: inherit;
  font-size: 13px;
}

/* ---------- layout ---------- */
#app {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  transition: width 0.2s ease, margin 0.2s ease;
  z-index: 30;
}

.mobile-nav-backdrop {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

html.sidebar-is-collapsed #sidebar {
  width: 64px;
}

html.sidebar-is-collapsed .brand-text,
html.sidebar-is-collapsed .nav-item .nav-label,
html.sidebar-is-collapsed .sidebar-status,
html.sidebar-is-collapsed .sidebar-version {
  display: none;
}

html.sidebar-is-collapsed .sidebar-brand {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
}

html.sidebar-is-collapsed .sidebar-toggle {
  margin-left: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #2f8fe0);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.brand-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-toggle {
  margin-left: auto;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.sidebar-nav {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav-bottom {
  flex: 0 0 auto;
  overflow: visible;
  border-top: 1px solid var(--border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  font-weight: 500;
}

.nav-item[hidden] {
  display: none;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.sidebar-is-collapsed .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

html[data-theme="dark"] .nav-item.active {
  color: #7fb3ff;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-status {
  overflow: hidden;
  text-overflow: ellipsis;
}

#main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

#mobile-menu-btn {
  display: none;
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  width: 260px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.lang-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.auth-area {
  display: flex;
  align-items: center;
}

.auth-btn[hidden],
.auth-user[hidden] {
  display: none;
}

.autojoin-bar[hidden] {
  display: none;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #1b2838;
  border: 1px solid #2a475e;
  color: #c7d5e0;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.auth-btn:hover {
  background: #2a475e;
  border-color: #66c0f4;
  color: #fff;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 6px 4px 5px;
  max-width: 210px;
}

.auth-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #1b2838;
  flex-shrink: 0;
}

.auth-avatar.lg {
  width: 44px;
  height: 44px;
}

.auth-name {
  font-size: 12.5px;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.account-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.account-info .muted {
  margin: 0;
  font-size: 12px;
}

.account-info a {
  color: var(--accent);
  font-size: 12.5px;
  text-decoration: none;
}

.account-info a:hover {
  text-decoration: underline;
}

.content {
  padding: 18px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.view-head {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.view-title {
  margin: 0;
  font-size: 18px;
}

.view-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  outline: none;
}

.segmented {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}

.segmented .seg {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.segmented .seg.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.segmented.wide .seg {
  padding: 8px 18px;
}

/* ---------- community tabs ---------- */
.community-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.community-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.community-tab:hover {
  border-color: var(--accent);
}

.community-tab.active {
  border-color: var(--tab-accent, var(--accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tab-accent, var(--accent)) 30%, transparent);
}

.ct-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tab-accent, var(--accent));
}

.ct-check {
  color: var(--tab-accent, var(--accent));
  font-weight: 700;
}

.ct-count {
  background: var(--bg-soft);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.community-tab.active .ct-count {
  background: color-mix(in srgb, var(--tab-accent, var(--accent)) 18%, transparent);
  color: var(--tab-accent, var(--accent));
}

/* ---------- server filters ---------- */
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.filter-badge {
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}

.filter-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  width: min(340px, calc(100vw - 24px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-panel[hidden] {
  display: none;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.filter-quick {
  display: inline-flex;
  gap: 10px;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover:not(:disabled) {
  text-decoration: underline;
}

.link-btn:disabled {
  color: var(--text-muted);
  cursor: default;
  opacity: 0.45;
}

.filter-hint {
  font-size: 12px;
}

.filter-community-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
}

.filter-community .ct-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.filter-toggles .check-label {
  display: flex;
  width: 100%;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* ---------- server cards ---------- */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.server-grid[hidden] {
  display: none;
}

.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}

.server-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.server-card.offline {
  opacity: 0.58;
}

.card-map {
  position: relative;
  height: 108px;
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  overflow: hidden;
}

.card-map::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.62));
  pointer-events: none;
}

.card-map-name {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--mono);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-community {
  position: absolute;
  top: 9px;
  left: 11px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.card-status {
  position: absolute;
  top: 9px;
  right: 11px;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.card-status.on {
  background: rgba(53, 192, 126, 0.9);
  color: #04231a;
}

.card-status.off {
  background: rgba(120, 125, 135, 0.85);
  color: #222;
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.card-title {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.6em;
}

.card-map-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.map-cn {
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
}

.card-players {
  display: flex;
  align-items: center;
  gap: 10px;
}

.players-text {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
}

.player-bar {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
  display: inline-block;
}

.player-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #46a3ef);
  transition: width 0.4s ease;
}

.player-bar.wide {
  flex: 0 0 90px;
}

.card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}

.tag {
  background: var(--bg-soft);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
}

.tag.game, .tag.region {
  border: 1px solid var(--border);
  background: transparent;
}

.tag.ping {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.tag.map-run {
  background: var(--accent-soft);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .tag.map-run {
  color: #7fb3ff;
}

.tag.run-tag {
  background: var(--accent-soft);
  color: var(--accent);
}

html[data-theme="dark"] .tag.run-tag {
  color: #7fb3ff;
}

/* ---------- server list ---------- */
.server-row {
  display: grid;
  grid-template-columns: 22px 2fr 1.4fr 150px auto;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.server-row:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.server-row.offline {
  opacity: 0.55;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.on {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
}

.status-dot.off {
  background: var(--text-muted);
}

.row-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.row-map-en {
  font-family: var(--mono);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-map-cn {
  color: var(--text-muted);
  font-size: 12px;
}

.row-players {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn.small {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.btn.small.active, .fav-filter.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.fav-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s, transform 0.15s;
}

.fav-btn:hover {
  color: #f0b429;
  transform: scale(1.15);
}

.fav-btn.on {
  color: #f0b429;
}

.btn.fav-btn {
  font-size: 13px;
  border: 1px solid var(--border);
  padding: 8px 12px;
}

.btn.fav-btn.on {
  border-color: rgba(240, 180, 41, 0.55);
  color: #f0b429;
}

.sub-map-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}

.sub-map-btn:hover:not(:disabled) {
  color: var(--accent);
  transform: scale(1.15);
}

.sub-map-btn.on {
  color: #f0b429;
}

.sub-map-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn.sub-map-btn {
  font-size: 13px;
  border: 1px solid var(--border);
  padding: 8px 12px;
}

.btn.sub-map-btn.on {
  border-color: rgba(240, 180, 41, 0.55);
  color: #f0b429;
}

.loading-hint, .empty-hint {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
}

.empty-hint {
  grid-column: 1 / -1;
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 52px 16px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 34px;
  line-height: 1;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.empty-state-desc {
  max-width: 460px;
  font-size: 13px;
}

.empty-state-btn {
  margin-top: 8px;
}

/* ---------- login required ---------- */
.login-required {
  padding: 34px 20px;
  text-align: center;
}

.login-required-icon {
  font-size: 30px;
  margin-bottom: 10px;
}

.login-required-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-required p {
  margin: 0 auto 18px;
  max-width: 320px;
  line-height: 1.6;
}

/* ---------- modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 480px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: popIn 0.16s ease;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.detail-map-banner {
  position: relative;
  height: 110px;
  display: flex;
  align-items: flex-end;
  padding: 14px 16px;
}

.detail-map-name {
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
}

.modal-body {
  padding: 16px 18px 18px;
}

.detail-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.detail-map-cn {
  color: var(--text-muted);
  margin-top: 3px;
}

.detail-meta {
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.detail-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.detail-item > span:first-child {
  color: var(--text-muted);
}

.detail-item b {
  font-weight: 600;
  word-break: break-all;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.autojoin-setup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.aj-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.aj-label input {
  width: 72px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

.aj-label input:focus {
  border-color: var(--accent);
}

.aj-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  max-width: 100%;
}

.player-chip i {
  color: var(--text-muted);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.player-list .muted {
  color: var(--text-muted);
  font-size: 12.5px;
}

.autojoin-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--shadow-lg);
  max-width: min(720px, calc(100vw - 32px));
  animation: popIn 0.18s ease;
}

.aj-status {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- map sub ---------- */
.inline-search {
  margin-left: auto;
}

.inline-search input {
  width: 300px;
}

.map-section {
  margin-bottom: 22px;
}

.map-section h3, .cd-community h3 {
  font-size: 14px;
  margin: 0 0 10px;
  color: var(--text-muted);
}

.map-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 8px;
}

.map-thumb {
  width: 88px;
  height: 50px;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background-size: cover;
  background-position: center;
}

.map-row-main {
  flex: 1;
  min-width: 0;
}

.map-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-cn-line {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.map-running {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.map-sub-communities {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 300px;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}

.check-chip input {
  accent-color: var(--accent);
}

.map-row-action {
  flex-shrink: 0;
}

/* ---------- cooldown ---------- */
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.check-label input {
  accent-color: var(--accent);
}

.cd-community {
  margin-bottom: 24px;
}

.cd-row {
  display: grid;
  grid-template-columns: 1fr auto 90px;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 8px;
}

.cd-status {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
}

.cd-status.cooling {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.cd-status.ok {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}

.cd-sub {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.cd-duration {
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

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

.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.kpi-label {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 4px;
}

.kpi.hot .kpi-label {
  margin-top: 0;
}

.hot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 13px;
  align-items: center;
}

.hot-list i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.stats-charts {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chart-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.chart-head h3 {
  margin: 0;
}

#trend-mode .seg::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
}

#trend-mode .seg[data-series="total"]::before {
  background: var(--accent);
}

#trend-mode .seg[data-series="online"]::before {
  background: var(--ok);
}

.chart-card canvas {
  width: 100%;
  height: 280px;
}

.chart-note {
  color: var(--text-muted);
  font-size: 11.5px;
  margin-top: 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ---------- settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.settings-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.settings-card h3:not(:first-child) {
  margin-top: 22px;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 10px;
}

.about-text {
  font-size: 12.5px;
}

.accent-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.12s, border-color 0.12s;
}

.swatch:hover {
  transform: scale(1.12);
}

.swatch.active {
  border-color: var(--text);
  transform: scale(1.12);
}

input[type="color"] {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  padding: 2px;
  cursor: pointer;
}

/* ---------- toast ---------- */
.toast-root {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast-root.above-aj {
  bottom: 76px;
}

.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  max-width: 70vw;
  word-break: break-all;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-ok {
  border-color: var(--ok);
}

.toast-error {
  border-color: var(--danger);
}

/* ---------- animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(80vw, 280px);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: var(--shadow-lg);
    padding-top: env(safe-area-inset-top, 0px);
    z-index: 40;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    display: block;
  }

  body.mobile-nav-open #sidebar {
    transform: translateX(0);
  }

  /* The collapse toggle is meaningless while the sidebar is a drawer */
  #sidebar-toggle {
    display: none;
  }

  html.sidebar-is-collapsed #sidebar {
    width: min(80vw, 280px);
  }

  html.sidebar-is-collapsed .brand-text,
  html.sidebar-is-collapsed .nav-item .nav-label,
  html.sidebar-is-collapsed .sidebar-status,
  html.sidebar-is-collapsed .sidebar-version {
    display: block;
  }

  html.sidebar-is-collapsed .sidebar-brand {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 12px;
  }

  html.sidebar-is-collapsed .sidebar-toggle {
    margin-left: auto;
  }

  html.sidebar-is-collapsed .nav-item {
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .nav-item {
    padding: 12px 14px;
  }

  #mobile-menu-btn {
    display: inline-flex;
  }

  .sidebar-footer {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .search-wrap input {
    width: 170px;
  }

  .stats-charts {
    grid-template-columns: 1fr;
  }

  .server-row {
    grid-template-columns: 22px minmax(0, 1fr) minmax(0, auto);
  }

  .server-row .row-name,
  .server-row .row-actions {
    min-width: 0;
  }

  .server-row .row-actions {
    flex-wrap: wrap;
  }

  .row-map {
    display: none;
  }

  .row-players {
    display: none;
  }

  .cd-row {
    grid-template-columns: 1fr auto;
  }

  .cd-duration {
    display: none;
  }
}

@media (max-width: 560px) {
  #topbar {
    height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 10px 0;
    gap: 6px;
  }

  .topbar-title {
    display: none;
  }

  .search-wrap {
    flex: 1;
    min-width: 0;
  }

  .search-wrap input {
    width: 100%;
  }

  .auth-btn span {
    display: none;
  }

  .auth-btn {
    padding: 7px 9px;
  }

  .auth-name {
    display: none;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  input, select, textarea {
    font-size: 16px; /* prevent iOS auto-zoom on focus */
  }

  .fav-btn {
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn.small {
    min-height: 34px;
  }

  .swatch {
    width: 36px;
    height: 36px;
  }

  .content {
    padding: 12px;
  }

  .view-head {
    align-items: stretch;
    gap: 10px;
  }

  .view-tools {
    margin-left: 0;
    width: 100%;
  }

  .view-tools .select {
    flex: 1;
    min-width: 0;
  }

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

  .card-map {
    height: 92px;
  }

  .inline-search {
    width: 100%;
  }

  .inline-search input {
    width: 100%;
  }

  .map-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-sub-communities {
    max-width: 100%;
  }

  .map-row-action {
    width: 100%;
  }

  .map-row-action .btn {
    width: 100%;
  }

  /* ---------- detail modal as bottom sheet ---------- */
  .modal-mask {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: sheetUp 0.24s ease;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .detail-item {
    grid-template-columns: 84px 1fr;
  }

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

  .detail-actions .btn {
    width: 100%;
  }

  .detail-actions .join-btn {
    grid-column: 1 / -1;
  }

  .autojoin-setup {
    flex-direction: column;
    align-items: stretch;
  }

  .aj-label {
    justify-content: space-between;
  }

  .autojoin-setup .btn {
    width: 100%;
  }

  /* ---------- stats ---------- */
  .stats-kpis {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .chart-card canvas {
    height: 210px;
  }

  /* ---------- overlays & safe area ---------- */
  .toast-root {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .toast-root.above-aj {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .autojoin-bar {
    left: 12px;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    transform: none;
    width: auto;
    max-width: none;
  }
}

/* ---------- admin panel ---------- */
.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-section {
  margin-bottom: 18px;
}

.admin-section > summary {
  cursor: pointer;
  user-select: none;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 0;
}

.um-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.um-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.um-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.um-info b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.um-self {
  color: var(--accent);
  font-size: 12px;
}

.um-add {
  display: flex;
  gap: 8px;
}

.um-add input {
  flex: 1;
  min-width: 0;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.admin-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.admin-ov-item {
  text-align: center;
  padding: 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-ov-item b {
  display: block;
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-ov-item span {
  color: var(--text-muted);
  font-size: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px 12px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-field input {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 13px;
  width: 100%;
}

.admin-field input[type="color"] {
  padding: 3px;
  height: 34px;
  cursor: pointer;
}

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

.admin-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
}

.admin-check input {
  width: auto;
}

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

.ac-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.ac-title .muted {
  font-size: 12px;
}

.ac-servers {
  margin-top: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.ac-server {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
}

.ac-server-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.admin-map-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.admin-map-key {
  min-width: 180px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-map-row input,
.admin-map-add input {
  flex: 1;
  min-width: 0;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 13px;
}

.admin-map-add {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.admin-json summary {
  cursor: pointer;
  font-weight: 600;
}

.admin-json textarea {
  width: 100%;
  min-height: 240px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  margin: 10px 0;
  resize: vertical;
}

.admin-json-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 560px) {
  .admin-map-key {
    min-width: 0;
  }

  .admin-map-row,
  .admin-map-add {
    flex-wrap: wrap;
  }
}

/* ---------- embed mode (/embed/servers) ---------- */
#sidebar[hidden],
#topbar[hidden],
.mobile-nav-backdrop[hidden] {
  display: none !important;
}

html.embed-mode .content {
  padding: 12px;
  max-width: none;
}

html.embed-dense .content {
  padding: 8px;
}

html.embed-dense .server-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

html.embed-dense .card-map {
  height: 72px;
}

html.embed-dense .community-tab {
  padding: 4px 10px;
  font-size: 12px;
}

html.embed-dense .view-head {
  gap: 8px;
}

html.embed-dense .server-card:hover {
  transform: none;
}

/* ---------- feedback view ---------- */
.feedback-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 760px;
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.feedback-form input,
.feedback-form textarea {
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  resize: vertical;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feedback-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.feedback-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.feedback-item-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
}

.feedback-item-msg {
  margin: 10px 0 0;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-status {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.feedback-status.new {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.feedback-status.done {
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  color: var(--ok);
}

/* ---------- admin audit ---------- */
.audit-list {
  padding: 10px 14px;
}

.audit-row {
  display: grid;
  grid-template-columns: 92px 130px 150px 64px 1fr;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.audit-row:last-child {
  border-bottom: none;
}

/* ---------- admin abuse & bans ---------- */
.abuse-row {
  display: grid;
  grid-template-columns: 92px minmax(150px, 1fr) 150px 110px minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.abuse-row:last-child {
  border-bottom: none;
}

.abuse-user {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.abuse-user .muted {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.abuse-reason {
  font-weight: 600;
  color: var(--danger, #e5484d);
  white-space: nowrap;
}

.abuse-ip {
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn.danger {
  border-color: var(--danger, #e5484d);
  color: var(--danger, #e5484d);
}

.btn.danger:hover {
  background: rgba(229, 72, 77, 0.12);
}

.ban-notice {
  color: var(--danger, #e5484d);
  font-weight: 600;
}

.audit-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

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

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

.audit-result {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
}

.audit-result.ok {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}

.audit-result.fail {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

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

@media (max-width: 900px) {
  .audit-row {
    grid-template-columns: 76px 1fr 58px;
  }
  .audit-actor,
  .audit-detail {
    display: none;
  }
  .abuse-row {
    grid-template-columns: 76px 1fr auto;
  }
  .abuse-ip,
  .abuse-row .audit-detail {
    display: none;
  }
}
