/* African Public homepage.
   Shared tokens, brand and footer and form styles come from styles.css.
   One container width, one type scale, one spacing rhythm. */

:root {
  --page-width: min(1080px, calc(100% - 32px));
  --t-note: 12px;
  --t-small: 14px;
  --t-body: 16px;
  --t-lead: 18px;
  --t-title: clamp(20px, 2.8vw, 32px);
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --switch-start: #6e5a4c;
  --switch-end: #9a7d69;
}

body.home-page { overflow-x: hidden; }
body.ap-locked { overflow: hidden; }
body.has-player { padding-bottom: 80px; }

/* ---------- hero: switch, rotating line, rows, play, stats, picker ---------- */

.ap-hero {
  width: var(--page-width);
  margin: 0 auto;
  padding: var(--space-3) 0 var(--space-5);
  text-align: center;
}

/* toggle switch: radio left, nothing in the middle, tv right */

.ap-toggle {
  position: relative;
  width: min(300px, 100%);
  margin: 0 auto var(--space-2);
}

.ap-toggle-track {
  position: relative;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(100deg, #4f4037 0%, #7a6253 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .18), 0 6px 16px rgba(0, 0, 0, .25);
}

.ap-toggle-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  width: 84px;
  height: 44px;
  border-radius: 999px;
  background: #d9cdbf;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
  transition: left .35s cubic-bezier(.3, .7, .3, 1);
}

.ap-toggle[data-pos="left"] .ap-toggle-knob { left: 6px; background: #8fae86; }
.ap-toggle[data-pos="mid"] .ap-toggle-knob { left: calc(50% - 42px); }
.ap-toggle[data-pos="right"] .ap-toggle-knob { left: calc(100% - 90px); background: #8fae86; }

/* the three touch zones sit over the track; their text is for screen readers only */
.ap-toggle-hit {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.ap-toggle .ap-slider-opt {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  cursor: pointer;
}

.ap-toggle .ap-slider-opt:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -6px;
  border-radius: 999px;
}

.ap-toggle-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0 28px;
  pointer-events: none;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  text-shadow: 0 1px 1px rgba(0,0,0,.22);
}

/* rotating station taglines */

.ap-title {
  margin: var(--space-2) 0 var(--space-2);
  font-size: var(--t-title);
  font-weight: 500;
  line-height: 1.1;
  min-height: 1.1em;
}

.ap-phrase {
  display: inline-block;
  transition: opacity .5s ease, transform .5s ease;
}

.ap-phrase.is-changing { opacity: 0; transform: translateY(6px); }

/* one scroll hint above all three rows */

.ap-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-bottom: 6px;
  font-size: var(--t-note);
  color: var(--muted);
}

.ap-roll {
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.ap-roll:hover,
.ap-roll:focus-visible { border-color: var(--ink); outline: none; }

/* continent rows: no labels, just the countries */

.ap-rows {
  width: 100%;
  text-align: left;
}

.ap-row { position: relative; margin-bottom: 10px; }
.ap-row:not(.is-static) { padding: 0 40px; }

.ap-row-view {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  touch-action: pan-y;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.ap-row-view.is-dragging { cursor: default; }

.ap-row-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--surface-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.ap-row-arrow-left { left: 2px; }
.ap-row-arrow-right { right: 2px; }

.ap-row-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.ap-row-set {
  display: flex;
  gap: var(--space-1);
  padding-right: var(--space-1);
}

/* a row whose countries all fit on screen stays still and shows once */
.ap-row.is-static .ap-row-track { width: 100%; }
.ap-row.is-static .ap-row-set { flex-wrap: wrap; }
.ap-row.is-static .ap-row-set[aria-hidden="true"] { display: none; }

.ap-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 36px;
  padding: 0 var(--space-2) 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--t-small);
  white-space: nowrap;
  cursor: pointer;
}

.ap-chip img { display: block; width: 28px; height: 19px; }
.ap-chip small { font-size: var(--t-note); color: var(--muted); }
.ap-chip:hover,
.ap-chip:focus-visible { border-color: var(--ink); outline: none; }

/* round play button, with its label under it */

.ap-play-wrap {
  display: grid;
  justify-items: center;
  gap: var(--space-1);
  margin-top: var(--space-4);
}

.ap-play {
  position: relative;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  transition: transform .2s ease, background .2s ease;
}

.ap-play:hover { background: var(--accent-hover); color: var(--accent-ink); transform: scale(1.04); }
.ap-play:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.ap-play[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.ap-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-40%, -50%);
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-left: 28px solid currentColor;
  transition: all .2s ease;
}

.ap-play.is-on .ap-play-icon {
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border: 0;
  background: currentColor;
}

.ap-play-label {
  margin: var(--space-1) 0 0;
  font-size: var(--t-lead);
  letter-spacing: .01em;
}

/* the one sentence: counts and the continents, under the play button */

.ap-stats {
  margin: var(--space-2) 0 0;
  font-size: var(--t-small);
  letter-spacing: .02em;
  color: var(--muted);
}

.ap-stats strong {
  color: var(--ink);
  font-weight: 600;
}

/* country picker: first selection only, then tune in */

.ap-picker {
  position: relative;
  display: flex;
  gap: var(--space-1);
  width: min(640px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  margin: var(--space-4) auto 0;
  text-align: left;
}

.ap-combo {
  position: relative;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 56px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.ap-combo:focus-within { border-color: var(--ink); }

.ap-picker-flag {
  display: inline-flex;
  width: 28px;
  margin-left: var(--space-2);
  flex: none;
}

.ap-picker-flag img { display: block; width: 28px; height: 19px; }

.ap-combo input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 var(--space-2);
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--t-body);
  outline: none;
}

.ap-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.ap-options li {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 10px var(--space-2);
  font-size: var(--t-small);
  cursor: pointer;
}

.ap-options li[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.ap-options li img { display: block; width: 28px; height: 19px; flex: none; }
.ap-options li small { margin-left: auto; color: var(--muted); font-size: var(--t-note); }

.ap-tune {
  height: 56px;
  box-sizing: border-box;
  padding: 0 var(--space-3);
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: var(--t-small);
  letter-spacing: .04em;
  cursor: pointer;
}

.ap-tune:hover { background: var(--accent-hover); color: var(--accent-ink); }

/* ---------- map: the animated network map, with the country search on it ---------- */

.ap-map-section {
  width: var(--page-width);
  margin: 0 auto var(--space-5);
}

.ap-map-picker { min-width: 0; }

.ap-map-picker .ap-combo {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 42px;
  border: 0;
  background: transparent;
  position: relative;
}

.ap-map-picker .ap-picker-flag { width: 22px; margin-left: 14px; flex: none; }
.ap-map-picker .ap-picker-flag img { display: block; width: 22px; height: 15px; }

.ap-map-picker .ap-options {
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 300px;
  padding: 7px;
  border: 1px solid rgba(244, 237, 225, .14);
  border-radius: 14px;
  background: rgba(5, 4, 3, .94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .36);
}

.ap-map-picker .ap-options li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 11px;
  color: #faf6ed;
}

.ap-map-picker .ap-options li:hover,
.ap-map-picker .ap-options li[aria-selected="true"] { background: rgba(244, 237, 225, .1); }
.ap-map-picker .ap-options li img { display: block; width: 22px; height: 15px; flex: none; }
.ap-map-picker .ap-options li small { margin-left: auto; color: rgba(244, 237, 225, .55); }

.ap-map-picker input::placeholder { color: rgba(244, 237, 225, .58); }

.ap-hint {
  min-height: 1.4em;
  margin: var(--space-1) 0 0;
  font-size: var(--t-note);
  text-align: center;
  color: var(--warn);
}

/* ---------- footer: centred to the same width as the page ---------- */

.site-footer {
  width: var(--page-width);
  margin: 0 auto;
  padding-bottom: var(--space-5);
  text-align: center;
}

.site-footer .footer-about {
  max-width: 640px;
  margin: 0 auto var(--space-2);
  font-size: var(--t-small);
  line-height: 1.6;
  color: var(--muted);
}

.site-footer .footer-links {
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--t-small);
}

/* ---------- radio: minimized bar ---------- */

.ap-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface-2) 94%, var(--ink)), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -16px 44px rgba(12, 8, 6, .32), 0 -2px 0 rgba(255, 255, 255, .06) inset;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ap-player[hidden] { display: none; }

.ap-player-art {
  width: 44px;
  height: 44px;
  background-size: 112%;
  background-position: center;
  border: 1px solid var(--line);
}

.ap-player-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.ap-player-copy #player-state { font-size: var(--t-note); color: var(--muted); }

.ap-player-copy strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--t-small);
  font-weight: 600;
}

.ap-player-controls { display: flex; gap: var(--space-1); }

.home-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px auto 0; font-size: 11px; line-height: 1; }
.home-nav a { color: var(--muted); text-decoration: none; }
.home-nav a:hover, .home-nav a:focus-visible { color: var(--ink); }
.mobile-menu { display: none; }

.ap-player-controls button,
.ap-tv-bar button {
  min-height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
}

.ap-player-controls button:hover,
.ap-tv-bar button:hover { border-color: var(--ink); }

/* ---------- TV: video screen ---------- */

.ap-tv {
  position: fixed;
  right: var(--space-2);
  bottom: var(--space-2);
  z-index: 70;
  width: min(520px, calc(100vw - 32px));
  background: #000;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}

.ap-tv[hidden] { display: none; }
body.has-player .ap-tv { bottom: 88px; }

.ap-tv-bar {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--t-note);
}

.ap-tv-bar #tv-state { color: var(--muted); }

.ap-tv-bar strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
}

.ap-tv-bar .ap-tv-actions { display: flex; gap: 6px; }
.ap-tv-bar button { min-height: 30px; padding: 0 10px; font-size: var(--t-note); }

.ap-tv video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.ap-tv.is-minimized video { display: none; }

/* ---------- country sheet: station and channel cards ---------- */

.ap-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh var(--space-2);
  overflow-y: auto;
  background: rgba(18, 15, 12, .86);
}

.ap-sheet[hidden] { display: none; }

.ap-sheet-card {
  width: min(1080px, 100%);
  padding: var(--space-3);
  background: var(--bg);
  border: 1px solid var(--line);
}

.ap-sheet-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.ap-sheet-flag img { display: block; width: 40px; height: 27px; }

.ap-sheet-head h2 {
  margin: 0;
  font-size: var(--t-lead);
  font-weight: 600;
}

.ap-sheet-head p {
  margin: 4px 0 0;
  font-size: var(--t-note);
  color: var(--muted);
}

.ap-sheet-head > button {
  margin-left: auto;
  min-height: 40px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--t-small);
  cursor: pointer;
}

.ap-sheet-sub {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--t-small);
  font-weight: 600;
  letter-spacing: .1em;
}

.ap-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.ap-card {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  overflow: hidden;
  background-color: var(--surface);
  background-size: 112%;
  background-position: center;
  color: #fbf7f1;
  text-align: left;
  cursor: pointer;
}

.ap-card:hover,
.ap-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ap-card-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0) 42%, rgba(20, 16, 12, .88) 100%);
}

.ap-card-body {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 12px;
  box-sizing: border-box;
}

.ap-card-name {
  font: 700 clamp(20px, 2.4vw, 30px)/1.05 'IBM Plex Serif', Georgia, serif;
  letter-spacing: -.015em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  overflow-wrap: anywhere;
}

.ap-card-meta {
  font: 400 italic 13px/1.3 'IBM Plex Serif', Georgia, serif;
  color: #f1e9de;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}

.ap-empty { color: var(--muted); }

/* ---------- phones ---------- */

@media (max-width: 640px) {
  .home-nav { display: none; }
  .mobile-menu { display: block; position: relative; font-size: 11px; line-height: 1; }
  .mobile-menu summary { cursor: pointer; list-style: none; color: var(--muted); }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .mobile-menu summary::after { content: ' +'; }
  .mobile-menu[open] summary::after { content: ' −'; }
  .mobile-menu nav { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; display: grid; min-width: 170px; padding: 12px; gap: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.2); }
  .mobile-menu a { color: var(--ink); text-decoration: none; white-space: nowrap; }
  .mobile-menu a:focus-visible, .mobile-menu a:hover { color: var(--accent); }
  :root { --t-title: 20px; --t-lead: 16px; }
  .ap-hero { padding-top: var(--space-2); }
  .ap-toggle { width: 100%; }
  .ap-play { width: 84px; height: 84px; }
  .ap-play-wrap { margin-top: var(--space-3); }
  .ap-row-set { gap: 6px; }
  .ap-chip { height: 34px; padding: 0 var(--space-1) 0 8px; font-size: var(--t-note); }
  .ap-chip img { width: 24px; height: 17px; }
  .ap-picker { flex-direction: column; }
  .ap-tune { width: 100%; height: 48px; }
  .ap-tv { left: var(--space-1); right: var(--space-1); width: auto; bottom: var(--space-1); }
  body.has-player .ap-tv { bottom: 88px; }
  .ap-player { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px; }
  .ap-player-art { width: 40px; height: 40px; }
  .ap-player-controls button { padding: 0 10px; }
  .ap-sheet { padding: 2vh var(--space-1); }
  .ap-sheet-card { padding: 14px; }
  .ap-card-name { font-size: 20px; }
  .ap-card-meta { font-size: 12px; }
}

/* ---------- rounded corners for cards, images and controls ---------- */

.ap-card { border-radius: 10px; }
.ap-sheet-card { border-radius: 20px; }
.country-modal-page { display: inline-block; margin: 4px 0 8px; color: var(--accent-hover); text-decoration: none; font-size: var(--t-note); }
.country-modal-page:hover, .country-modal-page:focus-visible { color: var(--ink); }
.ap-tv { border-radius: 16px; overflow: hidden; }
.ap-tv video { border-radius: 0; }
.ap-player-art { border-radius: 10px; }
.ap-chip { border-radius: 999px; }
.ap-roll { border-radius: 999px; }
.ap-tune { border-radius: 999px; }
.ap-player-controls button,
.ap-tv-bar button,
.ap-sheet-head > button { border-radius: 999px; }
.ap-options { border-radius: 14px; }
.ap-sheet-flag img,
.ap-chip img,
.ap-options li img { border-radius: 3px; }

/* the map box and the animation inside it share one rounded edge (iframes can ignore overflow clipping) */
.network-map-section {
  border-radius: 18px;
  overflow: hidden;
  clip-path: inset(0 round 18px);
  isolation: isolate;
}

.network-map-section .osmosis-frame { border-radius: 18px; }

/* ---------- page spacing ---------- */

.ap-title { text-align: center; max-width: none; width: 100%; margin: var(--space-3) auto var(--space-4); }
.ap-play-wrap { margin-top: var(--space-4); }
.ap-stats { margin: var(--space-3) 0 var(--space-4); }
.ap-scroll-hint { justify-content: center; margin: 0 0 var(--space-2); }
.ap-rows { margin-top: 0; }
.ap-row { margin-bottom: var(--space-2); }
.ap-map-section { margin: var(--space-4) auto var(--space-5); }

/* the country search is a large, first-class control at the top centre of the map */
.network-map-section .ap-map-picker {
  top: 28px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 48px));
  height: 68px;
  min-height: 68px;
  padding: 0 8px 0 0;
  border-radius: 999px;
  background: rgba(5, 4, 3, .96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .45), 0 0 0 1px rgba(244, 237, 225, .12) inset;
}

.network-map-section .ap-map-picker .ap-combo { height: 68px; }
.network-map-section .ap-map-picker .ap-picker-flag { width: 30px; margin-left: 22px; }
.network-map-section .ap-map-picker .ap-picker-flag img { width: 30px; height: 20px; }
.network-map-section .ap-map-picker input { font-size: 17px; padding: 0 18px; letter-spacing: .02em; }
.network-map-section .ap-map-picker button {
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  background: #f5efe7;
  color: #1d1b18;
  font-size: 15px;
  letter-spacing: .03em;
}
.network-map-section .ap-map-picker button:hover { background: #e8dfd2; }
.network-map-section .ap-options { top: calc(100% + 10px); font-size: 14px; max-height: 360px; }
.network-map-section .ap-options li { font-size: 14px; padding: 11px 14px; }

@media (max-width: 560px) {
  .network-map-section .ap-map-picker { top: 16px; height: 60px; }
  .network-map-section .ap-map-picker .ap-combo { height: 60px; }
  .network-map-section .ap-map-picker input { font-size: 15px; }
  .network-map-section .ap-map-picker button { height: 46px; padding: 0 18px; font-size: 14px; }
}

@media (max-width: 640px) {
  .ap-toggle { width: 100%; }
  .ap-toggle-track { height: 56px; }
  .ap-toggle-knob { width: 46px; height: 46px; top: 5px; left: 5px; }
  .ap-toggle[data-pos="mid"] .ap-toggle-knob { left: calc(50% - 23px); }
  .ap-toggle[data-pos="right"] .ap-toggle-knob { left: calc(100% - 51px); }
  .ap-play { width: 96px; height: 96px; }
}

/* ---------- hero controls ---------- */

.ap-hero-picker {
  width: min(640px, 100%);
  margin: var(--space-3) auto var(--space-4);
  box-sizing: border-box;
}

.network-map-section .ap-play-wrap {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  margin: 0;
  gap: 6px;
  pointer-events: auto;
}

.network-map-section .ap-play { width: 88px; height: 88px; }
.network-map-section .ap-play-icon { border-top-width: 16px; border-bottom-width: 16px; border-left-width: 24px; }
.network-map-section .ap-play.is-on .ap-play-icon { width: 24px; height: 24px; }
.network-map-section .ap-play-label { font-size: 15px; margin: 0; color: #d9cdbf; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }

@media (max-width: 560px) {
  .network-map-section .ap-play { width: 72px; height: 72px; }
  .network-map-section .ap-play-wrap { top: 16px; }
}
.ap-hero-picker .ap-tune { background: #9a7d69; color: #1d1b18; }
.ap-hero-picker .ap-tune:hover { background: #b39179; color: #1d1b18; }

/* the counts sentence is set on two lines: the totals, then the continents */
.ap-stats { line-height: 1.7; }

/* ---------- toggle and search on one line; radio and tv on the ends of the toggle ---------- */

.ap-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: var(--space-2) auto 0;
}

.ap-controls .ap-toggle {
  flex: none;
  width: 280px;
  margin: 0;
}

.ap-controls .ap-hero-picker {
  flex: 0 1 440px;
  min-width: 0;
  width: min(440px, 100%);
  max-width: 440px;
  box-sizing: border-box;
  margin: 0;
}

@media (max-width: 900px) {
  .ap-controls {
    width: min(100%, calc(100vw - 32px));
    margin-left: auto;
    margin-right: auto;
  }

  .ap-controls .ap-hero-picker {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

}

@media (max-width: 640px) {
  .ap-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .ap-controls .ap-toggle,
  .ap-controls .ap-hero-picker {
    width: 100%;
    max-width: 100%;
  }

  .ap-controls .ap-toggle { order: 1; }
  .ap-controls .ap-hero-picker { order: 2; }
  .ap-controls .ap-hero-picker {
    flex: none;
    position: static;
    display: block;
    margin: 0;
    min-width: 0;
    overflow: visible;
  }
  .ap-controls .ap-toggle-track,
  .ap-controls .ap-search-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 56px;
  }
  .ap-controls .ap-search-field { overflow: hidden; }
  .ap-controls .ap-search-field input {
    min-width: 0;
    padding: 0 8px 0 12px;
    font-size: 12px;
    letter-spacing: 0;
    text-overflow: ellipsis;
  }
  .ap-controls .ap-search-field input::placeholder { opacity: 1; }
  .ap-controls .ap-search-field .ap-tune {
    flex: 0 0 92px;
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    height: 48px;
    margin-right: 4px;
  }
}

@media (max-width: 560px) {
  .ap-map-section { width: 100%; margin-bottom: var(--space-4); }
  .network-map-section { height: min(72vw, 420px); aspect-ratio: auto; }
  .network-map-section .ap-play-wrap { left: 50%; transform: translateX(-50%); }
}

/* the play button on the map is smaller again */
.network-map-section .ap-play { width: 64px; height: 64px; }
.network-map-section .ap-play-icon { border-top-width: 12px; border-bottom-width: 12px; border-left-width: 18px; }
.network-map-section .ap-play.is-on .ap-play-icon { width: 18px; height: 18px; }
.network-map-section .ap-play-label { font-size: 13px; }

/* canonical country search */
.ap-hero-picker {
  display: block;
  width: min(640px, 100%);
  max-width: 100%;
}
.ap-search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 60px;
  box-sizing: border-box;
  overflow: visible;
  border: 1px solid rgba(154, 125, 105, .45);
  border-radius: 999px;
  background: #3d332c;
}
.ap-search-field .ap-picker-flag { flex: none; }
.ap-search-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 20px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  direction: ltr;
  text-align: left;
}
.ap-search-field:focus-within { border-color: var(--ink); }
.ap-search-field .ap-options { left: 0; right: 0; }
.ap-search-field .ap-tune {
  flex: none;
  width: 128px;
  min-width: 128px;
  height: 48px;
  margin-right: 6px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: #9a7d69;
  color: #1d1b18;
  font: inherit;
  font-size: 15px;
  white-space: nowrap;
  cursor: pointer;
}
.ap-search-field .ap-tune:hover { background: #b39179; }

@media (max-width: 900px) {
  .ap-hero-picker { width: 100%; }
  .ap-search-field .ap-tune { min-width: 104px; width: 104px; padding: 0 8px; font-size: 14px; }
}
@media (max-width: 640px) {
  .ap-search-field .ap-tune { min-width: 92px; width: 92px; margin-right: 4px; }
  .ap-search-field { height: 56px; }
  .ap-search-field input { padding: 0 12px; font-size: 14px; }
}

@media (max-width: 560px) {
  .network-map-section .ap-play { width: 56px; height: 56px; }
}
