.fleet-command-shell {
  width: min(1500px, calc(100% - 28px));
  margin: 14px auto 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 10px;
}

.fleet-command-header {
  grid-column: 1 / -1;
  min-height: 360px;
  padding: clamp(24px, 4vw, 54px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  background:
    linear-gradient(90deg, rgba(1, 5, 10, 0.94), rgba(2, 12, 24, 0.74)),
    radial-gradient(circle at 70% 25%, rgba(53, 200, 255, 0.2), transparent 18rem),
    url("../posters/monad_slide2.png") center / cover;
}

.fleet-command-header h1 {
  max-width: 980px;
  margin-bottom: 14px;
  font-size: clamp(3rem, 8vw, 7.8rem);
  line-height: 0.92;
}

.fleet-subtitle {
  color: var(--gold);
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.command-status-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.command-status {
  padding: 12px;
  border: 1px solid rgba(53, 200, 255, 0.28);
  border-radius: 8px;
  background: rgba(1, 8, 17, 0.66);
}

.command-status.primary {
  border-color: rgba(53, 255, 210, 0.72);
  box-shadow: inset 0 0 24px rgba(53, 255, 210, 0.12), 0 0 18px rgba(53, 255, 210, 0.12);
}

.command-status span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.command-status strong {
  color: #e9fbff;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.doctrine-line {
  grid-column: 1 / -1;
  max-width: 100%;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid rgba(241, 183, 79, 0.4);
  border-radius: 8px;
  color: #fff7d8;
  background: rgba(241, 183, 79, 0.08);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fleet-nav {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tactical-plot {
  grid-column: 1 / -1;
  padding: clamp(20px, 3vw, 34px);
}

.map-command-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 12px;
}

.map-status-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid rgba(53, 200, 255, 0.28);
  background: rgba(1, 8, 17, 0.76);
}

.map-status-panel div {
  min-width: 0;
  padding: 11px 14px;
  border-right: 1px solid rgba(53, 200, 255, 0.18);
}

.map-status-panel div:last-child {
  border-right: 0;
}

.map-status-panel dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.map-status-panel dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: #e9fbff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ais-toggle {
  min-width: 210px;
  display: flex;
  gap: 13px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid rgba(241, 183, 79, 0.52);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(1, 8, 17, 0.84);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.ais-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 26px;
  border: 1px solid rgba(53, 255, 210, 0.72);
  border-radius: 999px;
  background: rgba(53, 255, 210, 0.16);
  box-shadow: inset 0 0 12px rgba(53, 255, 210, 0.14);
  transition: border-color 160ms ease, background 160ms ease;
}

.toggle-knob {
  position: absolute;
  top: 4px;
  left: 25px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #35ffd2;
  box-shadow: 0 0 12px rgba(53, 255, 210, 0.8);
  transition: left 160ms ease, background 160ms ease;
}

.ais-toggle input:focus-visible + .toggle-track {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.ais-toggle input:not(:checked) + .toggle-track {
  border-color: rgba(241, 183, 79, 0.52);
  background: rgba(241, 183, 79, 0.08);
}

.ais-toggle input:not(:checked) + .toggle-track .toggle-knob {
  left: 5px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(241, 183, 79, 0.55);
}

.map-frame {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(53, 200, 255, 0.28);
  border-radius: 8px;
  overflow: hidden;
  background: #020914;
  box-shadow: inset 0 0 34px rgba(53, 200, 255, 0.08);
}

.fleet-map {
  width: 100%;
  height: clamp(460px, 62vh, 680px);
  background: #020914;
}

.fleet-map::after {
  position: absolute;
  z-index: 500;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(rgba(53, 200, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 200, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  box-shadow: inset 0 0 58px rgba(0, 0, 0, 0.78);
}

.fleet-map .leaflet-tile-pane {
  filter: invert(1) hue-rotate(168deg) brightness(0.54) contrast(1.28) saturate(0.72);
}

.fleet-map .leaflet-control-zoom a {
  border-color: rgba(53, 200, 255, 0.32);
  color: #dffaff;
  background: rgba(1, 8, 17, 0.94);
}

.fleet-map .leaflet-control-zoom a:hover,
.fleet-map .leaflet-control-zoom a:focus {
  color: #ffffff;
  background: rgba(6, 37, 54, 0.98);
}

.fleet-map .leaflet-control-attribution {
  color: #8ba3ad;
  background: rgba(1, 8, 17, 0.82);
}

.fleet-map .leaflet-control-attribution a {
  color: var(--cyan);
}

.fleet-map .leaflet-popup-content-wrapper,
.fleet-map .leaflet-popup-tip {
  color: var(--text);
  background: rgba(1, 8, 17, 0.97);
}

.fleet-map .leaflet-popup-content-wrapper {
  border: 1px solid rgba(241, 183, 79, 0.58);
  border-radius: 8px;
}

.contact-popup {
  min-width: 190px;
}

.contact-popup p {
  margin: 5px 0;
  line-height: 1.35;
}

.contact-popup .label {
  color: var(--cyan);
}

.fleet-contact-icon {
  background: none;
  border: 0;
}

.contact-marker {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(1, 8, 17, 0.9);
  box-shadow: 0 0 18px currentColor;
}

.contact-marker::before {
  width: 9px;
  height: 9px;
  content: "";
  border-radius: 50%;
  background: currentColor;
}

.contact-marker::after {
  position: absolute;
  inset: -8px;
  content: "";
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.3;
}

.contact-marker.flagship {
  color: #35ffd2;
}

.contact-marker.station {
  color: var(--gold);
}

.contact-marker.area {
  color: #9c7cff;
  border-radius: 3px;
  rotate: 45deg;
}

.contact-marker.area::before {
  border-radius: 1px;
}

.leaflet-marker-icon.is-selected .contact-marker {
  color: #ffffff;
  scale: 1.18;
  box-shadow: 0 0 8px #ffffff, 0 0 26px currentColor;
}

.contact-panel {
  position: absolute;
  z-index: 700;
  top: 16px;
  right: 16px;
  width: min(330px, calc(100% - 32px));
  padding: 17px;
  border: 1px solid rgba(53, 255, 210, 0.68);
  border-radius: 8px;
  color: var(--text);
  background: rgba(1, 8, 17, 0.96);
  box-shadow: 0 0 26px rgba(53, 255, 210, 0.12);
}

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

.contact-panel-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(53, 200, 255, 0.24);
}

.contact-panel-head h3 {
  margin: 3px 0 0;
  color: #f4fbff;
  font-size: 1.08rem;
}

.contact-panel-head .label {
  margin: 0;
}

.contact-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(53, 200, 255, 0.32);
  border-radius: 4px;
  color: var(--cyan);
  background: rgba(53, 200, 255, 0.06);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.contact-close:hover,
.contact-close:focus-visible {
  border-color: var(--cyan);
  color: #ffffff;
}

.contact-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.contact-detail-grid div {
  min-width: 0;
}

.contact-detail-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #e9fbff;
  font-size: 0.82rem;
  line-height: 1.4;
}

.contact-center {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(241, 183, 79, 0.6);
  border-radius: 5px;
  color: var(--gold);
  background: rgba(241, 183, 79, 0.08);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact-center:hover,
.contact-center:focus-visible {
  border-color: var(--gold);
  color: #ffffff;
  background: rgba(241, 183, 79, 0.14);
}

.map-data-note {
  position: absolute;
  z-index: 600;
  right: 12px;
  bottom: 12px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid rgba(241, 183, 79, 0.45);
  border-radius: 4px;
  color: var(--gold);
  background: rgba(1, 8, 17, 0.88);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.status-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: currentColor;
  background: rgba(53, 200, 255, 0.06);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.roster-panel,
.missions-panel,
.watch-tail-panel {
  padding: clamp(20px, 3vw, 34px);
}

.roster-panel {
  grid-column: 1 / -1;
}

.roster-table-wrap {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  border: 1px solid rgba(165, 106, 48, 0.58);
}

.roster-table td:nth-child(4) {
  color: #e9fbff;
}

.roster-table tr.is-selected td {
  background: rgba(53, 255, 210, 0.1);
  box-shadow: inset 0 1px rgba(53, 255, 210, 0.3), inset 0 -1px rgba(53, 255, 210, 0.3);
}

.roster-contact-button {
  padding: 0;
  border: 0;
  color: #f4fbff;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.roster-contact-button:hover,
.roster-contact-button:focus-visible {
  color: #35ffd2;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.mission-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.mission-list li {
  padding: 13px 14px;
  border: 1px solid rgba(53, 200, 255, 0.22);
  border-radius: 8px;
  color: var(--text);
  background: rgba(1, 8, 17, 0.54);
}

.watch-tail {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
}

.watch-tail p {
  margin: 0;
  padding: 12px 14px;
  border-left: 2px solid var(--gold);
  color: var(--text);
  background: rgba(1, 8, 17, 0.56);
  line-height: 1.45;
}

.watch-tail span {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.doctrine-ticker {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: rgba(1, 6, 12, 0.96);
}

.doctrine-ticker div {
  display: flex;
  width: max-content;
  gap: 34px;
  padding: 14px 18px;
  animation: ticker-drift 42s linear infinite;
}

.doctrine-ticker span {
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doctrine-ticker span:nth-child(odd) {
  color: var(--cyan);
}

@keyframes ticker-drift {
  from {
    translate: 0 0;
  }

  to {
    translate: -50% 0;
  }
}

@media (max-width: 980px) {
  .fleet-command-shell,
  .fleet-command-header {
    grid-template-columns: 1fr;
  }

  .tactical-plot {
    min-height: auto;
  }

  .map-command-bar {
    grid-template-columns: 1fr;
  }

  .ais-toggle {
    min-width: 0;
  }

  .fleet-map {
    height: 520px;
  }
}

@media (max-width: 680px) {
  .fleet-command-shell {
    width: min(100% - 18px, 1500px);
    margin-top: 9px;
  }

  .fleet-command-header {
    padding: 24px;
  }

  .doctrine-line {
    letter-spacing: 0.06em;
  }

  .map-status-panel {
    grid-template-columns: 1fr 1fr;
  }

  .map-status-panel div:nth-child(2) {
    border-right: 0;
  }

  .map-status-panel div:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(53, 200, 255, 0.18);
  }

  .fleet-map {
    height: 430px;
  }

  .contact-panel {
    position: relative;
    inset: auto;
    width: auto;
    margin: 10px;
  }

  .map-data-note {
    right: 8px;
    bottom: 24px;
    max-width: calc(100% - 16px);
  }

  .doctrine-ticker {
    position: static;
  }

  .doctrine-ticker div {
    width: auto;
    flex-wrap: wrap;
    animation: none;
    gap: 10px 18px;
  }
}
