/* GTA 6 map tool, design A v2: night background, sunset-pink road signs. Colours only from the theme variables in style.css. */

/* ---------- hero: intro + filter panel on the left, map on the right; shorter than the window so the next section shows ---------- */
/* the same column as .wrap (and so the site header): max --wrap-max wide, --gutter on each side */
.gm-page .gm-list-wrap, .gm-page .gm-sell, .gm-intro-top, .gm-map-note, .gm-hero-sub { width: min(calc(var(--wrap-max) - 2 * var(--gutter)), calc(100% - 2 * var(--gutter))); margin-left: auto; margin-right: auto; }
.gm-hero { display: grid; grid-template-columns: 424px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100vh - var(--head-h, 64px) - 160px); min-height: 560px; max-height: 880px; border-bottom: 1px solid var(--line); }
.gm-intro { grid-column: 1; grid-row: 1; padding: 22px 28px 12px; border-right: 1px solid var(--line); }
.gm-intro h1 { font-size: 34px; margin: 0; }
.gm-intro .lead { margin: 10px 0 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.gm-intro .callout { margin-top: 12px; }
.gm { display: contents; }
.gm-side { grid-column: 1; grid-row: 2; min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); padding: 4px 28px 24px; scrollbar-color: var(--line) transparent; }
.gm-map-wrap { grid-column: 2; grid-row: 1 / 3; position: relative; min-height: 0; isolation: isolate; }   /* keeps Leaflet's z-index 1000 controls under the sticky site header */
.gm-map { position: absolute; inset: 0; background: var(--sea); }

/* ---------- map sub-pages (/map/…): answer and table first, the map below them ---------- */
.gm-intro-top { padding: 28px 0 0; border-right: 0; }
.gm-intro-top .lead { max-width: 780px; }
.gm-jump { display: inline-block; margin-top: 14px; padding: 10px 16px 8px; border: 2px solid var(--primary); border-radius: 8px; color: var(--primary); font-weight: 800; text-decoration: none; }
.gm-jump:hover, .gm-jump:focus-visible { background: var(--primary); color: var(--on-primary); }
.gm-map-section { margin-top: 40px; scroll-margin-top: var(--head-h, 64px); }
.gm-map-section .gm-map { scroll-margin-top: calc(var(--head-h, 64px) + 8px); }   /* scrollMapIntoView targets .gm-map; keep it clear of the sticky header */
.gm-map-note { margin-top: 0; margin-bottom: 12px; color: var(--muted); }
/* sub-page map: full width; the filter panel floats over its right edge and starts folded (home keeps the fixed left panel) */
/* the map sits inside the content column, not edge to edge: the margins on both sides let people scroll the page past it */
.gm-hero-sub { display: block; position: relative; border-bottom: 0; }
.gm-hero-sub .gm-map-wrap { position: absolute; inset: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gm-filters-btn { position: absolute; z-index: 3; top: 12px; right: 16px; padding: 10px 16px 8px; border: 2px solid var(--primary); border-radius: 8px; background: var(--bg-deep); color: var(--primary); font: inherit; font-weight: 800; cursor: pointer; }
.gm-filters-btn:hover, .gm-filters-btn:focus-visible, .gm-filters-btn[aria-expanded="true"] { background: var(--primary); color: var(--on-primary); }
.gm-hero-sub .gm-side { display: none; position: absolute; z-index: 2; top: 64px; right: 16px; bottom: 16px; width: 360px; padding: 16px 20px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-deep); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.gm-filters-open .gm-hero-sub .gm-side { display: block; }
.gm .leaflet-container { font: inherit; font-family: var(--font-body); }

/* search */
.gm-search-box { position: relative; }
.gm-search { width: 100%; height: 48px; padding: 0 14px; border-radius: 8px; border: 2px solid var(--muted); background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.gm-search::placeholder { color: var(--muted); opacity: .85; }
.gm-search:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.gm-results { margin-top: 6px; max-height: 260px; overflow-y: auto; border: 1.5px solid var(--primary); border-radius: 8px; background: var(--bg-deep); }
.gm-hit { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 12px 7px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 15px; cursor: pointer; }
.gm-hit:last-child { border-bottom: 0; }
.gm-hit:hover, .gm-hit:focus-visible { background: var(--card); outline: none; box-shadow: inset 3px 0 0 var(--primary); }
.gm-hit small { display: block; color: var(--muted); font-size: 13px; }
.gm-hit .gm-dot { margin-top: 5px; }
.gm-empty { margin: 0; padding: 9px 12px; font-size: 14px; color: var(--muted); }

/* the six everyday layers: one pink road sign, two columns, counts right-aligned */
.gm-signs { list-style: none; margin: 12px 0 0; padding: 5px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 4px; background: var(--primary); border-radius: var(--radius); box-shadow: inset 0 0 0 2px var(--on-primary), 0 0 0 2px var(--primary); }
.gm-signs li { min-width: 0; }
.gm-signs li:nth-child(n+3) { border-top: 1px solid color-mix(in srgb, var(--on-primary) 22%, transparent); }
.gm-sign { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 7px; width: 100%; min-height: 44px; padding: 6px 7px 4px; background: none; border: 0; border-radius: 6px; color: var(--on-primary); font: inherit; font-size: 14.5px; font-weight: 800; line-height: 1.2; text-align: left; white-space: nowrap; cursor: pointer; }
.gm-sign:hover { background: var(--primary-dark); }
.gm-sign:focus-visible { outline: 3px solid var(--on-primary); outline-offset: -3px; }
.gm-sign .gm-sign-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--on-primary); background: var(--c); margin-top: -2px; }
.gm-sign .gm-sign-name { overflow: hidden; text-overflow: ellipsis; }
.gm-sign .gm-sign-n { font-size: 15px; font-variant-numeric: tabular-nums; }
.gm-sign[aria-pressed="false"] { color: color-mix(in srgb, var(--on-primary) 72%, transparent); }
.gm-sign[aria-pressed="false"] .gm-sign-dot { background: transparent; border-color: color-mix(in srgb, var(--on-primary) 50%, transparent); }
.gm-sign[aria-pressed="false"] .gm-sign-n { text-decoration: line-through; text-decoration-thickness: 2px; }

/* show all / hide all / hide found */
.gm-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 15px; }
.gm-btn { min-height: 34px; padding: 6px 10px 4px; border-radius: 6px; border: 1.5px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.gm-btn:hover { border-color: var(--muted); }
.gm-btn:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.gm-check { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; color: var(--text); cursor: pointer; min-height: 32px; }
.gm-check input, .gm-list input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--lime); }
.gm-found-count { color: var(--muted); font-size: 15px; }

/* every category, grouped and expandable */
.gm-all { margin-top: 16px; }
.gm-all-toggle { display: none; }
.gm-all-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; color: var(--cream); }
.gm-group { border-top: 1px solid var(--line); }
.gm-group:last-child { border-bottom: 1px solid var(--line); }
.gm-group > summary { list-style: none; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 14px; gap: 10px; align-items: center; padding: 11px 2px 9px; cursor: pointer; font-weight: 700; font-size: 16px; }
.gm-group > summary::-webkit-details-marker { display: none; }
.gm-group > summary input { width: 18px; height: 18px; margin: 0; accent-color: var(--c); cursor: pointer; }
.gm-group-n { color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gm-chev { width: 12px; height: 8px; color: var(--muted); transition: transform .15s; }
.gm-group[open] .gm-chev, .gm-all[open] > summary .gm-chev { transform: rotate(180deg); }
.gm-group ul { list-style: none; margin: 0 0 10px; padding: 0 0 0 30px; }
.gm-cat { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 36px; padding: 6px 2px 4px; font-size: 15px; cursor: pointer; }
.gm-cat input { width: 16px; height: 16px; margin: 0; accent-color: var(--c); }
.gm-count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.gm-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.gm-group > summary .gm-dot { margin-right: 8px; vertical-align: 1px; }

/* map overlays */
.gm-status { position: absolute; left: 12px; bottom: 12px; z-index: 500; max-width: calc(100% - 24px); margin: 0; padding: 7px 12px 5px; border-radius: 8px; background: var(--bg-deep); color: var(--text); font-size: 14px; line-height: 1.4; pointer-events: none; }
.gm .leaflet-bar a { background: var(--bg-deep); color: var(--text); border-bottom-color: var(--line); }
.gm .leaflet-bar a:hover { background: var(--card); color: var(--cream); }
.gm .leaflet-bar a.leaflet-disabled { background: var(--bg-deep); color: var(--line); }
.gm .leaflet-touch .leaflet-bar, .gm .leaflet-bar { border: 2px solid var(--primary); }

/* town plates on the map */
.leaflet-div-icon.gm-town-icon { background: none; border: 0; }
.gm-town { width: max-content; transform: translate(-50%, -50%); padding: 3px 8px 1px; background: var(--primary); color: var(--on-primary); border: 2px solid var(--on-primary); border-radius: 6px; font-weight: 800; font-size: 14px; line-height: 1.3; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.35); pointer-events: none; }
.gm-town.r { transform: translate(6px, -50%); }
.gm-town.l { transform: translate(calc(-100% - 6px), -50%); }
.gm-town.b { transform: translate(-50%, 6px); }

/* popup */
.gm .leaflet-popup-content-wrapper, .gm .leaflet-popup-tip { background: var(--bg-deep); color: var(--text); box-shadow: 0 0 0 1.5px var(--primary), 0 8px 24px rgba(0,0,0,.4); }
.gm .leaflet-popup-content-wrapper { border-radius: 8px; }
.gm .leaflet-popup-content { margin: 14px 16px; font-size: 15px; line-height: 1.45; min-width: 200px; }
.gm .leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.gm .leaflet-container a.leaflet-popup-close-button:hover { color: var(--cream); }
.gm-pop-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.gm-pop-cat i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.gm-pop strong { display: block; margin: 4px 0 6px; font-size: 17px; font-weight: 800; color: var(--cream); }
.gm-pop-desc { margin: 0 0 10px; color: var(--muted); max-width: 260px; }
.gm-pop-actions { display: flex; gap: 14px; align-items: center; }
.gm-pop .gm-check { font-weight: 700; }
.gm-copy { min-height: 30px; padding: 4px 10px 2px; border: 1.5px solid var(--primary); border-radius: 6px; background: transparent; color: var(--primary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.gm-copy:hover { background: var(--primary); color: var(--on-primary); }
.gm .leaflet-tooltip { background: var(--bg-deep); color: var(--text); border: 1px solid var(--primary); font-weight: 700; }
.gm .leaflet-tooltip-top::before { border-top-color: var(--primary); }

/* ---------- lists under the map (map pages) ---------- */
.gm-list-wrap, .gm-sell { margin-top: 40px; }
.gm-list-wrap h2, .gm-sell h2 { margin-top: 0; }
.gm-list-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gm-progress { font-weight: 800; color: var(--lime); }
.gm-list { width: 100%; border-collapse: collapse; font-size: 15px; border-top: 2px solid var(--muted); }
/* a long location name can make the table a few pixels wider than a phone; scroll the table, never the page */
.gm-list-wrap { overflow-x: auto; }
.gm-list th, .gm-list td { text-align: left; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.gm-list th { color: var(--muted); font-weight: 700; font-size: 14px; }
.gm-list tr[data-point], .gm-list tr[data-town] { cursor: pointer; }
.gm-list tbody tr:hover { background: var(--card); }
.gm-list tr.gm-row-done td:not(:first-child) { color: var(--muted); text-decoration: line-through; }
.gm-list td.gm-num, .gm-list th.gm-num { text-align: right; font-variant-numeric: tabular-nums; }
.gm-list .gm-go { text-align: right; white-space: nowrap; }
.gm-go-plate { display: inline-block; padding: 3px 9px 1px; border: 2px solid var(--primary); border-radius: 6px; color: var(--primary); font-size: 13px; font-weight: 800; white-space: nowrap; transition: background .15s, color .15s; }
.gm-list tbody tr:hover .gm-go-plate { background: var(--primary); color: var(--on-primary); }
.gm-plate { display: inline-block; padding: 3px 9px 1px; border: 2px solid var(--primary); border-radius: 6px; color: var(--primary); font-weight: 800; white-space: nowrap; transition: background .15s, color .15s; }
.gm-list tr[data-town]:hover .gm-plate, .gm-list tr.gm-town-on .gm-plate { background: var(--primary); color: var(--on-primary); }
.gm-list tr.gm-town-on { background: var(--card); }

/* type switch: one pink sign, the pressed option flips to a dark plate */
.gm-kind { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: var(--primary); border-radius: var(--radius); box-shadow: inset 0 0 0 2px var(--on-primary), 0 0 0 2px var(--primary); }
.gm-kind button { min-height: 36px; padding: 6px 12px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--on-primary); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.gm-kind button:hover { background: var(--primary-dark); }
.gm-kind button[aria-pressed="true"] { background: var(--on-primary); color: var(--primary); }
.gm-kind button:focus-visible { outline: 3px solid var(--on-primary); outline-offset: 1px; }
.gm-town-active { font-size: 15px; font-weight: 700; color: var(--accent); }

/* who will buy your car */
.gm-sell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.gm-sell-pick { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.gm-sell-pick label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.gm-sell-pick select { height: 44px; min-width: 220px; max-width: 100%; border-radius: 8px; border: 2px solid var(--muted); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; padding: 0 10px; }
.gm-sell-pick select:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.gm-sell-out { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gm-buyer { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.gm-buyer strong { color: var(--cream); font-size: 17px; }
.gm-buyer p { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.gm-buyer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gm-buyer-actions .gm-btn { border: 2px solid var(--primary); color: var(--primary); }
.gm-buyer-actions .gm-btn:hover { background: var(--primary); color: var(--on-primary); }
.gm-badge { display: inline-block; margin-left: 6px; padding: 3px 10px 1px; border-radius: 6px; font-size: 13px; font-weight: 800; border: 2px solid var(--muted); color: var(--muted); }
.gm-v-yes .gm-badge { background: var(--lime); border-color: var(--lime); color: var(--on-primary); }
.gm-v-unknown .gm-badge, .gm-v-special .gm-badge { background: var(--accent); border-color: var(--accent); color: var(--on-primary); }

/* ---------- phone: intro, sign chips, map, then search and the category list ---------- */
@media (max-width: 900px) {
  .gm-hero { display: flex; flex-direction: column; height: auto; min-height: 0; max-height: none; border-bottom: 0; }
  .gm-side { display: contents; }
  .gm-intro { order: 1; padding: 16px 16px 12px; border-right: 0; }
  .gm-intro-top { padding: 16px 0 0; }
  /* phone: button above the map, panel parts (folded) below it */
  .gm-hero-sub .gm-map-wrap { position: relative; inset: auto; }
  .gm-filters-btn { position: static; order: 1; align-self: flex-start; margin: 0 0 10px; }
  /* inside the content column the phone parts need no side margins of their own */
  .gm-hero-sub .gm-signs { padding-left: 0; padding-right: 0; }
  .gm-hero-sub .gm-search-box, .gm-hero-sub .gm-actions, .gm-hero-sub .gm-all { margin-left: 0; margin-right: 0; }
  .gm-hero-sub { display: flex; }
  .gm-hero-sub .gm-side, .gm-filters-open .gm-hero-sub .gm-side { display: contents; position: static; }
  .gm-hero-sub .gm-side > * { display: none; }
  .gm-filters-open .gm-hero-sub .gm-side > * { display: revert; }
  .gm-filters-open .gm-hero-sub .gm-signs, .gm-filters-open .gm-hero-sub .gm-actions { display: flex; }   /* revert above drops their own flex */
  .gm-intro h1 { font-size: 28px; }
  .gm-intro .lead { font-size: 15px; margin-top: 6px; line-height: 1.45; }
  .gm-signs { order: 2; margin: 0; display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px; border-radius: 0; box-shadow: none; scrollbar-width: none; }
  .gm-signs::-webkit-scrollbar { display: none; }
  .gm-signs li:nth-child(n+3) { border-top: 0; }
  .gm-signs li { flex: none; }
  .gm-sign .gm-sign-dot { flex: none; }
  .gm-sign .gm-sign-name { overflow: visible; }
  .gm-sign { display: inline-flex; gap: 8px; font-size: 15px; padding: 6px 12px 4px; border: 2px solid var(--on-primary); border-radius: 22px; }
  .gm-sign[aria-pressed="false"] { border-color: color-mix(in srgb, var(--on-primary) 35%, transparent); }
  .gm-map-wrap { order: 3; height: 56vh; min-height: 360px; }
  .gm-search-box { order: 4; margin: 14px 16px 0; }
  .gm-actions { order: 5; margin: 8px 16px 0; gap: 8px 12px; }
  .gm-btn { padding: 6px 8px 4px; }
  .gm-all { order: 6; margin: 14px 16px 0; }
  .gm-all-toggle { display: flex; justify-content: space-between; align-items: center; list-style: none; cursor: pointer; min-height: 44px; padding: 10px 14px 8px; border: 2px solid var(--primary); color: var(--primary); border-radius: 8px; font-weight: 800; font-size: 16px; }
  .gm-all-toggle::-webkit-details-marker { display: none; }
  .gm-all-toggle .gm-chev { color: var(--primary); }
  .gm-all[open] > .gm-all-toggle { margin-bottom: 8px; }
  .gm-all-title { display: none; }
  .gm-town { font-size: 12px; padding: 2px 6px 0; border-width: 1.5px; }
  .gm-status { font-size: 13px; }
}
@media (max-width: 640px) {
  .gm-list { font-size: 15px; }
  .gm-list th, .gm-list td { padding: 10px 6px 8px; }
  .gm-list .gm-hide-sm { display: none; }
  .gm-go-plate { padding: 3px 6px 1px; }
  .gm-buyer { flex-direction: column; align-items: flex-start; }
  .gm-sell { padding: 16px; }
  .gm-sell-pick label, .gm-sell-pick select { width: 100%; min-width: 0; }
}
