/* ============================================================================
   TACTICAL_MAP (/map) — page-specific styles.
   Tokens come from the inline critical block + style.css. Cyan is reserved for
   DATA (pins, routes, selection, live indicators) — chrome stays gray/dark.
   ========================================================================== */

.tmap-page { overscroll-behavior: none; }

/* the hidden attribute must always win, even over display:flex rules below */
.tmap-page [hidden] { display: none !important; }

/* ---- app frame ---------------------------------------------------------- */
.tmap-frame {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 70px); /* fallback for browsers without dvh */
  height: calc(100dvh - 70px);
}
@media (max-width: 768px) {
  .tmap-frame {
    height: calc(100vh - 46px);
    height: calc(100dvh - 46px);
  }
}

/* ---- header live badge --------------------------------------------------- */
.tmap-net-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-size: 0.62rem;
  letter-spacing: 2px;
  color: var(--text-dim);
}
.tmap-net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: tmap-net-blink 2.4s ease-in-out infinite;
}
@media (max-width: 519px) { .tmap-net-status { display: none; } }
@keyframes tmap-net-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---- filter topbar ------------------------------------------------------- */
.tmap-topbar {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 14px 8px;
  background: var(--bg-black);
  border-bottom: 1px solid rgba(15, 240, 252, 0.12);
  z-index: 20;
}
.tmap-search-wrap {
  flex: 0 0 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}
.tmap-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 10px rgba(15, 240, 252, 0.25);
}
.tmap-search-prompt {
  font-family: var(--font-head);
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.7;
}
.tmap-search {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}
.tmap-search::placeholder { color: var(--text-faint); letter-spacing: 1.5px; }
.tmap-search::-webkit-search-cancel-button { filter: grayscale(1) brightness(2); }

.tmap-chipwrap {
  flex: 1;
  min-width: 0;
  position: relative;
}
.tmap-chiprows {
  display: flex;
  flex-flow: row wrap;
  gap: 6px 0;
  align-items: center;
}
/* mobile-only FILTERS toggle — desktop shows the chip rows inline instead */
.tmap-filters-toggle { display: none; }
.tmap-chiprow {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tmap-chiprow::-webkit-scrollbar { display: none; }
.tmap-chiplabel {
  flex: 0 0 auto;
  width: 62px;
  font-family: var(--font-head);
  font-size: 0.56rem;
  letter-spacing: 1.5px;
  color: var(--text-faint);
}
.tmap-chip {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 11px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
  font-family: var(--font-head);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  cursor: pointer;
  clip-path: polygon(6px 0, 100% 0, 100% 100%, 0 100%, 0 6px);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tmap-chip:hover { color: var(--text-bright); border-color: var(--border-strong); }
.tmap-chip.is-active {
  color: var(--accent);
  border-color: rgba(15, 240, 252, 0.55);
  background: rgba(15, 240, 252, 0.07);
  text-shadow: 0 0 6px rgba(15, 240, 252, 0.6);
}
/* NOTE: these controls are clip-path'd to their border box, which clips the
   outline too — the ring must sit INSIDE the shape (negative offset) or it is
   invisible to keyboard users. Same trick as .maplibregl-canvas below. */
.tmap-chip:focus-visible,
.tmap-filters-toggle:focus-visible,
.tmap-btn:focus-visible,
.tmap-locate:focus-visible,
.tmap-clear-btn:focus-visible,
.tmap-sheet-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* desktop: chip groups flow inline and wrap, divider between groups
   (must sit AFTER the base chip rules — same specificity, source order wins) */
@media (min-width: 1024px) {
  .tmap-chiprow { flex: 0 0 auto; }
  .tmap-chiprow + .tmap-chiprow { margin-left: 16px; padding-left: 16px; border-left: 1px solid var(--border-subtle); }
  .tmap-chiplabel { width: auto; margin-right: 6px; }
}
/* mid-desktop: tighten chips so groups pair up instead of stacking 5 rows */
@media (min-width: 1024px) and (max-width: 1280px) {
  .tmap-chip { padding: 0 8px; font-size: 0.55rem; letter-spacing: 1px; }
  .tmap-chiprow + .tmap-chiprow { margin-left: 10px; padding-left: 10px; }
  .tmap-search-wrap { flex-basis: 180px; }
}

/* strip breakpoint matches the mobile body layout (1023px) so tablets never
   get the tall wrapped-rows topbar over a full-screen map */
@media (max-width: 1023px) {
  /* search + FILTERS share one line; flex-wrap covers pathologically narrow
     screens rather than a breakpoint */
  .tmap-topbar { position: relative; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px 8px; }
  .tmap-search-wrap { flex: 1 1 120px; min-width: 0; height: 40px; }
  /* the five chip groups collapse behind a FILTERS toggle; the old scrolling
     strip hid most groups off-screen no matter how loud the affordance got */
  .tmap-filters-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-soft);
    font-family: var(--font-head);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    cursor: pointer;
    clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
    transition: color 0.15s, border-color 0.15s;
  }
  .tmap-filters-prompt { color: var(--accent); opacity: 0.7; }
  .tmap-filters-toggle[aria-expanded="true"] {
    color: var(--accent);
    border-color: rgba(15, 240, 252, 0.55);
    background: rgba(15, 240, 252, 0.07);
  }
  .tmap-filters-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(15, 240, 252, 0.12);
    border: 1px solid rgba(15, 240, 252, 0.45);
    color: var(--accent);
    font-size: 0.58rem;
  }
  .tmap-filters-caret {
    margin-left: auto;
    color: var(--accent);
    font-size: 0.8rem;
    line-height: 1;
    transition: transform 0.2s;
  }
  .tmap-filters-toggle[aria-expanded="true"] .tmap-filters-caret { transform: rotate(180deg); }
  /* dropdown panel: anchored under the topbar, over the map — every chip
     visible, every group a wrapping row, zero sideways scrolling */
  .tmap-chipwrap {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 10px 12px 14px;
    background: var(--bg-deep);
    border-bottom: 1px solid rgba(15, 240, 252, 0.25);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.55);
    max-height: min(62vh, 430px);
    overflow-y: auto;
  }
  .tmap-chipwrap.is-open { display: block; }
  .tmap-chiprows { flex-flow: column nowrap; align-items: stretch; gap: 10px; }
  /* each group fits ONE line: zero-basis chips share the row equally and the
     type/padding scale with viewport width instead of the row wrapping.
     VIBE is the exception — 9 chips can't fit a phone line legibly. */
  .tmap-chiprow { flex-flow: row wrap; gap: 4px; overflow: visible; }
  .tmap-chiprow + .tmap-chiprow { padding-top: 10px; border-top: 1px solid var(--border-subtle); }
  .tmap-chiplabel { flex: 0 0 100%; width: auto; margin: 0 0 2px; }
  .tmap-chip {
    flex: 1 1 0;
    min-width: 0;
    height: 32px;
    padding: 0 clamp(2px, 0.8vw, 10px);
    font-size: clamp(0.48rem, 2.2vw, 0.6rem);
    letter-spacing: clamp(0.4px, 0.3vw, 1.2px);
    white-space: nowrap;
  }
  .tmap-chiprow[data-group="vibe"] .tmap-chip { flex: 1 1 auto; padding: 0 clamp(6px, 2vw, 12px); }
}

/* ---- split body ---------------------------------------------------------- */
.tmap-body {
  flex: 1;
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-columns: minmax(350px, 430px) 1fr;
}

/* ---- list panel (desktop column / mobile sheet) --------------------------- */
.tmap-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-deep);
  border-right: 1px solid var(--border-subtle);
  z-index: 30;
}
.tmap-sheet-handle { display: none; }
.tmap-count-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-black);
}
.tmap-count {
  font-family: var(--font-head);
  font-size: 0.62rem;
  letter-spacing: 1.8px;
  color: var(--text-muted);
}
.tmap-count b { color: var(--accent); font-weight: 700; }
.tmap-count.is-zero b { color: var(--accent-warn); }
.tmap-clear-btn {
  background: rgba(15, 240, 252, 0.07);
  border: 1px solid rgba(15, 240, 252, 0.45);
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 0.55rem;
  letter-spacing: 1px;
  padding: 5px 9px;
  cursor: pointer;
  clip-path: polygon(5px 0, 100% 0, 100% 100%, 0 100%, 0 5px);
}
.tmap-clear-btn:hover {
  border-color: var(--accent);
  background: rgba(15, 240, 252, 0.12);
  text-shadow: 0 0 6px rgba(15, 240, 252, 0.6);
}

.tmap-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}
.tmap-list::-webkit-scrollbar { width: 6px; }
.tmap-list::-webkit-scrollbar-thumb { background: var(--border-mid); }

.tmap-intro { padding: 4px 2px 14px; border-bottom: 1px dashed var(--border-subtle); margin-bottom: 12px; }
.tmap-intro-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 2px;
  color: var(--text-main);
  margin: 0 0 6px;
}
.tmap-intro-copy {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-dim);
  margin: 0;
}
.tmap-intro-copy a { color: var(--accent); opacity: 0.85; }
.tmap-intro-copy a:hover { opacity: 1; text-shadow: 0 0 6px rgba(15, 240, 252, 0.5); }

/* zero-results row inside the list */
.tmap-list-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  color: var(--accent-warn);
  border: 1px dashed rgba(255, 200, 0, 0.35);
  padding: 12px;
  margin: 4px 0 10px;
}

/* section header inside list (NO_FIX bucket) */
.tmap-list-section {
  font-family: var(--font-head);
  font-size: 0.58rem;
  letter-spacing: 2px;
  color: var(--text-faint);
  padding: 16px 2px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tmap-list-section::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }

/* hoisted venue group: sticky header pinned to the top of the list scroll */
.tmap-venuehead {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin: 0 0 8px;
  background: rgba(6, 20, 22, 0.97);
  border: 1px solid var(--accent);
  border-left-width: 3px;
  box-shadow: 0 0 14px rgba(15, 240, 252, 0.22), inset 0 0 10px rgba(15, 240, 252, 0.08);
}
.tmap-venuehead.is-engaging { animation: tmap-venuehead-engage 0.9s ease-out; }
@keyframes tmap-venuehead-engage {
  0% { box-shadow: 0 0 26px rgba(15, 240, 252, 0.85), inset 0 0 18px rgba(15, 240, 252, 0.35); }
  100% { box-shadow: 0 0 14px rgba(15, 240, 252, 0.22), inset 0 0 10px rgba(15, 240, 252, 0.08); }
}
/* group cards form one connected cyan block under the header */
.tmap-card.is-invenue {
  border-color: rgba(15, 240, 252, 0.25);
  border-left: 2px solid rgba(15, 240, 252, 0.75);
  background: rgba(15, 240, 252, 0.055);
}
.tmap-card.is-invenue:hover { border-color: rgba(15, 240, 252, 0.5); border-left-color: var(--accent); }
.tmap-venuehead-label {
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tmap-venuehead-x {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--border-mid);
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 1px;
  padding: 2px 6px;
  cursor: pointer;
}
.tmap-venuehead-x:hover,
.tmap-venuehead-x:focus-visible { border-color: var(--accent); text-shadow: 0 0 6px rgba(15, 240, 252, 0.5); }

/* ---- event card (compact horizontal) -------------------------------------- */
.tmap-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 9px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.tmap-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  transform: translateX(2px);
}
.tmap-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px; /* inside the clip-path — see note above */
}
.tmap-card.is-selected {
  border-color: rgba(15, 240, 252, 0.65);
  background: rgba(15, 240, 252, 0.05);
  box-shadow: 0 0 14px rgba(15, 240, 252, 0.18) inset, inset 3px 0 0 var(--accent);
}
.tmap-card-thumb {
  width: 64px;
  height: 84px;
  object-fit: cover;
  display: block;
  background: var(--bg-badge);
  filter: saturate(0.92);
}
.tmap-card-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tmap-card-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  color: var(--text-bright);
  letter-spacing: 0.3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-transform: uppercase;
}
.tmap-card-when {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-size: 0.58rem;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.tmap-when-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  transform: rotate(45deg);
  background: var(--accent);
}
.tmap-card[data-tier="soon"] .tmap-when-dot { box-shadow: 0 0 7px var(--accent); animation: tmap-net-blink 1.6s ease-in-out infinite; }
.tmap-card[data-tier="far"] .tmap-when-dot { background: var(--border-strong); box-shadow: none; }
.tmap-card[data-tier="soon"] .tmap-card-when { color: var(--accent); }
.tmap-card-venue {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tmap-card-tags { display: flex; gap: 5px; margin-top: auto; flex-wrap: wrap; }
.tmap-tag {
  font-family: var(--font-head);
  font-size: 0.5rem;
  letter-spacing: 1px;
  color: var(--text-soft);
  background: var(--bg-badge);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
}
.tmap-tag--state { color: var(--accent); border-color: rgba(15, 240, 252, 0.3); }
.tmap-tag--nofix { color: var(--accent-warn); border-color: rgba(255, 200, 0, 0.35); }
.tmap-tag--route { color: var(--text-bright); }
.tmap-tag--route-partial { border-left: 2px solid var(--accent-warn); }

/* ---- map area -------------------------------------------------------------- */
.tmap-mapwrap { position: relative; min-height: 0; overflow: hidden; }
.tmap-map { position: absolute; inset: 0; background: #050505; }
/* subtle vignette so the map edges recede into the chrome */
.tmap-mapwrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 90px 24px rgba(0, 0, 0, 0.55);
}

/* radar ping on first pin reveal */
.tmap-ping {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  z-index: 5;
  pointer-events: none;
  border: 1.5px solid rgba(15, 240, 252, 0.85);
  border-radius: 50%;
  animation: tmap-radar 1.4s cubic-bezier(0.1, 0.6, 0.3, 1) forwards;
}
@keyframes tmap-radar {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(38); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .tmap-ping { display: none; } }

/* corner coordinate readout */
.tmap-hud-tl {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  pointer-events: none;
}
.tmap-coords {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  display: inline-block;
}

/* top-right HUD button stack (locate + share) */
.tmap-hud-tr {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.tmap-locate {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: rgba(5, 5, 5, 0.85);
  border: 1px solid var(--border-mid);
  color: var(--text-soft);
  font-family: var(--font-head);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  transition: color 0.15s, border-color 0.15s;
}
.tmap-locate:hover { color: var(--accent); border-color: var(--border-color); }
.tmap-locate.is-active { color: var(--accent); border-color: rgba(15, 240, 252, 0.55); }
@media (max-width: 600px) {
  .tmap-locate-label { display: none; }
  .tmap-locate { padding: 0; width: 44px; justify-content: center; }
}
/* touch-first layouts (sheet UI active): full 44px targets even with labels */
@media (max-width: 1023px) {
  .tmap-locate { height: 44px; }
}

/* pin hover tooltip (desktop) */
.tmap-tip {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  max-width: 260px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(15, 240, 252, 0.35);
  padding: 7px 10px;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}
.tmap-tip b {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-bright);
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tmap-tip span {
  display: block;
  font-family: var(--font-head);
  font-size: 0.52rem;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-top: 2px;
}

/* maplibre control restyle */
.maplibregl-ctrl-group {
  background: rgba(5, 5, 5, 0.85) !important;
  border: 1px solid var(--border-mid);
  border-radius: 0 !important;
  box-shadow: none !important;
}
.maplibregl-ctrl-group button { background: transparent !important; border-radius: 0 !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--border-subtle) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(0.75); }
.maplibregl-ctrl button:hover .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib {
  background: rgba(0, 0, 0, 0.65) !important;
  font-family: var(--font-body);
  font-size: 10px !important;
  color: var(--text-faint) !important;
}
.maplibregl-ctrl-attrib a { color: var(--text-dim) !important; }
.maplibregl-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* pulsing diamond ping for <=48h pins. The MARKER element (.tmap-pulse-anchor)
   is a 0x0 box that MapLibre positions — never style its position/size/transform.
   The visual lives in the child, absolutely centered on the anchor point. */
.tmap-pulse-anchor { pointer-events: none; }
.tmap-pulse {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.tmap-pulse::before,
.tmap-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(15, 240, 252, 0.8);
  transform: rotate(45deg) scale(1);
  animation: tmap-ping 2.2s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
.tmap-pulse::after { animation-delay: 1.1s; }
/* cluster-sized beacon: same ping, scaled to wrap the cluster circle */
.tmap-pulse--lg {
  left: -17px;
  top: -17px;
  width: 34px;
  height: 34px;
}
@keyframes tmap-ping {
  0% { transform: rotate(45deg) scale(0.7); opacity: 0.9; }
  80%, 100% { transform: rotate(45deg) scale(2.6); opacity: 0; }
}

/* one-shot lock ping when a venue group engages */
.tmap-lockping {
  position: absolute;
  left: -22px;
  top: -22px;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--accent);
  transform: rotate(45deg) scale(0.3);
  opacity: 1;
  animation: tmap-lockping 0.85s ease-out forwards;
  pointer-events: none;
}
@keyframes tmap-lockping {
  to { transform: rotate(45deg) scale(1.5); opacity: 0; }
}

/* route focus: unrelated soon-pulses fade with the dimmed grid layers */
.tmap-pulse { transition: opacity 0.35s ease; }
.tmap-mapwrap.is-routefocus .tmap-pulse { opacity: 0.12; }

/* cruise route waypoint chips */
.tmap-wp {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  color: var(--bg-black);
  background: var(--accent);
  padding: 1px 5px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(15, 240, 252, 0.7);
  pointer-events: none;
}

/* user location ring */
.tmap-userdot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 12px var(--accent);
}

/* ---- preview card ------------------------------------------------------------ */
.tmap-preview {
  position: absolute;
  right: 14px;
  bottom: 26px;
  z-index: 6;
  width: 344px;
  max-width: calc(100% - 28px);
  background: rgba(5, 5, 5, 0.94);
  border: 1px solid rgba(15, 240, 252, 0.4);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: tmap-preview-in 0.22s ease-out;
}
@keyframes tmap-preview-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.tmap-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.tmap-preview-label {
  font-family: var(--font-head);
  font-size: 0.56rem;
  letter-spacing: 2px;
  color: var(--accent);
}
.tmap-preview-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.62rem;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 6px;
}
.tmap-preview-close:hover { color: var(--accent); }
.tmap-preview-main { display: grid; grid-template-columns: 86px 1fr; gap: 12px; padding: 12px; }
.tmap-preview-thumb { width: 86px; height: 112px; object-fit: cover; background: var(--bg-badge); }
.tmap-preview-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tmap-preview-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--text-main);
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tmap-preview-when {
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 1.2px;
  color: var(--accent);
}
.tmap-preview-venue { display: flex; gap: 6px; align-items: flex-start; line-height: 1.3; }
.tmap-venue-pin { flex: 0 0 auto; margin-top: 3px; color: var(--accent); opacity: 0.7; }
.tmap-venue-text { min-width: 0; display: flex; flex-direction: column; }
.tmap-venue-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tmap-venue-addr {
  font-size: 0.76rem;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* linked organiser chip in the preview (tap → /organiser/<handle>) */
.tmap-org-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--border-subtle);
  clip-path: polygon(5px 0, 100% 0, 100% 100%, 0 100%, 0 5px);
  min-width: 0;
  transition: border-color 0.15s, background 0.15s;
}
.tmap-org-chip:hover {
  border-color: rgba(15, 240, 252, 0.5);
  background: rgba(15, 240, 252, 0.06);
}
.tmap-org-chip:focus-visible {
  border-color: rgba(15, 240, 252, 0.5);
  background: rgba(15, 240, 252, 0.06);
  outline: 2px solid var(--accent);
  outline-offset: -2px; /* inside the clip-path */
}
.tmap-org-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(15, 240, 252, 0.3);
}
.tmap-org-av--mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 240, 252, 0.08);
  color: rgba(15, 240, 252, 0.85);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.7rem;
}
.tmap-org-name {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tmap-org-chip:hover .tmap-org-name { color: var(--accent); }
.tmap-org-go {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 0.85rem;
}
.tmap-org-chip:hover .tmap-org-go { color: var(--accent); }
.tmap-preview-route {
  font-family: var(--font-head);
  font-size: 0.54rem;
  letter-spacing: 1.2px;
  color: var(--text-bright);
  padding: 8px 12px 0;
  border-top: 1px dashed var(--border-subtle);
  margin-top: 2px;
}
.tmap-preview-stops {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 6px 12px 2px;
}
.tmap-stop {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tmap-stop b {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  color: var(--accent);
  font-weight: 700;
}
.tmap-stop--more { color: var(--text-faint); }
.tmap-stop--nofix { color: var(--text-faint); }
.tmap-stop--nofix b { color: var(--text-faint); }
.tmap-stop-nofix {
  font-family: var(--font-head);
  font-size: 0.5rem;
  letter-spacing: 1px;
  color: var(--accent-warn);
  border: 1px solid rgba(255, 200, 0, 0.35);
  padding: 1px 4px;
  vertical-align: 1px;
}
.tmap-route-nofix { color: var(--accent-warn); }
/* screen-reader-only text (unplotted stop rows) */
.tmap-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tmap-preview-cta {
  display: block;
  margin: 0 12px 12px;
  padding: 11px 0;
  text-align: center;
  font-family: var(--font-head);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--bg-black);
  background: var(--accent);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
  transition: box-shadow 0.15s;
}
.tmap-preview-cta:hover { box-shadow: 0 0 18px rgba(15, 240, 252, 0.55); }

/* desktop: the dossier card is the main reading surface next to a huge map —
   scale it up and stack route stops one per line so it reads at a glance */
@media (min-width: 1024px) {
  .tmap-preview { width: 400px; right: 18px; bottom: 30px; }
  .tmap-preview-label { font-size: 0.6rem; }
  .tmap-preview-main { grid-template-columns: 104px 1fr; gap: 14px; padding: 14px; }
  .tmap-preview-thumb { width: 104px; height: 136px; }
  .tmap-preview-title { font-size: 1.1rem; }
  .tmap-preview-when { font-size: 0.66rem; }
  .tmap-venue-name { font-size: 0.9rem; }
  .tmap-venue-addr { font-size: 0.8rem; }
  .tmap-preview-route { font-size: 0.58rem; padding: 10px 14px 0; }
  .tmap-preview-stops { flex-direction: column; align-items: flex-start; gap: 5px; padding: 8px 14px 4px; }
  .tmap-preview-cta { font-size: 0.72rem; padding: 13px 0; margin: 6px 14px 14px; }
}

/* ---- empty state ---------------------------------------------------------------- */
.tmap-empty {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 5, 0.45);
  pointer-events: none;
}
.tmap-empty-box {
  pointer-events: auto;
  text-align: center;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--border-mid);
  padding: 26px 34px;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.tmap-empty-title {
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--accent-warn);
  margin-bottom: 6px;
}
.tmap-empty-copy { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 14px; }
.tmap-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 10px 18px;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}
.tmap-btn:hover { background: rgba(15, 240, 252, 0.08); }

/* ---- boot overlay ------------------------------------------------------------------ */
.tmap-boot {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease 0.15s;
}
.tmap-boot.is-done { opacity: 0; pointer-events: none; }
.tmap-boot-inner { width: min(340px, 80%); }
.tmap-boot-line {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0;
  margin-bottom: 8px;
  animation: tmap-boot-line 0.3s ease forwards;
}
.tmap-boot-line:nth-child(1) { animation-delay: 0.1s; }
.tmap-boot-line:nth-child(2) { animation-delay: 0.55s; }
.tmap-boot-line:nth-child(3) { animation-delay: 1s; }
@keyframes tmap-boot-line { to { opacity: 0.85; } }
.tmap-boot-bar {
  height: 3px;
  background: var(--bg-badge);
  margin-top: 14px;
  overflow: hidden;
}
.tmap-boot-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: tmap-boot-sweep 1.1s ease-in-out infinite;
}
@keyframes tmap-boot-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ---- toast ------------------------------------------------------------------ */
.tmap-toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 9;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  font-family: var(--font-head);
  font-size: 0.6rem;
  letter-spacing: 1.2px;
  padding: 10px 16px;
  white-space: nowrap;
}

/* ============================================================================
   MOBILE: full-screen map + bottom sheet  (< 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
  .tmap-body { display: block; }
  .tmap-mapwrap { position: absolute; inset: 0; }

  .tmap-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: 86%;
    border-right: none;
    border-top: 1px solid rgba(15, 240, 252, 0.35);
    background: rgba(5, 5, 5, 0.97);
    z-index: 30;
    transform: translateY(calc(100% - 92px));
    transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.35, 1);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
    touch-action: none;
  }
  /* 28% keeps ~55% of the screen for results — must track HALF_VISIBLE in map.js */
  .tmap-panel.is-half { transform: translateY(28%); }
  .tmap-panel.is-full { transform: translateY(0); }
  .tmap-panel.is-dragging { transition: none; }
  .tmap-list, .tmap-count-line { touch-action: pan-y; }

  .tmap-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 26px;
    background: none;
    border: none;
    cursor: grab;
    padding: 0;
  }
  .tmap-handle-bar {
    width: 52px;
    height: 4px;
    background: var(--text-dim);
    box-shadow: 0 0 6px rgba(15, 240, 252, 0.25);
    clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  }

  /* lift map controls + attribution clear of the collapsed sheet */
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: 96px; }

  /* preview sits above the collapsed sheet bar */
  .tmap-preview { right: 10px; left: 10px; bottom: 104px; width: auto; }
  /* tablets: don't stretch the dossier card across the whole screen */
  @media (min-width: 600px) {
    .tmap-preview { left: auto; width: 400px; }
  }

  /* 16px stops iOS Safari from auto-zooming the search field on focus */
  .tmap-search { font-size: 1rem; }

  .tmap-coords { font-size: 0.56rem; }
  .tmap-hud-tl { top: 8px; left: 8px; }
  .tmap-hud-tr { top: 8px; right: 8px; }

  /* the sheet is a signal surface on phones — the descriptive copy is SEO/orientation
     text that costs ~77px above the first card. It stays in the DOM (crawlers read it,
     desktop shows it); only the h1 survives on screen to title the sheet.
     Scoped to the intro block — the noscript fallback reuses .tmap-intro-copy. */
  .tmap-intro > .tmap-intro-copy { display: none; }
  /* once a venue/event is locked, even the title yields to the event cards */
  .tmap-panel.is-engaged .tmap-intro { display: none; }

  /* compact chrome: small screens spend their pixels on signal, not padding
     (bottom padding keeps sheet content clear of the iOS home indicator) */
  .tmap-count-line { padding: 6px 12px; }
  .tmap-list { padding: 8px 10px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .tmap-intro { padding: 2px 2px 10px; margin-bottom: 8px; }
  .tmap-intro-copy { font-size: 0.82rem; }
  .tmap-card { padding: 7px; gap: 10px; margin-bottom: 6px; }
  .tmap-venuehead { padding: 6px 8px; }
  .tmap-preview-head { padding: 6px 10px; }
  .tmap-preview-main { gap: 10px; padding: 10px; }
  .tmap-preview-route { padding: 6px 10px 0; }
  .tmap-preview-stops { padding: 5px 10px 2px; gap: 3px 8px; }
}

/* very narrow phones */
@media (max-width: 380px) {
  /* the search field already carries a >> prompt — reclaim the width */
  .tmap-filters-prompt { display: none; }
  .tmap-hud-tl { display: none; }
  .tmap-preview-main { grid-template-columns: 72px 1fr; }
  .tmap-preview-thumb { width: 72px; height: 94px; }
}

/* landscape phones / short viewports: compress chrome, keep the map usable */
@media (max-height: 520px) and (max-width: 1023px) {
  .tmap-topbar { gap: 10px; padding: 6px 10px; }
  .tmap-search-wrap { height: 36px; }
  .tmap-filters-toggle { height: 36px; }
  .tmap-chip { height: 30px; }
  .tmap-intro { display: none; }
  .tmap-panel { transform: translateY(calc(100% - 66px)); }
  .tmap-panel.is-half { transform: translateY(30%); }
  .tmap-preview { bottom: 78px; }
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: 70px; }
}

/* ---- reduced motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .tmap-net-dot,
  .tmap-card[data-tier="soon"] .tmap-when-dot,
  .tmap-pulse::before,
  .tmap-pulse::after,
  .tmap-boot-bar span { animation: none !important; }
  .tmap-pulse::before { opacity: 0.5; transform: rotate(45deg) scale(1.4); }
  .tmap-pulse::after { display: none; }
  .tmap-preview { animation: none; }
  .tmap-panel { transition: none; }
  .tmap-boot { transition-duration: 0.01s; }
  .tmap-boot-line { animation-duration: 0.01s; animation-delay: 0s; }
}
