/* Big Projects Map legend, shared by the home map layer (.bp-lg) and /labs/big-projects-us/ (.legend).
   One icon column (20px), one row height, three headed sections: Stage, Heat map, Other. One short dollars note. */
.lg-grid { display: grid; grid-template-columns: auto auto; gap: 8px 16px; align-items: start; justify-content: start; }
.lg-grid > .lg-sec:first-child { grid-row: span 2; }
.lg-sec { min-width: 0; }
.lg-h { margin: 0 0 3px; padding: 0; font: inherit; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hs-dim, #b8b2a6); line-height: 1.3; }
.lg-l { list-style: none; margin: 0; padding: 0; }
.lg-r { display: flex; align-items: center; gap: 8px; min-height: 22px; color: var(--hs-text, #f1ebe0); font-size: 11.5px; line-height: 1.2; white-space: nowrap; }
.lg-i { flex: none; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.lg-i .lg-svg, .lg-i svg { width: 20px; height: 20px; display: block; flex: none; }
.lg-sw { display: block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.25); box-sizing: border-box; }
.lg-n { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.12); color: var(--hs-dim, #b8b2a6); font-size: 11px; line-height: 1.3; }

/* Place card buttons (minimize, Back, More) use the one map control family: same height, radius, border, fill and type as Tips, Legend and Big projects. */
.map-stage .map-card .mc-minbtn, .map-stage .map-card .mc-back, .map-stage .map-card .mc-more {
  box-sizing: border-box; height: var(--ux-h, 36px); min-height: var(--ux-h, 36px); padding: 0 12px; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: 0;
  color: var(--ux-fg, #f1ebe0); background: var(--ux-bg, rgba(10, 14, 20, 0.9)); border: 1px solid var(--ux-bd, rgba(255, 255, 255, 0.22)); border-radius: var(--ux-rad, 10px);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.map-stage .map-card .mc-minbtn { width: var(--ux-h, 36px); min-width: var(--ux-h, 36px); padding: 0; font-size: 17px; }
.map-stage .map-card .mc-minbtn:hover, .map-stage .map-card .mc-back:hover, .map-stage .map-card .mc-more:hover { border-color: rgba(255, 255, 255, 0.45); background: rgba(30, 36, 46, 0.95); }
.map-stage .map-card .mc-minbtn:focus-visible, .map-stage .map-card .mc-back:focus-visible, .map-stage .map-card .mc-more:focus-visible { outline: 2px solid var(--hs-acc, #deba80); outline-offset: 2px; }
.map-stage .map-card .mc-more { display: none; }
.map-card .mc-top { align-items: center; gap: 8px; margin: -2px -2px 6px 10px; }
/* Collapsed card: one balanced row. Label over place name on the left, buttons centered on the right. */
@media (min-width: 901px) {
.map-stage .map-card.mc-min { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "lvl top" "name top"; align-items: center; column-gap: 14px; row-gap: 2px; padding: 8px 8px 8px 14px; }
.map-stage .map-card.mc-min > :not(.mc-top):not(.mc-level):not(.mc-name) { display: none !important; }
.map-stage .map-card.mc-min .mc-level { grid-area: lvl; align-self: end; margin: 0; line-height: 1.2; }
.map-stage .map-card.mc-min .mc-name { grid-area: name; align-self: start; margin: 0; line-height: 1.2; min-width: 0; }
.map-stage .map-card.mc-min .mc-top { grid-area: top; float: none; margin: 0; flex: none; justify-content: flex-end; align-self: center; }
}
/* Phones and tablets, normal view: the card is already a one-line chip (name left, Back right). Back becomes a full 44px tap target. */
@media (max-width: 900px) {
  .map-stage:not(.is-fs) .map-card { padding: 4px 4px 4px 12px; gap: 10px; }
  .map-stage:not(.is-fs) .map-card .mc-back, .map-stage:not(.is-fs) .map-card .mc-minbtn { height: 44px; min-height: 44px; }
  .map-stage:not(.is-fs) .map-card .mc-minbtn { width: 44px; min-width: 44px; }
}
@media (max-width: 700px) {
  .map-stage .map-card .mc-more { display: inline-flex; }
  .map-stage .map-card .mc-minbtn, .map-stage .map-card .mc-back, .map-stage .map-card .mc-more { height: 44px; min-height: 44px; }
  .map-stage .map-card .mc-minbtn { width: 44px; min-width: 44px; }
  .map-stage:not(.is-fs) .map-card .mc-more { display: none !important; }
}

/* Phone (v986 regression): the short map could not hold the Tips row, the color key, the Legend button, the place card and the bottom control stack at once, so the card covered the key and the Legend button. The map takes enough height for all of them to stack without touching. */
@media (max-width: 700px) {
  .map-stage:not(.is-fs) { min-height: 380px; }
}
/* Phone: the place card is a compact chip under the search, on the right. Do not set
   top and bottom together: that stretches it into a tall empty box over the map. */
@media (max-width: 700px) {
  .map-stage:not(.is-fs) #map-card { left: auto !important; right: 8px !important; top: 52px !important; bottom: auto !important; height: auto !important; min-height: 0 !important; max-width: min(210px, calc(100% - 16px)) !important; }
}
