:root {
  --bg: #020205;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.38);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.56);
  --faint: rgba(255, 255, 255, 0.28);
  --shadow: rgba(0, 0, 0, 0.65);
  --glow: rgba(255, 255, 255, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

.background-video,
.background-fallback,
.snow,
.scanlines,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background-video {
  z-index: -6;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  filter: brightness(0.62) contrast(1.12) saturate(0.38) blur(0.2px);
  background: #020205;
}

.background-fallback {
  z-index: -7;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,0.11), transparent 26%),
    radial-gradient(circle at 78% 8%, rgba(255,255,255,0.075), transparent 31%),
    radial-gradient(circle at 50% 120%, rgba(255,255,255,0.09), transparent 42%),
    linear-gradient(135deg, #010102 0%, #08080f 45%, #000 100%);
}

.snow {
  z-index: -3;
  opacity: 0.34;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.48) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255,255,255,0.23) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255,255,255,0.16) 0 1px, transparent 1.4px);
  background-size: 170px 170px, 260px 260px, 390px 390px;
  background-position: 0 0, 70px 100px, 160px 50px;
  animation: snowDrift 32s linear infinite;
}

.scanlines {
  z-index: -2;
  opacity: 0.15;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.06) 0,
    rgba(255,255,255,0.06) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: screen;
}

.vignette {
  z-index: -1;
  opacity: 0.78;
  background:
    radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.20) 48%, rgba(0,0,0,0.84) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.58), transparent 26%, rgba(0,0,0,0.82));
}

@keyframes snowDrift {
  from {
    transform: translate3d(0, -24px, 0);
  }

  to {
    transform: translate3d(-90px, 120px, 0);
  }
}

.shell {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 34px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.fent-text-logo {
  display: block;
  width: clamp(260px, 42vw, 720px);
  height: auto;
  max-height: 118px;
  object-fit: contain;
  object-position: left center;
  filter:
    drop-shadow(0 0 22px rgba(255,255,255,0.20))
    drop-shadow(0 22px 70px rgba(0,0,0,0.70));
}

.eyebrow,
.clock,
.subtitle,
.small-status,
.tag,
.title,
.card-foot,
.map-head {
  font-family: "Rubik Glitch", Impact, "Arial Black", sans-serif;
}

.pill,
.btn,
.members-search,
.empty,
.user-handle,
.user-location,
.fent-pin-loc,
.fent-popup-handle,
.fent-popup-loc,
.fent-popup-tag {
  font-family: "Rubik Mono One", Impact, "Arial Black", sans-serif;
}

.eyebrow,
.small-status,
.tag,
.pill,
.map-head {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
}

.eyebrow {
  color: var(--faint);
  margin: 0 0 8px;
}

.subtitle {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.status-stack {
  text-align: right;
  padding-top: 8px;
  color: var(--muted);
}

.clock {
  font-size: 30px;
  font-weight: 200;
  color: rgba(255,255,255,0.86);
  text-shadow: 0 0 18px rgba(255,255,255,0.18);
}

.small-status span {
  color: rgba(255,255,255,0.86);
}

.members-stage {
  display: grid;
  place-items: center;
  min-height: 0;
}

.members-card {
  width: min(1180px, 100%);
  max-height: calc(100vh - 188px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.13), rgba(255,255,255,0.025)),
    rgba(0,0,0,0.44);
  backdrop-filter: blur(24px);
  box-shadow:
    0 30px 90px var(--shadow),
    0 0 70px rgba(255,255,255,0.07),
    inset 0 1px 0 rgba(255,255,255,0.16);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.members-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.16), transparent 34%),
    linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.11) 50%, transparent 60%);
  opacity: 0.62;
  pointer-events: none;
}

.card-bar,
.card-body,
.card-foot,
.glowline {
  position: relative;
  z-index: 1;
}

.card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  box-shadow:
    0 0 10px rgba(255,255,255,0.42),
    0 0 28px rgba(255,255,255,0.14);
  flex: 0 0 auto;
}

.dot.dim {
  background: rgba(255,255,255,0.42);
  box-shadow: none;
}

.title {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glowline {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.18),
    rgba(255,255,255,0.72),
    rgba(255,255,255,0.18),
    transparent
  );
  opacity: 0.72;
}

.card-body {
  min-height: 0;
  padding: 20px 20px 18px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  overflow: hidden;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.members-search {
  flex: 1 1 360px;
  min-height: 46px;
  min-width: 220px;
  padding: 12px 15px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.025)),
    rgba(0,0,0,0.34);
  color: rgba(255,255,255,0.88);
  outline: none;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    0 14px 42px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

.members-search::placeholder {
  color: rgba(255,255,255,0.32);
}

.members-search:focus {
  border-color: rgba(255,255,255,0.42);
  box-shadow:
    0 22px 64px rgba(0,0,0,0.44),
    0 0 30px rgba(255,255,255,0.08),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 15px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.11), rgba(255,255,255,0.025)),
    rgba(0,0,0,0.34);
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 14px 42px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.10);
  transition: 160ms ease;
}

.btn:hover {
  transform: translateY(-2px);
  color: rgba(255,255,255,0.96);
  border-color: rgba(255,255,255,0.42);
  box-shadow:
    0 22px 64px rgba(0,0,0,0.48),
    0 0 30px rgba(255,255,255,0.08),
    inset 0 1px 0 rgba(255,255,255,0.18);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  color: rgba(255,255,255,0.94);
  border-color: rgba(255,255,255,0.24);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.035)),
    rgba(0,0,0,0.42);
}

.statusline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  border: 1px dashed rgba(255,255,255,0.18);
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.20);
  color: var(--faint);
}

.ok {
  color: rgba(255,255,255,0.92);
}

.dim {
  color: var(--muted);
}

.view-panel {
  min-height: 0;
}

.view-panel[hidden] {
  display: none !important;
}

.map-panel {
  position: relative;
  min-height: 0;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.018)),
    rgba(0,0,0,0.38);
  box-shadow:
    0 20px 70px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

.map-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 404;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.035) 0,
    rgba(255,255,255,0.035) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.16;
}

.map-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 405;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.18) 54%, rgba(0,0,0,0.64) 100%),
    linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.06) 50%, transparent 60%);
}

.map-head {
  position: relative;
  z-index: 406;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.22);
  color: var(--muted);
}



.grid-panel {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.user-card {
  position: relative;
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 24px;
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.105), rgba(255,255,255,0.018)),
    rgba(0,0,0,0.32);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.36),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  transition: 160ms ease;
}

.user-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.12), transparent 32%),
    linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.055) 50%, transparent 60%);
  opacity: 0.55;
  pointer-events: none;
}

.user-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.38);
  box-shadow:
    0 22px 70px rgba(0,0,0,0.54),
    0 0 34px rgba(255,255,255,0.07),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

.user-pfp,
.user-name,
.user-handle,
.user-location {
  position: relative;
  z-index: 1;
}

.user-pfp {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: #09090d;
  filter: saturate(0.52) contrast(1.12) brightness(0.9);
}

.user-name,
.user-handle,
.user-location {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name {
  font-weight: 800;
  color: rgba(255,255,255,0.92);
}

.user-handle,
.user-location {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card-foot {
  position: relative;
  z-index: 1;
  padding: 14px 20px 17px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 12px;
  background: rgba(0,0,0,0.16);
}

/* Leaflet PS3 treatment */

.leaflet-container {
  background: #020205;
  font-family: "Rubik Mono One", Impact, "Arial Black", sans-serif;
}

.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.34) contrast(1.42) saturate(0.06);
  opacity: 0.92;
}

.leaflet-overlay-pane,
.leaflet-marker-pane,
.leaflet-popup-pane,
.leaflet-control-container {
  filter: none;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 14px 42px rgba(0,0,0,0.44);
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.11), rgba(255,255,255,0.025)),
    rgba(0,0,0,0.72) !important;
  color: rgba(255,255,255,0.92) !important;
  text-shadow: 0 0 14px rgba(255,255,255,0.22);
}

.leaflet-control-zoom a:hover {
  border-color: rgba(255,255,255,0.42) !important;
}

.leaflet-control-attribution {
  background: rgba(0,0,0,0.56) !important;
  color: rgba(255,255,255,0.42) !important;
  border-top: 1px solid rgba(255,255,255,0.12);
  border-left: 1px solid rgba(255,255,255,0.12);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
}

.leaflet-control-attribution a {
  color: rgba(255,255,255,0.74) !important;
}

.fent-marker {
  background: transparent;
  border: none;
}

.fent-pin {
  position: relative;
  min-width: 150px;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.13), rgba(255,255,255,0.025)),
    rgba(0,0,0,0.68);
  box-shadow:
    0 18px 52px rgba(0,0,0,0.58),
    0 0 34px rgba(255,255,255,0.065),
    inset 0 1px 0 rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
}

.fent-pin::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-right: 1px solid rgba(255,255,255,0.14);
  border-bottom: 1px solid rgba(255,255,255,0.14);
  background: rgba(8,8,12,0.86);
}

.fent-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  box-shadow:
    0 0 10px rgba(255,255,255,0.42),
    0 0 28px rgba(255,255,255,0.14);
  flex: 0 0 auto;
}

.fent-pin img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: #09090d;
  filter: saturate(0.55) contrast(1.08);
  flex: 0 0 auto;
}

.fent-pin-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.fent-pin-name {
  color: rgba(255,255,255,0.92);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fent-pin-loc {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fent-popup .leaflet-popup-content-wrapper,
.fent-popup .leaflet-popup-tip {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.105), rgba(255,255,255,0.018)),
    rgba(0,0,0,0.86);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    0 22px 70px rgba(0,0,0,0.58),
    0 0 34px rgba(255,255,255,0.07),
    inset 0 1px 0 rgba(255,255,255,0.12);
  backdrop-filter: blur(24px);
}

.fent-popup-card {
  min-width: 230px;
  max-width: 300px;
  display: grid;
  gap: 10px;
}

.fent-popup-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fent-popup-head img,
.fent-popup-mini img {
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.16);
  background: #09090d;
  filter: saturate(0.52) contrast(1.12);
}

.fent-popup-head img {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}

.fent-popup-name {
  font-weight: 900;
}

.fent-popup-handle,
.fent-popup-loc,
.fent-popup-tag {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fent-popup-btn {
  display: inline-flex;
  width: max-content;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.11), rgba(255,255,255,0.025)),
    rgba(0,0,0,0.34);
  color: rgba(255,255,255,0.86);
  text-decoration: none;
  font-family: "Rubik Mono One", Impact, "Arial Black", sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fent-popup-btn:hover {
  border-color: rgba(255,255,255,0.42);
}

.fent-popup-list {
  display: grid;
}

.fent-popup-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.fent-popup-mini img {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.fent-popup-mini-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.fent-popup-mini-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fent-popup-mini a {
  color: var(--muted);
  text-decoration: none;
  font-family: "Rubik Mono One", Impact, "Arial Black", sans-serif;
  font-size: 9px;
}

/* Responsive */

@media (max-width: 1180px) {
  .user-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  body {
    overflow-y: auto;
  }

  .shell {
    width: min(100% - 28px, 1480px);
    min-height: 100vh;
    padding-top: 24px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .status-stack {
    text-align: left;
  }

  .members-stage {
    place-items: start center;
  }

  .members-card {
    max-height: none;
    border-radius: 24px;
  }

  .card-body {
    overflow: visible;
  }

  .control-row {
    align-items: stretch;
    flex-direction: column;
  }

  .members-search {
    width: 100%;
    flex: 0 0 auto;
  }

  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }


  .grid-panel {
    overflow: visible;
  }

  .user-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .fent-text-logo {
    width: min(100%, 430px);
  }

  .user-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-bar,
  .card-foot,
  .map-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tag {
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .user-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   FENTCONNECT MEMBERS — corrected top-safe layout
   Put at very bottom of users.css
========================================================= */

body {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Keep everything inside the viewport instead of cropping top HUD/logo */
.shell {
  width: min(1760px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;

  padding: 10px 0 18px;
  gap: 10px;

  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

/* Topbar stays visible and compact */
.topbar {
  min-height: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

/* Logo was too tall and getting clipped */
.fent-text-logo {
  width: clamp(230px, 30vw, 500px);
  max-height: 72px;
  object-fit: contain;
  object-position: left top;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 10px;
}

.subtitle {
  margin: 5px 0 0;
  font-size: 12px;
}

.status-stack {
  padding-top: 0;
}

.clock {
  font-size: 22px;
  line-height: 1;
}

.small-status {
  font-size: 10px;
}

/* Do not center the card vertically. That was part of the weird shift. */
.members-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 0;
}

/* Wider card, but contained below the header */
.members-card {
  width: min(1560px, 100%);
  min-height: 0;
  max-height: none;
  border-radius: 24px;

  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

/* Smaller card chrome */
.card-bar {
  padding: 12px 16px;
}

.card-body {
  min-height: 0;
  padding: 13px 16px;
  gap: 10px;
  overflow: hidden;
}

.card-foot {
  padding: 9px 16px 11px;
  font-size: 10px;
}

/* Controls smaller */
.members-search,
.btn {
  min-height: 38px;
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 10px;
}

.button-row {
  gap: 8px;
}

.statusline {
  gap: 7px;
}

.pill {
  padding: 5px 8px;
  font-size: 9px;
}

/* Map uses remaining space without forcing the page downward */
.view-panel {
  min-height: 0;
}

.map-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 20px;
}

.map-head {
  padding: 8px 12px;
  font-size: 9px;
}

/* This is the key: no giant forced min-height */
#map {
  width: 100%;
  height: 100%;
  min-height: 360px;
}

/* Still fix Leaflet blue link issue */
.leaflet-container .fent-popup-btn,
.leaflet-container .fent-popup-btn:visited,
.leaflet-container .fent-popup-btn:hover,
.leaflet-container .fent-popup-btn:active {
  color: rgba(255,255,255,0.88) !important;
  text-decoration: none !important;
}

.leaflet-container .fent-popup-mini a,
.leaflet-container .fent-popup-mini a:visited,
.leaflet-container .fent-popup-mini a:hover,
.leaflet-container .fent-popup-mini a:active {
  color: var(--muted) !important;
  text-decoration: none !important;
}

/* Grid view still gets a cleaner spread */
.user-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.user-card {
  padding: 9px;
  border-radius: 18px;
}

.user-pfp {
  border-radius: 14px;
}

/* Mobile */
@media (max-width: 920px) {
  .shell {
    width: min(100% - 20px, 1480px);
    min-height: 100vh;
    padding-top: 12px;
    display: block;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 12px;
  }

  .members-card {
    min-height: auto;
  }

  .card-body {
    overflow: visible;
  }

  #map {
    height: 58vh;
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .fent-text-logo {
    width: min(100%, 380px);
    max-height: 68px;
  }

  .card-bar,
  .card-foot,
  .map-head {
    align-items: flex-start;
    flex-direction: column;
  }
}