:root {
  --bg: #0b0f13;
  --bg-alt: #0e1319;
  --card: #161c23;
  --card-alt: #1d2530;
  --line: #28313b;
  --lineSoft: #1e2731;
  --text: #edf2f6;
  --dim: #8a97a3;
  --dimmer: #5c6873;
  --accent: #2fe6b8;
  --accent2: #3e7bfa;
  --danger: #ff6b5e;
  --walk: #2fe6b8;
  --bike: #3e7bfa;
  --drive: #9b4dff;
  --purple: #9b4dff;
  --radius: 16px;
  --max-width: 1080px;

  --grad-brand: linear-gradient(120deg, #2fe6b8 0%, #3e7bfa 55%, #9b4dff 112%);
  --surface: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
  --shadow-md: 0 20px 48px -26px rgba(0, 0, 0, .8);
  --shadow-glow: 0 26px 60px -30px rgba(47, 230, 184, .4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent2);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 19, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

nav.wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
}
.brand svg {
  display: block;
}

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.tier-badge {
  display: inline-block;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.tier-badge.pro {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1f16;
}
.tier-badge.free {
  background: transparent;
  color: var(--dim);
}

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

.server-tag {
  color: var(--dimmer);
  font-size: 12.5px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Layout */

main {
  padding: 32px 0 80px;
}

.hidden {
  display: none !important;
}

h1 {
  font-size: 26px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 16px;
  margin: 28px 0 12px;
  color: var(--text);
}

.sub {
  color: var(--dim);
  font-size: 13.5px;
  margin: 0 0 8px;
}

/* Login */

.login-shell {
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card);
  background-image: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 32px 30px;
  overflow: hidden;
  box-shadow: var(--shadow-glow), var(--shadow-md);
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
}
.login-card::after {
  content: "";
  position: absolute;
  inset: -50% -30% auto auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(47, 230, 184, 0.12), transparent 70%);
  pointer-events: none;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.login-card .sub {
  text-align: center;
  margin-bottom: 24px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--accent2);
}

.field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
}

.field select:focus {
  outline: none;
  border-color: var(--accent2);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.field-row .field {
  flex: 1 1 140px;
  min-width: 0;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-row input {
  flex: 1 1 200px;
  min-width: 0;
}

.mode-checks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
/* Overrides .field label's block/dim styling for the inline check labels. */
.mode-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.mode-checks input[type="checkbox"] {
  accent-color: var(--accent2);
}

/* position + z-index create a stacking context so Leaflet's internal panes
   (z-index up to ~700) stay underneath the .modal-backdrop (z-index 50). */
.league-map {
  position: relative;
  z-index: 0;
  height: 320px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-alt);
  margin-top: 4px;
}
.league-map-hint {
  margin: 8px 0 12px;
}
.league-coords {
  margin-bottom: 12px;
}
.league-coords summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 13px;
  margin-bottom: 8px;
}

.box-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}
.box-size-row {
  align-items: end;
  margin-bottom: 10px;
}
.compact-field {
  max-width: 150px;
}
.box-draw-active {
  box-shadow: 0 0 0 3px rgba(47, 230, 184, 0.22);
  cursor: crosshair;
}
.box-handle {
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--accent2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.box-handle.center {
  width: 18px;
  height: 18px;
  background: var(--accent);
}
.box-handle.edge {
  border-radius: 5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover {
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  background-image: linear-gradient(120deg, #38ecc0, #2fe6b8 42%, #37c9e6);
  color: #05201a;
  width: 100%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 8px 22px -14px rgba(47, 230, 184, 0.7);
}
.btn.primary:hover:not(:disabled) {
  background-image: linear-gradient(120deg, #5cf0cd, #38ecc0 42%, #4fd6ee);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn.ghost:hover:not(:disabled) {
  background: var(--card-alt);
}

.btn.danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn.danger:hover:not(:disabled) {
  background: rgba(255, 107, 94, 0.12);
}

.btn.small {
  padding: 7px 14px;
  font-size: 13px;
}

.error-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--danger);
  font-size: 13.5px;
  background: rgba(255, 107, 94, 0.1);
  border: 1px solid rgba(255, 107, 94, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.note-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--accent);
  font-size: 13.5px;
  background: rgba(47, 230, 184, 0.08);
  border: 1px solid rgba(47, 230, 184, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

/* Stat tiles */

.tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.tile .tile-value {
  font-size: 23px;
  font-weight: 900;
  margin: 6px 0 2px;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #fff, #bcd8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.tile .tile-label {
  color: var(--dim);
  font-size: 12px;
}

/* Card / panel */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.panel + .panel {
  margin-top: 12px;
}

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

/* Range control */

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

.segmented button {
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.segmented button.active {
  background: var(--card-alt);
  color: var(--text);
}

/* Chart */

.chart {
  position: relative;
  margin-top: 8px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  cursor: pointer;
}

.chart-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: opacity 0.1s;
}

.chart-bar-col:hover .chart-bar {
  opacity: 0.75;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--dimmer);
  font-size: 10.5px;
}

.chart-caption {
  color: var(--dim);
  font-size: 11.5px;
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.04em;
}

.chart-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  white-space: nowrap;
  pointer-events: none;
  margin-bottom: 6px;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.chart-tooltip .t-day {
  color: var(--dim);
  display: block;
}

.chart-tooltip .t-val {
  color: var(--text);
  font-weight: 700;
}

/* Mode legend */

.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--dim);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

/* Rows / lists */

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
}

.row + .row {
  border-top: 1px solid var(--line);
}

.row-title {
  font-weight: 700;
  font-size: 13.5px;
}

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

.row-value {
  font-weight: 800;
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

.row-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--card-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: none;
}

.time-ago {
  color: var(--dimmer);
  font-size: 10.5px;
  white-space: nowrap;
}

.empty {
  color: var(--dim);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 10, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 100%;
}

.modal h3 {
  margin: 0 0 8px;
  color: var(--danger);
}
.modal h3.neutral {
  color: var(--text);
}

.modal p {
  color: var(--dim);
  font-size: 13.5px;
}

.modal .field input {
  text-align: center;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .btn {
  flex: 1;
}

/* Footer */

footer.site {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--dim);
  font-size: 13px;
}

@media (max-width: 640px) {
  .server-tag {
    display: none;
  }
}

/* 2026 admin refresh */
body {
  background:
    radial-gradient(52% 40% at 8% -2%, rgba(47, 230, 184, 0.13), transparent 60%),
    radial-gradient(46% 36% at 92% 4%, rgba(62, 123, 250, 0.13), transparent 62%),
    radial-gradient(46% 46% at 96% 92%, rgba(155, 77, 255, 0.08), transparent 70%),
    linear-gradient(180deg, var(--bg-alt), var(--bg) 34rem);
  position: relative;
}
/* Faint map grid, masked toward the top — the operations-center backdrop. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .4;
  background-image:
    linear-gradient(rgba(120, 150, 180, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 150, 180, .05) 1px, transparent 1px);
  background-size: 58px 58px, 58px 58px;
  mask-image: radial-gradient(120% 70% at 50% 0%, #000 12%, transparent 70%);
  -webkit-mask-image: radial-gradient(120% 70% at 50% 0%, #000 12%, transparent 70%);
}

.hero-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid rgba(47, 230, 184, 0.26);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(80% 150% at 100% 0%, rgba(155, 77, 255, 0.12), transparent 58%),
    linear-gradient(135deg, rgba(47, 230, 184, 0.13), rgba(62, 123, 250, 0.09) 48%, rgba(155, 77, 255, 0.08));
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
}
.hero-panel h1 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--text), #bfe6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  background: rgba(11, 15, 19, 0.42);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}
.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 230, 184, 0.12);
}
.status-pill.loading::before { background: var(--accent2); }
.status-pill.error::before { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 107, 94, 0.12); }

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.insight-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(22, 28, 35, 0.78);
  padding: 14px;
}
.insight-label {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.insight-value {
  color: var(--text);
  font-size: 19px;
  font-weight: 900;
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.insight-card {
  background-image: var(--surface);
}
.insight-note {
  color: var(--dimmer);
  font-size: 12px;
  margin-top: 2px;
}

.tile, .panel, .login-card, .modal {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
}
.tile {
  position: relative;
  overflow: hidden;
}
.tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--drive));
  opacity: 0.72;
}

.trust-panel {
  display: grid;
  gap: 8px;
}
.trust-meter {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.trust-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: conic-gradient(var(--accent) var(--trust-pct, 0%), var(--lineSoft, #1e2731) 0);
  position: relative;
}
.trust-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--card);
}
.trust-ring span {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-weight: 900;
  font-size: 14px;
}

.chart-bar {
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}

@media (max-width: 640px) {
  .hero-panel { align-items: flex-start; flex-direction: column; }
  .hero-actions { justify-content: flex-start; width: 100%; }
}

/* Collapsible sections (anti-cheat lists) */

.collapse-section {
  margin-top: 28px;
}

.collapse-section summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.collapse-section summary::-webkit-details-marker {
  display: none;
}

.collapse-section summary h2 {
  margin: 0;
}

/* Disclosure caret: points right when closed, down when open. */
.collapse-section summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--dim);
  border-bottom: 2px solid var(--dim);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex: none;
}
.collapse-section[open] summary::before {
  transform: rotate(45deg);
}

.count-pill {
  border: 1px solid rgba(255, 107, 94, 0.3);
  background: rgba(255, 107, 94, 0.1);
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Cheat-flag triage toolbar: filter a long review queue by player or kind. */

.flag-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.flag-search {
  flex: 1 1 200px;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
}
.flag-search:focus {
  outline: none;
  border-color: var(--accent2);
}
.flag-search::placeholder {
  color: var(--dimmer);
}

.flag-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.flag-chip:hover {
  color: var(--text);
}
.flag-chip.active {
  background: var(--card-alt);
  color: var(--text);
  border-color: var(--dimmer);
}
.flag-chip .chip-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--dimmer);
}
.flag-chip.active .chip-count {
  color: var(--dim);
}

/* Cap the queue so a long list scrolls inside the panel instead of pushing
   the rest of the dashboard down the page. */
.flag-scroll {
  max-height: 420px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

/* ---- 2026 admin polish ---- */

::selection {
  background: rgba(47, 230, 184, .3);
  color: var(--text);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 128px; /* clear the sticky header + subnav on anchor jumps */
}

/* Sticky admin sub-nav: quick jump to major sections without a full-page scroll. */
.admin-subnav {
  position: sticky;
  top: 62px;
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 8px;
  margin: 16px 0 20px;
  background: rgba(11, 15, 19, .72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-subnav::-webkit-scrollbar { display: none; }
.admin-subnav a {
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.admin-subnav a:hover {
  color: var(--text);
  background: var(--card-alt);
  text-decoration: none;
}
.admin-subnav a.active {
  color: #0b1f16;
  background: var(--grad-brand);
  box-shadow: 0 8px 20px -12px rgba(47, 230, 184, .7);
}

/* H2 section headers — space out and give a subtle accent bar. */
h2 {
  scroll-margin-top: 128px;
  padding-top: 4px;
  font-size: 18px;
  letter-spacing: -0.005em;
}

/* Top-level dashboard section headers get a gradient tick marker so the long
   scroll reads as clearly delineated operational sections. */
#dashboardView > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
}
#dashboardView > h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: var(--grad-brand);
  flex: none;
}

/* Card / panel refinement */
.panel {
  transition: border-color .15s ease;
}

/* Better hover feedback on inputs */
.field input:hover,
.field select:hover,
.flag-search:hover {
  border-color: var(--dimmer);
}

/* Insight cards — subtle hover */
.insight-card {
  transition: transform .15s ease, border-color .15s ease;
}
.insight-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 230, 184, .35);
}

/* Tile hover */
.tile {
  transition: transform .15s ease, border-color .15s ease;
}
.tile:hover {
  transform: translateY(-2px);
  border-color: rgba(62, 123, 250, .35);
}

/* Back-to-top floating button */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #0b1f16;
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.back-to-top:hover {
  background: #78e8b3;
  text-decoration: none;
}

/* Error/note row animation */
.error-row,
.note-row {
  animation: msg-in .18s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* Modal open animation */
.modal-backdrop:not(.hidden) {
  animation: fade-in .15s ease;
}
.modal-backdrop:not(.hidden) .modal {
  animation: modal-in .2s ease;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(.96) translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Buttons — subtle press effect */
.btn:not(:disabled):active {
  transform: translateY(1px);
}
.btn.primary {
  transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn.primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px -6px rgba(47, 230, 184, .42);
}

/* Header actions layout — tighten and align */
.header-actions .btn {
  padding: 7px 14px;
  font-size: 13px;
}

/* Print-friendly */
@media print {
  header.site, .admin-subnav, .btn, .modal-backdrop, .back-to-top, footer.site { display: none !important; }
  body { background: #fff; color: #000; }
  .panel, .tile, .insight-card { background: #fff !important; border: 1px solid #ccc !important; box-shadow: none !important; color: #000; }
}

/* -------- Tier summary -------- */
.tier-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.tier-cell {
  background: var(--card-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.tier-cell-wide {
  grid-column: 1 / -1;
  text-align: left;
}
.tier-count {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  margin-top: 4px;
}
.two-col-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
@media (max-width: 780px) {
  .two-col-summary { grid-template-columns: 1fr; }
}
.section-mini-title {
  color: var(--dim);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 8px;
}
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--bg-alt);
}
.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
}
.mini-row:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

/* -------- Drawer / detail modal -------- */
.modal.drawer {
  max-width: min(920px, 96vw);
  max-height: 92vh;
  overflow: auto;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.drawer-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.drawer-summary > div {
  background: var(--card-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.drawer-summary b {
  color: var(--dim);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
}
.drawer-scroll {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.drawer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.drawer-table th,
.drawer-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.drawer-table th {
  background: var(--bg-alt);
  color: var(--dim);
  font-weight: 700;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  position: sticky;
  top: 0;
}
.drawer-table td.status-accepted { color: var(--walk); }
.drawer-table td.status-rejected { color: var(--danger); }
.drawer-table td.status-verified { color: var(--walk); }
.drawer-table td.status-failed { color: var(--danger); }
.drawer-table td.status-degraded { color: #f5b400; }
.drawer-table tr.unread td { font-weight: 700; }
.drawer-h4 {
  color: var(--dim);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 10px 0 8px;
}

/* -------- Broadcast tool -------- */
#broadcastError:not(:empty) { margin: 8px 0; }

/* -------- Mobile refinements --------
   Narrow-viewport tightening: tighter side padding, wrapping controls, and
   stacked form rows so multi-column .field-row groups (width / height / unit)
   don't cram or push horizontal scroll. */
@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }
  main {
    padding: 20px 0 60px;
  }
  h1 {
    font-size: 22px;
  }
  h2 {
    font-size: 16px;
    margin-top: 22px;
  }
  .hero-panel {
    padding: 18px;
    border-radius: var(--radius);
  }
  .panel {
    padding: 16px;
  }
  .login-card {
    padding: 22px;
  }
  .modal {
    padding: 20px;
    max-width: 100%;
  }
  .modal-actions {
    flex-direction: column;
  }
  .drawer-head {
    flex-wrap: wrap;
  }
  html {
    scroll-padding-top: 108px;
  }
  h2 {
    scroll-margin-top: 108px;
  }
  .admin-subnav {
    top: 58px;
  }
  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
  .btn {
    padding: 10px 16px;
  }
  .segmented {
    flex-wrap: wrap;
  }
  .panel-head .segmented {
    width: 100%;
    justify-content: center;
  }
  .field-row {
    flex-direction: column;
    gap: 8px;
  }
  .field-row .field {
    flex: 1 1 auto;
  }
  .compact-field {
    max-width: none;
  }
  .box-tools .btn {
    flex: 1 1 auto;
  }
  .league-map {
    height: 260px;
  }
  .drawer-summary {
    grid-template-columns: 1fr;
  }
  .drawer-table th,
  .drawer-table td {
    padding: 6px 8px;
    font-size: .82rem;
  }
  .chart-bars {
    height: 110px;
  }
  .row {
    flex-wrap: wrap;
  }
  .search-row .btn,
  .box-tools .btn {
    flex: 1 1 auto;
  }
}
