/* Design tokens — primary blue, ink for text / dark surfaces */
:root {
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --insight-border: #60a5fa;
  --ink: #0f172a;
}

/* Full-screen scroll-snap layout */
html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

/* Shared primary CTA (intro, FAQ, methods, quiz, sounds) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.75rem 1.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: #fff;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Callout strip under section leads — always brand blue */
.section-insight {
  border-left: 2px solid var(--insight-border);
  padding-left: 0.75rem;
}

.site-lang a.is-active {
  color: var(--ink);
  background: #e2e8f0;
}

.snap-section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
  min-height: 100dvh;
}

.snap-section-inner {
  display: flex;
  flex-direction: column;
  /* Match ribbon spacing: titles sit near the top, not vertically centered */
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem 0 2rem;
}

#block-intro .snap-section-inner {
  position: relative;
  justify-content: flex-start;
  padding-top: 0;
}

#block-cities-intro .snap-section-inner {
  justify-content: flex-start;
}

.intro-gradient {
  background:
    radial-gradient(ellipse 70% 75% at 80% 30%, rgba(59, 130, 246, 0.16), transparent),
    radial-gradient(ellipse 60% 50% at 6% 94%, rgba(139, 92, 246, 0.09), transparent);
}

/* Top announcement strip — matches site blue accent */
.intro-ticker {
  overflow: hidden;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--accent-hover);
  background: var(--accent);
  color: #ffffff;
}

.intro-ticker-track {
  display: flex;
  width: max-content;
  padding: 0.4rem 0;
  animation: intro-ticker-scroll 28s linear infinite;
}

.intro-ticker-half {
  display: flex;
  flex-shrink: 0;
  gap: 3rem;
  /* Trailing gap belongs to each half so -50% loops seamlessly */
  padding-right: 3rem;
}

.intro-ticker-item {
  flex-shrink: 0;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

@keyframes intro-ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.intro-layout {
  display: grid;
  align-items: center;
  gap: 1rem;
  /* Vertically balance copy+map in the remaining viewport below the ticker */
  flex: 1;
  /* Reserve space so map/copy do not sit under the absolute author byline */
  padding-bottom: 2.25rem;
}

.intro-copy {
  min-width: 0;
}

.intro-map-panel {
  position: relative;
  min-height: 11rem;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.intro-map-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 11rem;
  transform: scale(1.02);
  transform-origin: center;
}

.intro-map-land {
  mix-blend-mode: multiply;
  opacity: 0.32;
}

.intro-map-city {
  cursor: default;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 550ms ease var(--city-delay), transform 550ms ease var(--city-delay);
}

.intro-map-root.is-ready .intro-map-city,
.intro-map-panel.is-ready .intro-map-city {
  opacity: 1;
}

.intro-map-city:focus-visible .intro-map-logo,
.intro-map-city:hover .intro-map-logo {
  transform: scale(1.12);
}

.intro-map-logo {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 200ms ease;
  /* Soft halo so logos stay readable on the pale landmass */
  filter: drop-shadow(0 0 2px #f8fafc) drop-shadow(0 1px 2px rgba(15, 23, 42, 0.2));
}

.intro-map-label {
  fill: #334155;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 650;
  paint-order: stroke;
  stroke: #f8fafc;
  stroke-linejoin: round;
  stroke-width: 5px;
}

.intro-transition {
  max-width: 36rem;
}

/* Bottom-right author credit — clears fixed section-nav dashes */
.intro-author {
  position: absolute;
  right: 4.75rem;
  bottom: 1.5rem;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100% - 5rem);
  overflow: visible;
  font-size: 0.875rem;
  line-height: 1.3;
  color: #64748b;
}

.intro-author-label {
  flex-shrink: 0;
}

.intro-author-name {
  color: #334155;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 0.15em;
  transition: color 0.15s ease;
}

.intro-author-name:hover {
  color: var(--accent);
  text-decoration: underline;
}

.intro-author-name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.intro-author-tg {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: -0.1rem;
  overflow: visible;
  border-radius: 9999px;
  color: #64748b;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.intro-author-tg svg {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

.intro-author-tg:hover {
  color: var(--accent);
  background-color: rgba(37, 99, 235, 0.08);
}

.intro-author-tg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .intro-ticker {
    margin-bottom: 1.25rem;
  }

  .intro-ticker-track {
    padding: 0.55rem 0;
  }

  .intro-layout {
    gap: 1.5rem;
    padding-bottom: 3rem;
  }

  .intro-map-panel {
    min-height: 16rem;
  }

  .intro-map-svg {
    min-height: 16rem;
    transform: scale(1.04);
  }

  .intro-author {
    right: 5rem;
    bottom: 3.25rem;
    font-size: 0.9375rem;
  }
}

@media (min-width: 1024px) {
  .intro-layout {
    grid-template-columns: minmax(18rem, 0.7fr) minmax(34rem, 1.3fr);
    gap: 2rem;
  }

  .intro-map-panel {
    min-height: 24rem;
  }

  .intro-map-svg {
    min-height: 24rem;
  }

  .intro-author {
    right: 5.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-map-city {
    transition: none;
  }

  .intro-map-logo {
    transition: none;
  }

  .intro-ticker-track {
    animation: none;
  }
}

/* Section navigation dashes */
.section-nav {
  position: fixed;
  right: 0.75rem;
  top: 50%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  transform: translateY(-50%);
}

.section-nav-dot {
  position: relative;
  display: block;
  width: 0.75rem;
  height: 0.875rem;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

/* Visible dash mark */
.section-nav-dot::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.75rem;
  height: 0.125rem;
  border-radius: 9999px;
  background: #94a3b8;
  transform: translateY(-50%);
  transition: width 0.2s ease, background 0.2s ease;
}

.section-nav-dot:hover::after {
  background: #64748b;
}

.section-nav-dot.is-active {
  width: 1.5rem;
}

.section-nav-dot.is-active::after {
  width: 1.5rem;
  background: #3b82f6;
}

.section-nav-dot.is-active:hover::after {
  background: #2563eb;
}

/* Tooltip to the left of the dash */
.section-nav-dot::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 0.625rem);
  top: 50%;
  transform: translateY(-50%);
  max-width: 14rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
  background: var(--ink);
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  text-align: right;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 1;
}

.section-nav-dot:hover::before,
.section-nav-dot:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

/* Intro stat cards — number sits in the visual center */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.45rem 0.3rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(4px);
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
  color: #0f172a;
}

.stat-label {
  margin-top: 0.2rem;
  font-size: 0.6rem;
  line-height: 1.2;
  color: #64748b;
}

/* Compact intro spacing on phones so the first slide fits one viewport */
#intro-stats {
  margin-top: 1.1rem;
}

#block-intro .intro-copy > p.mt-5 {
  margin-top: 0.85rem;
}

#block-intro .intro-transition {
  margin-top: 0.85rem;
}

#block-intro .btn-primary {
  margin-top: 0.85rem;
}

@media (min-width: 640px) {
  .stat-card {
    min-height: 6.5rem;
    border-radius: 1rem;
    padding: 1.125rem 0.875rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .stat-label {
    margin-top: 0.4rem;
    font-size: 0.8125rem;
  }

  #intro-stats {
    margin-top: 2rem;
  }

  #block-intro .intro-copy > p.mt-5 {
    margin-top: 1.25rem;
  }

  #block-intro .intro-transition {
    margin-top: 1.75rem;
  }

  #block-intro .btn-primary {
    margin-top: 1.5rem;
  }
}

/* Combined metro network ribbon */
.network-ribbon-root {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.network-ribbon-svg {
  display: block;
  width: 100%;
  max-height: min(48vh, 26rem);
  overflow: visible;
}

.network-ribbon-track {
  stroke: #e2e8f0;
  stroke-width: 26;
}

.network-ribbon-segment {
  cursor: pointer;
  stroke-width: 26;
  transition: filter 180ms ease, stroke-width 180ms ease;
}

.network-ribbon-segment-underlay {
  pointer-events: none;
  stroke-width: 26;
}

.network-ribbon-segment:hover,
.network-ribbon-segment:focus-visible {
  filter: brightness(0.88) drop-shadow(0 5px 6px rgba(15, 23, 42, 0.2));
  outline: none;
  stroke-width: 31;
}

.network-ribbon-label {
  fill: #334155;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #f8fafc;
  stroke-linejoin: round;
  stroke-width: 5px;
}

.network-ribbon-callout-line {
  stroke: #94a3b8;
  stroke-dasharray: 2 4;
  stroke-width: 1.5;
}

.network-ribbon-detail {
  min-height: 4.75rem;
  text-align: center;
}

.network-ribbon-city {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}

.network-ribbon-facts {
  margin-top: 0.125rem;
  color: #64748b;
  font-size: 0.875rem;
}

.network-ribbon-insight {
  margin: 0.5rem auto 0;
  max-width: 38rem;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.5;
}

@media (max-width: 639px) {
  .network-ribbon-svg {
    min-width: 39rem;
    width: 39rem;
    max-width: none;
  }

  .network-ribbon-root {
    overflow-x: auto;
    overflow-y: hidden;
    /* ~20% smaller than previous mobile scale (0.7 → 0.56) */
    zoom: 0.56;
  }

  .network-ribbon-label {
    font-size: 15px;
  }
}

/* Metro openings timeline (“Время открытий”) */
.openings-timeline-root {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.openings-track {
  --openings-axis-y: 50%;
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0.25rem;
  min-height: min(52vh, 28rem);
}

/* Central horizontal axis */
.openings-track::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  top: var(--openings-axis-y);
  height: 2px;
  background: var(--ink);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
}

.openings-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  gap: 0;
  min-width: 0;
  height: 100%;
}

.openings-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0 0.15rem;
}

.openings-item--above .openings-card {
  align-self: end;
  text-align: center;
  /* Keep copy clear of the axis logos */
  padding-bottom: 2rem;
}

.openings-item--below .openings-card {
  align-self: start;
  text-align: center;
  /* Keep copy clear of the axis logos */
  padding-top: 2rem;
}

.openings-title {
  margin: 0;
  color: #0f172a;
  font-size: clamp(0.8rem, 1.35vw, 0.95rem);
  font-weight: 700;
  line-height: 1.2;
}

.openings-year {
  margin: 0;
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 700;
}

.openings-summary {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: clamp(0.68rem, 1.05vw, 0.78rem);
  line-height: 1.4;
}

.openings-spacer {
  min-height: 0;
}

.openings-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  z-index: 2;
}

.openings-stem {
  position: absolute;
  left: 50%;
  width: 1px;
  background: #cbd5e1;
  transform: translateX(-50%);
  pointer-events: none;
}

.openings-item--above .openings-stem {
  bottom: 50%;
  height: 2.4rem;
}

.openings-item--below .openings-stem {
  top: 50%;
  height: 2.4rem;
}

.openings-logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: #fff;
  border: 3px solid #0f172a;
  box-shadow: 0 0 0 3px #fff;
  overflow: hidden;
}

.openings-logo img {
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
}

@media (max-width: 1023px) {
  .openings-timeline-root {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
  }

  .openings-track {
    grid-template-columns: repeat(7, minmax(9.5rem, 1fr));
    min-width: 48rem;
    min-height: min(48vh, 24rem);
    gap: 0.75rem;
    padding-inline: 0.25rem;
  }

  .openings-summary {
    font-size: 0.72rem;
  }
}

@media (max-width: 639px) {
  /* Vertical timeline reads better in a tall mobile viewport */
  .openings-timeline-root {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .openings-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    min-height: 0;
    padding: 0.25rem 0 0.5rem 0.25rem;
  }

  .openings-track::before {
    left: 1.375rem;
    right: auto;
    top: 0.75rem;
    bottom: 0.75rem;
    width: 2px;
    height: auto;
    transform: translateX(-50%);
  }

  .openings-item {
    display: grid;
    grid-template-columns: 2.75rem 1fr;
    grid-template-rows: auto;
    gap: 0 0.85rem;
    padding: 0.65rem 0;
  }

  .openings-spacer {
    display: none;
  }

  .openings-node {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    align-self: start;
  }

  .openings-stem {
    display: none;
  }

  .openings-card {
    grid-column: 2;
    grid-row: 1;
    text-align: left;
    align-self: center;
    padding: 0;
  }

  .openings-item--above .openings-card,
  .openings-item--below .openings-card {
    text-align: left;
    padding: 0;
  }

  .openings-title {
    font-size: 0.95rem;
  }

  .openings-year {
    font-size: 0.8125rem;
  }

  .openings-summary {
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .openings-logo {
    width: 2.5rem;
    height: 2.5rem;
  }

  .openings-logo img {
    width: 1.4rem;
    height: 1.4rem;
  }
}

/* Metro growth timeline */
.history-timeline-root {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.history-city-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.125rem 0.75rem;
  scrollbar-width: thin;
}

.history-city-button {
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.history-city-button:hover,
.history-city-button:focus-visible {
  border-color: var(--city-color, #2563eb);
  background: color-mix(in srgb, var(--city-color, #2563eb) 10%, white);
  color: var(--city-color, #1d4ed8);
  outline: none;
}

.history-city-button.is-active {
  border-color: var(--city-color, #2563eb);
  background: color-mix(in srgb, var(--city-color, #2563eb) 14%, white);
  color: var(--city-color, #1d4ed8);
  outline: none;
}

.history-city-button.is-hatch.is-active {
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--city-color) 18%, white) 0 6px,
    color-mix(in srgb, var(--city-color-2) 18%, white) 6px 12px
  );
  color: #0f172a;
}

.history-chart {
  min-height: 0;
}

.history-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
}

.history-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #64748b;
  font-size: 0.75rem;
}

.history-legend-swatch {
  display: inline-block;
  width: 0.875rem;
  height: 0.625rem;
  border-radius: 2px;
  background: var(--city-color, #2563eb);
}

.history-legend-swatch.is-hatch {
  background: repeating-linear-gradient(
    45deg,
    var(--city-color) 0 3px,
    var(--city-color-2) 3px 6px
  );
}

.history-legend-swatch--total {
  background: #e2e8f0;
}

.history-chart-svg {
  display: block;
  width: 100%;
  max-height: min(43vh, 21rem);
  overflow: visible;
}

.history-grid-line {
  stroke: #e2e8f0;
  stroke-dasharray: 3 4;
}

.history-axis-label,
.history-year-label {
  fill: #64748b;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
}

.history-bar-total {
  fill: #e2e8f0;
}

.history-bar-opened {
  transition: opacity 180ms ease;
}

.history-bar {
  cursor: pointer;
  outline: none;
}

.history-bar-hit {
  pointer-events: all;
}

.history-bar:hover .history-bar-total,
.history-bar:focus-visible .history-bar-total,
.history-bar.is-selected .history-bar-total {
  fill: #cbd5e1;
}

.history-bar:hover .history-bar-opened,
.history-bar:focus-visible .history-bar-opened,
.history-bar.is-selected .history-bar-opened {
  opacity: 0.78;
}

.history-detail {
  min-height: 3.5rem;
  margin-top: 0.75rem;
}

.history-detail-hint {
  margin: 0;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
}

.history-card {
  margin: 0 auto;
  max-width: 40rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  background: #fff;
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.history-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.4rem;
}

.history-card-year {
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
}

.history-card-stats {
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 600;
}

.history-card-stations {
  margin: 0;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.45;
}

.history-card-stations.is-empty {
  color: #94a3b8;
  font-style: italic;
}

@media (max-width: 639px) {
  .history-city-buttons {
    justify-content: flex-start;
  }

  .history-chart-svg {
    min-width: 40rem;
    max-width: none;
  }

  .history-chart {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .history-card {
    padding: 0.65rem 0.85rem;
  }

  .history-card-stations {
    font-size: 0.8125rem;
  }
}

/* Station rename timeline */
.renames-timeline-root {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  min-height: 0;
}

.renames-city-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.125rem 0.5rem;
  scrollbar-width: thin;
}

.renames-city-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

/* Color swatch matches timeline dots so the filter doubles as a legend */
.renames-city-button.has-city-swatch::before {
  content: '';
  width: 0.55rem;
  height: 0.55rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: var(--city-color, #2563eb);
}

.renames-city-button.has-city-swatch.is-hatch::before {
  background: repeating-linear-gradient(
    45deg,
    var(--city-color) 0 2px,
    var(--city-color-2) 2px 4px
  );
}

.renames-city-button:hover:not(:disabled),
.renames-city-button:focus-visible:not(:disabled) {
  border-color: var(--city-color, #2563eb);
  background: color-mix(in srgb, var(--city-color, #2563eb) 10%, white);
  color: var(--city-color, #1d4ed8);
  outline: none;
}

.renames-city-button.is-active {
  border-color: var(--city-color, #2563eb);
  background: color-mix(in srgb, var(--city-color, #2563eb) 14%, white);
  color: var(--city-color, #1d4ed8);
  outline: none;
}

/* Two-color network: soft split background when the city filter is active */
.renames-city-button.is-hatch.is-active {
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--city-color) 18%, white) 0 6px,
    color-mix(in srgb, var(--city-color-2) 18%, white) 6px 12px
  );
  border-image: none;
  color: #0f172a;
}

.renames-city-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.renames-chart {
  min-height: 0;
}

.renames-chart-svg {
  display: block;
  width: 100%;
  max-height: min(34vh, 14.5rem);
  overflow: visible;
}

.renames-axis {
  stroke: #94a3b8;
  stroke-width: 2;
}

.renames-tick {
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.renames-year-label {
  fill: #64748b;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
}

.renames-stem {
  stroke-width: 1.5;
  opacity: 0.55;
}

.renames-dot {
  cursor: pointer;
  outline: none;
}

.renames-circle {
  stroke: #ffffff;
  stroke-width: 2;
  transition: r 160ms ease, stroke-width 160ms ease;
}

.renames-dot:hover .renames-circle,
.renames-dot:focus-visible .renames-circle,
.renames-dot.is-selected .renames-circle {
  stroke: #ffffff;
  stroke-width: 2.5;
}

.renames-empty,
.renames-detail-hint {
  margin: 0;
  text-align: center;
  color: #64748b;
  font-size: 0.9375rem;
}

.renames-detail {
  min-height: 5.5rem;
}

.renames-card {
  margin: 0 auto;
  max-width: 36rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  background: #fff;
  padding: 0.875rem 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  /* Prefer horizontal swipe over page scroll while gesturing on the card */
  touch-action: pan-y;
  outline: none;
}

.renames-card:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent, #2563eb);
}

.renames-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.5rem;
}

.renames-card-city {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.renames-card-city::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--city-color, #2563eb);
}

.renames-card-city.is-hatch::before {
  background: repeating-linear-gradient(
    45deg,
    var(--city-color) 0 2px,
    var(--city-color-2) 2px 4px
  );
}

.renames-card-year {
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 600;
}

.renames-card-names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.5rem;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.renames-card-from {
  color: #64748b;
  font-weight: 600;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.renames-card-arrow {
  color: #94a3b8;
  font-weight: 500;
}

.renames-card-note {
  margin: 0;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.5;
}

.renames-card-swipe-hint {
  display: none;
  margin: 0.55rem 0 0;
  text-align: center;
  color: #94a3b8;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 639px) {
  .renames-city-buttons {
    justify-content: flex-start;
  }

  .renames-chart-svg {
    min-width: 36rem;
    max-width: none;
  }

  .renames-chart {
    overflow-x: auto;
  }

  .renames-card-swipe-hint {
    display: block;
  }
}

/* Station construction types — 100% stacked bars */
.station-types-root {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  min-height: 0;
}

.station-types-legend {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.station-types-legend-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
}

.station-types-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.35rem 0.55rem;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.station-types-legend-item:hover,
.station-types-legend-item:focus-visible {
  border-color: var(--type-color, var(--accent));
  background: color-mix(in srgb, var(--type-color, var(--accent)) 10%, white);
  color: var(--ink);
  outline: none;
}

.station-types-legend-item.is-active {
  border-color: var(--type-color, var(--accent));
  background: color-mix(in srgb, var(--type-color, var(--accent)) 14%, white);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--type-color, var(--accent)) 35%, transparent);
}

.station-types-legend-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.station-types-chart {
  min-height: 0;
  overflow-x: auto;
}

.station-types-svg {
  display: block;
  width: 100%;
  height: auto;
  /* Keep full section width; flatter viewBox avoids letterboxed side gaps */
  max-height: min(52vh, 26rem);
}

.station-types-city-label {
  fill: #475569;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.station-types-seg-group {
  cursor: pointer;
  outline: none;
  transition: opacity 160ms ease;
}

.station-types-seg-group.is-dimmed {
  opacity: 0.18;
}

.station-types-seg-group:hover .station-types-seg,
.station-types-seg-group:focus-visible .station-types-seg {
  filter: brightness(1.06);
}

.station-types-seg {
  transition: opacity 160ms ease;
}

.station-types-seg-icon {
  pointer-events: none;
}

/* Architecture style dictionary — mid size between original and tight compact */
#block-architecture .snap-section-inner {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

#block-architecture h2 {
  font-size: clamp(1.75rem, 2.8vw, 2.75rem);
}

#block-architecture [data-i18n='architectureLead'] {
  margin-top: 0.65rem;
  font-size: 0.975rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  #block-architecture [data-i18n='architectureLead'] {
    font-size: 1.0625rem;
  }
}

.architecture-showcases-root {
  position: relative;
  min-height: 0;
  margin-top: 1rem;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .architecture-showcases-root {
    margin-top: 1.25rem;
    overflow: hidden;
  }
}

.architecture-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  height: 100%;
  align-content: start;
}

@media (min-width: 640px) {
  .architecture-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }
}

@media (min-width: 1024px) {
  .architecture-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

.architecture-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Truncated blurbs expand over the card on hover */
@media (hover: hover) and (pointer: fine) {
  .architecture-card--clamped:hover {
    z-index: 6;
    overflow: visible;
  }

  .architecture-card--clamped:hover .architecture-card-body {
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -1px;
    z-index: 2;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.8rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  }

  .architecture-card--clamped:hover .architecture-card-blurb--clamped {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
}

.architecture-media {
  position: relative;
  flex-shrink: 0;
  aspect-ratio: 16 / 9.5;
  background: #f1f5f9;
  overflow: hidden;
}

.architecture-media-trigger {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.architecture-media-trigger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.architecture-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Station name only on the thumbnail; city appears in the popup */
.architecture-photo-caption {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  max-width: calc(100% - 0.8rem);
  padding: 0.18rem 0.42rem;
  border-radius: 0.3rem;
  background: rgba(15, 23, 42, 0.62);
  color: #f8fafc;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

@media (min-width: 640px) {
  .architecture-photo-caption {
    right: 0.45rem;
    bottom: 0.45rem;
    font-size: 0.72rem;
  }
}

.architecture-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.2), transparent 55%),
    repeating-linear-gradient(
      -12deg,
      #e2e8f0,
      #e2e8f0 8px,
      #f8fafc 8px,
      #f8fafc 16px
    );
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  padding: 0.85rem;
}

.architecture-photo-placeholder svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.architecture-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.65rem 0.8rem 0.75rem;
  min-height: 0;
}

.architecture-card-title {
  margin: 0;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.28;
}

.architecture-card-blurb {
  margin: 0;
  color: #475569;
  font-size: 0.72rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.architecture-card-blurb--clamped {
  cursor: default;
}

/* Click-to-open enlarged image preview (architecture + map station card) */
.image-preview[hidden] {
  display: none;
}

.image-preview {
  position: fixed;
  inset: 0;
  /* Above fullscreen map frames (z-index 2000) */
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.55);
  cursor: zoom-out;
}

.image-preview-panel {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(92vw, 56rem);
  max-height: min(88vh, 40rem);
  display: flex;
  flex-direction: column;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
  animation: image-preview-in 140ms ease-out;
}

.image-preview-image {
  display: block;
  width: 100%;
  max-height: min(78vh, 34rem);
  object-fit: contain;
  background: var(--ink);
}

.image-preview-caption {
  margin: 0;
  padding: 0.55rem 0.85rem;
  color: #e2e8f0;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
}

@keyframes image-preview-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Metro door-closing sounds */
.metro-sounds-root {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.metro-sounds-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.metro-sounds-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.62rem 0.75rem 0.62rem 0.95rem;
}

.metro-sounds-city {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.metro-sounds-play {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: none;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.metro-sounds-play:hover:not(:disabled),
.metro-sounds-play:focus-visible:not(:disabled) {
  background: var(--accent-hover);
  outline: none;
}

.metro-sounds-play:disabled {
  cursor: not-allowed;
  background: #cbd5e1;
  color: #64748b;
}

.metro-sounds-play.is-playing {
  background: var(--accent-hover);
  animation: metro-sounds-pulse 1.1s ease-in-out infinite;
}

.metro-sounds-icon {
  width: 1rem;
  height: 1rem;
  display: block;
}

@keyframes metro-sounds-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    transform: scale(1.04);
  }
}

@media (min-width: 640px) {
  .metro-sounds-item {
    padding: 0.72rem 0.95rem 0.72rem 1.15rem;
  }

  .metro-sounds-city {
    font-size: 1.05rem;
  }

  .metro-sounds-play {
    width: 2.55rem;
    height: 2.55rem;
  }
}

/* Length comparison chart */
.length-chart-root {
  -webkit-overflow-scrolling: touch;
  overflow-x: clip;
}

.length-chart-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-x: clip;
}

@media (min-width: 640px) {
  .length-chart-inner {
    gap: 0.875rem;
  }
}

.length-city-row {
  display: grid;
  grid-template-columns: minmax(0, 7.5rem) 1fr minmax(0, 4.5rem);
  align-items: center;
  gap: 0.5rem 0.75rem;
  overflow-x: clip;
}

.length-city-row--snake {
  align-items: start;
}

.length-city-row--snake .length-city-label {
  padding-top: 0.25rem;
}

.length-city-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  text-align: right;
  line-height: 1.2;
}

.length-bar-area {
  position: relative;
  min-width: 0;
  overflow: visible;
}

/* Empty grid cell — reserves space for km labels and turn elbows */
.length-city-spacer {
  min-width: 0;
}

.length-km-label {
  position: absolute;
  z-index: 1;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  pointer-events: none;
}

/* Same 0.75rem gap as between city label and bar */
.length-km-label--after {
  left: calc(var(--km-x) + 0.75rem);
  transform: translateY(-50%);
}

.length-km-label--before {
  left: var(--km-x);
  transform: translate(calc(-100% - 0.75rem), -50%);
}

.length-snake-svg {
  display: block;
  overflow: visible;
}

.length-snake-svg .length-line {
  cursor: default;
}

.length-snake-svg .length-segment,
.length-snake-svg .length-turn {
  transition: opacity 0.15s;
  pointer-events: all;
}

.length-snake-svg .length-line:hover .length-segment,
.length-snake-svg .length-line:hover .length-turn {
  opacity: 0.82;
}

/* Depth comparison chart */
.depth-comparison-root {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.depth-comparison-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: #64748b;
}

.depth-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.depth-legend-swatch {
  display: inline-block;
  width: 1.25rem;
  height: 0.75rem;
  border-radius: 2px;
}

.depth-legend-swatch--range {
  background: rgba(59, 130, 246, 0.35);
  border: 1.5px solid #2563eb;
}

.depth-legend-swatch--avg {
  height: 0;
  width: 1.5rem;
  border-top: 2.5px solid #f97316;
  border-radius: 0;
}

.depth-legend-swatch--median {
  height: 0;
  width: 1.5rem;
  border-top: 2.5px solid #7c3aed;
  border-radius: 0;
}

.depth-marker-label {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.depth-marker-label--avg {
  fill: #c2410c;
}

.depth-marker-label--median {
  fill: #6d28d9;
}

.depth-comparison-area {
  width: 100%;
  min-width: 0;
}

.depth-comparison-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.depth-comparison-svg .depth-range-col {
  cursor: default;
}

.depth-comparison-svg .depth-range-col:hover rect {
  fill-opacity: 0.5;
}

@media (max-width: 639px) {
  /* Horizontal scroll like renames — full-size chart on a wider canvas */
  .depth-comparison-area {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .depth-comparison-svg {
    min-width: 36rem;
    width: 36rem;
    max-width: none;
  }
}

/* City history slide */
.city-history-shell {
  flex: 1;
  min-height: 0;
}

.city-history-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  min-height: 0;
  /* Bias content slightly above true vertical center */
  padding: 0.25rem 0 12vh;
}

.city-history-header {
  text-align: center;
}

.city-history-layout {
  display: grid;
  gap: 1.25rem 1.75rem;
  align-items: start;
  min-height: 0;
}

.city-history-body {
  display: grid;
  gap: 0.9rem;
  color: #475569;
  font-size: 1rem;
  line-height: 1.65;
}

.city-history-media {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  min-width: 0;
}

.city-history-media-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
  line-height: 0;
}

.city-history-media-trigger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.city-history-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(28rem, 55vh);
  object-fit: contain;
  background: transparent;
}

.city-history-caption {
  margin: 0;
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: center;
}

.city-history-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 0.75rem;
  border: 1px dashed #cbd5e1;
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.18), transparent 55%),
    #f8fafc;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}

.city-history-image-placeholder[hidden],
.city-history-media-trigger[hidden],
.city-history-caption[hidden] {
  display: none;
}

@media (min-width: 640px) {
  .city-history-body {
    font-size: 1.0625rem;
    line-height: 1.7;
  }
}

@media (min-width: 768px) {
  .city-history-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(12rem, 0.85fr);
  }
}

/* Cities block: sticky city picker over profile + map */
.block-cities {
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
}

.block-cities .snap-section-inner {
  min-height: auto;
  height: auto;
}

/* History slide: full viewport so content centers under the sticky bar */
.block-city-history .snap-section-inner {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Intro research slide: logos in one row, arrow hint at the bottom */
.cities-intro-layout {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.cities-intro-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: auto auto 0;
  flex-shrink: 0;
  padding: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.cities-intro-arrow:hover,
.cities-intro-arrow:focus-visible {
  color: var(--accent);
}

.cities-intro-arrow:hover {
  transform: translateY(2px);
}

.cities-intro-arrow:focus-visible {
  outline: none;
  border-radius: 0.5rem;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.cities-intro-chevron {
  display: block;
}

.cities-intro-teaser,
.games-intro-teaser {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: inherit;
}

.cities-logo-picker {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.35rem 0.5rem;
  margin-top: 1.75rem;
  width: 100%;
}

.cities-logo-btn {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 7.5rem;
  padding: 0.55rem 0.3rem;
  border: 2px solid transparent;
  border-radius: 1rem;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.cities-logo-btn img {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  transition: transform 160ms ease;
}

.cities-logo-label {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  /* Keep long names like «Санкт-Петербург» on one visual row of buttons */
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cities-logo-btn:hover {
  background: #f8fafc;
}

.cities-logo-btn:hover img {
  transform: scale(1.08);
}

.cities-logo-btn:focus-visible {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.cities-logo-btn.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

@media (max-width: 639px) {
  .cities-logo-picker {
    gap: 0.15rem;
    margin-top: 1.25rem;
  }

  .cities-logo-btn {
    padding: 0.25rem 0.05rem;
    gap: 0.3rem;
  }

  .cities-logo-btn img {
    width: 1.75rem;
    height: 1.75rem;
  }

  .cities-logo-label {
    font-size: 0.5rem;
    line-height: 1.15;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cities-logo-btn,
  .cities-logo-btn img,
  .cities-intro-arrow {
    transition: none;
  }

  .cities-intro-arrow:hover {
    transform: none;
  }
}

/* Games chapter bridge — mirrors cities-intro layout */
.games-intro-layout {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.games-intro-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: auto auto 0;
  flex-shrink: 0;
  padding: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.games-intro-arrow:hover,
.games-intro-arrow:focus-visible {
  color: var(--accent);
}

.games-intro-arrow:hover {
  transform: translateY(2px);
}

.games-intro-arrow:focus-visible {
  outline: none;
  border-radius: 0.5rem;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.games-intro-chevron {
  display: block;
}

.games-intro-picker {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
}

.games-intro-pick {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 16rem;
  min-height: 7.5rem;
  padding: 1.25rem 1.1rem;
  border: 2px solid #e2e8f0;
  border-radius: 1.15rem;
  background: #fff;
  color: #475569;
  text-decoration: none;
  text-align: center;
  cursor: default;
}

.games-intro-pick-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.games-intro-pick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.15rem;
  color: var(--accent);
  flex-shrink: 0;
}

.games-intro-pick-icon .quiz-round-svg {
  width: 100%;
  height: 100%;
}

.games-intro-pick-round {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.games-intro-pick-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.games-intro-pick-hint {
  font-size: 0.9rem;
  line-height: 1.35;
  color: #64748b;
}

/* Phones + narrow tablets: horizontal cards, compact type, centered stage */
@media (max-width: 767px) {
  #block-games-intro .snap-section-inner {
    justify-content: center;
    justify-content: safe center;
  }

  #block-games-intro .games-intro-layout {
    flex: 0 1 auto;
    min-height: 0;
  }

  #block-games-intro .games-intro-copy {
    flex: 0 1 auto;
  }

  #block-games-intro .games-intro-arrow {
    margin: 0.85rem auto 0;
  }

  #block-games-intro h2 {
    font-size: 1.65rem;
  }

  #block-games-intro [data-i18n='gamesIntroLead'] {
    margin-top: 0.65rem;
    font-size: 0.9375rem;
  }

  .games-intro-picker {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 1.1rem;
  }

  .games-intro-pick {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    max-width: none;
    min-height: 0;
    width: 100%;
    padding: 0.75rem 0.9rem;
    text-align: left;
    border-radius: 0.85rem;
  }

  .games-intro-pick-icon {
    width: 2.35rem;
    height: 2.35rem;
    margin-bottom: 0;
  }

  .games-intro-pick-body {
    align-items: flex-start;
    gap: 0.1rem;
    flex: 1 1 auto;
  }

  .games-intro-pick-round {
    font-size: 0.6875rem;
  }

  .games-intro-pick-title {
    font-size: 0.95rem;
  }

  .games-intro-pick-hint {
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .games-intro-arrow {
    transition: none;
  }

  .games-intro-arrow:hover {
    transform: none;
  }
}

.city-sticky-bar {
  position: sticky;
  top: 0.75rem;
  z-index: 30;
}

.city-sticky-bar-inner {
  display: grid;
  grid-template-columns: auto minmax(10rem, 16rem) 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
  padding: 0.75rem 1rem;
}

.city-sticky-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.625rem;
}

.city-sticky-logo {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
}

.city-sticky-metro {
  min-width: 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.3;
}

.city-select {
  border-radius: 0.75rem;
  border: 2px solid #e2e8f0;
  background: #fff;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  cursor: pointer;
}

.city-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* City map slide: tabs, mode switch, chronology range, station list */
.city-map-header {
  text-align: center;
}

.city-map-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.map-view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.map-fullscreen-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  /* Above Leaflet zoom/attribution panes */
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.map-fullscreen-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

.map-fullscreen-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Fullscreen frame: map + summary (+ timeline on chrono) */
.city-map-panel.map-frame.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 0.75rem;
  background: #fff;
  overflow: hidden;
}

.city-map-panel.map-frame.is-fullscreen .map-view-panel,
.city-map-panel.map-frame.is-fullscreen #map-view-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.city-map-panel.map-frame.is-fullscreen #list-view-panel:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.city-map-panel.map-frame.is-fullscreen .map-split-layout {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.city-map-panel.map-frame.is-fullscreen .map-stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.city-map-panel.map-frame.is-fullscreen .map-stage .map-container {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.city-map-panel.map-frame.is-fullscreen .map-container,
.city-map-panel.map-frame.is-fullscreen .map-info-panel {
  height: 100%;
  min-height: 0;
}

.city-map-panel.map-frame.is-fullscreen .map-chrono-timeline {
  flex: 0 0 auto;
}

.city-map-panel.map-frame.is-fullscreen .station-list-root {
  max-height: none;
  height: 100%;
  overflow: auto;
}

body.is-map-fullscreen {
  overflow: hidden;
}

body.is-map-fullscreen .section-nav {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 767px) {
  .city-map-panel.map-frame.is-fullscreen .map-split-layout {
    grid-template-rows: minmax(0, 1fr) minmax(10rem, 38%);
  }

  .city-map-panel.map-frame.is-fullscreen .map-info-panel {
    height: auto;
    min-height: 0;
    max-height: 100%;
  }
}

.map-view-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e2e8f0;
  border-radius: 9999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.map-view-tab:hover {
  border-color: #94a3b8;
  color: #334155;
}

.map-view-tab.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: none;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 1rem;
}

.map-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(16rem, 22rem);
  gap: 0.85rem 1rem;
  align-items: stretch;
}

@media (max-width: 767px) {
  .map-split-layout {
    grid-template-columns: 1fr;
  }
}

.map-info-panel {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.85rem 0.9rem;
  height: 24.2rem; /* match .map-container */
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.map-info-city,
.map-info-station {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-height: 100%;
}

.map-info-logo {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
}

.map-info-metro {
  margin: 0;
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
}

.map-info-asof {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
}

.map-info-stats,
.map-info-attrs {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.map-info-stats > div,
.map-info-attrs > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
}

.map-info-stats dt,
.map-info-attrs dt {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}

.map-info-stats dd,
.map-info-attrs dd {
  margin: 0;
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: right;
}

.map-info-hint {
  margin: 0.25rem 0 0;
  color: #94a3b8;
  font-size: 0.75rem;
}

.map-info-back {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0;
}

.map-info-back:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.map-info-photo-wrap {
  /* Keep 4:3 height: flex column + fixed panel height would otherwise crush this to a line */
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #e2e8f0;
  aspect-ratio: 4 / 3;
}

.map-info-photo-wrap.is-missing {
  display: none;
}

/* Same zoom-in affordance as architecture showcase photos */
.map-info-photo-trigger {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.map-info-photo-trigger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.map-info-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Transparent Leaflet divIcon wrapper for multi-line sector discs */
.metro-station-icon {
  background: transparent !important;
  border: none !important;
}

.map-hall-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.map-hall-picker-label {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}

.map-hall-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.map-hall-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  border: 2px solid var(--hall-color, #64748b);
  background: #fff;
  color: var(--hall-color, #64748b);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.map-hall-chip.is-active {
  background: var(--hall-color, #64748b);
  color: #fff;
}

.map-hall-chip:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.map-info-cross-platform {
  margin: 0.35rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.map-info-station-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.map-info-opened-title {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-info-opened-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem;
  max-height: 10rem;
  overflow: auto;
}

.map-info-opened-list li {
  color: #334155;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.map-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.map-mode-switch-label {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.map-mode-switch-label.is-active {
  color: #1e293b;
}

.map-mode-switch-btn {
  position: relative;
  width: 2.5rem;
  height: 1.4rem;
  border: none;
  border-radius: 9999px;
  background: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}

.map-mode-switch-btn.is-on,
.map-mode-switch-btn[aria-checked='true'] {
  background: #2563eb;
}

.map-mode-switch-knob {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.map-mode-switch-btn.is-on .map-mode-switch-knob,
.map-mode-switch-btn[aria-checked='true'] .map-mode-switch-knob {
  transform: translateX(1.1rem);
}

.map-stage {
  position: relative;
}

.map-access-overlay {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  z-index: 500;
  pointer-events: none;
}

.map-access-overlay.hidden {
  display: none;
}

/* City border legend stacked above the basemap toggle (bottom-right) */
.map-right-overlays {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  z-index: 1100;
  display: inline-grid;
  grid-template-columns: max-content;
  justify-items: stretch;
  gap: 0.4rem;
  pointer-events: none;
}

.map-border-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  padding: 0.3rem 0.7rem 0.3rem 0.55rem;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.map-border-legend-swatch {
  display: block;
  width: 1.35rem;
  height: 0;
  border-top: 1.5px dashed #475569;
  opacity: 0.85;
  flex-shrink: 0;
}

.map-basemap-overlay {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  padding: 0.35rem 0.55rem 0.35rem 0.75rem;
  pointer-events: auto;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Hide Leaflet attribution (incl. Ukraine flag prefix); credit remains in methods */
.map-container .leaflet-control-attribution {
  display: none;
}

.map-basemap-label {
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
}

.map-access-fab {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  color: #334155;
  cursor: pointer;
  padding: 0.55rem 1rem;
  text-align: left;
  width: min(36rem, calc(100% - 6.5rem));
  max-width: calc(100% - 6.5rem);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.map-access-fab:hover:not(:disabled) {
  border-color: #93c5fd;
}

.map-access-fab.is-active {
  border-color: #2563eb;
  background: #eff6ff;
}

/* Toggled off — solid, muted colors (no transparency) */
.map-access-fab:not(.is-active):not(:disabled) {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.map-access-fab:disabled,
.map-access-fab.is-disabled {
  cursor: not-allowed;
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

.map-access-fab-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: inherit;
}

.map-access-fab.is-active .map-access-fab-title {
  color: #1d4ed8;
}

.map-access-fab-metric {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
}

.map-access-fab:not(.is-active) .map-access-fab-metric {
  color: #94a3b8;
}

/* Chronology range timeline (histogram + dual handles) */
.map-chrono-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.15rem;
  padding: 0.35rem 0.15rem 0.1rem;
  user-select: none;
}

.map-chrono-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 2.75rem;
  padding: 0 0.35rem;
}

.map-chrono-bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 1px 1px 0 0;
  background: #60a5fa;
  opacity: 0.95;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.map-chrono-bar.is-dim {
  background: #cbd5e1;
  opacity: 0.55;
}

.map-chrono-slider {
  padding: 0 0.35rem;
}

.map-chrono-track {
  position: relative;
  height: 1.5rem;
  border-radius: 9999px;
  background: #e2e8f0;
}

.map-chrono-selected {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 9999px;
  background: #bfdbfe;
  pointer-events: none;
}

.map-chrono-selected--asof {
  border-radius: 9999px 0 0 9999px;
}

.map-chrono-handle {
  position: absolute;
  top: 50%;
  width: 0.7rem;
  height: 1.15rem;
  margin-left: -0.35rem;
  border: 2px solid #fff;
  border-radius: 9999px;
  background: #1e293b;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
  cursor: ew-resize;
  transform: translateY(-50%);
  touch-action: none;
  z-index: 2;
}

.map-chrono-handle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.map-chrono-axis {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.35rem;
  color: #64748b;
  font-size: 0.6875rem;
  font-weight: 600;
}

.map-chrono-axis span:nth-child(2) {
  color: #0f172a;
}

.station-list-root {
  column-count: 1;
  column-gap: 1.25rem;
  max-height: min(55vh, 28rem);
  overflow-y: auto;
  padding: 0.15rem 0.1rem 0.35rem;
}

@media (min-width: 640px) {
  .station-list-root {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .station-list-root {
    column-count: 3;
  }
}

.station-list-line {
  break-inside: avoid;
  margin-bottom: 1rem;
}

.station-list-line-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
}

.station-list-line-dot {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
}

.station-list-stations {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.station-list-station {
  display: block;
  width: 100%;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 0.8125rem;
  line-height: 1.35;
  padding: 0.2rem 0.35rem;
  text-align: left;
}

.station-list-station:hover {
  background: #f1f5f9;
  color: #0f172a;
}

@media (max-width: 639px) {
  .city-sticky-bar-inner {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

.map-container {
  position: relative;
  height: 24.2rem;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  z-index: 0;
}

/* Profile chart: legend sits to the right of the diagram */
.profile-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 11rem);
  gap: 0.75rem 1rem;
  align-items: start;
}

.profile-chart-legend {
  border-left: 1px solid #e2e8f0;
  padding-left: 0.85rem;
  padding-top: 1.5rem;
}

.profile-chart-main {
  min-width: 0;
  width: 100%;
}

.profile-chart-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-chart-scroll svg {
  display: block;
  max-width: none;
}

@media (max-width: 767px) {
  .profile-chart-layout {
    grid-template-columns: 1fr;
  }

  .profile-chart-legend {
    border-left: 0;
    border-top: 1px solid #e2e8f0;
    padding-left: 0;
    padding-top: 0.75rem;
  }
}

/* Line picker: circular number icons, one row (Moscow = 14) */
.line-chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  /* Padding keeps selection/hover rings inside the scrollport */
  padding: 0.4rem 0.2rem;
  margin: -0.15rem -0.1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.line-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 2px solid;
  border-radius: 9999px;
  background: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.line-chip:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--chip-color) 28%, transparent);
}

.line-chip.is-active {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--chip-color) 35%, transparent);
}

.line-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

@media (max-width: 639px) {
  .line-chips {
    gap: 0.2rem;
    justify-content: space-between;
    padding: 0.35rem 0.1rem;
  }

  .line-chip {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.5rem;
    border-width: 1.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .line-chip {
    transition: none;
  }

  .line-chip:hover {
    transform: none;
  }
}

/* Unified quiz — fixed-height frame, centered in the snap section */
.quiz-layout {
  flex: 1 1 auto;
  justify-content: center;
  gap: 0.85rem;
  min-height: 0;
}

.quiz-layout-header {
  flex-shrink: 0;
}

.station-name-quiz-root {
  width: 100%;
  /* Same frame for rounds, bridges, and finale so actions stay put */
  height: min(34rem, calc(100dvh - 11.5rem));
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .station-name-quiz-root {
    height: min(36rem, calc(100dvh - 12.5rem));
  }
}

#block-quiz .snap-section-inner {
  justify-content: center;
  /* Keep overflow visible so page scroll-snap can leave this slide */
  overflow: visible;
}

.quiz-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  padding: 1.1rem 1rem 1rem;
}

@media (min-width: 640px) {
  .quiz-card {
    padding: 1.35rem 1.5rem 1.15rem;
  }
}

.quiz-card-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-x: hidden;
  /* Default: no nested scrollport — page snap receives the wheel/touch */
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

.quiz-card-scroll.is-scrollable {
  overflow-y: auto;
  /* Chain to the page at the top/bottom so snap still works */
  overscroll-behavior-y: auto;
}

.quiz-card-bridge .quiz-card-scroll,
.quiz-card-finale .quiz-card-scroll {
  justify-content: center;
}

.quiz-card-footer {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
}

.quiz-progress {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quiz-prompt {
  margin-top: 0.75rem;
  color: #64748b;
  font-size: 0.9375rem;
}

.quiz-station-name {
  margin-top: 0.35rem;
  color: #0f172a;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .quiz-station-name {
    font-size: 1.85rem;
  }
}

.quiz-cities {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

@media (min-width: 480px) {
  .quiz-cities {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 768px) {
  .quiz-cities {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.quiz-city {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-city:hover {
  border-color: #94a3b8;
}

.quiz-city:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.quiz-city.is-correct,
.quiz-city.is-correct:has(input:checked) {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #15803d;
}

.quiz-city.is-wrong,
.quiz-city.is-wrong:has(input:checked) {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}

.quiz-city input {
  accent-color: #2563eb;
  flex-shrink: 0;
}

.quiz-city.is-correct input {
  accent-color: #16a34a;
}

.quiz-city.is-wrong input {
  accent-color: #dc2626;
}

.quiz-city:has(input:disabled) {
  cursor: default;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0;
}

.quiz-card-bridge .quiz-actions,
.quiz-card-finale .quiz-actions {
  justify-content: center;
}

.quiz-btn {
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
}

.quiz-btn-primary {
  border-color: var(--accent-hover);
  background: var(--accent);
  color: #fff;
}

.quiz-btn-primary:hover {
  background: var(--accent-hover);
}

.quiz-feedback {
  margin-top: 1rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.85rem;
}

.quiz-feedback.hidden {
  display: none;
}

.quiz-result-line {
  font-size: 0.9375rem;
  font-weight: 700;
}

.quiz-result-line.is-ok {
  color: #15803d;
}

.quiz-result-line.is-miss {
  color: #b91c1c;
}

.quiz-answer {
  margin-top: 0.35rem;
  color: #475569;
  font-size: 0.875rem;
}

.quiz-note {
  margin-top: 0.75rem;
  color: #64748b;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.quiz-card-finale {
  text-align: center;
}

.quiz-finale-score {
  color: #0f172a;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.quiz-finale-verdict {
  margin: 0.75rem auto 0;
  max-width: 28rem;
  color: #475569;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.quiz-round-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quiz-round-tag-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: inherit;
}

.quiz-round-tag-icon .quiz-round-svg {
  width: 100%;
  height: 100%;
}

.quiz-card-bridge {
  text-align: center;
}

.quiz-bridge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1rem;
  border-radius: 1.25rem;
  background: linear-gradient(160deg, #eff6ff 0%, #f8fafc 70%);
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.quiz-bridge-icon .quiz-round-svg {
  width: 3.25rem;
  height: 3.25rem;
}

.quiz-bridge-title {
  margin-top: 0.5rem;
  color: #0f172a;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.quiz-bridge-hint {
  margin: 0.65rem auto 0;
  max-width: 22rem;
  color: #64748b;
  font-size: 1rem;
  line-height: 1.5;
}

.quiz-round-breakdown {
  display: grid;
  gap: 0.45rem;
  margin: 1.25rem auto 0;
  max-width: 18rem;
  padding: 0;
  list-style: none;
  text-align: left;
}

.quiz-round-breakdown li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #475569;
  font-size: 0.875rem;
}

.quiz-breakdown-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.quiz-breakdown-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: #2563eb;
}

.quiz-breakdown-icon .quiz-round-svg {
  width: 100%;
  height: 100%;
}

.quiz-round-breakdown strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.quiz-share-status {
  margin: 0;
  color: #15803d;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

.quiz-share-status.is-error {
  color: #b91c1c;
}

.quiz-choice-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

@media (min-width: 640px) {
  .quiz-choice-list {
    grid-template-columns: 1fr 1fr;
  }
}

.quiz-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.quiz-choice:hover {
  border-color: #94a3b8;
}

.quiz-choice:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.quiz-choice.is-correct,
.quiz-choice.is-correct:has(input:checked) {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #15803d;
}

.quiz-choice.is-wrong,
.quiz-choice.is-wrong:has(input:checked) {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}

.quiz-choice input {
  accent-color: #2563eb;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.quiz-choice.is-correct input {
  accent-color: #16a34a;
}

.quiz-choice.is-wrong input {
  accent-color: #dc2626;
}

.quiz-choice:has(input:disabled) {
  cursor: default;
}

.quiz-photo-frame {
  margin-top: 0.85rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  background: #f1f5f9;
  aspect-ratio: 16 / 10;
  max-height: 11.5rem;
}

/* Same zoom-in affordance as architecture gallery / map station card */
.quiz-photo-trigger {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.quiz-photo-trigger:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.quiz-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quiz-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.2), transparent 55%),
    repeating-linear-gradient(
      -12deg,
      #e2e8f0,
      #e2e8f0 8px,
      #f8fafc 8px,
      #f8fafc 16px
    );
  color: #64748b;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}

.quiz-clue-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 480px) {
  .quiz-clue-list {
    grid-template-columns: 1fr 1fr;
  }
}

.quiz-clue-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.65rem 0.8rem;
}

.quiz-clue-label {
  color: #94a3b8;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quiz-clue-value {
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Engineering FAQ flip-card carousel (before games intro) */
.block-faq {
  min-height: 100vh;
  min-height: 100dvh;
}

.block-faq .snap-section-inner {
  justify-content: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.faq-cards-root {
  width: 100%;
}

.faq-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  .faq-carousel {
    gap: 0.75rem;
  }
}

.faq-carousel-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.faq-carousel-arrow:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.faq-carousel-arrow:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.faq-carousel-arrow:disabled {
  color: #cbd5e1;
  cursor: default;
  opacity: 0.55;
}

.faq-carousel-page {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .faq-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

.faq-card {
  display: block;
  width: 100%;
  min-height: 16rem;
  height: 16rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1200px;
  text-align: center;
}

@media (min-width: 900px) {
  .faq-card {
    min-height: 22rem;
    height: 22rem;
  }
}

.faq-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 0.85rem;
}

.faq-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}

.faq-card.is-flipped .faq-card-inner {
  transform: rotateY(180deg);
}

.faq-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.faq-face-front {
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
}

.faq-face-back {
  background: var(--ink);
  color: #f8fafc;
  transform: rotateY(180deg);
  border-color: var(--ink);
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.faq-question {
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

@media (min-width: 768px) {
  .faq-question {
    font-size: 1.05rem;
  }
}

.faq-kicker {
  color: #93c5fd;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.faq-answer {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .faq-answer {
    font-size: 0.95rem;
  }
}

.faq-detail {
  color: #cbd5e1;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

@media (min-width: 768px) {
  .faq-detail {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-card-inner {
    transition: none;
  }
}

.faq-ask-form {
  margin: 0.75rem auto 0;
  width: 100%;
  max-width: 36rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.faq-ask-title {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
}

.faq-ask-lead {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}

.faq-ask-question {
  width: 100%;
  resize: vertical;
  min-height: 3.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #0f172a;
  background: #fff;
}

.faq-ask-question:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #93c5fd;
}

.faq-ask-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.faq-ask-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.faq-ask-captcha-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.faq-ask-captcha-label {
  flex: 0 1 auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

.faq-ask-captcha {
  width: 4.25rem;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.875rem;
  text-align: center;
  color: #0f172a;
  background: #fff;
}

.faq-ask-captcha:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #93c5fd;
}

.faq-ask-submit {
  margin-left: auto;
  border: 0;
  border-radius: 9999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.faq-ask-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

.faq-ask-submit:disabled {
  opacity: 0.55;
  cursor: default;
}

.faq-ask-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.faq-ask-status {
  margin: 0;
  min-height: 1.1rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.faq-ask-status[data-kind='success'] {
  color: #15803d;
}

.faq-ask-status[data-kind='error'] {
  color: #b91c1c;
}

/* Methodology & sources */
.block-methods {
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.12), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 45%, #f1f5f9 100%);
}

.block-methods .snap-section-inner {
  min-height: auto;
  height: auto;
}

.methods-credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
  color: #0f172a;
  padding: 1.1rem 1.15rem 1.25rem;
  text-align: center;
}

@media (min-width: 640px) {
  .methods-credit {
    gap: 0.5rem;
    padding: 1.25rem 1.5rem 1.4rem;
  }
}

.methods-credit-line {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

@media (min-width: 640px) {
  .methods-credit-line {
    font-size: 1.0625rem;
  }
}

.methods-credit-line a {
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.15em;
}

.methods-credit-line a:hover {
  color: #1e3a8a;
}

/* CTA sits as the third row inside the credit block */
.methods-credit-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  width: 100%;
  max-width: 16rem;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.7rem 1.25rem;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.methods-credit-cta-icon {
  flex-shrink: 0;
}

.methods-credit-cta:hover {
  background: var(--accent-hover);
  color: #fff;
}

.methods-credit-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.methods-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  padding-bottom: 1.25rem;
}

/* Side-by-side sources / limits with a tight column gap */
@media (min-width: 768px) {
  .methods-body {
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
  }
}

.methods-block h3 {
  color: #0f172a;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.methods-block p {
  margin-top: 0.4rem;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.55;
}

.methods-list {
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.55;
  list-style-type: disc;
}

.methods-list li + li {
  margin-top: 0.3rem;
}

.methods-list-nested {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  list-style-type: circle;
}

.methods-list-nested li + li {
  margin-top: 0.2rem;
}

.methods-list a {
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-thickness: 1.25px;
  text-underline-offset: 0.12em;
}

.methods-list a:hover {
  color: #1e3a8a;
}

@media (min-width: 640px) {
  .methods-block p,
  .methods-list {
    font-size: 0.9375rem;
  }
}

/* Depth chart */
.station-point:focus {
  outline: none;
}

.station-point:focus circle[fill='#fff'],
.station-point:hover circle[fill='#fff'] {
  stroke-width: 3.5;
}

#chart-tooltip dt {
  color: #64748b;
}

#chart-tooltip dd {
  color: #0f172a;
  font-weight: 500;
}

#chart-tooltip.is-pinned {
  pointer-events: auto;
  border-color: #cbd5e1;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}

.chart-tooltip-close {
  display: inline-flex;
  height: 1.25rem;
  width: 1.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  font-size: 1rem;
  line-height: 1;
  color: #94a3b8;
  transition: color 0.15s, background-color 0.15s;
}

.chart-tooltip-close:hover {
  background-color: #f1f5f9;
  color: #475569;
}

/* Mobile tweaks */
@media (max-width: 639px) {
  .section-nav {
    right: 0.5rem;
    gap: 0.125rem;
  }

  .section-nav-dot {
    width: 0.625rem;
    height: 0.75rem;
  }

  .section-nav-dot::after {
    width: 0.625rem;
  }

  .section-nav-dot.is-active {
    width: 1.25rem;
  }

  .section-nav-dot.is-active::after {
    width: 1.25rem;
  }

  /* Hide tooltips on touch / narrow screens — they collide with content */
  .section-nav-dot::before {
    display: none;
  }

  .snap-section-inner {
    padding: 1rem 0 1.5rem;
  }

  /*
   * Vertically center lighter narrative slides.
   * Collapse h-full / flex-1 stretch so the stage is only as tall as content,
   * then safe-center it in the viewport (falls back to start if it overflows).
   */
  #block-ribbon .snap-section-inner,
  #block-lengths .snap-section-inner,
  #block-history .snap-section-inner,
  #block-renames .snap-section-inner,
  #block-station-types .snap-section-inner,
  #block-sounds .snap-section-inner,
  #block-depths .snap-section-inner {
    justify-content: center;
    justify-content: safe center;
  }

  #block-ribbon .snap-section-inner > div,
  #block-lengths .snap-section-inner > div,
  #block-history .snap-section-inner > div,
  #block-renames .snap-section-inner > div,
  #block-station-types .snap-section-inner > div,
  #block-sounds .snap-section-inner > div,
  #block-depths .snap-section-inner > div {
    height: auto;
  }

  #block-ribbon .network-ribbon-root,
  #block-lengths .length-chart-root,
  #block-history .history-timeline-root,
  #block-renames .renames-timeline-root,
  #block-station-types .station-types-root,
  #block-sounds .metro-sounds-root,
  #block-depths .depth-comparison-root {
    flex: 0 1 auto;
  }

  /* Lengths: scale whole chart (not thinner bars) so it fits like ribbon */
  #block-lengths h2 {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  #block-lengths [data-i18n='lengthsLead'],
  #block-lengths .section-insight {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
  }

  #block-lengths .length-chart-root {
    margin-top: 0.75rem;
    margin-left: auto;
    margin-right: auto;
    overflow: visible;
    /* zoom shrinks layout box too (unlike transform alone) */
    zoom: 0.68;
  }

  /* Snake elbows use negative SVG margin — do not clip them */
  #block-lengths .length-chart-inner,
  #block-lengths .length-city-row {
    overflow: visible;
  }

  #block-lengths .length-chart-inner {
    gap: 0.45rem;
    /* Room for Moscow left-turn semicircles */
    padding-left: 1.4rem;
    padding-right: 0.35rem;
  }

  .length-city-row {
    grid-template-columns: 1fr minmax(0, 3.5rem);
    grid-template-rows: auto auto;
    gap: 0.2rem 0.4rem;
  }

  .length-city-label {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: left;
    font-size: 0.65rem;
  }

  .length-bar-area {
    grid-column: 1;
    grid-row: 2;
  }

  .length-city-spacer {
    grid-column: 2;
    grid-row: 2;
  }

  .length-km-label {
    font-size: 0.55rem;
  }

  /* Tighter km offset so labels sit next to thinner scaled bars */
  .length-km-label--after {
    left: calc(var(--km-x) + 0.4rem);
  }

  .length-km-label--before {
    transform: translate(calc(-100% - 0.4rem), -50%);
  }

  /* Station-type chips: denser on narrow screens */
  .station-types-legend {
    gap: 0.35rem;
  }

  .station-types-legend-row {
    gap: 0.3rem;
  }

  .station-types-legend-item {
    font-size: 0.6rem;
    padding: 0.28rem 0.45rem;
    gap: 0.25rem;
    max-width: 100%;
  }

  .station-types-legend-item span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .station-types-legend-icon svg {
    width: 12px;
    height: 12px;
  }

  /* Depths: shorter chart + compact header */
  #block-depths h2 {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  #block-depths [data-i18n='depthsLead'],
  #block-depths .section-insight {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
  }

  #block-depths .depth-comparison-root {
    margin-top: 0.75rem;
  }

  .depth-comparison-legend {
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
  }

  /* Compact avg / median legend ticks to match thinner chart markers */
  .depth-legend-swatch--avg,
  .depth-legend-swatch--median {
    width: 0.35rem;
    border-top-width: 1.1px;
  }

  .depth-legend-swatch--range {
    width: 0.65rem;
    height: 0.55rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .map-container {
    height: 22rem;
  }

  .map-info-panel {
    height: 22rem;
  }

  /* Architecture showcases: ~28% shorter photos */
  .architecture-media {
    aspect-ratio: 16 / 6.8;
  }

  .architecture-grid {
    gap: 0.55rem;
  }

  .architecture-card-body {
    padding: 0.55rem 0.65rem 0.65rem;
  }

  .architecture-photo-caption {
    font-size: 0.6rem;
    padding: 0.12rem 0.32rem;
  }

  /* Station types: city labels sit above bars in JS; keep default chart scale */

  /* Map 15-min access chip: tighter on mobile */
  .map-access-fab {
    width: min(22rem, calc((100% - 6.5rem) * 0.65));
    max-width: calc((100% - 6.5rem) * 0.65);
    padding: 0.35rem 0.55rem;
  }

  .map-access-fab-title {
    font-size: 0.625rem;
    line-height: 1.2;
  }

  .map-access-fab-metric {
    font-size: 0.5625rem;
  }

  /* FAQ: denser type/padding so full flip-side text fits in a compact card */
  .faq-card {
    min-height: 15rem;
    height: 15rem;
  }

  .faq-face {
    padding: 0.55rem 0.55rem;
    gap: 0.22rem;
    border-radius: 0.7rem;
  }

  .faq-question {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .faq-kicker {
    font-size: 0.55rem;
  }

  .faq-answer {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .faq-detail {
    font-size: 0.58rem;
    line-height: 1.35;
  }

  .faq-grid {
    gap: 0.55rem;
  }

  .faq-carousel-arrow {
    width: 2rem;
    height: 2rem;
  }
}

@media (min-width: 1024px) {
  .map-container {
    height: 28.6rem;
  }

  .map-info-panel {
    height: 28.6rem;
  }
}

/*
 * Phones + narrow tablets: continuous page scroll.
 * Desktop keeps full-viewport scroll-snap; here sections take natural height.
 */
@media (max-width: 767px) {
  html {
    scroll-snap-type: none;
  }

  .snap-section {
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    min-height: 0;
  }

  .snap-section-inner {
    min-height: 0;
    /* Breathing room between flowing sections */
    padding: 1.75rem 0 2.5rem;
  }

  #block-intro .snap-section-inner {
    padding-bottom: 2rem;
  }

  .block-cities,
  .block-faq,
  .block-methods {
    min-height: 0;
  }

  .block-city-history .snap-section-inner {
    min-height: 0;
  }

  /* Centering was for full-screen snap slides — top-align in document flow */
  #block-ribbon .snap-section-inner,
  #block-lengths .snap-section-inner,
  #block-history .snap-section-inner,
  #block-renames .snap-section-inner,
  #block-station-types .snap-section-inner,
  #block-sounds .snap-section-inner,
  #block-depths .snap-section-inner,
  #block-cities-intro .snap-section-inner,
  #block-games-intro .snap-section-inner,
  #block-faq .snap-section-inner,
  #block-quiz .snap-section-inner {
    justify-content: flex-start;
  }

  .cities-intro-layout,
  .games-intro-layout {
    flex: 0 1 auto;
  }

  .cities-intro-arrow,
  .games-intro-arrow {
    margin: 1rem auto 0;
  }

  /* Quiz grows with content — no nested card scrollport on flow layout */
  .station-name-quiz-root {
    height: auto;
  }

  .quiz-card {
    height: auto;
  }

  .quiz-card-scroll,
  .quiz-card-scroll.is-scrollable {
    overflow-y: visible;
  }
}

/* Leaflet-safe overlay: shimmer without wiping map panes */
.map-container.is-phantom-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(226, 232, 240, 0.92) 0%,
    rgba(241, 245, 249, 0.96) 45%,
    rgba(226, 232, 240, 0.92) 90%
  );
  background-size: 200% 100%;
  animation: phantom-shimmer 1.35s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .map-container.is-phantom-loading::after {
    animation: none;
    background: rgba(226, 232, 240, 0.92);
  }
}

/* ── Phantom / skeleton loaders ─────────────────────────────────────────── */
@keyframes phantom-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.phantom {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  height: 100%;
  min-height: inherit;
  pointer-events: none;
  user-select: none;
}

.phantom-bone {
  display: block;
  border-radius: 0.4rem;
  background: linear-gradient(
    90deg,
    #e2e8f0 0%,
    #f1f5f9 45%,
    #e2e8f0 90%
  );
  background-size: 200% 100%;
  animation: phantom-shimmer 1.35s ease-in-out infinite;
}

.phantom-bone--fill {
  flex: 1;
  width: 100%;
  min-height: 10rem;
  border-radius: 0.75rem;
}

.phantom-bone--label {
  flex: 0 0 4.5rem;
  height: 0.7rem;
  align-self: center;
}

.phantom-bone--bar {
  height: 0.85rem;
  border-radius: 999px;
}

.phantom-bone--line {
  height: 0.7rem;
  width: 100%;
}

.phantom-bone--media {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.65rem;
}

.phantom-bone--quiz-media {
  aspect-ratio: 16 / 10;
  max-height: 14rem;
}

.phantom-bone--tab,
.phantom-bone--chip {
  height: 1.75rem;
  width: 4.5rem;
  border-radius: 999px;
}

.phantom-bone--ribbon-seg {
  flex: 1;
  min-width: 2.5rem;
  height: 2.25rem;
  border-radius: 0.5rem;
}

.phantom-bone--axis {
  height: 0.2rem;
  width: 100%;
  border-radius: 999px;
}

.phantom-bone--dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  margin: 0 auto;
}

.phantom-bone--logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.55rem;
  margin: 0.35rem auto 0;
}

.phantom-bone--caption {
  height: 0.55rem;
  width: 3.5rem;
  margin: 0.35rem auto 0;
}

.phantom-bone--chart {
  flex: 1;
  min-height: 8rem;
  width: 100%;
  border-radius: 0.65rem;
}

.phantom-bone--swatch {
  flex: 0 0 0.85rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
}

.phantom-bar-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.phantom--map,
.phantom--panel,
.phantom--profile {
  min-height: 12rem;
}

.phantom--map .phantom-bone--fill,
.phantom--profile .phantom-bone--fill {
  min-height: 14rem;
}

.intro-map-panel .phantom--map,
.intro-map-panel .phantom--map .phantom-bone--fill {
  min-height: 100%;
  height: 100%;
}

.map-container .phantom--map,
.map-container .phantom--map .phantom-bone--fill {
  min-height: 100%;
  height: 100%;
}

.phantom--ribbon {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  min-height: 4rem;
}

.phantom--timeline {
  gap: 0.85rem;
  justify-content: flex-end;
  padding-top: 1rem;
}

.phantom-timeline-items {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
}

.phantom-timeline-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phantom--history {
  gap: 0.85rem;
}

.phantom-history-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.phantom-history-detail {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.phantom--cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .phantom--cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.phantom-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.phantom--types {
  gap: 0.55rem;
}

.phantom-types-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.phantom--list {
  gap: 0.55rem;
  padding: 0.35rem 0;
}

.phantom-list-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.phantom--quiz {
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.phantom-quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.phantom-quiz-actions .phantom-bone--chip {
  flex: 1 1 40%;
  height: 2.4rem;
  border-radius: 0.65rem;
}

/* Intro stat numbers while CSV totals are still loading */
.stat-value.is-phantom {
  color: transparent;
  border-radius: 0.35rem;
  background: linear-gradient(
    90deg,
    #e2e8f0 0%,
    #f1f5f9 45%,
    #e2e8f0 90%
  );
  background-size: 200% 100%;
  animation: phantom-shimmer 1.35s ease-in-out infinite;
  min-width: 2.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .phantom-bone,
  .stat-value.is-phantom {
    animation: none;
    background: #e2e8f0;
  }
}

/* First-paint fallback before JS modules inject structured phantoms */
.intro-map-panel:empty,
.network-ribbon-root:empty,
.length-chart-root:empty,
.openings-timeline-root:empty,
.history-timeline-root:empty,
.renames-timeline-root:empty,
.architecture-showcases-root:empty,
.station-types-root:empty,
.depth-comparison-root:empty,
.faq-cards-root:empty,
.station-name-quiz-root:empty,
.city-history-body:empty,
.station-list-root:empty,
.profile-chart-main:empty {
  min-height: 8rem;
  border-radius: 0.75rem;
  background: linear-gradient(
    90deg,
    #e2e8f0 0%,
    #f1f5f9 45%,
    #e2e8f0 90%
  );
  background-size: 200% 100%;
  animation: phantom-shimmer 1.35s ease-in-out infinite;
}

.intro-map-panel:empty,
.profile-chart-main:empty {
  min-height: 14rem;
}

@media (prefers-reduced-motion: reduce) {
  .intro-map-panel:empty,
  .network-ribbon-root:empty,
  .length-chart-root:empty,
  .openings-timeline-root:empty,
  .history-timeline-root:empty,
  .renames-timeline-root:empty,
  .architecture-showcases-root:empty,
  .station-types-root:empty,
  .depth-comparison-root:empty,
  .faq-cards-root:empty,
  .station-name-quiz-root:empty,
  .city-history-body:empty,
  .station-list-root:empty,
  .profile-chart-main:empty {
    animation: none;
    background: #e2e8f0;
  }
}
