/* Murder Map — case-level map in the Rapetrail shell family. */
.murdermap { display: grid; gap: 1.2rem; padding-top: 1.5rem; }
.murdermap h1, .murdermap h2, .murdermap h3, .murdermap p { margin-top: 0; }

.murdermap-filters, .murdermap-patterns {
  padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-strong);
}
.murdermap-filters h2, .murdermap-patterns h2 { margin-bottom: 0.55rem; font-family: var(--display); line-height: 1.2; }
.murdermap-patterns p { color: var(--muted); line-height: 1.6; }
.murdermap-patterns h3 { margin: 1rem 0 0.5rem; font-family: var(--display); }

.mm-reset {
  min-height: 2.2rem; padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-md);
  color: var(--ink); background: var(--surface-soft); font: 700 0.82rem var(--body); cursor: pointer;
}
.mm-reset:hover { border-color: var(--accent); }

.mm-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 0.8rem; }
.mm-filter { margin: 0; min-width: 0; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius-md); display: grid; gap: 0.35rem; align-content: start; }
.mm-filter legend { padding: 0 0.25rem; color: var(--signal); font: 700 0.78rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.mm-filter label { display: flex; gap: 0.45rem; align-items: center; min-width: 0; font: 600 0.85rem var(--body); cursor: pointer; }
.mm-filter input { accent-color: var(--accent); }
.mm-filter select {
  min-height: 2.1rem; max-width: 100%; min-width: 0; flex: 1 1 auto; padding: 0 0.4rem; border: 1px solid var(--line); border-radius: var(--radius-md);
  color: var(--ink); background: var(--bg-deep); font: 500 0.88rem var(--body);
}
.mm-filter__note { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.mm-count { margin: 0.9rem 0 0; font: 700 0.92rem var(--body); color: var(--signal); }

.murdermap-map-shell {
  position: relative; isolation: isolate; min-height: 34rem; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: #e8e2d6;
}
.murdermap-map { height: 34rem; width: 100%; }
.murdermap-map .maplibregl-control-container { font-family: var(--body); }
.murdermap-map .maplibregl-ctrl-group { background: var(--surface-strong); }
.murdermap-map .maplibregl-ctrl-group button { border-color: var(--line); }
.murdermap-map .maplibregl-ctrl-attrib { color: #132b31; background: rgba(255, 254, 250, 0.85); }
.murdermap-map .maplibregl-ctrl-scale { color: #181211; background: rgba(255, 254, 250, 0.75); border-color: #181211; }

.mm-top-areas { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.mm-top-areas li { display: flex; justify-content: space-between; max-width: 26rem; font: 600 0.9rem var(--body); }
.mm-top-areas strong { color: var(--accent-deep); }

.murdermap-map .maplibregl-popup-content { border-radius: var(--radius-md); padding: 0.9rem 1rem; background: #fffefa; color: #181211; box-shadow: var(--shadow-soft); }
.mm-popup h3 { margin: 0 0 0.35rem; font: 700 1.02rem var(--display); }
.mm-popup__tier { margin: 0 0 0.6rem; color: #5f544e; font-size: 0.8rem; line-height: 1.45; }
.mm-popup dl { display: grid; gap: 0.3rem; margin: 0 0 0.6rem; }
.mm-popup dl div { display: grid; grid-template-columns: 8.2rem 1fr; gap: 0.5rem; }
.mm-popup dt { color: #5f544e; font: 700 0.74rem var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.mm-popup dd { margin: 0; font: 600 0.84rem var(--body); }
.mm-popup__src { margin: 0; color: #5f544e; font-size: 0.78rem; line-height: 1.5; }
.mm-popup__src a { color: #143d50; }
.mm-popup__removal { margin: 0.65rem 0 0; padding-top: 0.55rem; border-top: 1px solid #e3dccd; font: 700 0.84rem var(--body); }
.mm-popup__removal a { color: #8a3b12; }

.murdermap-filters :focus-visible, .mm-reset:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Counts layer — "Every state, counted". Rendered from
   counts-state-year.json by the template; styles reuse the shell variables. */
.mm-counts { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mm-counts h2 { margin-bottom: 0.55rem; font-family: var(--display); line-height: 1.2; }
.mm-counts h3 { margin: 1rem 0 0.4rem; font-family: var(--display); }
.mm-counts p { color: var(--muted); line-height: 1.6; }
.mm-counts__list { margin: 0.8rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; }
.mm-counts__row { padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.mm-counts__head { display: flex; justify-content: space-between; gap: 0.6rem; font: 600 0.9rem var(--body); }
.mm-counts__head strong { color: var(--accent-deep); white-space: nowrap; }
.mm-counts__status { margin: 0.25rem 0 0; font-size: 0.82rem; }
.mm-counts__flag { margin: 0.25rem 0 0; color: var(--signal); font-size: 0.82rem; line-height: 1.5; }
.mm-counts :focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Tier 2 — Reported Cases (design SS8). Appended; no
   existing rule touched. The Tier 2 colour matches the hollow-pin
   stroke colour in murdermap-map.mjs (#6b4fa1). */

.mm-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; align-items: center; margin: 0.7rem 0 0; font: 600 0.85rem var(--body); color: var(--muted); }
.mm-legend__item { display: inline-flex; gap: 0.45rem; align-items: center; }
.mm-legend__dot { width: 0.95rem; height: 0.95rem; border-radius: 50%; background: #ba5d31; border: 1.5px solid #fffdf8; box-shadow: 0 0 0 1px var(--line); flex: none; }
.mm-legend__ring { width: 0.95rem; height: 0.95rem; border-radius: 50%; background: transparent; border: 3px solid #6b4fa1; flex: none; }

/* SS8 is silent on popup height. A Reported popup's mandatory
   provenance block + short form runs ~680px — taller than the map
   frame (34rem) — and the part past the frame is hidden behind the
   page sections below the map (verified in the staging render; see
   PREVIEW-NOTES). Build choice, flagged for Faith's ruling: popup
   content scrolls internally, so every mandatory element stays
   reachable in place. */
.murdermap-map .maplibregl-popup-content { max-height: min(76vh, 38rem); overflow-y: auto; }

.mm-popup__reported-header {
  margin: 0 0 0.5rem; padding: 0.35rem 0.55rem; border: 1.5px solid #6b4fa1; border-radius: var(--radius-md);
  color: #4a2f73; background: #f2edfa; font: 700 0.8rem var(--body); letter-spacing: 0.02em;
}

.mm-tier2 { margin-top: 1.4rem; padding: 1rem 1.1rem; border: 1px solid #6b4fa1; border-left: 5px solid #6b4fa1; border-radius: var(--radius-md); background: var(--surface-soft); }
.mm-tier2 h2 { margin-bottom: 0.55rem; font-family: var(--display); line-height: 1.25; }
.mm-tier2 h3 { margin: 1rem 0 0.4rem; font-family: var(--display); }
.mm-tier2 p { color: var(--muted); line-height: 1.6; }
.mm-tier2 dl { display: grid; gap: 0.3rem; margin: 0.6rem 0; }
.mm-tier2 dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem; }
.mm-tier2 dt { color: var(--muted); font: 700 0.74rem var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.mm-tier2 dd { margin: 0; font: 600 0.88rem var(--body); }
.mm-tier2__disclosure { padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-strong); }
.mm-tier2 :focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

@media (max-width: 720px) {
  .murdermap-map, .murdermap-map-shell { min-height: 26rem; height: 26rem; }
  .mm-popup dl div { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* Tier 3 — Community Reports (design TIER3-DESIGN.md SS6,
   approved 2026-11-15). Appended; no existing rule touched.
   The teal matches the pin fill in murdermap-map.mjs (#0e7a6d). */
.mm-legend__teal { width: 0.95rem; height: 0.95rem; border-radius: 50%; background: #0e7a6d; border: 1.5px solid #fffdf8; box-shadow: 0 0 0 1px var(--line); flex: none; }
.mm-popup__community-header {
  margin: 0 0 0.5rem; padding: 0.35rem 0.55rem; border: 1.5px solid #0e7a6d; border-radius: var(--radius-md);
  color: #0a5a50; background: #e6f4f1; font: 700 0.8rem var(--body); letter-spacing: 0.02em;
}
.mm-tier3 { margin-top: 1.4rem; padding: 1rem 1.1rem; border: 1px solid #0e7a6d; border-left: 5px solid #0e7a6d; border-radius: var(--radius-md); background: var(--surface-soft); }
.mm-tier3 h2 { margin-bottom: 0.55rem; font-family: var(--display); line-height: 1.25; }
.mm-tier3 h3 { margin: 1rem 0 0.4rem; font-family: var(--display); }
.mm-tier3 p { color: var(--muted); line-height: 1.6; }
.mm-tier3 dl { display: grid; gap: 0.3rem; margin: 0.6rem 0; }
.mm-tier3 dl div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.5rem; }
.mm-tier3 dt { color: var(--muted); font: 700 0.74rem var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.mm-tier3 dd { margin: 0; font: 600 0.88rem var(--body); }
.mm-tier3__disclosure { padding: 0.7rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-strong); }
.mm-tier3 :focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Detective Board skin (Faith's pick, Mock 2, 2026-11-16).
   Appended; no existing rule touched. The LOOK only: aged
   case-file paper, ink lines, paper cards, typewriter labels,
   the purple PUBLIC RECORDS ONLY stamp. The mock's invented
   words (open cases, suspect routes, statuses, export) are NOT
   carried over — this map is public-records listings.
   Palette: cream #f1ead9 / #f6efdd, ink #26221c, purple
   #7b2ff7, brass pin #a07d2c (matches murdermap-map.mjs). */
.murdermap {
  --mm-paper: #f6efdd; --mm-paper-hi: #fffdf7; --mm-ink: #26221c;
  --mm-purple: #7b2ff7; --mm-brass: #a07d2c;
  --mm-type: "Special Elite", "Courier New", monospace;
}

/* Board frame around the map: cork-tone mat, ink rule, brass
   pins in the two top corners (pseudo-elements). */
.murdermap-map-shell {
  border: 3px solid #8a6d3b; border-radius: 6px; background: #e9dfc8;
  box-shadow: inset 0 0 0 8px #d9c9a3, inset 0 0 0 10px rgba(38, 34, 28, 0.45), var(--shadow-soft);
}
.murdermap-map-shell::before, .murdermap-map-shell::after {
  content: ""; position: absolute; top: 7px; z-index: 3; width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e8cd85, var(--mm-brass) 62%, #6e5518);
  border: 1px solid rgba(38, 34, 28, 0.65); box-shadow: 0 1px 2px rgba(38, 34, 28, 0.5); pointer-events: none;
}
/* Along the top edge only, clear of the navigation control. */
.murdermap-map-shell::before { left: 7px; }
.murdermap-map-shell::after { right: 56px; }

/* Case-file cards: the filter panel and the patterns panel sit
   on case-file paper with an ink edge and a washi-tape strip. */
.murdermap-filters, .murdermap-patterns {
  position: relative; background: linear-gradient(178deg, var(--mm-paper-hi), var(--mm-paper) 55%);
  border: 1.5px solid rgba(38, 34, 28, 0.55); border-radius: 4px;
  box-shadow: 0 2px 5px rgba(74, 58, 28, 0.18);
}
.murdermap-filters::before, .murdermap-patterns::before {
  content: ""; position: absolute; top: -11px; left: 50%; width: 118px; height: 22px;
  transform: translateX(-50%) rotate(-1.6deg);
  background: rgba(217, 207, 240, 0.75); border-left: 1px dashed rgba(38, 34, 28, 0.25); border-right: 1px dashed rgba(38, 34, 28, 0.25);
  pointer-events: none;
}
.murdermap-filters h2, .murdermap-patterns h2 { font-family: var(--mm-type); letter-spacing: 0.03em; }

/* Index cards inside the file: one card per filter group,
   typewriter legends pinned like card labels. */
.mm-filter { background: var(--mm-paper-hi); border: 1px solid rgba(38, 34, 28, 0.45); border-radius: 3px; box-shadow: 0 1px 2px rgba(74, 58, 28, 0.14); }
.mm-filter legend { font-family: var(--mm-type); color: var(--mm-ink); letter-spacing: 0.06em; }
.mm-count { font-family: var(--mm-type); color: var(--mm-ink); letter-spacing: 0.02em; }
.mm-reset { font-family: var(--mm-type); background: var(--mm-paper); border: 1.5px solid rgba(38, 34, 28, 0.55); border-radius: 3px; box-shadow: 2px 2px 0 rgba(38, 34, 28, 0.8); }
.mm-reset:hover { border-color: var(--mm-purple); color: var(--mm-purple); }
.mm-top-areas strong { font-family: var(--mm-type); }

/* Case popups as case-file cards: paper ground, ink edge, a
   folder tab across the top. Content and fields are the
   popup builders' own — styling only. */
.murdermap-map .maplibregl-popup-content {
  background: linear-gradient(178deg, var(--mm-paper-hi), var(--mm-paper) 60%);
  border: 1.5px solid rgba(38, 34, 28, 0.6); border-radius: 4px;
  box-shadow: 0 4px 14px rgba(74, 58, 28, 0.3); padding-top: 1.35rem; position: relative;
}
.murdermap-map .maplibregl-popup-content::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 9px;
  background: var(--mm-paper); border-bottom: 1.5px solid rgba(38, 34, 28, 0.6); border-radius: 4px 4px 0 0;
}
.murdermap-map .maplibregl-popup-tip { border-top-color: var(--mm-paper) !important; border-bottom-color: var(--mm-paper) !important; }
.mm-popup dt { font-family: var(--mm-type); color: #4c463c; letter-spacing: 0.04em; }
.mm-popup__removal { border-top: 1.5px dashed rgba(38, 34, 28, 0.4); }

/* The safety exit: a solid purple pill, as on the Rapetrail
   toolbar. The child theme's readability layer flattens
   .rapetrail-exit with background:var(--panel) !important
   (v0.2.6), which left this pill cream with a purple outline;
   the board fill must outrank it. */
.murdermap .rapetrail-exit {
  background: var(--mm-purple) !important; color: #fffdf7 !important;
  border: 1px solid #6d28e0; border-radius: 999px;
  font-family: var(--mm-type); font-weight: 400; letter-spacing: 0.07em;
  padding-inline: 1.05rem; box-shadow: 0 3px 0 rgba(38, 34, 28, 0.35);
}
.murdermap .rapetrail-exit:hover { background: #6d28e0 !important; border-color: #6d28e0; }

/* The stamp — the mock's one piece of real text, in the
   corrections section: purple ink, rotated, double rule. */
.mm-stamp {
  display: inline-block; margin: 0.4rem 0 0.2rem; padding: 0.3rem 0.7rem;
  font-family: var(--mm-type); font-size: 1.02rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mm-purple); border: 3px double var(--mm-purple); border-radius: 6px;
  transform: rotate(-4deg); opacity: 0.88; background: rgba(123, 47, 247, 0.05);
}

/* Reorder guard (2026-11-20): the map section is now a direct
   child of .murdermap (Faith's page order: intro, map, search,
   then everything else). rapetrail.css's max-width:1080px block
   sets .rapetrail-map-section { order: 2 } for the old flattened
   in-layout arrangement; as a top-level grid item that value
   would drop the map below the layout block on small screens.
   Pin the moved section to DOM order. Placement only — no
   visual property changes. */
@media (max-width: 1080px) {
  .murdermap > .rapetrail-map-section { order: 0; }
}
