:root {
  --navy: #2C3889;
  --navy-dark: #1A2458;
  --navy-deep: #151C4A;
  --orange: #F29024;
  --orange-dark: #E8740A;
  --cream: #FFF4E5;
  --ink: #151C4A;
  --muted: #5A6180;
  --line: #E4E7F2;
  --card: #ffffff;
  --bg: #F4F5FA;
  --ok: #16A34A;
  --radius: 16px;
  --tap: 56px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
.header {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 60%, #3A4AA0 100%);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 16px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(21, 28, 74, 0.28);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}
.header img.logo {
  height: 36px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}
.header .titles { flex: 1; min-width: 0; }
.header h1 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  font-weight: 700;
}
.header p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  opacity: 0.82;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 14px 40px; }
.search {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 12px 42px;
  font-size: 16px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%235A6180' stroke-width='2' stroke-linecap='round'><circle cx='9' cy='9' r='6'/><path d='M14 14l4 4'/></svg>") 14px 50% no-repeat;
  color: var(--ink);
  outline: none;
}
.search:focus { border-color: var(--navy); }
.hint {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.section { margin: 22px 0 8px; }
.section h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.grid { display: grid; gap: 10px; }
.btn, .card-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(21, 28, 74, 0.06);
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .card-link:active { transform: scale(0.99); }
.btn .icon, .card-link .icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: var(--navy);
}
.icon.orange { background: var(--orange-dark); }
.icon.green { background: #16A34A; }
.icon.gold { background: #C48A12; }
.icon.blue { background: #1A73E8; }
.icon.red { background: #C5221F; }
.icon.sky { background: #0284C7; }
.icon.slate { background: #334155; }
.icon.purple { background: #6D28D9; }
.icon.teal { background: #0F766E; }
.icon.pink { background: #BE185D; }
.meta { flex: 1; min-width: 0; }
.meta strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}
.meta span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}
.chev {
  color: #9AA0B8;
  font-size: 1.3rem;
  font-weight: 300;
  flex: 0 0 auto;
}
.featured {
  display: block;
  background: var(--navy-deep);
  color: #fff;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(21, 28, 74, 0.28);
  margin: 16px 0 6px;
}
.featured img {
  display: block;
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: 35% 50%;
  background: #efebe3;
}
.featured .body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 16px;
  min-height: 64px;
}
.featured .body strong { font-size: 1.12rem; color: #fff; }
.featured .body span { color: #D6DAF0; }
.featured .pill {
  background: var(--orange-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.footer {
  margin: 28px 8px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
.hidden { display: none !important; }
.empty {
  display: none;
  margin: 24px 8px;
  text-align: center;
  color: var(--muted);
}
.empty.show { display: block; }

/* Map viewer */
.viewer-header a.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.stage {
  background: #F3EFE8;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: none;
}
.stage img {
  display: block;
  width: 100%;
  height: auto;
}
.caption {
  padding: 14px 16px 28px;
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 10px;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
@media (min-width: 700px) {
  .featured img { height: 220px; }
}
