/* Planet command surface: runtime structure modeled after the v4.1 OBBIETTIVO sheet. */
#view-planet .planet-head-retired {
  display: none !important;
}

#view-planet .planet-layout-v31 {
  align-items: start;
  display: grid;
  grid-template-columns: minmax(720px, 1fr) minmax(370px, 430px) !important;
  grid-template-rows: auto auto auto;
  gap: 12px 14px;
  justify-content: center;
  max-width: 1480px;
  margin-inline: auto;
}

#view-planet .planet-main-column {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
}

#view-planet .owned-planets-panel {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

#view-planet .owned-planets-grid {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(58px, 1fr);
  grid-template-columns: repeat(6, minmax(92px, 1fr)) !important;
  grid-template-rows: minmax(52px, auto) !important;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

#view-planet .owned-planet-btn {
  min-width: 0;
  width: 100%;
  height: 54px;
  padding: 3px 6px;
  overflow: hidden;
}

#view-planet .owned-planet-index {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}

#view-planet .owned-planet-copy {
  min-width: 0;
  overflow: hidden;
}

#view-planet .owned-planet-copy b,
#view-planet .owned-planet-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-planet .planet-side-column {
  display: grid;
  align-content: start;
  grid-column: 2;
  grid-row: 3;
  gap: 10px;
  position: sticky;
  top: 66px;
  min-width: 270px;
  grid-auto-flow: row;
  grid-auto-rows: max-content;
  max-height: none;
  overflow-y: visible;
  overflow-x: hidden;
  padding-bottom: 84px;
}

#view-planet .resource-summary {
  grid-column: 1 / -1;
  grid-row: 1;
  position: relative;
  z-index: 3;
  width: 100%;
  margin: 0;
}

#view-planet .resource-summary > .resource-unified-bar { transform: none; }

#view-planet .resource-unified-bar {
  min-height: 98px;
  border: 1px solid rgba(174, 123, 48, .9) !important;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(2, 13, 22, .88), rgba(1, 8, 14, .94)),
    url("../assets/ui/v4.1/Gateward_UI_GOLD_ARABESQUE_MODULAR_KIT_v3_HD_CLEAN/ELEMENTI COMPLETI/11_RACCORDI_COMPLETI/cornice_topbar_schedapianeta_1774x887.webp") center 3% / 100% auto no-repeat !important;
  box-shadow: inset 0 0 0 2px rgba(236, 190, 93, .08), 0 10px 24px rgba(0, 0, 0, .42) !important;
}
#view-planet .resource-unified-bar .resource-card-flipper,
#view-planet .resource-unified-bar .resource-card-front { min-height: 96px; }
#view-planet .resource-unified-bar .resource-card-front { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(148px, .72fr); }
#view-planet .resource-unified-bar .resource-meter-card {
  min-height: 94px;
  padding: 10px 22px 16px 58px !important;
  border-right-color: rgba(173, 121, 47, .72) !important;
  background: url("../assets/ui/v4.1/Gateward_UI_GOLD_ARABESQUE_MODULAR_KIT_v3_HD_CLEAN/ELEMENTI COMPLETI/01_TOPBAR/cornice_risorsa_01_220x76.webp") center / 100% 100% no-repeat !important;
}
#view-planet .resource-name-with-icon { display: contents; }
#view-planet .resource-name-with-icon > span { min-width: 0; }
#view-planet .resource-identity-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(62, 178, 232, .35));
}
#view-planet .resource-stock > span { color: #efcf83; font-size: 10px; }
#view-planet .resource-stock b { color: #f4e3ba; font: 700 18px/1 Georgia, serif !important; }
#view-planet .resource-category-label { display: none !important; }
#view-planet .resource-production { border-left-color: rgba(171, 121, 51, .5); }
#view-planet .resource-capacity-value {
  position: absolute;
  left: 58px;
  bottom: 7px;
  color: #6e9caf;
  font: 600 7px/1 system-ui, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}
#view-planet .storage-gauge {
  right: 8px;
  top: 13px;
  bottom: 13px;
  width: 8px;
  border-color: #8c612b !important;
  background: #01070c !important;
}
#view-planet .storage-gauge i {
  background: linear-gradient(to top, #096ab3, #45c9ff) !important;
  box-shadow: 0 0 8px rgba(57, 186, 243, .7) !important;
}
#view-planet .resource-extra-window { border-left-color: rgba(173, 121, 47, .72); background: rgba(2, 12, 20, .64); }
#view-planet .resource-extra-window > span { grid-template-columns: 34px minmax(0, 1fr); padding: 7px 10px; }
#view-planet .resource-extra-window > span + span { border-top-color: rgba(173, 121, 47, .48); }
#view-planet .resource-extra-window img { grid-row: 1 / 3; width: 28px; height: 28px; align-self: center; object-fit: contain; }
#view-planet .resource-extra-window small { color: #9fc9d9; }
#view-planet .resource-extra-window b { color: #efd28e; font-size: 12px; }

#view-planet .planet-system-map { order: 0; }
#view-planet #buildingsModule { order: 1; }
#view-planet #technologiesModule { order: 2; }
#view-planet #planetVaultModule { order: 3; }
#view-planet #planetLibraryModule { order: 4; }

#view-planet .planet-system-map .map-dock-body,
#view-planet .planet-system-map .mini-map-wrap {
  width: 100% !important;
  height: clamp(440px, 28vw, 560px) !important;
  transform: none;
}

#view-planet .planet-system-map #miniMapCanvas {
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  transform: none;
}

#view-planet .planet-system-map:not(.open) .map-dock-body { height: 0 !important; }

.planet-command-card {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid rgba(188, 130, 46, .82);
  border-radius: 3px;
  background:
    linear-gradient(115deg, rgba(2, 12, 22, .98) 0 51%, rgba(2, 12, 22, .38) 76%, rgba(2, 12, 22, .06)),
    var(--panel-ornate-texture, linear-gradient(145deg, #061523, #020a12));
  box-shadow: inset 0 0 0 1px rgba(243, 193, 91, .12), 0 14px 34px rgba(0, 0, 0, .4);
  color: #dce9ef;
}

.planet-command-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 82% 30%, rgba(45, 151, 218, .16), transparent 35%);
}

.planet-command-card header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  min-height: 142px;
  padding: 14px 10px 9px 14px;
}

.planet-command-card header small,
.planet-command-card header b {
  display: block;
  color: #74d8ff;
  font: 700 9px/1.3 system-ui, sans-serif;
  letter-spacing: .08em;
}

.planet-command-card h2 {
  margin: 4px 0 7px;
  color: #f0cc7b;
  font: 700 20px/1.05 Georgia, serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planet-command-skin {
  align-self: center;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 0 12px rgba(57, 162, 224, .52));
  transform-origin: center;
}

.planet-command-card.under-attack .planet-command-skin {
  animation: planet-command-danger-pulse 1.7s ease-in-out infinite;
}

@keyframes planet-command-danger-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(57, 162, 224, .42)); }
  50% { filter: sepia(.2) saturate(1.45) drop-shadow(0 0 18px rgba(230, 48, 38, .92)); transform: scale(1.025); }
}

.planet-command-card dl {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0;
  border-top: 1px solid rgba(64, 174, 220, .28);
  background: rgba(20, 72, 99, .24);
}

.planet-command-card dl div {
  padding: 8px 10px;
  background: rgba(1, 10, 18, .82);
}

.planet-command-card dt {
  color: #7ca8ba;
  font: 600 9px/1.2 system-ui, sans-serif;
  text-transform: uppercase;
}

.planet-command-card dd {
  margin: 3px 0 0;
  color: #f2d38e;
  font: 700 15px/1 Georgia, serif;
}

.planet-command-effects {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid rgba(64, 174, 220, .28);
  background: rgba(20, 72, 99, .24);
}

.planet-command-effects::before {
  content: "FASCIA ORBITALE · " attr(data-planet-band);
  grid-column: 1 / -1;
  padding: 5px 10px;
  background: rgba(2, 13, 22, .94);
  color: #7fb9cd;
  font: 700 8px/1.2 system-ui, sans-serif;
  letter-spacing: .08em;
}

.planet-command-effect-group { min-width: 0; padding: 7px 9px 8px; background: rgba(1, 10, 18, .86); }
.planet-command-effect-group strong { display: block; margin-bottom: 5px; color: #81df9a; font: 700 9px/1.1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.planet-command-effect-group.malus strong { color: #ff9187; }
.planet-command-effect-group ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.planet-command-effect-group li { display: flex; justify-content: space-between; gap: 5px; min-width: 0; color: #a9c1cc; font: 600 8px/1.15 system-ui, sans-serif; }
.planet-command-effect-group li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planet-command-effect-group li b { flex: 0 0 auto; color: #81df9a; }
.planet-command-effect-group.malus li b { color: #ff9187; }
.planet-command-effect-group li.neutral { color: #718b98; font-weight: 500; }

/* Selector planetario: mantiene leggibili icona e testo anche quando la barra si restringe. */
.galaxy-planet-tab { grid-template-columns: clamp(27px, 2.2vw, 32px) minmax(0, 1fr) !important; column-gap: 7px !important; padding-left: 10px !important; }
.galaxy-planet-tab-skin { justify-self: start; width: clamp(27px, 2.2vw, 32px); height: clamp(27px, 2.2vw, 32px); }

@media (max-width: 700px) {
  .galaxy-planet-tab { grid-template-columns: 27px minmax(0, 1fr) !important; column-gap: 6px !important; padding-left: 10px !important; }
  .galaxy-planet-tab-skin { width: 27px; height: 27px; }
}

/* Le cinque icone filtro condividono la stessa scatola visiva di base. */
.pc2-galaxy-page .galaxy-map-legend button img { width: 36px; height: 36px; aspect-ratio: 1; }

.planet-command-alert {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border-block: 1px solid rgba(255, 76, 62, .62);
  background: rgba(112, 8, 8, .72);
  color: #ffd1c8;
  font: 700 10px/1.2 system-ui, sans-serif;
}

.planet-command-alert[hidden] { display: none; }

#view-planet .planet-primary-services-side {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: repeat(3, 104px) !important;
  gap: 10px;
  position: static;
  width: 100%;
  height: auto !important;
  margin: 0;
  overflow: visible;
  z-index: 2;
}

#view-planet .shared-quick-actions-host[data-quick-context="planet"],
#view-planet .shared-fleet-widget-host[data-fleet-context="planet"] {
  position: relative;
  transform: none;
}

#view-planet .planet-primary-services-side .primary-service-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end;
  gap: 12px;
  min-height: 104px !important;
  width: 100%;
  padding: 16px 18px;
  background-position: center;
  background-size: cover;
}

#view-planet .planet-primary-services-side .primary-service-copy b {
  font-size: 15px;
  line-height: 1.15;
  white-space: nowrap;
}

#view-planet .planet-primary-services-side .primary-service-count {
  min-width: 74px;
}

#view-planet .planet-primary-services-side .primary-service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 8, 15, .94), rgba(0, 8, 15, .34));
  pointer-events: none;
}

#view-planet .planet-primary-services-side .primary-service-card > * {
  position: relative;
  z-index: 1;
}

#view-planet .planet-module-head {
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
}

.planet-module-title small {
  display: block;
  margin-top: 2px;
  color: #77a9bc;
  font: 600 9px/1.2 system-ui, sans-serif;
}

.planet-module-queue {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  color: #d8e8ee;
  white-space: nowrap;
}

.planet-module-queue b {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e6c77c;
}

.planet-module-queue time {
  min-width: 62px;
  color: #73dcff;
  font-variant-numeric: tabular-nums;
}

.planet-module-queue[hidden] { display: none; }

#view-planet .planet-module.open .planet-module-body {
  height: auto;
  overflow: visible;
}

#view-planet .module-workspace,
#view-planet .technology-workspace {
  display: block;
  height: auto;
  min-height: 0;
}

#view-planet .module-nav,
#view-planet .technology-workspace .module-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  padding: 12px;
  overflow: visible;
  border: 0;
  background: rgba(1, 9, 16, .74);
}

.module-nav-card {
  position: relative;
  min-width: 0;
  min-height: 118px;
  overflow: hidden;
  border: 1px solid rgba(160, 125, 62, .7);
  border-radius: 3px;
  background: #03101a var(--module-card-art, none) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(34, 165, 211, .08), 0 7px 16px rgba(0, 0, 0, .28);
}

.module-nav-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(1, 8, 15, .16), rgba(1, 8, 15, .92)),
    linear-gradient(90deg, rgba(1, 8, 15, .88) 0 36%, transparent 78%);
}

.module-nav-card:has(.module-nav-btn.active) {
  border-color: #49c7ff;
  box-shadow: inset 0 0 0 1px rgba(73, 199, 255, .42);
}

.module-nav-card .module-nav-btn {
  position: relative;
  z-index: 1;
  display: block !important;
  width: 100%;
  min-width: 0;
  min-height: 116px;
  padding: 12px 13px;
  border: 0 !important;
  background: transparent !important;
  overflow: hidden;
}

.module-nav-card .module-nav-icon {
  display: none !important;
}

.module-nav-card .module-nav-copy {
  position: absolute;
  inset: 11px 12px auto;
  display: block;
  width: auto;
  min-width: 0;
  max-width: none;
  text-align: left;
}

.module-nav-card .module-nav-copy b,
.module-nav-card .module-nav-copy small {
  display: block;
  text-shadow: 0 2px 3px #000;
}
.module-card-time {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 12px;
  padding: 4px 6px;
  border-left: 2px solid #4dbfe9;
  background: rgba(1, 10, 17, .76);
  color: #b9ddeb;
  font: 700 9px/1 system-ui, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  pointer-events: none;
}

.module-nav-card .module-nav-copy b {
  color: #f4d48a;
  font: 700 14px/1.15 Georgia, "Times New Roman", serif !important;
  white-space: normal;
}
.module-nav-card .module-nav-copy b em {
  margin-left: 5px;
  color: #74d8ff;
  font: 700 10px/1 system-ui, sans-serif;
  font-style: normal;
  white-space: nowrap;
}
.module-nav-card .module-nav-copy small {
  position: absolute;
  top: 75px;
  left: 0;
  margin: 0;
  color: #b9ddeb;
  font-size: 10px !important;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.module-card-upgrade {
  position: absolute;
  z-index: 2;
  right: 7px;
  bottom: 7px;
  min-width: 76px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #a9772e;
  border-radius: 2px;
  background: rgba(4, 20, 29, .92);
  color: #f1d28b;
  font: 700 9px/1 system-ui, sans-serif;
  text-transform: uppercase;
}

.module-card-upgrade:hover:not(:disabled) { border-color: #53cef8; color: white; }
.module-card-upgrade:disabled { opacity: .42; cursor: not-allowed; }

#view-planet .module-detail {
  position: relative;
  min-height: 520px;
  margin: 0 12px 12px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(160, 125, 62, .72);
  border-radius: 3px;
  background: #03101a;
  isolation: isolate;
}

#view-planet .module-detail::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(1, 8, 15, .78) 0 34%, rgba(1, 8, 15, .48) 64%, rgba(1, 8, 15, .22)),
    linear-gradient(0deg, rgba(1, 8, 15, .68), transparent 52%);
  pointer-events: none;
}

#view-planet #technologyDetail {
  background: #03101a var(--research-detail-art, url("../assets/ui/v4.1/cards/buildings/lab.webp")) center / cover no-repeat;
}

#view-planet .module-detail > *:not(.building-visual-card) {
  position: relative;
  z-index: 2;
}

#view-planet .module-detail .building-visual-card {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
}

#view-planet .module-detail .building-visual-card::after { display: none; }
#view-planet .module-detail .building-visual-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .94;
}

#view-planet .module-detail-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(167, 127, 61, .58);
}

#view-planet .module-detail-title .big-icon { display: none; }
#view-planet .module-detail-title h3 {
  margin: 0;
  color: #f3d48f;
  font-size: 22px;
  text-shadow: 0 2px 5px #000;
}
#view-planet .module-detail-title p,
#view-planet .module-desc {
  max-width: 720px;
  color: #d5e3e8;
  text-shadow: 0 2px 4px #000;
}

#view-planet .construction-state-line,
#view-planet .construction-cost-grid,
#view-planet .construction-meta-grid,
#view-planet .building-prerequisite-list,
#view-planet .production-control-panel {
  max-width: 720px;
  background: rgba(2, 13, 22, .62);
  backdrop-filter: blur(2px);
}

#view-planet .construction-prototype-note,
#view-planet .construction-divider,
#view-planet .construction-queue-header,
#view-planet .construction-queue-list {
  display: none !important;
}

#view-planet .production-control-note,
#view-planet .module-desc { display: none !important; }

#view-planet .construction-state-line,
#view-planet .construction-meta-grid { grid-template-columns: minmax(160px, 240px); }

#view-planet .planet-module-head { grid-template-columns: minmax(150px, auto) minmax(0, 1fr); }
#view-planet .planet-module-symbol { display: none !important; }

#view-planet .owned-planet-index::after { content: none !important; display: none !important; }

#view-planet .shared-quick-actions-host,
#view-planet .shared-quick-actions { width: 100% !important; box-sizing: border-box; }

#view-planet .planet-primary-services-side .primary-service-card::after {
  background: linear-gradient(90deg, rgba(0, 8, 15, .72), rgba(0, 8, 15, .12));
}

#view-planet .mini-map-wrap::before { opacity: 1; filter: saturate(1.18) contrast(1.06); }
#view-planet .mini-map-zoom {
  position: absolute;
  z-index: 8;
  top: 50%;
  right: 10px;
  display: grid;
  gap: 5px;
  transform: translateY(-50%);
}
#view-planet .mini-map-zoom button {
  width: 40px;
  height: 40px;
  border: 1px solid #9b6b2c;
  background: rgba(2, 14, 23, .88);
  color: #f0cf83;
  font: 700 21px/1 Georgia, serif;
  cursor: pointer;
}
#view-planet .mini-map-zoom button:hover { border-color: #55c8ef; color: #fff; }

#view-planet .shared-fleet-widget-host[data-fleet-context="planet"],
#view-planet .fleet-orbit-summary { display: block !important; width: 100% !important; box-sizing: border-box; }
#view-planet .fleet-orbit-summary { background: rgba(2, 13, 22, .78); }
#view-planet .fleet-orbit-content {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(150px, .9fr);
  min-height: 205px;
  align-items: center;
  background: url("../assets/ui/v4.1/Gateward_UI_GOLD_ARABESQUE_MODULAR_KIT_v3_HD_CLEAN/ELEMENTI COMPLETI/10_SCHEDA_PIANETA/pannello_flotta_orbita_570x230.webp") center / 100% 100% no-repeat;
}
#view-planet .fleet-orbit-content > img { width: 100%; height: 190px; object-fit: contain; filter: drop-shadow(0 8px 16px #000); }
#view-planet .fleet-orbit-content dl { display: grid; gap: 7px; margin: 0; padding: 12px 14px 12px 0; }
#view-planet .fleet-orbit-content dl div { display: flex; justify-content: space-between; gap: 8px; color: #aebdc5; font-size: 10px; }
#view-planet .fleet-orbit-content dt { margin: 0; }
#view-planet .fleet-orbit-content dd { margin: 0; color: #efce7f; font-weight: 700; }
#view-planet .fleet-orbit-manage { grid-column: 1 / -1; width: 100%; margin-top: 4px; }

@media (max-width: 760px) {
  #view-planet .module-nav,
  #view-planet .technology-workspace .module-nav { grid-template-columns: minmax(0, 1fr); }
}

#view-planet .module-actions { margin-top: 10px; }
#view-planet .module-actions .planet-btn,
#view-planet .research-ready-btn { min-height: 40px; }

#systemView,
#mapDock .mini-map-wrap {
  isolation: isolate;
}

#systemView::before,
#mapDock .mini-map-wrap::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -18px;
  background-image: var(--system-event-backdrop, none);
  background-position: calc(50% + var(--system-event-x, 0px)) calc(50% + var(--system-event-y, 0px));
  background-size: cover;
  background-repeat: no-repeat;
  transition: background-image .35s ease, background-position .18s ease-out;
  pointer-events: none;
}

#systemView > canvas,
#mapDock .mini-map-wrap > canvas {
  position: relative;
  z-index: 1;
}

#mapDock .mini-map-wrap > .mini-back-galaxy,
#mapDock .mini-map-wrap > .mini-map-open,
#mapDock .mini-map-wrap > .mini-object-info,
#mapDock .mini-map-wrap > .mini-nav-tools {
  position: absolute;
}

#mapDock .mini-nav-tool .map-search-action-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

#mapDock[data-system-environment="comet"] .mini-map-wrap::after,
#systemView[data-system-environment="comet"]::after {
  content: "COMETA DI MEDJAI";
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 12px;
  padding: 5px 8px;
  border: 1px solid rgba(89, 205, 255, .7);
  background: rgba(1, 12, 22, .76);
  color: #9be8ff;
  font: 700 9px/1 system-ui, sans-serif;
  letter-spacing: .12em;
  pointer-events: none;
}

@media (max-width: 1050px) {
  #view-planet .planet-layout-v31 { grid-template-columns: minmax(0, 1fr) !important; max-width: 940px; }
  #view-planet .resource-summary,
  #view-planet .owned-planets-panel,
  #view-planet .planet-main-column,
  #view-planet .planet-side-column { grid-column: 1; grid-row: auto; }
  #view-planet .resource-summary { order: 0; }
  #view-planet .owned-planets-panel { order: 1; }
  #view-planet .planet-main-column { order: 2; }
  #view-planet .planet-side-column { order: 3; position: static; min-width: 0; padding-bottom: 84px; }
  #view-planet .planet-primary-services-side {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: repeat(3, 104px) !important;
  }
  #view-planet .module-nav,
  #view-planet .technology-workspace .module-nav { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .planet-command-card.under-attack .planet-command-skin { animation: none; filter: drop-shadow(0 0 14px rgba(230, 48, 38, .9)); }
  #systemView::before, #mapDock .mini-map-wrap::before { transition: none; }
}
