:root {
  color-scheme: dark;
  --bg: #121723;
  --bg-2: #192034;
  --panel: #202940;
  --panel-2: #27324f;
  --panel-3: #303b59;
  --line: #3f4d72;
  --text: #d7e4ff;
  --muted: #8fa4cf;
  --cyan: #26c6da;
  --cyan-2: #0aa7bd;
  --amber: #f4b75e;
  --coral: #ef6f6c;
  --green: #66d29c;
  --blue: #6aa9ff;
  --shadow: 0 18px 45px rgba(0, 0, 0, .34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(38, 198, 218, .08), transparent 280px),
    linear-gradient(135deg, #121723 0%, #182038 48%, #171a26 100%);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

.fa {
  display: inline-block;
  font-family: Arial, Helvetica, sans-serif;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.fa::before {
  content: "*";
}

.fa-home::before { content: "H"; }
.fa-users::before { content: "G"; }
.fa-microchip::before { content: "M"; }
.fa-volume-up::before { content: "V"; }
.fa-bars::before { content: "="; }
.fa-shield::before { content: "S"; }
.fa-android::before { content: "B"; }
.fa-bell::before { content: "!"; }
.fa-terminal::before { content: ">"; }
.fa-mail-reply::before { content: "<"; }
.fa-toggle-on::before { content: "O"; }
.fa-crosshairs::before { content: "+"; }
.fa-plug::before { content: "P"; }
.fa-credit-card::before { content: "$"; }
.fa-bullhorn::before { content: "A"; }
.fa-registered::before { content: "R"; }
.fa-lightbulb-o::before { content: "?"; }
.fa-refresh::before { content: "R"; }
.fa-undo::before { content: "U"; }
.fa-save::before { content: "S"; }
.fa-plus::before,
.fa-plus-circle::before { content: "+"; }
.fa-times::before { content: "x"; }
.fa-key::before { content: "K"; }
.fa-pencil::before { content: "E"; }
.fa-paint-brush::before { content: "C"; }
.fa-magic::before { content: "M"; }
.fa-trash::before { content: "X"; }
.fa-archive::before { content: "A"; }
.fa-shopping-cart::before { content: "$"; }
.fa-map::before { content: "N"; }
.fa-map-marker::before { content: "L"; }
.fa-bullseye::before { content: "T"; }
.fa-th::before { content: "#"; }
.fa-search::before { content: "?"; }
.fa-play-circle::before { content: ">"; }
.fa-eye::before { content: "O"; }
.fa-video-camera::before { content: "C"; }
.fa-steam::before { content: "S"; }

.is-hidden {
  display: none !important;
}

.fa-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(143, 164, 207, .2);
  background: rgba(18, 23, 35, .88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.brand-mark,
.server-icon,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 700;
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #08111c;
}

.brand strong {
  color: #fff;
}

.brand-mark,
.public-hero h1,
.steam-login-button {
  background-size: 300% 300%;
}

.brand-mark {
  background-image: linear-gradient(135deg, #ff4d6d, #ffd166, #5cff9d, #27d8ff, #8f7bff, #ff4dcb, #ff4d6d);
  animation: rainbow-flow 8s ease-in-out infinite;
  box-shadow: 0 0 22px rgba(39, 216, 255, .18);
}

.brand-mark.large,
.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.brand small,
.server-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  gap: 6px;
  flex: 1;
}

.top-nav a,
.side-nav a,
.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  color: #c5d4f8;
}

.top-nav a {
  padding: 10px 12px;
  color: var(--muted);
}

.top-nav a:hover,
.top-nav a.active,
.side-nav a:hover,
.quick-link:hover {
  background: rgba(106, 169, 255, .11);
  color: #fff;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-link {
  font-size: 12px;
}

.server-pill {
  border: 1px solid rgba(38, 198, 218, .45);
  border-radius: 999px;
  padding: 6px 10px;
  color: #a8eff7;
  font-size: 12px;
  font-weight: 700;
}

.avatar {
  width: 36px;
  height: 36px;
  background: #354467;
  color: #fff;
}

.public-home {
  overflow: hidden;
}

.public-hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: calc(100vh - 138px);
  padding: 64px 24px;
  isolation: isolate;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(circle at 38% 38%, rgba(92, 255, 157, .12), transparent 18%),
    radial-gradient(circle at 46% 68%, rgba(39, 216, 255, .14), transparent 20%),
    radial-gradient(circle at 52% 34%, rgba(143, 123, 255, .14), transparent 19%),
    radial-gradient(circle at 76% 24%, rgba(244, 183, 94, .2), transparent 22%),
    radial-gradient(circle at 62% 68%, rgba(239, 111, 108, .18), transparent 24%),
    linear-gradient(135deg, rgba(18, 23, 35, .86), rgba(21, 27, 44, .55)),
    #121723;
}

.map-grid {
  position: absolute;
  inset: -20%;
  opacity: .5;
  background-image:
    linear-gradient(rgba(143, 164, 207, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 164, 207, .14) 1px, transparent 1px);
  background-size: 58px 58px;
  transform: perspective(680px) rotateX(58deg) rotateZ(-9deg) translateY(6%);
  transform-origin: center;
  animation: grid-drift 18s linear infinite;
}

.signal-card {
  position: absolute;
  display: grid;
  gap: 3px;
  width: 238px;
  border: 1px solid rgba(143, 164, 207, .18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(21, 27, 44, .82);
  box-shadow: var(--shadow);
  animation: signal-float 7s ease-in-out infinite;
}

.signal-card strong {
  color: #fff;
}

.signal-card small {
  color: #b7c8ee;
}

.card-alarm {
  top: 18%;
  right: 12%;
}

.card-device {
  right: 24%;
  bottom: 22%;
  animation-delay: -2s;
}

.card-team {
  top: 44%;
  right: 6%;
  animation-delay: -4s;
}

.public-hero-content {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: center;
}

.public-hero h1 {
  margin-bottom: 12px;
  font-size: 54px;
  background-image: linear-gradient(90deg, #ff4d6d, #ffd166, #5cff9d, #27d8ff, #8f7bff, #ff4dcb, #ff4d6d);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  text-shadow: 0 12px 34px rgba(0, 0, 0, .42);
  animation: rainbow-flow 7s ease-in-out infinite, title-pulse 3.8s ease-in-out infinite;
}

.public-lede {
  max-width: 700px;
  margin: 0 auto 28px;
  color: #d9e7ff;
  font-size: 18px;
}

.hero-actions {
  justify-content: center;
}

.steam-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 11px 18px;
  background-image: linear-gradient(135deg, #ff4d6d, #ffd166, #5cff9d, #27d8ff, #8f7bff, #ff4dcb);
  color: #08111c;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .32);
  animation: rainbow-flow 7s ease-in-out infinite;
}

.steam-login-button:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.steam-icon {
  flex: 0 0 auto;
  fill: currentColor;
}

@keyframes rainbow-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes title-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(39, 216, 255, .18));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(255, 77, 203, .24));
  }
}

@keyframes signal-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -8px, 0);
  }
}

@keyframes grid-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 58px 58px;
  }
}

.public-band,
.public-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.youtube-band {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(143, 164, 207, .16);
  border-bottom: 1px solid rgba(143, 164, 207, .16);
  color: #dce7ff;
}

.youtube-band span {
  color: var(--muted);
}

.section-intro {
  margin-bottom: 18px;
  text-align: center;
}

.section-intro h2 {
  font-size: 28px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  display: grid;
  gap: 10px;
  min-height: 178px;
  border: 1px solid rgba(143, 164, 207, .16);
  border-radius: 8px;
  padding: 18px;
  background: rgba(32, 41, 64, .82);
  box-shadow: var(--shadow);
}

.feature-card i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(244, 183, 94, .16);
  color: #ffe1a8;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.login-section {
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
}

.secondary-login {
  min-width: 220px;
}

.small {
  font-size: 13px;
}

.servers-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.servers-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.header-lockup,
.steam-card,
.servers-actions,
.guild-entry,
.guild-help {
  border: 1px solid rgba(143, 164, 207, .16);
  border-radius: 8px;
  background: rgba(32, 41, 64, .88);
  box-shadow: var(--shadow);
}

.header-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  padding: 22px;
}

.steam-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
  padding: 18px;
}

.steam-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.servers-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

.guild-help {
  display: none;
  margin-bottom: 14px;
}

/* Access panels are driven by the hidden attribute, not a .show class, so they
   must NOT inherit .guild-help's display:none. */
.access-panel {
  margin-bottom: 14px;
}

.access-panel[hidden] {
  display: none;
}

.access-panel p {
  margin: 8px 0 0;
}

.member-access-note {
  margin-top: 10px;
  font-size: 0.9em;
  opacity: 0.85;
}

.guild-help.show {
  display: block;
}

.guild-help p {
  margin: 8px 0 0;
}

.guild-list {
  display: grid;
  gap: 14px;
}

.guild-entry {
  position: relative;
  display: grid;
  grid-template-columns: 112px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  transition: opacity .14s ease, transform .14s ease;
}

.guild-entry.guild-hidden:not(.revealed) {
  display: none;
}

.guild-entry.is-busy {
  opacity: .55;
  transform: scale(.995);
}

.guildimg-container {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(143, 164, 207, .18);
  border-radius: 8px;
  background: #151b2c;
}

.guild-initials {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--amber), var(--cyan));
  color: #08111c;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
}

.guild-initials img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.guild-select-title {
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.guild-select-title:hover {
  color: var(--cyan);
}

.guild-details h2 {
  margin: 0 0 8px;
  font-size: 21px;
}

.guild-meta {
  display: grid;
  gap: 4px;
  color: #c9d7f8;
  font-size: 14px;
}

.guild-meta b {
  color: #fff;
}

.guild-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guild-actions .icon-button {
  flex: 0 0 auto;
}

.guild-hidden-label {
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed rgba(143, 164, 207, .26);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: rgba(21, 27, 44, .48);
}

.mobile-menu {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

body.settings-locked [data-settings-only] {
  display: none !important;
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
}

.server-card,
.quick-panel,
.panel,
.toolbar,
.hero-row {
  border: 1px solid rgba(143, 164, 207, .16);
  border-radius: 8px;
  background: rgba(32, 41, 64, .88);
  box-shadow: var(--shadow);
}

.health-panel {
  margin-top: 18px;
}

.setup-panel {
  margin-top: 18px;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.setup-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(143, 164, 207, .14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(18, 24, 40, .62);
}

.setup-step-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(143, 164, 207, .24);
  border-radius: 8px;
  background: rgba(143, 164, 207, .1);
  color: #cfe0ff;
  font-size: 13px;
  font-weight: 800;
}

.setup-step strong,
.setup-step small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.setup-step strong {
  color: #fff;
  font-size: 14px;
}

.setup-step small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.setup-step.setup-done {
  border-left: 4px solid #58d27d;
}

.setup-step.setup-warn {
  border-left: 4px solid #f4b75e;
}

.setup-step.setup-wait {
  border-left: 4px solid rgba(143, 164, 207, .42);
}

.setup-wizard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  border: 1px solid rgba(143, 164, 207, .14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(18, 24, 40, .46);
}

.setup-owner {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.setup-owner span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.setup-owner strong {
  color: #fff;
  overflow-wrap: anywhere;
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.health-item {
  min-width: 0;
  border: 1px solid rgba(143, 164, 207, .14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(18, 24, 40, .62);
}

.health-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.health-item strong {
  display: block;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 14px;
}

.health-item-wide {
  grid-column: span 3;
}

.health-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.health-actions .muted {
  margin-right: auto;
}

.team-activity-panel {
  margin-top: 18px;
}

.team-activity-summary {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.team-activity-list {
  display: grid;
  gap: 8px;
}

.team-activity-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(143, 164, 207, .14);
  border-left: 4px solid rgba(143, 164, 207, .42);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(18, 24, 40, .62);
}

.team-activity-row.state-online {
  border-left-color: #58d27d;
}

.team-activity-row.state-afk {
  border-left-color: #f4b75e;
}

.team-activity-row.state-dead {
  border-left-color: #ef476f;
}

.team-activity-row.state-offline {
  border-left-color: rgba(143, 164, 207, .34);
  opacity: .82;
}

.team-activity-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.team-activity-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-activity-name-line strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-marker-number {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 20px;
  border: 1px solid rgba(38, 198, 218, .48);
  border-radius: 999px;
  padding: 0 6px;
  background: rgba(38, 198, 218, .12);
  color: #8cecff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.team-activity-main small {
  overflow: hidden;
  color: #9fb7f1;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-activity-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.team-activity-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag.mini {
  padding: 2px 7px;
  font-size: 11px;
}

.empty-state.compact {
  padding: 10px 12px;
  font-size: 13px;
}

.live-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
  align-items: start;
}

.live-map-stage-panel,
.live-map-roster-panel {
  min-width: 0;
}

.live-map-heading {
  align-items: flex-start;
}

.live-map-heading .panel-copy {
  margin: 4px 0 0;
}

.live-map-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.live-map-filter {
  min-height: 34px;
  border: 1px solid rgba(143, 164, 207, .26);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(18, 24, 40, .7);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.live-map-filter:hover {
  border-color: rgba(38, 198, 218, .56);
  color: #fff;
}

.live-map-filter.active {
  border-color: var(--cyan);
  background: rgba(38, 198, 218, .16);
  color: #fff;
}

.live-team-map {
  position: relative;
  width: 100%;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(143, 164, 207, .24);
  border-radius: 8px;
  aspect-ratio: 1;
  background-color: #121a2a;
  background-image:
    linear-gradient(rgba(143, 164, 207, .13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 164, 207, .13) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(38, 198, 218, .12), transparent 60%);
  background-size: 12.5% 12.5%, 12.5% 12.5%, 100% 100%;
}

.live-map-terrain,
.live-mini-map-terrain {
  position: absolute;
  display: block;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.live-map-terrain {
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.9) contrast(1.04) brightness(.78);
}

/* No pan transition: the terrain, the cached grid layer and the player markers
   are all repositioned in the same paint, so easing one of them would leave the
   grid labels visibly off the terrain for the length of the animation. */
.live-mini-map-terrain {
  z-index: 0;
  filter: saturate(.9) contrast(1.04) brightness(.78);
  transform-origin: top left;
}

.live-map-terrain[hidden],
.live-mini-map-terrain[hidden] {
  display: none;
}

.live-map-markers {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.live-map-marker {
  --marker-color: #66d29c;
  position: absolute;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid var(--marker-color);
  border-radius: 50%;
  padding: 0;
  background: #111827;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: width .12s ease, height .12s ease, box-shadow .12s ease;
}

.live-map-marker:hover,
.live-map-marker.selected {
  z-index: 4;
  width: 42px;
  height: 42px;
  box-shadow: 0 0 0 5px rgba(38, 198, 218, .16);
}

.live-map-marker.state-afk {
  --marker-color: #f4b75e;
}

.live-map-marker.state-dead {
  --marker-color: #ef6f6c;
}

.live-map-marker.state-offline {
  --marker-color: #8fa4cf;
  opacity: .76;
}

.live-map-marker-label {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  max-width: 180px;
  overflow: hidden;
  transform: translateX(-50%);
  border: 1px solid rgba(143, 164, 207, .2);
  border-radius: 4px;
  padding: 3px 6px;
  background: rgba(10, 14, 24, .92);
  color: #fff;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.live-map-corner {
  position: absolute;
  z-index: 3;
  color: rgba(143, 164, 207, .72);
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.corner-nw { top: 10px; left: 10px; }
.corner-ne { top: 10px; right: 10px; }
.corner-sw { bottom: 10px; left: 10px; }
.corner-se { right: 10px; bottom: 10px; }

.live-map-empty {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.live-map-empty.is-hidden {
  display: none;
}

.live-map-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.live-map-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.live-map-legend-dot,
.live-map-roster-state {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #66d29c;
}

.live-map-legend-dot.state-afk,
.live-map-roster-state.state-afk {
  background: #f4b75e;
}

.live-map-legend-dot.state-dead,
.live-map-roster-state.state-dead {
  background: #ef6f6c;
}

.live-map-legend-dot.state-offline,
.live-map-roster-state.state-offline {
  background: #8fa4cf;
}

.live-map-selected {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(143, 164, 207, .18);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  padding: 12px;
  background: rgba(18, 24, 40, .62);
}

.live-mini-map-block {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.live-mini-map-toolbar,
.live-mini-map-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.live-mini-map-follow {
  min-width: 0;
}

.live-mini-map-follow small,
.live-mini-map-follow strong {
  display: block;
}

.live-mini-map-follow small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
}

.live-mini-map-follow strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-mini-map-range-controls {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(143, 164, 207, .28);
  border-radius: 6px;
}

.live-mini-map-range-controls button {
  min-height: 28px;
  border: 0;
  border-right: 1px solid rgba(143, 164, 207, .2);
  padding: 0 8px;
  background: rgba(18, 24, 40, .72);
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.live-mini-map-range-controls button:last-child {
  border-right: 0;
}

.live-mini-map-range-controls button:hover,
.live-mini-map-range-controls button.active {
  background: rgba(38, 198, 218, .16);
  color: #fff;
}

.live-mini-map-range-controls button.active {
  box-shadow: inset 0 -2px 0 var(--cyan);
}

.live-mini-map {
  position: relative;
  width: min(100%, 310px);
  overflow: hidden;
  border: 1px solid rgba(143, 164, 207, .32);
  border-radius: 50%;
  aspect-ratio: 1;
  margin: 0 auto;
  background-color: #101827;
  background-image:
    linear-gradient(rgba(143, 164, 207, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 164, 207, .12) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(38, 198, 218, .16), transparent 66%);
  background-size: 25% 25%, 25% 25%, 100% 100%;
  box-shadow: inset 0 0 34px rgba(3, 8, 17, .72);
}

/* Once the real Rust grid is drawn, drop the decorative placeholder grid so the
   two sets of lines cannot be mistaken for each other. */
.live-mini-map.has-rust-grid {
  background-image: radial-gradient(circle at 50% 50%, rgba(38, 198, 218, .16), transparent 66%);
  background-size: 100% 100%;
}

/* Compact in-circle player filter. Stays out of the way until hovered or
   focused, so the pop-out still reads as "just the map". */
.live-mini-map-filter {
  position: absolute;
  z-index: 5;
  bottom: 10px;
  left: 50%;
  display: flex;
  overflow: hidden;
  transform: translateX(-50%);
  border: 1px solid rgba(143, 164, 207, .3);
  border-radius: 999px;
  background: rgba(8, 12, 20, .78);
  opacity: .3;
  transition: opacity .14s ease;
}

.live-mini-map:hover .live-mini-map-filter,
.live-mini-map-filter:focus-within {
  opacity: 1;
}

.live-mini-map-filter button {
  min-width: 26px;
  min-height: 18px;
  border: 0;
  padding: 0 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.live-mini-map-filter button:hover {
  color: #fff;
}

.live-mini-map-filter button.active {
  background: rgba(38, 198, 218, .24);
  color: #fff;
}

/* Subtle stale / disconnected state. Deliberately quiet: it must read at a
   glance in the pop-out without covering the map. */
.live-mini-map.is-stale,
.live-mini-map.is-disconnected {
  border-color: rgba(244, 183, 94, .55);
}

.live-mini-map.is-disconnected {
  border-color: rgba(239, 111, 108, .6);
}

.live-mini-map.is-stale .live-mini-map-terrain,
.live-mini-map.is-disconnected .live-mini-map-terrain {
  filter: saturate(.35) contrast(1.02) brightness(.6);
}

.live-mini-map.is-stale .live-mini-map-markers,
.live-mini-map.is-disconnected .live-mini-map-markers {
  opacity: .72;
}

.live-mini-map.is-stale::after,
.live-mini-map.is-disconnected::after {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 3px;
  padding: 1px 6px;
  background: rgba(10, 14, 24, .84);
  color: var(--amber);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  content: "STALE";
  pointer-events: none;
}

.live-mini-map.is-disconnected::after {
  color: var(--coral);
  content: "OFFLINE";
}

/* Cached Rust grid layer: sits above the terrain, below the player markers. */
.live-mini-map-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.live-mini-map-north {
  position: absolute;
  z-index: 1;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .82);
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

.live-mini-map-range-ring {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(143, 164, 207, .22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Ring radius as a share of the container radius equals the share of the
   selected range, so the inner ring is half range and the outer ring is the
   full range, kept a hair inside the rim so its stroke stays visible. */
.live-mini-map-range-ring.ring-inner {
  width: 50%;
  height: 50%;
}

.live-mini-map-range-ring.ring-outer {
  width: 99%;
  height: 99%;
}

.live-mini-map-crosshair {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.live-mini-map-crosshair::before,
.live-mini-map-crosshair::after {
  position: absolute;
  display: block;
  background: rgba(143, 164, 207, .16);
  content: "";
}

.live-mini-map-crosshair::before {
  top: 50%;
  right: 7%;
  left: 7%;
  height: 1px;
}

.live-mini-map-crosshair::after {
  top: 7%;
  bottom: 7%;
  left: 50%;
  width: 1px;
}

.live-mini-map-markers {
  position: absolute;
  z-index: 2;
  inset: 0;
}

/* The marker button itself is a zero-size anchor at the projected position; the
   status circle and the name label are positioned around it. Clicks still land
   on the button because both children are inside its subtree. */
.live-mini-map-marker {
  --marker-color: #66d29c;
  position: absolute;
  z-index: 3;
  width: 0;
  height: 0;
  border: 0;
  padding: 0;
  background: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.live-mini-map-marker.state-afk {
  --marker-color: #f4b75e;
}

.live-mini-map-marker.state-dead {
  --marker-color: #ef6f6c;
}

.live-mini-map-marker.state-offline {
  --marker-color: #8fa4cf;
  opacity: .74;
}

.live-mini-map-marker-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 15px;
  height: 15px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--marker-color);
  border-radius: 50%;
  background: #111827;
  box-shadow: 0 0 0 1px rgba(3, 8, 17, .8);
  transition:
    width .12s ease,
    height .12s ease,
    box-shadow .12s ease;
}

/* Followed player: double ring plus a solid centre dot. */
.live-mini-map-marker.is-focus {
  z-index: 6;
}

.live-mini-map-marker.is-focus .live-mini-map-marker-dot {
  width: 21px;
  height: 21px;
  box-shadow:
    0 0 0 2px #0b1220,
    0 0 0 4px var(--marker-color),
    0 0 0 8px rgba(38, 198, 218, .2);
}

.live-mini-map-marker.is-focus .live-mini-map-marker-dot::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--marker-color);
  content: "";
}

.live-mini-map-marker.is-edge .live-mini-map-marker-dot {
  border-style: dashed;
}

/* Off-range teammates get a small chevron pointing off the rim toward them. */
.live-mini-map-marker.is-edge .live-mini-map-marker-dot::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%) rotate(calc(var(--edge-angle, 0deg) + 90deg)) translateY(-13px);
  border-right: 4px solid transparent;
  border-bottom: 6px solid var(--marker-color);
  border-left: 4px solid transparent;
  content: "";
}

/* Movement-direction arrow. This shows the direction of TRAVEL derived from
   successive Rust+ positions - Rust+ never reports where a player is looking. */
.live-mini-map-marker-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%) rotate(var(--arrow-angle, 0deg)) translateY(-15px);
  border-right: 4px solid transparent;
  border-bottom: 7px solid #fff;
  border-left: 4px solid transparent;
  filter: drop-shadow(0 0 1px rgba(3, 8, 17, .95));
}

.live-mini-map-marker.has-arrow .live-mini-map-marker-arrow {
  display: block;
}

.live-mini-map-marker.is-focus .live-mini-map-marker-arrow {
  transform: translate(-50%, -50%) rotate(var(--arrow-angle, 0deg)) translateY(-19px);
}

.live-mini-map-marker-name {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 104px;
  overflow: hidden;
  border-radius: 3px;
  padding: 1px 3px;
  background: rgba(10, 14, 24, .8);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 12px;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(3, 8, 17, .95);
  white-space: nowrap;
  pointer-events: none;
}

/* Label collision handling hides only lower-priority names; the status circles
   are never hidden. Hovering or focusing brings a hidden name back. */
.live-mini-map-marker.label-hidden .live-mini-map-marker-name {
  display: none;
}

.live-mini-map-marker:hover,
.live-mini-map-marker:focus-visible {
  z-index: 7;
}

.live-mini-map-marker:hover .live-mini-map-marker-name,
.live-mini-map-marker:focus-visible .live-mini-map-marker-name {
  display: block;
  z-index: 7;
  background: rgba(10, 14, 24, .96);
  outline: 1px solid rgba(143, 164, 207, .3);
}

.live-mini-map-marker:focus-visible .live-mini-map-marker-dot {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.live-mini-map-empty {
  position: absolute;
  z-index: 3;
  inset: 24%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  pointer-events: none;
}

.live-mini-map-empty.is-hidden {
  display: none;
}

.live-mini-map-meta {
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 11px;
}

.live-mini-map-grid-label {
  color: rgba(226, 236, 255, .8);
  font-weight: 700;
  letter-spacing: .4px;
}

.live-mini-map-popout-wrap {
  display: flex;
  justify-content: center;
}

/* Also applied to the download link, which is an <a> so it behaves like a real
   download (middle-click, copy link, right-click save). */
.live-mini-map-popout {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(143, 164, 207, .28);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(18, 24, 40, .72);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.live-mini-map-popout[hidden] {
  display: none;
}

.live-mini-map-popout:hover,
.live-mini-map-popout[aria-pressed="true"] {
  border-color: rgba(38, 198, 218, .5);
  background: rgba(38, 198, 218, .16);
  color: #fff;
}

.live-map-selected-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.live-map-selected-grid strong {
  display: block;
  margin-top: 2px;
  color: #fff;
  font-size: 13px;
}

.live-map-roster {
  display: grid;
  gap: 7px;
  max-height: 610px;
  margin-top: 12px;
  overflow: auto;
}

.live-map-roster-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(143, 164, 207, .14);
  border-radius: 7px;
  padding: 9px 10px;
  background: rgba(18, 24, 40, .55);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.live-map-roster-item:hover,
.live-map-roster-item.selected {
  border-color: rgba(38, 198, 218, .55);
  background: rgba(38, 198, 218, .09);
}

.live-map-roster-copy {
  min-width: 0;
}

.live-map-roster-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.live-map-roster-copy strong,
.live-map-roster-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-map-roster-name-line strong {
  min-width: 0;
}

.live-map-roster-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.live-map-roster-location {
  color: #9fb7f1;
  font-size: 11px;
}

.event-history-panel {
  margin-bottom: 18px;
}

.event-history-summary {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.event-history-grid h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 15px;
}

.event-history-list {
  display: grid;
  gap: 8px;
}

.event-history-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(143, 164, 207, .14);
  border-left: 4px solid rgba(143, 164, 207, .42);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(18, 24, 40, .62);
}

.event-history-row.state-active {
  border-left-color: #58d27d;
}

.event-history-row.state-recent {
  border-left-color: #f4b75e;
  opacity: .9;
}

.event-history-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.event-history-main strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-history-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.event-history-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.server-icon {
  width: 46px;
  height: 46px;
  background: #f4b75e;
  color: #1f1707;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}

.side-nav a,
.quick-link {
  width: 100%;
  border: 0;
  padding: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.side-nav a i,
.top-nav a i,
.quick-link i,
.btn i {
  width: 16px;
  text-align: center;
}

.side-nav a.active {
  background: linear-gradient(90deg, rgba(38, 198, 218, .22), rgba(106, 169, 255, .1));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.quick-panel {
  padding: 8px;
}

.settings-access-card {
  display: grid;
  gap: 9px;
  margin: 14px 0;
  padding: 13px;
  border: 1px solid rgba(38, 198, 218, .24);
  border-radius: 8px;
  background: rgba(20, 39, 56, .9);
  box-shadow: var(--shadow);
}

.settings-access-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-locked-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.settings-locked-banner p {
  margin: 4px 0 0;
}

body:not(.settings-locked) .settings-locked-banner {
  display: none;
}

.content {
  min-width: 0;
}

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 34px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.muted {
  color: var(--muted);
}

.field-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* A setting the server refused, or one whose consequence needs to be read. */
.field-help.is-warning {
  color: var(--amber, #f0b429);
}

.status-strip {
  display: grid;
  gap: 8px;
  min-width: 270px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(18, 23, 35, .62);
  color: #c7d6fa;
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.dot.online {
  background: var(--green);
}

.dot.warn {
  background: var(--amber);
}

.dot.info {
  background: var(--cyan);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  margin-bottom: 18px;
}

.toolbar-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pending-update-msg {
  display: none;
  margin-left: 12px;
  color: var(--cyan);
  font-size: 13px;
  filter: drop-shadow(0 0 2px #000);
}

.pending-update-msg.show {
  display: inline-block;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.section-grid {
  display: grid;
  gap: 18px;
}

.section-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel.full-width {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-copy {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.integration-panel {
  margin-top: 18px;
}

.integration-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 18px;
  border-top: 1px solid rgba(143, 164, 207, .18);
  border-bottom: 1px solid rgba(143, 164, 207, .18);
}

.integration-status-grid > div {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid rgba(143, 164, 207, .18);
}

.integration-status-grid > div:first-child {
  padding-left: 0;
}

.integration-status-grid > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.integration-status-grid span,
.integration-status-grid strong {
  display: block;
}

.integration-status-grid span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.integration-status-grid strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 14px;
}

.secret-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px auto auto;
  gap: 10px;
  align-items: center;
}

.secret-input-row .icon-button {
  width: 42px;
  height: 42px;
}

.integration-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
}

.integration-actions .field-help {
  margin: 0;
}

.integration-error {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 98, 115, .3);
  color: #ff9aa8;
  font-size: 13px;
}

.template-help {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(143, 164, 207, .16);
  border-radius: 8px;
  background: rgba(15, 22, 38, .58);
  color: var(--muted);
}

.template-help strong {
  color: var(--text);
}

.template-help code {
  border: 1px solid rgba(106, 169, 255, .22);
  border-radius: 6px;
  padding: 3px 7px;
  color: #d9e7ff;
  background: rgba(14, 20, 36, .76);
}

.notification-template-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.notification-template-card {
  border: 1px solid rgba(143, 164, 207, .16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(15, 22, 38, .54);
}

.template-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.template-card-head h3 {
  margin: 3px 0 4px;
  font-size: 17px;
}

.template-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.template-group {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.notification-template-input {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid rgba(106, 169, 255, .34);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(13, 19, 34, .92);
  font: inherit;
  line-height: 1.4;
}

.notification-template-input:focus {
  outline: 2px solid rgba(38, 198, 218, .42);
  outline-offset: 1px;
}

.template-preview {
  margin-top: 10px;
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  padding: 9px 10px;
  color: #d7e6ff;
  background: rgba(5, 10, 22, .55);
  line-height: 1.4;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(106, 169, 255, .35);
  border-radius: 999px;
  padding: 3px 9px;
  color: #b9d3ff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.cyan {
  border-color: rgba(38, 198, 218, .45);
  color: #a8eff7;
}

.tag.success {
  border-color: rgba(102, 210, 156, .45);
  color: #b7f4d4;
}

.tag.amber {
  border-color: rgba(244, 183, 94, .55);
  color: #ffe1a8;
}

.tag.danger {
  border-color: rgba(239, 111, 108, .55);
  color: #ffc5c2;
}

label {
  display: block;
  margin: 14px 0 7px;
  color: #c9d7f8;
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="search"],
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #151b2c;
  color: var(--text);
  outline: 0;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(38, 198, 218, .14);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
}

input[type="file"] {
  min-width: 0;
  border: 1px solid rgba(143, 164, 207, .28);
  border-radius: 8px;
  padding: 8px 10px;
  background: #151b2c;
  color: var(--muted);
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-form input,
.inline-form select {
  flex: 1;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--cyan);
}

.btn,
.icon-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--panel-3);
  color: #fff;
  font-weight: 700;
}

.btn.primary {
  background: linear-gradient(135deg, var(--cyan-2), var(--blue));
  color: #071321;
}

.btn.secondary {
  background: #32405f;
  color: #dce7ff;
}

.btn.danger {
  background: #7c333c;
}

.btn.compact {
  min-height: 38px;
  padding: 8px 11px;
  white-space: nowrap;
}

.btn:hover,
.icon-button:hover {
  filter: brightness(1.08);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.35);
}

.btn:disabled:hover {
  filter: grayscale(.35);
}

.text-button {
  padding: 0;
  background: none;
  color: var(--cyan);
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #303b59;
  color: #dce7ff;
}

.icon-button.large {
  width: 44px;
  height: 44px;
  font-size: 26px;
}

.list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.list li,
.device-card,
.plugin-card,
.highlight-row,
.switch-card,
.log-line {
  border: 1px solid rgba(143, 164, 207, .14);
  border-radius: 8px;
  background: rgba(21, 27, 44, .72);
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}

.remove-item {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(239, 111, 108, .16);
  color: #ffc7c5;
  cursor: pointer;
}

.highlight-row {
  display: grid;
  gap: 5px;
  padding: 12px;
  margin-bottom: 12px;
}

.bot-status-row strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bot-status-row strong i {
  color: #d8c7aa;
}

.highlight-row span {
  color: var(--muted);
  font-size: 12px;
}

.selector-grid,
.event-grid,
.device-list,
.plugin-list {
  display: grid;
  gap: 12px;
}

.selector-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.event-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.switch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  margin: 0;
  padding: 13px;
  font-weight: 700;
}

.switch-card.wide {
  margin-bottom: 14px;
}

.switch-card input {
  width: 46px;
  height: 24px;
  flex: 0 0 auto;
  accent-color: var(--cyan);
}

.raid-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 18px;
}

.raid-siren-upload {
  align-items: stretch;
  margin-bottom: 8px;
}

.raid-siren-upload input[type="file"] {
  flex: 1 1 220px;
}

.raid-status-box {
  display: grid;
  gap: 6px;
  min-height: 96px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(143, 164, 207, .14);
  border-radius: 8px;
  background: rgba(21, 27, 44, .72);
}

.raid-status-box strong {
  color: #fff;
}

.raid-status-box small {
  color: var(--muted);
}

.raid-action-row {
  justify-content: flex-end;
}

.device-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.device-card {
  display: grid;
  gap: 10px;
  min-height: 152px;
  padding: 14px;
}

.device-card.is-busy {
  pointer-events: none;
  opacity: .66;
}

.device-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.device-card-actions .btn {
  flex: 1 1 0;
}

/*
 * A device Rust+ cannot find. Dimmed rather than hidden: the owner paired it, so
 * it stays visible and removable, but it should not read as a working switch.
 */
.device-card.is-unreachable {
  opacity: .62;
  border-style: dashed;
}

.device-card.is-unreachable i {
  color: var(--muted, #8fa4cf);
}

.device-card i {
  color: var(--cyan);
  font-size: 28px;
}

.device-card strong {
  display: block;
}

.device-card small,
.plugin-card small {
  color: var(--muted);
}

.log {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.log-line {
  padding: 10px;
  color: #cfe0ff;
  font-size: 13px;
}

.plugin-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plugin-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.plugin-card i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(38, 198, 218, .14);
  color: var(--cyan);
}

.credit-total {
  font-size: 58px;
  font-weight: 700;
  color: #ffe1a8;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 360px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(38, 198, 218, .35);
  border-radius: 8px;
  padding: 12px 14px;
  background: #111827;
  color: #e7f3ff;
  box-shadow: var(--shadow);
  transition: .18s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal {
  width: min(680px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(0, 0, 0, .58);
}

.modal form {
  margin: 0;
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(143, 164, 207, .18);
}

.modal-body {
  padding: 16px;
  color: #d7e4ff;
}

.modal-body ul {
  padding-left: 22px;
}

.settings-password-modal {
  width: min(480px, calc(100vw - 32px));
}

.settings-password-body {
  display: grid;
  gap: 10px;
}

.settings-password-body label {
  margin: 2px 0 -4px;
  font-weight: 700;
}

.settings-password-body input {
  width: 100%;
}

.settings-password-body small {
  color: var(--muted);
}

.settings-password-body .button-row {
  justify-content: flex-end;
  margin-top: 4px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #ff9c9c;
  font-size: 13px;
}

.token-modal {
  width: min(500px, calc(100vw - 32px));
  border: 0;
  background: #fff;
  color: #222;
}

.token-modal::backdrop {
  background: rgba(0, 0, 0, .68);
}

.token-modal .modal-heading {
  padding: 16px;
  border-bottom: 1px solid #dee2e6;
}

.token-modal .modal-heading h2 {
  margin: 0;
  color: #111;
  font-size: 20px;
}

.token-modal .icon-button {
  width: 28px;
  height: 28px;
  background: transparent;
  color: #777;
  font-size: 18px;
}

.token-modal .modal-body {
  padding: 0;
  color: #222;
}

.manual-token-dialog {
  font-size: 16px;
  line-height: 1.5;
}

.manual-token-dialog p {
  margin: 0 0 20px;
  padding: 0 16px;
}

.manual-token-dialog p:first-child {
  padding-top: 16px;
}

.manual-token-dialog a {
  color: #222;
  text-decoration: underline;
}

.manual-token-dialog .help-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  font-size: 12px;
}

.manual-token-dialog textarea {
  display: block;
  width: calc(100% - 32px);
  min-height: 62px;
  margin: 0 16px 16px;
  resize: vertical;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 8px;
  color: #222;
  background: #fff;
  font: inherit;
}

.manual-token-dialog textarea.input-error {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, .16);
}

.manual-token-message {
  display: none;
  width: calc(100% - 32px);
  margin: -4px 16px 16px;
  border: 1px solid #f1aeb5;
  border-radius: 4px;
  padding: 9px 10px;
  background: #f8d7da;
  color: #842029;
  font-size: 13px;
  line-height: 1.4;
}

.manual-token-message.show {
  display: block;
}

.manual-token-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #dee2e6;
  padding: 16px;
}

.manual-token-footer p {
  margin: 0;
  padding: 0;
  color: #b21f2d;
  font-size: 13px;
  line-height: 1.35;
}

.manual-token-actions {
  display: flex;
  gap: 8px;
}

.manual-token-actions .btn {
  min-height: 38px;
  border-radius: 4px;
  padding: 7px 13px;
  font-weight: 500;
}

.manual-token-actions .btn.primary {
  background: #0d6efd;
  color: #fff;
}

.manual-token-actions .btn.secondary {
  background: #6c757d;
  color: #fff;
}

.server-modal,
.player-modal {
  width: min(798px, calc(100vw - 32px));
  border: 0;
  background: #fff;
  color: #222;
}

.server-modal::backdrop,
.player-modal::backdrop {
  background: rgba(0, 0, 0, .68);
}

.server-modal .modal-heading,
.player-modal .modal-heading {
  padding: 16px;
  border-bottom: 1px solid #dee2e6;
}

.server-modal .modal-heading h2,
.player-modal .modal-heading h2 {
  margin: 0;
  color: #111;
  font-size: 20px;
}

.server-modal .icon-button,
.player-modal .icon-button {
  width: 28px;
  height: 28px;
  background: transparent;
  color: #777;
  font-size: 18px;
}

.server-modal .modal-body,
.player-modal .modal-body {
  padding: 0;
  color: #222;
}

.server-change-dialog,
.player-change-dialog {
  font-size: 16px;
  line-height: 1.5;
}

.server-change-dialog p,
.player-change-dialog p {
  margin: 0 0 18px;
  padding: 16px 16px 0;
}

.server-change-dialog ul {
  margin: 0 16px 0 38px;
  padding: 0;
}

.server-change-dialog .server-change-note,
.player-change-dialog .server-change-note {
  margin: 4px 0 16px;
  padding: 0 16px 0 56px;
  font-size: 13px;
}

.server-change-dialog a,
.player-change-dialog a {
  color: #222;
  text-decoration: underline;
}

.server-change-dialog select {
  display: block;
  width: calc(100% - 32px);
  min-height: 42px;
  margin: 0 16px 16px;
  border: 1px solid #86b7fe;
  border-radius: 4px;
  padding: 7px 10px;
  background: #fff;
  color: #222;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .25);
}

.player-option-list {
  display: grid;
  gap: 10px;
  margin: 0 16px 16px;
}

.player-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #cfd7e6;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  cursor: pointer;
}

.player-option input {
  width: 18px;
  height: 18px;
  accent-color: #0d6efd;
}

.player-option-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.player-option-body small,
.player-option-body em {
  color: #56627a;
  font-size: 13px;
  font-style: normal;
}

.player-option.is-current {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .16);
}

.player-option.is-disabled {
  cursor: not-allowed;
  opacity: .62;
}

.server-change-message {
  display: none;
  width: calc(100% - 32px);
  margin: -4px 16px 16px;
  border: 1px solid #f1aeb5;
  border-radius: 4px;
  padding: 9px 10px;
  background: #f8d7da;
  color: #842029;
  font-size: 13px;
}

.server-change-message.show {
  display: block;
}

.server-change-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #dee2e6;
  padding: 16px;
}

.server-change-footer p {
  margin: 0;
  padding: 0;
  color: #b21f2d;
  font-size: 13px;
  line-height: 1.35;
}

.server-change-footer code {
  color: inherit;
  background: transparent;
}

.server-change-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.server-change-actions .btn {
  min-height: 38px;
  border-radius: 4px;
  padding: 7px 13px;
  font-weight: 500;
}

.server-change-actions .btn.primary {
  background: #0d6efd;
  color: #fff;
}

.server-change-actions .btn.secondary {
  background: #6c757d;
  color: #fff;
}

#registered-list-view {
  list-style: disc;
  padding-left: 24px;
}

#registered-list-view li::marker {
  color: var(--coral);
  font-size: 1.5em;
}

#registered-list-view li.reg-success::marker {
  color: var(--green);
}

#registered-list-view li.reg-incomplete::marker {
  color: var(--amber);
}

.ncustomize-form {
  color: var(--text);
}

.ncustomize-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0;
  margin-bottom: 10px;
}

.ncustomize-toggle,
.ncustomize-config {
  display: flex;
  align-items: center;
  min-height: 76px;
  background: #1b2235;
}

.ncustomize-toggle {
  justify-content: center;
  border-radius: 16px 0 0 16px;
}

.ncustomize-config {
  gap: 12px;
  border-radius: 0 16px 16px 0;
  padding: 12px;
}

.ncustomize-enabled {
  background: #42547f;
}

.ncustomize-config-color {
  width: 42px;
  height: 42px;
  border: 0;
  padding: 0;
  background: transparent;
}

@media (max-width: 1100px) {
  .servers-header {
    flex-direction: column;
  }

  .steam-card {
    min-width: 0;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
    position: static;
  }

  .sidebar.open {
    display: block;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .brand {
    min-width: 0;
  }

  .top-nav {
    display: none;
  }

  .section-grid.two,
  .raid-settings-grid,
  .notification-template-list,
  .setup-grid,
  .health-grid,
  .device-list,
  .event-grid {
    grid-template-columns: 1fr;
  }

  .health-item-wide {
    grid-column: auto;
  }

  .team-activity-row,
  .team-activity-meta,
  .event-history-meta {
    grid-template-columns: 1fr;
  }

  .live-map-layout {
    grid-template-columns: 1fr;
  }

  .live-map-roster {
    max-height: none;
  }

  .setup-wizard {
    align-items: stretch;
    flex-direction: column;
  }

  .setup-actions {
    justify-content: flex-start;
  }

  .hero-row,
  .toolbar,
  .settings-locked-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integration-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .integration-status-grid > div:nth-child(2) {
    border-right: 0;
  }

  .signal-card {
    opacity: .58;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 10px 12px;
  }

  .public-hero {
    min-height: calc(100vh - 130px);
    padding: 46px 14px;
  }

  .public-hero h1 {
    font-size: 40px;
  }

  .public-lede {
    font-size: 16px;
  }

  .signal-card {
    display: none;
  }

  .public-band,
  .public-section {
    padding: 20px 14px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .profile .server-pill {
    display: none;
  }

  .app-shell {
    padding: 14px;
  }

  .live-team-map {
    min-height: 300px;
  }

  .live-map-marker-label {
    display: none;
  }

  .live-map-marker.selected .live-map-marker-label {
    display: block;
  }

  .live-map-selected-grid {
    grid-template-columns: 1fr;
  }

  .servers-view {
    padding: 14px;
  }

  .header-lockup,
  .servers-actions,
  .guild-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .header-lockup,
  .guild-entry {
    display: flex;
  }

  .servers-actions {
    display: grid;
  }

  .guildimg-container {
    width: 100%;
  }

  .guild-actions {
    justify-content: space-between;
  }

  .selector-grid,
  .plugin-list {
    grid-template-columns: 1fr;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form .btn,
  .inline-form .icon-button {
    width: 100%;
  }

  .integration-status-grid,
  .secret-input-row {
    grid-template-columns: 1fr;
  }

  .integration-status-grid > div,
  .integration-status-grid > div:first-child,
  .integration-status-grid > div:last-child {
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(143, 164, 207, .18);
  }

  .integration-status-grid > div:last-child {
    border-bottom: 0;
  }

  .secret-input-row .icon-button,
  .secret-input-row .btn {
    width: 100%;
  }

  .integration-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ncustomize-row {
    grid-template-columns: 1fr;
  }

  .ncustomize-toggle,
  .ncustomize-config {
    border-radius: 8px;
  }

  .manual-token-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .server-change-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-token-actions {
    justify-content: flex-end;
  }

  .server-change-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark,
  .public-hero h1,
  .steam-login-button,
  .signal-card,
  .map-grid {
    animation: none;
  }

  .steam-login-button:hover {
    transform: none;
  }
}
