.mapgenie-marker {
  position: relative;
  transition: background .15s, box-shadow .15s;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.mapgenie-marker:hover {
  z-index: 2;
  transform: none !important;
  scale: 1 !important;
  box-shadow: none !important;
}

.mapgenie-marker img { width: 30px !important; height: 30px !important; object-fit: contain; }
.app .mapgenie-marker,
.app .mapgenie-marker-materials,
.app .mapgenie-marker-collectibles,
.app .mapgenie-marker-npcs,
.app .mapgenie-marker-pals,
.app .mapgenie-marker-locations {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.app .mapgenie-marker.visited {
  border-radius: 50% !important;
  box-shadow: 0 0 0 3px #55d98e, 0 0 10px #55d98e99 !important;
}
.app .mapgenie-marker.visited img { filter: grayscale(.75) brightness(.82); }

.mapgenie-marker::after {
  content: attr(data-label);
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: calc(100% + 8px);
  display: none;
  width: max-content;
  max-width: 220px;
  padding: 5px 8px;
  border: 1px solid #ffffff33;
  border-radius: 6px;
  background: #10252cee;
  color: #fff;
  box-shadow: 0 4px 12px #06151c88;
  white-space: nowrap;
  pointer-events: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  transform: translateX(-50%);
}

.mapgenie-marker:hover::after { display: block; }

.mapgenie-detail {
  position: absolute;
  z-index: 6;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 11px;
  width: min(350px, calc(100% - 350px));
  padding: 16px;
  border: 1px solid #f5cc6566;
  border-radius: 11px;
  background: #10252cf2;
  color: #e7f5f3;
  box-shadow: 0 14px 34px #06151c99;
  backdrop-filter: blur(12px);
}

.mapgenie-detail h3 { margin: 4px 0 7px; color: #fff; font-size: 17px; }
.mapgenie-detail p { margin: 0 0 8px; color: #b9d0d1; font-size: 12px; line-height: 1.45; }
.mapgenie-detail small { display: block; color: #9ab8bc; font-size: 10px; }
.mapgenie-detail[hidden] { display: none; }
.mapgenie-detail-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 9px; background: #ffffff12; color: #f5cc65; font-size: 21px; }
.mapgenie-detail-icon img { width: 34px; height: 34px; object-fit: contain; }
.mapgenie-detail-close { position: absolute; top: 7px; right: 8px; border: 0; background: transparent; color: #a9c5c8; cursor: pointer; font-size: 20px; }
.map-detail-visit { margin-top: 10px; padding: 6px 9px; border-color: #2c7b76; background: #2c7b76; color: #fff; font-size: 10px; }

@media (max-width: 800px) {
  .mapgenie-detail { right: 10px; bottom: 10px; width: calc(100% - 20px); }
}

/* El mapa ocupa una sola superficie; el panel no añade un segundo marco. */
.app .mapgenie-panel {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.app .mapgenie-map {
  border: 1px solid #345059;
  border-radius: 10px;
}

.app .mapgenie-note { display: none !important; }
.app .mapgenie-sidebar .search { flex: 0 0 auto; min-height: 42px; }

/* Las acciones viven en la misma línea que las pestañas, sin cabecera vacía. */
.app > main > header {
  position: static !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  pointer-events: none;
}

.app > main > header .crumb { display: none; }
.app > main > header .user { position: fixed; top: 10px; right: clamp(16px, 4vw, 54px); z-index: 40; margin-left: auto; pointer-events: auto; }
.app > main > header .theme-toggle { border-color: #345059; background: #10252c; color: #f5cc65; }
.app > main > header .user em { background: #d7a447; }
.app > .sidebar nav { min-width: 0; padding-right: 112px; overflow: hidden; }
.app > .sidebar nav .nav { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 800px) {
  .app > main > header .user { top: 8px; right: 14px; gap: 8px; }
  .app > .sidebar nav { padding-right: 96px; }
}

/* Paleta azul de PalAtlas */
.app {
  --primary: #498EB9;
  --primary-dark: #356F94;
  --mint: #498EB9;
  --surface-2: #e8f1f7;
  --line: #a9c7d9;
}

.app .tag,
.app button.tag,
.app .source-link,
.app .map-detail-visit,
.app #save-home-profile,
.app #save-team,
.app #favorite-team,
.app #add-team {
  background: #498EB9 !important;
  border-color: #498EB9 !important;
  color: #fff !important;
}

.app > .sidebar .nav:hover,
.app > .sidebar .nav.active {
  background: #498EB9 !important;
  color: #fff !important;
  box-shadow: inset 0 -2px #bfe0f1 !important;
}

.dark .app > .sidebar .nav:hover,
.dark .app > .sidebar .nav.active {
  background: #498EB9 !important;
  color: #fff !important;
  box-shadow: inset 0 -2px #bfe0f1 !important;
}

.app .profile-avatar {
  width: 62px !important;
  height: 62px !important;
  min-width: 62px;
  min-height: 62px;
  overflow: hidden;
  flex-shrink: 0;
  background: #498EB9 !important;
}

.app .profile-avatar-image {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.app .home-readonly { min-height: 0; }
.app .profile-facts span { border-color: #498EB9; }
.app .home-progress-item i,
.app .progress-tile i b { background: #498EB9; }
.app .search:focus,
.app .select:focus { border-color: #498EB9; box-shadow: 0 0 0 3px #498EB933; }
.app .kicker,
.app .profile-facts b { color: #498EB9; }

/* Fondo principal solicitado */
body,
.app,
.app > main,
.app #root {
  background: #498EB9 !important;
}

.app .home-readonly {
  background: #498EB9 !important;
  border-color: #8fc8e4 !important;
  color: #fff !important;
}

.app .home-readonly .sub,
.app .home-readonly p {
  color: #e3f3fa !important;
}

.app .home-readonly .profile-facts span {
  background: #3f82a9 !important;
  border-color: #8fc8e4 !important;
}

.app .home-readonly .profile-facts b { color: #dff3fb !important; }

/* Tecnología: columnas estables para que checkbox, icono y nombre queden centrados. */
.app .technology-level .check-row {
  display: grid !important;
  grid-template-columns: 24px 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
}
.app .technology-level .check-row > input {
  margin: 0;
  justify-self: center;
}
.app .technology-level .check-row > .catalog-thumb {
  width: 48px !important;
  height: 48px !important;
  margin: 0 !important;
  justify-self: center;
}
.app .technology-level .check-row > span {
  min-width: 0;
  display: flex;
  align-items: center;
  line-height: 1.2;
}
.app .technology-level .check-row > span b {
  display: block;
  text-align: left;
}

.catalog-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #06151ccc;
}
.catalog-detail-sheet {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, 90vh);
  overflow: auto;
  padding: 24px;
  border: 1px solid #4b8284;
  border-radius: 12px;
  background: #214f5a;
  color: #f4fbf8;
  box-shadow: 0 20px 60px #06151c99;
}
.catalog-detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid #76a9aa;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 22px;
}
.catalog-detail-head {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 18px;
  padding-right: 34px;
}
.catalog-detail-head .catalog-card-art {
  width: 110px;
  height: 110px;
  background: #193b43 !important;
}
.catalog-detail-head .catalog-card-art img { width: 88%; height: 88%; object-fit: contain; }
.catalog-detail-head h2 { margin: 6px 0; color: #fff; }
.catalog-detail-head p { margin: 0; color: #d1e6e3; line-height: 1.5; }
.catalog-detail-facts { display: grid; gap: 12px; margin-top: 22px; }
.catalog-detail-facts > div { padding: 12px; border: 1px solid #4b8284; border-radius: 8px; background: #285d66; }
.catalog-detail-facts b { display: block; margin-bottom: 7px; color: #d3bd79; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.catalog-detail-facts > div > span { color: #eaf5f2; }
.catalog-materials { display: flex; flex-wrap: wrap; gap: 7px; }
.catalog-materials span { padding: 6px 9px; border-radius: 6px; background: #193f49; color: #f4fbf8; font-size: 12px; font-weight: 700; }
.catalog-detail-note { margin: 18px 0 0; color: #a9c5c8; font-size: 11px; }
.app .catalog-card[data-structure-card] .catalog-card-art img {
  width: auto !important;
  height: auto !important;
  max-width: 100px;
  max-height: 100px;
  object-fit: contain !important;
  image-rendering: auto;
}
@media (max-width: 560px) {
  .catalog-detail-sheet { padding: 18px; }
  .catalog-detail-head { grid-template-columns: 78px 1fr; gap: 12px; }
  .catalog-detail-head .catalog-card-art { width: 78px; height: 78px; }
}
.key-spheres-profile{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px 0}.key-sphere-profile{display:grid;justify-items:center;gap:5px;padding:8px;border:1px solid var(--line);border-radius:8px;background:var(--blue);opacity:.42;text-align:center}.key-sphere-profile.collected{opacity:1;border-color:var(--orange)}.key-sphere-profile img{width:58px;height:58px;object-fit:contain}.key-sphere-profile span{font-size:10px;font-weight:800}.key-spheres-editor{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.key-spheres-editor label{display:flex;align-items:center;gap:7px;padding:7px;border:1px solid var(--line);border-radius:7px;background:var(--blue);font-size:10px}.key-spheres-editor img{width:35px;height:35px;object-fit:contain}.key-spheres-editor input{accent-color:var(--green)}@media(max-width:700px){.key-spheres-profile{grid-template-columns:repeat(2,minmax(0,1fr))}.key-spheres-editor{grid-template-columns:1fr}}
.trainer-v2-spheres>div{opacity:.45}.trainer-v2-spheres>div.collected{opacity:1}.trainer-v2-spheres img{width:42px;height:42px;object-fit:contain}.trainer-v2-spheres>div span{display:block;max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
