:root {
  color-scheme: dark;
  --bg: #062747;
  --bg-deep: #03192f;
  --ink: #f8fbff;
  --muted: #a9c5df;
  --line: rgba(136, 194, 239, 0.26);
  --map-line: rgba(149, 210, 255, 0.62);
  --province: rgba(48, 133, 203, 0.64);
  --province-hover: rgba(96, 178, 238, 0.9);
  --province-selected: rgba(255, 255, 255, 0.96);
  --accent: #63b3ed;
  --accent-strong: #2f7dff;
  --panel: rgba(3, 22, 41, 0.82);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 16%, rgba(47, 125, 255, 0.2), transparent 27%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.map-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.app-header {
  position: relative;
  z-index: 2;
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px clamp(18px, 4vw, 54px) 0;
}

.brand-block {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  border: 1px solid rgba(136, 194, 239, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(5, 32, 57, 0.92), rgba(3, 22, 41, 0.72));
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  padding: 10px 14px;
}

.brand-logo-wrap {
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  padding: 10px 14px;
}

.brand-logo {
  display: block;
  width: clamp(190px, 23vw, 315px);
  height: auto;
  object-fit: contain;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header #appEyebrow,
.section-title span,
.detail-hero span {
  display: block;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-header #appEyebrow {
  margin-bottom: 5px;
}

.app-header h1 {
  margin: 0;
  color: #f7fbff;
  font-size: clamp(1.65rem, 4.8vw, 4.5rem);
  font-weight: 650;
  letter-spacing: 0.24em;
  line-height: 0.95;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.language-switcher {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.62);
  padding: 4px;
}

.language-button {
  min-width: 86px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
}

.flag-icon {
  position: relative;
  width: 18px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(248, 251, 255, 0.34);
  overflow: hidden;
}

.flag-es {
  background: linear-gradient(180deg, #c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%);
}

.flag-en {
  background:
    linear-gradient(180deg, transparent 0 42%, #ffffff 42% 58%, transparent 58% 100%),
    linear-gradient(90deg, transparent 0 42%, #ffffff 42% 58%, transparent 58% 100%),
    linear-gradient(180deg, #012169 0 100%);
}

.flag-en::before,
.flag-en::after {
  content: "";
  position: absolute;
  inset: 5px -3px;
  background: #c8102e;
  transform: rotate(32deg);
}

.flag-en::after {
  transform: rotate(-32deg);
}

.language-button.active,
.language-button:hover,
.language-button:focus-visible {
  background: rgba(99, 179, 237, 0.2);
  color: #ffffff;
  outline: 0;
}

.contact-button {
  min-height: 38px;
  border: 1px solid rgba(99, 179, 237, 0.42);
  border-radius: 8px;
  background: rgba(99, 179, 237, 0.12);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  padding: 0 16px;
}

.contact-button:hover,
.contact-button:focus-visible,
.contact-submit:hover,
.contact-submit:focus-visible {
  background: rgba(99, 179, 237, 0.24);
  outline: 0;
}

.explore-tools {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 12px clamp(18px, 4vw, 54px) 6px;
}

.mode-summary {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: rgba(169, 197, 223, 0.82);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.search-wrap {
  position: relative;
}

.search-wrap input,
.contact-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(136, 194, 239, 0.32);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 850;
  padding: 0 12px;
}

.search-wrap input:focus,
.contact-form select:focus {
  border-color: rgba(99, 179, 237, 0.84);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.18);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.search-result {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid rgba(136, 194, 239, 0.12);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 850;
  text-align: left;
  padding: 8px 11px;
}

.search-result:hover,
.search-result:focus-visible {
  background: rgba(99, 179, 237, 0.16);
  outline: 0;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.filter-chip,
.view-chip,
.small-tool-button,
.detail-action {
  min-height: 34px;
  border: 1px solid rgba(136, 194, 239, 0.28);
  border-radius: 999px;
  background: rgba(3, 22, 41, 0.56);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0 12px;
}

.detail-action {
  min-height: 40px;
  border-width: 1.5px;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  padding: 0 15px;
}

.share-action {
  border-color: rgba(89, 184, 255, 0.95);
  background: linear-gradient(135deg, rgba(47, 125, 255, 0.92), rgba(22, 94, 202, 0.78));
}

.filter-chip.active,
.view-chip.active,
.small-tool-button:hover,
.small-tool-button:focus-visible,
.detail-action:hover,
.detail-action:focus-visible {
  border-color: rgba(99, 179, 237, 0.62);
  background: rgba(99, 179, 237, 0.2);
  color: #ffffff;
  outline: 0;
}

.whatsapp-action {
  border-color: rgba(73, 255, 139, 0.95);
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.95), rgba(12, 145, 64, 0.84));
  color: #eafff1;
}

.whatsapp-action:hover,
.whatsapp-action:focus-visible {
  border-color: rgba(37, 211, 102, 0.95);
  background: linear-gradient(135deg, rgba(56, 235, 123, 1), rgba(7, 120, 52, 0.92));
}

.suggest-action {
  border-color: rgba(255, 218, 94, 0.95);
  background: linear-gradient(135deg, rgba(255, 181, 43, 0.95), rgba(204, 117, 5, 0.84));
}

.suggest-action:hover,
.suggest-action:focus-visible {
  border-color: rgba(255, 234, 140, 1);
  background: linear-gradient(135deg, rgba(255, 201, 71, 1), rgba(188, 98, 0, 0.92));
}

.plan-action {
  border-color: rgba(255, 126, 126, 0.95);
  background: linear-gradient(135deg, rgba(232, 32, 58, 0.95), rgba(159, 31, 69, 0.86));
}

.plan-action:hover,
.plan-action:focus-visible {
  border-color: rgba(255, 166, 166, 1);
  background: linear-gradient(135deg, rgba(245, 55, 80, 1), rgba(137, 18, 58, 0.94));
}

.tool-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.reset-tool-button {
  border-color: rgba(255, 218, 94, 0.46);
  background: rgba(255, 181, 43, 0.12);
}

.map-frame {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0 clamp(12px, 3vw, 42px) clamp(42px, 6vh, 72px);
}

.province-map {
  width: min(100%, calc((100vh - 120px) * 1.52));
  height: auto;
  max-height: calc(100vh - 126px);
  overflow: visible;
  filter: drop-shadow(0 22px 45px rgba(0, 0, 0, 0.18));
}

.province {
  fill: var(--province);
  stroke: var(--map-line);
  stroke-width: 1.1;
  transform-box: fill-box;
  transform-origin: center;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  animation: provinceIn 560ms ease both;
  transition: fill 150ms ease, filter 150ms ease, stroke 150ms ease, stroke-width 150ms ease, transform 150ms ease;
}

.province:hover,
.province:focus-visible {
  fill: var(--province-hover);
  stroke: #d9f1ff;
  stroke-width: 1.8;
  transform: scale(1.055);
  filter: drop-shadow(0 0 9px rgba(99, 179, 237, 0.76));
  outline: 0;
}

.province.active {
  fill: var(--province-selected);
  stroke: #7fc8ff;
  stroke-width: 2.2;
  transform: scale(1.045);
  filter:
    drop-shadow(0 0 12px rgba(125, 202, 255, 0.88))
    drop-shadow(0 0 32px rgba(47, 125, 255, 0.36));
}

.province.dimmed {
  fill: rgba(42, 91, 135, 0.26);
  stroke: rgba(149, 210, 255, 0.22);
}

.province.highlighted {
  fill: rgba(99, 179, 237, 0.88);
  stroke: #e5f7ff;
  stroke-width: 1.8;
  filter: drop-shadow(0 0 12px rgba(99, 179, 237, 0.72));
}

.province.ranked {
  fill: var(--rank-color, rgba(99, 179, 237, 0.82));
}

.hover-layer {
  pointer-events: none;
}

.province-hover-preview {
  fill: rgba(228, 32, 58, 0.94);
  stroke: #ffe08a;
  stroke-width: 3.2;
  vector-effect: non-scaling-stroke;
  filter:
    drop-shadow(0 0 18px rgba(228, 32, 58, 0.86))
    drop-shadow(0 16px 24px rgba(0, 0, 0, 0.32));
}

.province-label {
  fill: rgba(240, 248, 255, 0.94);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(3, 25, 47, 0.84);
  stroke-width: 3px;
  text-anchor: middle;
}

.network-line {
  stroke: rgba(99, 179, 237, 0.14);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.map-dot {
  fill: #7fc8ff;
  opacity: 0.72;
  pointer-events: none;
  animation: dotPulse 2.8s ease-in-out infinite;
}

.capital-marker {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 150ms ease, filter 150ms ease;
}

.capital-marker-ring {
  fill: rgba(99, 179, 237, 0.16);
  stroke: rgba(162, 219, 255, 0.42);
  stroke-width: 1.5;
}

.capital-marker-dot {
  fill: #eef8ff;
  stroke: #68bff8;
  stroke-width: 3;
  filter: drop-shadow(0 0 12px rgba(99, 179, 237, 0.88));
}

.capital-marker text {
  fill: #082341;
  font-size: 10px;
  font-weight: 950;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
}

.capital-marker:hover .capital-marker-dot,
.capital-marker:focus-visible .capital-marker-dot,
.capital-marker.active .capital-marker-dot {
  fill: #ffffff;
  stroke: #ffffff;
}

.capital-marker:hover,
.capital-marker:focus-visible,
.capital-marker.active {
  transform: scale(1.12);
  filter: drop-shadow(0 0 14px rgba(99, 179, 237, 0.8));
}

.capital-marker-hover-preview {
  filter:
    drop-shadow(0 0 20px rgba(228, 32, 58, 0.9))
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.28));
}

.capital-marker-hover-preview .capital-marker-dot {
  fill: #e4203a;
  stroke: #ffe08a;
}

.capital-marker:focus-visible {
  outline: 0;
}

.tooltip {
  position: fixed;
  z-index: 30;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  padding: 9px 11px;
  pointer-events: none;
  transform: translate(14px, -44px);
}

.hover-card {
  position: fixed;
  z-index: 31;
  width: min(280px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.95);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  color: var(--ink);
  pointer-events: none;
  padding: 12px;
  transform: translate(16px, -18px);
}

.hover-card span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hover-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.12rem;
  line-height: 1.1;
}

.hover-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.hover-card .whatsapp-hint {
  color: #b9ffd1;
  font-weight: 900;
}

.ranking-panel {
  position: fixed;
  right: clamp(14px, 2.2vw, 32px);
  top: 156px;
  z-index: 22;
  width: min(280px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.76);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  padding: 10px;
}

.ranking-panel h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ranking-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-top: 1px solid rgba(136, 194, 239, 0.12);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 7px 2px;
  text-align: left;
}

.ranking-item:hover,
.ranking-item:focus-visible {
  background: rgba(99, 179, 237, 0.14);
  outline: 0;
}

.ranking-item span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(99, 179, 237, 0.2);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 950;
}

.ranking-item strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-item em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 850;
}

.source-note {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 10;
  margin: 0;
  color: rgba(169, 197, 223, 0.72);
  font-size: 0.72rem;
  font-weight: 750;
}

.detail-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  background:
    radial-gradient(circle at 72% 12%, rgba(47, 125, 255, 0.26), transparent 30%),
    linear-gradient(180deg, rgba(6, 39, 71, 0.98), rgba(3, 25, 47, 0.98));
  color: var(--ink);
  overflow: auto;
}

.detail-view[hidden] {
  display: none;
}

.contact-view,
.share-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(3, 18, 34, 0.78);
  color: var(--ink);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.contact-view[hidden],
.share-view[hidden] {
  display: none;
}

.admin-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(3, 18, 34, 0.78);
  color: var(--ink);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.admin-view[hidden] {
  display: none;
}

.close-button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 45;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(248, 251, 255, 0.34);
  border-radius: 999px;
  background: rgba(3, 22, 41, 0.78);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 950;
}

.close-button:hover,
.close-button:focus-visible {
  background: rgba(99, 179, 237, 0.22);
  outline: 0;
}

.contact-card,
.share-card {
  position: relative;
  width: min(540px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 84% 4%, rgba(99, 179, 237, 0.24), transparent 34%),
    rgba(3, 22, 41, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  padding: 24px;
}

.admin-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 84% 4%, rgba(99, 179, 237, 0.24), transparent 34%),
    rgba(3, 22, 41, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  padding: 24px;
}

.admin-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-card h2 {
  margin: 0;
  padding-right: 52px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 0.98;
}

.admin-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.admin-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 13, 26, 0.32);
  padding: 12px;
}

.admin-stat span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
}

.admin-stat p {
  margin: 6px 0 0;
  font-size: 0.84rem;
}

.contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.contact-card > span,
.share-card > span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contact-card h2,
.share-card h2 {
  margin: 0;
  padding-right: 52px;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 0.98;
}

.contact-card p,
.share-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.share-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 20px;
}

.share-box input {
  min-width: 0;
  border: 1px solid rgba(136, 194, 239, 0.32);
  border-radius: 8px;
  background: rgba(0, 13, 26, 0.42);
  color: var(--ink);
  font: inherit;
  padding: 12px;
}

.contact-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  color: #f8fbff;
  font-size: 0.9rem;
  font-weight: 900;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  border: 1px solid rgba(136, 194, 239, 0.32);
  border-radius: 8px;
  background: rgba(0, 13, 26, 0.42);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  padding: 12px;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-color: rgba(99, 179, 237, 0.84);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.18);
}

.contact-submit {
  min-height: 44px;
  border: 1px solid rgba(99, 179, 237, 0.5);
  border-radius: 8px;
  background: rgba(99, 179, 237, 0.16);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 950;
}

.contact-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.contact-status {
  margin: 0;
  color: #d8efff;
  font-size: 0.94rem;
  font-weight: 850;
}

.detail-scroll {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 68px 0 42px;
}

.detail-hero {
  max-width: 900px;
  padding-right: 62px;
}

.detail-hero span,
.section-title span {
  margin-bottom: 8px;
}

.detail-hero h2 {
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 5.4rem);
  line-height: 0.95;
}

.detail-hero p {
  max-width: 790px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.55;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 980px;
  margin-top: 20px;
}

.quick-fact {
  border: 1px solid rgba(136, 194, 239, 0.28);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.56);
  padding: 10px 12px;
}

.quick-fact span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quick-fact strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.2;
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.insights-section,
.places-section,
.neighbors-section {
  margin-top: 34px;
}

.neighbors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.neighbor-chip {
  min-height: 36px;
  border: 1px solid rgba(136, 194, 239, 0.34);
  border-radius: 999px;
  background: rgba(99, 179, 237, 0.14);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  padding: 0 13px;
}

.neighbor-chip:hover,
.neighbor-chip:focus-visible {
  border-color: rgba(99, 179, 237, 0.8);
  background: rgba(99, 179, 237, 0.28);
  outline: 0;
}

.section-title h3 {
  margin: 0;
  font-size: clamp(1.42rem, 3vw, 2.25rem);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.insight-card {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.56);
  padding: 14px;
}

.insight-card h4 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 0.96rem;
  line-height: 1.22;
}

.insight-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.insight-card div {
  display: grid;
  gap: 2px;
}

.insight-card dt {
  color: #f8fbff;
  font-size: 0.78rem;
  font-weight: 900;
}

.insight-card dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.places-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.place-card {
  min-height: 360px;
  display: grid;
  grid-template-rows: 190px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 22, 41, 0.58);
  overflow: hidden;
}

.coming-soon-card {
  min-height: 180px;
  grid-template-rows: 1fr;
}

.place-media {
  position: relative;
  background:
    radial-gradient(circle at 28% 24%, rgba(99, 179, 237, 0.32), transparent 30%),
    linear-gradient(135deg, rgba(47, 125, 255, 0.36), rgba(3, 22, 41, 0.82));
}

.place-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.place-media span {
  position: absolute;
  inset: auto 12px 12px 12px;
  color: rgba(248, 251, 255, 0.78);
  font-size: 0.8rem;
  font-weight: 850;
}

.place-body {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
}

.place-body h4 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.place-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.42;
}

.place-body a {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.place-body a:hover,
.place-body a:focus-visible {
  text-decoration: underline;
}

.media-note {
  margin: 18px 0 0;
  color: rgba(169, 197, 223, 0.72);
  font-size: 0.78rem;
  font-weight: 750;
}

.loading-state {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-weight: 900;
}

@keyframes provinceIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dotPulse {
  0%,
  100% {
    opacity: 0.48;
  }

  50% {
    opacity: 0.9;
  }
}

@media (max-width: 980px) {
  .explore-tools {
    grid-template-columns: 1fr 1fr;
  }

  .tool-actions {
    justify-content: flex-start;
  }

  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .places-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    min-height: 100svh;
    overflow: auto;
  }

  .map-shell {
    min-height: 100svh;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    padding: 18px 16px;
  }

  .brand-block {
    width: 100%;
  }

  .brand-logo {
    width: min(250px, 70vw);
  }

  .app-header h1 {
    font-size: clamp(1.45rem, 9vw, 2.6rem);
    letter-spacing: 0.14em;
  }

  .header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .toolbar-row {
    justify-content: flex-start;
    width: 100%;
  }

  .language-switcher {
    width: min(100%, 250px);
  }

  .contact-button {
    width: auto;
  }

  .explore-tools {
    grid-template-columns: 1fr;
    padding: 10px 16px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .share-box {
    grid-template-columns: 1fr;
  }

  .map-frame {
    align-items: start;
    min-height: 65vh;
    overflow-x: auto;
    padding: 6px 14px 180px;
  }

  .ranking-panel {
    position: static;
    width: auto;
    margin: 0 14px 12px;
  }

  .province-map {
    width: 1120px;
    max-width: none;
    max-height: none;
  }

  .detail-scroll {
    width: min(100% - 24px, 720px);
    padding-top: 74px;
  }

  .detail-hero {
    padding-right: 52px;
  }

  .places-grid,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .quick-facts {
    grid-template-columns: 1fr 1fr;
  }

  .place-card {
    min-height: 330px;
  }
}
