/* Locations index + detail */

.location-detail-shell {
  min-width: 0;
}

.location-detail-shell.is-map-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0.85rem;
  align-items: start;
}

.location-detail-content {
  min-width: 0;
}

.location-detail-shell .npc-map-trigger,
.location-map-trigger {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  flex: 0 0 auto;
  border: 1px solid rgba(51, 255, 167, 0.28);
  border-radius: 50%;
  background: rgba(51, 255, 167, 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}

.location-detail-shell .npc-map-trigger img,
.location-map-trigger img {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
}

.location-detail-shell .npc-map-trigger:hover,
.location-detail-shell .npc-map-trigger:focus-visible,
.location-map-trigger:hover,
.location-map-trigger:focus-visible {
  border-color: var(--accent);
  background: rgba(51, 255, 167, 0.14);
  outline: none;
}

.locations-hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.locations-hub-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-muted);
  padding: 0.38rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.locations-hub-tab.is-active,
.locations-hub-tab:hover,
.locations-hub-tab:focus-visible {
  color: var(--accent);
  border-color: rgba(51, 255, 167, 0.28);
  background: rgba(51, 255, 167, 0.08);
}

.locations-region__hint {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.locations-hub-tab__count {
  margin-left: 0.35rem;
  opacity: 0.72;
  font-size: 0.78em;
}

@media (max-width: 900px) {
  .location-detail-shell.is-map-open {
    display: block;
  }
}

.flow-nav a.locations-nav-link.is-active {
  color: var(--accent);
}

.locations-nav-count {
  margin-left: 0.4rem;
  color: var(--text-muted);
  font-size: 0.78em;
}

.flow-nav a.locations-nav-link.is-active .locations-nav-count {
  color: inherit;
  opacity: 0.75;
}

.locations-index {
  display: grid;
  gap: 1.25rem;
}

.locations-region {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.locations-region__head {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel-head-bg);
}

.locations-region__head h2 {
  margin: 0;
  font-size: var(--text-h2);
  line-height: 1.25;
}

.locations-region__en {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.locations-region__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.locations-region__item + .locations-region__item {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.locations-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  color: inherit;
  text-decoration: none;
}

a.locations-row:hover,
a.locations-row:focus-visible {
  background: rgba(51, 255, 167, 0.05);
}

.locations-row__main {
  min-width: 0;
}

.locations-row__title {
  display: block;
  font-weight: 700;
}

.locations-row__sub {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.locations-row__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.locations-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.locations-tag--category {
  color: var(--accent);
  border-color: rgba(51, 255, 167, 0.18);
  background: rgba(51, 255, 167, 0.07);
}

.location-complex-nav {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.location-complex-nav__title {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.location-complex-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.location-complex-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
}

.location-complex-nav__link.is-current {
  border-color: rgba(51, 255, 167, 0.35);
  background: rgba(51, 255, 167, 0.1);
  color: var(--accent);
}

.location-resident-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.location-resident-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  margin-bottom: -1px;
  padding: 0.25rem 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
}

.location-resident-tab.is-active {
  border-bottom-color: var(--accent);
  background: transparent;
  color: var(--accent);
}

.location-resident-tab__count {
  opacity: 0.85;
  font-size: 0.78rem;
}

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

.location-resident-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0 1rem;
}

.location-resident-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.location-resident-list .entity-link {
  width: 100%;
  padding: 0.6rem 0.2rem;
}

.location-loot-note {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.location-loot-card {
  border-top: 1px solid var(--border);
}

.location-loot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
}

.location-loot-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
}

.location-loot-tab.is-active {
  border-color: rgba(51, 255, 167, 0.35);
  background: rgba(51, 255, 167, 0.1);
  color: var(--accent);
}

.location-loot-tab__count {
  opacity: 0.85;
  font-size: 0.78rem;
}

.location-loot-panels {
  padding: 0.85rem 0;
}

.location-hub-link {
  margin: 0.8rem 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

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

.location-loot-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.location-loot-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.location-loot-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.location-loot-row:first-child {
  padding-top: 0;
}

.location-loot-row__item,
.location-loot-row__sources {
  min-width: 0;
}

.location-loot-npc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.location-loot-npc-list .entity-link {
  width: 100%;
}

.entity-empty--inline {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
}

@media (max-width: 720px) {
  .locations-row {
    grid-template-columns: 1fr;
  }

  .locations-row__meta {
    justify-content: flex-start;
  }

  .location-loot-row {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
}
