/* ══════════════════════════════════════════════════════════════════════════
   HejMap v2 — explorer (js/v2/explore.js): every data map on one stage.
   A sticky stage holds the morphing countries; scroll chapters pass over it.
   ══════════════════════════════════════════════════════════════════════════ */

.v2 [hidden] { display: none !important; }
.v2-explore { --col-max: 1560px; --col-pad: 24px; --dock: 0px; --xp-tone: 100%; --xp-nodata: color-mix(in srgb, var(--text) 10%, var(--surface)); }
:root.v2[data-theme="dark"] .v2-explore { --xp-tone: 78%; }
.v2-explore main { display: block; }
@media (max-width: 899px) { .v2-explore { --col-pad: 16px; } }
@media (max-width: 640px) { .v2-explore { --col-pad: 12px; --dock: 72px; } }

.xp { position: relative; margin-top: calc(-1 * var(--nav-h)); }
.xp-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.xp-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 70% at 70% 55%, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--blue) 11%, var(--canvas)) 0%, var(--canvas) 80%);
}
.xp-sky .v2-floaters { position: absolute; inset: 0; opacity: 0.55; }

/* Big year watermark for time maps */
.xp-year-big {
  position: absolute;
  right: max(var(--col-pad), calc((100% - var(--col-max)) / 2));
  top: calc(var(--nav-h) + 4px);
  z-index: 0;
  color: color-mix(in srgb, var(--blue) 12%, transparent);
  font-family: var(--serif);
  font-size: clamp(80px, 13vw, 200px);
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.02em;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* ── Countries ────────────────────────────────────────────────────────────── */
.xp-svg { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; opacity: 0; transition: opacity 0.6s; }
.xp-stage.is-ready .xp-svg { opacity: 1; }
#xpWorld { transform-origin: 0 0; transition: transform 0.9s var(--ease); }
.xp-bg { fill: color-mix(in srgb, var(--text) 8%, var(--surface)); stroke: var(--surface); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
#xpBackdrop { transition: opacity 0.4s; }
.xp-c {
  stroke: var(--surface);
  stroke-width: 0.7;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.6s ease, opacity 0.35s ease, filter 0.2s;
}
.xp-c:hover { filter: brightness(1.08) saturate(1.15); stroke: var(--text); stroke-width: 1.2; }
.xp-stage.has-highlight .xp-c:not(.is-lit) { opacity: 0.2; }
.xp-stage.has-highlight .xp-c.is-lit { stroke: var(--surface); stroke-width: 1; }
.xp-stage.is-focused .xp-c:not(.is-focus) { opacity: 0.35; }
.xp-stage.is-focused .xp-c.is-focus { stroke: var(--text); stroke-width: 1.5; filter: drop-shadow(0 6px 14px rgba(16, 24, 40, 0.25)); }
#xpText { pointer-events: none; transition: opacity 0.35s; }
#xpText text {
  fill: #fff;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: rgba(11, 18, 32, 0.28);
  stroke-width: 2px;
  letter-spacing: 0.02em;
}

/* Group labels (Groups view) */
.xp-group-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.xp-glabel {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 3px 8px 3px 4px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  animation: xp-fade 0.5s 0.6s var(--ease) backwards;
}
.xp-glabel i { width: 10px; height: 10px; border-radius: 3px; background: var(--g); }
.xp-glabel b { color: var(--text-3); font-weight: 600; }
.xp-glabel.is-lit { box-shadow: 0 0 0 2px var(--g); }
@keyframes xp-fade { from { opacity: 0; transform: translateY(4px); } }

/* ── Chapters (scroll story) ──────────────────────────────────────────────── */
.xp-chapters { position: relative; z-index: 3; margin-top: -100svh; pointer-events: none; }
.xp-chapter {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 20px) max(var(--col-pad), calc((100% - var(--col-max)) / 2)) 110px;
}
.xp-chapter-card {
  width: min(380px, 100%);
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  opacity: 0.35;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.5s var(--ease);
}
.xp-chapter.is-active .xp-chapter-card { opacity: 1; transform: none; }
.xp-chapter-title { margin: 6px 0 8px; font-size: 26px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.12; text-wrap: balance; }
.xp-chapter-card p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.55; }
/* The opening chapter is the page hero. */
.xp-chapter--intro .xp-chapter-card { width: min(460px, 100%); padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.xp-chapter--intro .xp-chapter-title { font-size: clamp(40px, 4.6vw, 66px); line-height: 1.02; letter-spacing: -0.045em; }
.xp-chapter--intro p { font-size: 17px; }
.xp-scroll-hint { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-sm); }
.xp-scroll-hint svg { width: 15px; height: 15px; animation: v2-nudge 1.6s ease-in-out infinite; }

/* ── HUD: controls, legend, card and tooltip float above stage and chapters ── */
.xp-hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; transition: opacity 0.3s, visibility 0.3s; }
.xp-hud:not(.is-on) { opacity: 0; visibility: hidden; }
.xp-hud > * { pointer-events: auto; }
.xp-hud > .xp-tip { pointer-events: none; }
.xp-stage .v2-floaters--top { z-index: 0; opacity: 0.55; }

/* ── Controls: views, year, maps ──────────────────────────────────────────── */
.xp-bar {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--dock));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 20px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(-50%);
}
.xp-views { display: inline-flex; gap: 2px; padding: 3px; border-radius: 13px; background: var(--surface-2); }
.xp-views button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.xp-views button svg { width: 16px; height: 16px; }
.xp-views button:hover { color: var(--text); }
.xp-views button[aria-checked="true"] { background: var(--text); color: var(--surface); box-shadow: var(--shadow-sm); }
.xp-year { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; }
.xp-play { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: var(--blue); color: #fff; cursor: pointer; }
.xp-play svg { width: 14px; height: 14px; }
.xp-play.is-playing { background: var(--brand); }
.xp-year input { width: 160px; accent-color: var(--blue); }
.xp-year output { min-width: 40px; font-weight: 750; font-variant-numeric: tabular-nums; }
.xp-maps { position: relative; }
.xp-maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  max-width: 260px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.xp-maps-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-maps-btn svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--blue); }
.xp-maps-btn .xp-caret { color: var(--text-3); }
.xp-maps-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  width: min(720px, calc(100vw - 24px));
  max-height: min(64svh, 560px);
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.xp-maps-group { display: grid; align-content: start; gap: 2px; }
.xp-maps-group .v2-kicker { margin-bottom: 4px; }
.xp-maps-group a { padding: 6px 8px; border-radius: 8px; color: var(--text); font-size: 13.5px; font-weight: 550; text-decoration: none; }
.xp-maps-group a:hover { background: var(--surface-2); }
.xp-maps-group a[aria-current="true"] { background: var(--blue-soft); color: var(--blue); font-weight: 700; }

/* ── Legend ───────────────────────────────────────────────────────────────── */
.xp-legend {
  position: absolute;
  left: max(var(--col-pad), calc((100% - var(--col-max)) / 2));
  bottom: 24px;
  z-index: 4;
  display: grid;
  gap: 2px;
  max-width: 260px;
  max-height: calc(50svh - 150px);
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
}
.xp-legend-title { margin: 0 4px 4px; color: var(--text-3); font-size: 10.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
.xp-legend button, .xp-legend-none {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.xp-legend button:hover { background: var(--surface-2); }
.xp-legend button[aria-pressed="true"] { background: var(--blue-soft); }
.xp-legend i { width: 12px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--g) var(--xp-tone), var(--surface)); }
.xp-legend-none i { background: var(--xp-nodata); }
.xp-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-legend b { color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Tooltip + card ───────────────────────────────────────────────────────── */
.xp-tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  pointer-events: none;
}
.xp-tip img { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }
.xp-tip span { grid-column: 1 / -1; color: var(--text-2); }
.xp-tip em { grid-column: 1 / -1; color: var(--blue); font-size: 20px; font-style: italic; }

.xp-card {
  position: absolute;
  right: max(var(--col-pad), calc((100% - var(--col-max)) / 2));
  top: calc(var(--nav-h) + 20px);
  z-index: 6;
  display: grid;
  gap: 12px;
  width: 320px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.4s var(--ease);
}
.xp-card.is-open { opacity: 1; transform: none; }
.xp-card-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text-2); font-size: 18px; line-height: 1; cursor: pointer; }
.xp-card-head { display: flex; align-items: center; gap: 12px; padding-right: 30px; }
.xp-card-head img { width: 48px; height: 34px; border-radius: 6px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.xp-card-head h3 { margin: 2px 0 0; font-size: 22px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.xp-card-value { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.xp-card-value i { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--g) var(--xp-tone), var(--surface)); }
.xp-card-value strong { display: block; font-size: 17px; }
.xp-card-value span { color: var(--text-3); font-size: 12px; }
.xp-card-detail { margin: 0; color: var(--text-2); font-size: 13.5px; }
.xp-card-hello { display: grid; gap: 6px; }
.xp-card-hello > span {
  font-size: 48px;
  font-style: italic;
  line-height: 1;
  overflow-wrap: anywhere;
  color: var(--blue);
  padding-bottom: 4px;
}
.xp-card-hello > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 12.5px; }
.xp-card-links { display: flex; flex-wrap: wrap; gap: 8px; }
.xp-card-links .v2-btn { height: 36px; }
.xp-card-links svg { width: 14px; height: 14px; }

/* Greetings popping up on the language map */
.xp-pops { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.xp-pop {
  position: absolute;
  padding: 4px 10px;
  border-radius: 11px 11px 11px 3px;
  background: var(--g);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--g) 70%, transparent);
  color: #fff;
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  white-space: nowrap;
  transform: translate(-6px, calc(-100% - 4px));
  animation: v2-hello-in 0.45s var(--ease) both;
}
.xp-pop.is-out { animation: v2-hello-out 0.45s ease both; }
@keyframes v2-hello-in { from { opacity: 0; transform: translate(-6px, calc(-100% - 4px)) scale(0.4); } }
@keyframes v2-hello-out { to { opacity: 0; transform: translate(-6px, calc(-100% - 14px)) scale(0.9); } }

/* ── After the story ──────────────────────────────────────────────────────── */
.xp-after { position: relative; z-index: 3; padding: 40px 0 10px; }
.xp-after-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; }
.xp-about h2 { margin: 6px 0 8px; font-size: 26px; letter-spacing: -0.02em; }
.xp-about p { margin: 0 0 10px; color: var(--text-2); line-height: 1.6; }
.xp-note { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.xp-sources { font-size: 13px; }
.xp-chapter-card .xp-asof { margin: 10px 0 0; color: var(--text-3); font-size: 12.5px; font-weight: 550; }
.xp-legend .xp-legend-asof { margin: 4px 4px 0; padding-top: 7px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11px; }
.xp-sources a { color: var(--text); }
.xp-more-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.xp-more-links a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.2s var(--ease);
}
.xp-more-links a:hover { border-color: var(--line-strong); transform: translateY(-1px); }

/* ── Narrow screens: map on top, chapter cards along the bottom ───────────── */
@media (max-width: 999px) {
  .xp-chapter { align-items: flex-end; padding-bottom: calc(var(--xp-bar-h, 60px) + var(--dock) + 34px); }
  .xp-chapter-card { width: 100%; max-width: 560px; margin: 0 auto; }
  .xp-chapter--intro .xp-chapter-card { padding: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-md); }
  .xp-chapter--intro .xp-chapter-title { font-size: clamp(30px, 8vw, 44px); }
  .xp-chapter-title { font-size: 21px; }
  .xp-chapter-card p { font-size: 14px; }
  .xp-legend { display: none; }
  .xp-card { left: 10px; right: 10px; top: auto; bottom: calc(var(--xp-bar-h, 60px) + var(--dock) + 30px); width: auto; }
  .xp-after-grid { grid-template-columns: 1fr; }
  .xp-year-big { font-size: 72px; top: auto; bottom: calc(140px + var(--dock)); }
}
@media (max-width: 640px) {
  .xp-bar { flex-wrap: wrap; justify-content: center; gap: 6px; bottom: calc(10px + var(--dock)); padding: 5px; border-radius: 16px; }
  .xp-views button { height: 32px; padding: 0 10px; }
  .xp-views button span { display: none; }
  .xp-maps-btn { height: 38px; padding: 0 10px; }
  .xp-maps-btn span, .xp-maps-btn .xp-caret { display: none; }
  .xp-year { order: 3; flex: 1 1 100%; justify-content: center; }
  .xp-year input { flex: 1; width: auto; max-width: 220px; }
  .xp-play { width: 30px; height: 30px; }
  .xp-maps-menu { position: fixed; left: 12px; right: 12px; bottom: calc(var(--xp-bar-h, 60px) + var(--dock) + 18px); width: auto; max-height: 58svh; grid-template-columns: 1fr 1fr; }
  .xp-chapter { padding-bottom: calc(var(--xp-bar-h, 60px) + var(--dock) + 22px); }
  .xp-card { bottom: calc(var(--xp-bar-h, 60px) + var(--dock) + 18px); max-height: 52svh; overflow: auto; }
  .xp-card-hello > span { font-size: 38px; }
  .xp-tip { display: none; }
  .v2-explore .v2-floaters { --fs: 0.6; }
}
@media (prefers-reduced-motion: reduce) {
  #xpWorld, .xp-chapter-card { transition: none; }
}

/* ── Pangea on the explorer stage (js/v2/pangea.js) ───────────────────────── */
.pgx-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; transition: opacity 0.6s; }
.xp-stage.is-ready .pgx-canvas { opacity: 1; }
.pgx-era { display: grid; justify-items: end; gap: 6px; text-align: right; }
.pgx-era small { color: var(--text-3); font-family: var(--font); font-size: 12px; font-style: normal; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; }
.pgx-era span { color: color-mix(in srgb, var(--blue) 16%, transparent); }
.pgx-time input { width: 200px; }
.pgx-time output { min-width: 96px; font-size: 13px; text-align: right; }
.pgx-eras button[aria-pressed="true"] { background: var(--text); color: var(--surface); box-shadow: var(--shadow-sm); }
.pgx-eras button { padding: 0 10px; }
.xp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.xp-toggle svg { width: 16px; height: 16px; }
.xp-toggle[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.pgx-about h2 { margin: 6px 0 12px; font-size: 26px; letter-spacing: -0.02em; }
.pgx-about h2::after { content: none; }
.pgx-about .pg-qa { display: grid; gap: 10px; margin-bottom: 12px; }
.pgx-about .pg-qa-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.pgx-about .pg-qa-item h3 { margin: 0 0 4px; font-size: 14.5px; }
.pgx-about .pg-qa-item p { margin: 0; font-size: 14px; }
.pgx-about .pg-attrib { color: var(--text-3); font-size: 12.5px; }
@media (max-width: 1200px) {
  .pgx-eras button:nth-child(n+5):not(:last-child) { display: none; }
}
@media (max-width: 640px) {
  .pgx-eras { display: none; }
  .pgx-time input { width: auto; }
  .xp-toggle span { display: none; }
  .xp-toggle { padding: 0 10px; height: 38px; }
}

.v2-pangea-drift .v2-floater:has([data-greeting]) { display: none; }
/* The era name is the page's headline: above the land and the floating
   decorations, clear of the header, and readable rather than a watermark.
   pangea.js keeps the map below it. */
.pgx-era { z-index: 2; top: calc(var(--nav-h) + 20px); padding: 6px 4px 10px 40px; font-size: clamp(52px, 6vw, 104px); background: radial-gradient(closest-side, color-mix(in srgb, var(--canvas) 88%, transparent), transparent); }
.pgx-era span { color: color-mix(in srgb, var(--blue) 62%, var(--canvas)); text-shadow: 0 2px 18px var(--canvas); }
.pgx-era small { order: -1; color: var(--text-2); }
@media (max-width: 999px) {
  .pgx-era { top: calc(var(--nav-h) + 6px); bottom: auto; gap: 2px; padding-top: 2px; padding-bottom: 4px; font-size: 38px; }
  .pgx-era small { font-size: 11px; }
}
/* Short phones: tighter story cards, so the map keeps room above them. */
@media (max-width: 999px) and (max-height: 720px) {
  .xp-chapter-card { padding: 13px 15px; border-radius: 16px; }
  .xp-chapter-title { margin: 4px 0 6px; font-size: 18px; }
  .xp-chapter-card p { font-size: 13px; line-height: 1.45; }
  .xp-chapter-card .v2-kicker { font-size: 10px; }
}
.pgx-eras button { white-space: nowrap; }

/* ── Language map: "Say …" picker and the phrasebook in the country card ──── */
.xp-say { position: relative; }
.xp-say-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.xp-say-btn svg { width: 16px; height: 16px; color: var(--blue); }
.xp-say-btn span { display: grid; line-height: 1.05; text-align: left; }
.xp-say-btn small { color: var(--text-3); font-size: 10px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; }
.xp-say-menu {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
}
.xp-say-group > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.xp-say-group button {
  height: 32px;
  min-width: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.xp-say-group button:hover { border-color: var(--line-strong); }
.xp-say-group button[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--surface); }

.v2-explore[data-map="languages"] .xp-card { width: 360px; max-height: calc(100svh - var(--nav-h) - var(--xp-bar-h, 60px) - 60px); overflow: auto; overscroll-behavior: contain; }
.xp-book { display: grid; gap: 10px; }
.xp-book-langs { display: flex; flex-wrap: wrap; gap: 6px; }
.xp-book-langs button { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.xp-book-langs button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.xp-book-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.xp-book-tabs button { flex: 1; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.xp-book-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.xp-book-rows { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.xp-book-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 8px 10px; border-radius: 12px; }
.xp-book-rows li:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.xp-book-rows li.is-current { background: var(--blue-soft); }
.xp-book-rows small { grid-column: 1; color: var(--text-3); font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.xp-book-rows span { grid-column: 1; color: var(--text); font-family: var(--serif); font-size: 22px; font-style: italic; line-height: 1.15; overflow-wrap: anywhere; }
.xp-book-rows .xp-book-play { grid-column: 2; grid-row: 1 / 3; width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 50%; }
.xp-book-rows .xp-book-play svg { width: 15px; height: 15px; }
.xp-book-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.xp-book-num {
  display: grid !important;
  gap: 2px;
  height: auto !important;
  min-height: 58px;
  padding: 6px 4px !important;
  place-items: center;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  text-align: center;
}
.xp-book-num small { color: var(--text-3); font-size: 11px; font-weight: 700; }
.xp-book-num span { max-width: 100%; font-family: var(--serif); font-size: 15px; font-style: italic; line-height: 1.1; overflow-wrap: normal; }
.xp-book-num:hover { border-color: var(--blue) !important; }
.xp-book-num.is-playing { border-color: var(--blue) !important; background: var(--blue-soft) !important; }
.xp-book-empty { margin: 0; color: var(--text-3); font-size: 13px; }
@media (max-width: 640px) {
  .xp-say-btn small { display: none; }
  .xp-say-menu { position: fixed; left: 12px; right: 12px; bottom: calc(var(--xp-bar-h, 60px) + var(--dock) + 18px); width: auto; transform: none; }
  .v2-explore[data-map="languages"] .xp-card { width: auto; max-height: 56svh; }
}

/* Subject card (a language or currency from search): its countries as chips. */
.xp-subject-ico { display: grid; flex: 0 0 auto; min-width: 44px; height: 44px; padding: 0 8px; place-items: center; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: 17px; font-weight: 800; }
.xp-subject-kicker { display: block; margin: 14px 0 8px; }
.xp-subject-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow: auto; overscroll-behavior: contain; }
.xp-subject-list button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.xp-subject-list button:hover { border-color: var(--blue); color: var(--blue); }
.xp-subject-list img { width: 20px; height: 14px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08); }

/* ── Flags on tiles and squares (Tiles / Size views) ──────────────────────── */
#xpText .xp-flag { clip-path: inset(0 round 2px); filter: drop-shadow(0 0 0.6px rgba(11, 18, 32, 0.45)); }

/* ── Zoom: + / − / whole world (map view; js/v2/explore.js) ─────────────────── */
#xpWorld.is-instant { transition: none; }
.xp-zoom {
  position: absolute;
  right: max(var(--col-pad), calc((100% - var(--col-max)) / 2));
  bottom: calc(var(--xp-bar-h, 60px) + var(--dock) + 34px);
  z-index: 5;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.25s, visibility 0.25s;
}
.xp-zoom button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; background: none; color: var(--text); cursor: pointer; }
.xp-zoom button + button { border-top: 1px solid var(--line); }
.xp-zoom button:hover:not(:disabled) { background: var(--surface-2); }
.xp-zoom button:disabled { color: var(--text-3); opacity: 0.45; cursor: default; }
.xp-zoom button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.xp-zoom svg { width: 17px; height: 17px; }
/* Only the map view zooms; the tiles, groups and size views are fixed layouts. */
body:has(.xp-stage:not([data-view="map"])) .xp-zoom { opacity: 0; visibility: hidden; }
.xp-stage[data-view="map"] .xp-svg { touch-action: pan-y; }
.xp-stage.is-zoomed[data-view="map"] .xp-svg { touch-action: none; cursor: grab; }
.xp-stage.is-panning .xp-svg { cursor: grabbing; }
.xp-stage.is-panning .xp-c { pointer-events: none; }
@media (max-width: 999px) {
  .xp-zoom { right: 10px; top: calc(var(--nav-h) + 12px); bottom: auto; }
  .xp-zoom button { width: 36px; height: 36px; }
}
