/* Level 02 roadmap — controls, key and details (Claude's half). Scoped to rm2- control/panel/key
   elements only; the map's own nodes, ribbons, era bands and gutter are styled by roadmap-map.css.
   Colour tokens --rm-<current> come from roadmap.css, which loads first. */

/* Toolbar: a small sticky strip above the full-width map. */
.rm2-toolbar{position:sticky;top:0;z-index:6;display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;justify-content:space-between;
  padding:.5rem 0;margin:1rem 0 .5rem;background:var(--bg);border-top:1px solid var(--line);border-bottom:1px solid var(--line);}
.rm2-toolbar [data-rm-controls],.rm2-toolbar [data-rm-tools]{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;}
.rm2-summary{font-family:var(--font-mono);font-size:.72rem;color:var(--muted);margin-right:.2rem;}
.rm2-btn{font:600 .74rem/1 var(--font-sans);color:var(--text);background:var(--panel);border:1px solid var(--line);
  border-radius:6px;padding:.4rem .6rem;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;}
.rm2-btn:hover{border-color:var(--text);}
.rm2-keyjump{font-family:var(--font-mono);font-size:.68rem;}
.rm2-all{font-weight:700;}

/* Layout: map is full width by default; details float over a reserved strip the map leaves clear. */
.rm2-layout{position:relative;}
.rm2-layout[hidden]{display:none;}

/* Below-map key: the full current / domain / continent controls and counts. */
.rm2-key{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem 1.5rem;margin:1.25rem 0 .5rem;
  padding-top:1rem;border-top:1px solid var(--line);scroll-margin-top:4rem;}
.rm2-key[hidden]{display:none;}
.rm2-group-h{margin:0 0 .5rem;font:700 .7rem/1.3 var(--font-mono);letter-spacing:.08em;text-transform:uppercase;color:var(--text);display:flex;align-items:baseline;gap:.4rem;flex-wrap:wrap;}
.rm2-k-note{font-weight:400;text-transform:none;letter-spacing:0;color:var(--muted);font-size:.64rem;}
.rm2-count{margin-left:auto;font-family:var(--font-mono);font-size:.64rem;color:var(--muted);}
.rm2-chips{display:flex;flex-wrap:wrap;gap:.35rem;}
.rm2-chip{font:600 .74rem/1 var(--font-sans);color:var(--text);background:transparent;border:1px solid var(--line);border-radius:999px;
  padding:.4rem .62rem;cursor:pointer;display:inline-flex;align-items:center;gap:.4rem;white-space:nowrap;}
.rm2-chip[aria-pressed="false"]{opacity:1;color:var(--muted);border-style:dashed;}
.rm2-chip[aria-pressed="true"]{border-color:var(--text);}
.rm2-chip .rm2-sw{width:.7rem;height:.7rem;border-radius:50%;background:var(--c,var(--muted));flex:0 0 auto;}
.rm2-group-all{margin-left:.15rem;}

/* current colour swatches (chips, panel current lists). */
.rm2-sw[data-current=endocrine]{--c:var(--rm-endocrine);}
.rm2-sw[data-current=psychometrics]{--c:var(--rm-psychometrics);}
.rm2-sw[data-current=computing]{--c:var(--rm-computing);}
.rm2-sw[data-current=genetics]{--c:var(--rm-genetics);}
.rm2-sw[data-current=neuro]{--c:var(--rm-neuro);}
.rm2-sw[data-current=transhuman]{--c:var(--rm-transhuman);}
.rm2-chip[data-current] .rm2-sw{background:var(--rm2-c,var(--muted));}

/* Details panel: floats top-right over reserved map space on desktop; stacks below on phones. */
.rm2-panel{position:absolute;top:.5rem;right:.5rem;width:min(360px,92%);max-height:calc(100% - 1rem);overflow:auto;
  background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:1rem 1.1rem 1.25rem;z-index:5;
  box-shadow:0 10px 30px -12px rgba(0,0,0,.5);}
.rm2-panel[hidden]{display:none;}
.rm2-x{position:absolute;top:.5rem;right:.6rem;width:1.9rem;height:1.9rem;border:1px solid var(--line);background:var(--bg);
  color:var(--text);border-radius:6px;font-size:1.1rem;line-height:1;cursor:pointer;}
.rm2-pyear{margin:.1rem 0 0;font:600 .64rem/1.2 var(--font-mono);letter-spacing:.08em;color:var(--muted);}
.rm2-ptitle{margin:.15rem 2rem .6rem 0;font-size:1.15rem;line-height:1.2;}
.rm2-fig{margin:0 0 .5rem;}
.rm2-fig img{width:100%;height:auto;border-radius:8px;display:block;}
.rm2-fig-context{opacity:.95;}
.rm2-ctx{margin:.25rem 0 0;font-size:.62rem;color:var(--muted);font-style:italic;}
.rm2-credit{margin:.1rem 0 .6rem;font-size:.62rem;color:var(--muted);}
.rm2-credit-k{font-family:var(--font-mono);text-transform:uppercase;letter-spacing:.06em;}
.rm2-psum{margin:.2rem 0 .7rem;font-size:.9rem;line-height:1.5;}
.rm2-locs{margin:.2rem 0 .7rem;padding-left:1rem;font-size:.78rem;color:var(--text);}
.rm2-locs .rm2-cont{color:var(--muted);}
.rm2-cta{display:inline-block;margin:.1rem 0 .7rem;font-weight:700;color:var(--accent);}
.rm2-cta-soon{color:var(--muted);}
.rm2-rels{border-top:1px solid var(--line);padding-top:.6rem;}
.rm2-rel h4{margin:.5rem 0 .3rem;font:700 .64rem/1.3 var(--font-mono);text-transform:uppercase;letter-spacing:.06em;display:flex;align-items:center;gap:.4rem;}
.rm2-rel h4 .rm2-sw{width:.7rem;height:.7rem;border-radius:50%;background:var(--c,var(--muted));}
.rm2-rel-list{list-style:none;margin:0 0 .3rem;padding:0;}
.rm2-rel-list a{display:flex;gap:.45rem;padding:.22rem .3rem;border-radius:5px;color:var(--text);text-decoration:none;font-size:.78rem;}
.rm2-rel-list a:hover{background:color-mix(in srgb,var(--text) 8%,transparent);}
.rm2-rel-list a[aria-current=true]{background:var(--text);color:var(--bg);}
.rm2-yx{font-family:var(--font-mono);font-size:.64rem;color:var(--muted);min-width:2.3rem;}
.rm2-rel-list a[aria-current=true] .rm2-yx{color:var(--bg);}

.rm2-status{margin:.5rem 0 0;font-family:var(--font-mono);font-size:.68rem;color:var(--muted);}

@media (max-width:720px){
  .rm2-panel{position:static;width:auto;max-height:none;margin-top:.9rem;box-shadow:none;}
  .rm2-toolbar{top:0;}
}
@media (prefers-reduced-motion:reduce){ .rm2-chip,.rm2-btn{transition:none;} }

/* Integration: readable targets, page-scrolling details and a matching pictured current list. */
.rm2-btn,.rm2-chip{min-height:44px;line-height:1.3}.rm2-btn[aria-label^="Zoom"]{min-width:44px;justify-content:center}
.rm2-key{grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr))}
.rm2-panel{max-height:none;overflow:visible;z-index:15;overflow-wrap:anywhere}
.rm2-x{width:44px;height:44px}.rm2-ptitle{margin-right:44px}
.rm2-related-picture{width:42px;height:32px;object-fit:contain;flex:0 0 42px;border-radius:4px;background:#fff}
.rm2-rel-list a{min-height:48px;align-items:center}.rm2-rel-list a>span{min-width:0;overflow-wrap:anywhere}.rm2-yx{display:block}
.roadmap .rm-item[hidden]{display:none}
.rm2-chip .rm2-sw,.rm2-rel h4 .rm2-sw{width:28px;height:9px;flex:0 0 28px;border-radius:0;background:transparent;color:var(--c,var(--muted));overflow:visible}
.rm2-chip[data-current] .rm2-sw{background:transparent}
@media(max-width:720px){.rm2-panel{position:absolute;left:8px;right:8px;width:auto;margin-top:0;padding:14px}.rm2-key{grid-template-columns:1fr}.rm2-fig img{max-height:160px;object-fit:contain;background:#fff}}

/* Fit map + Filters: prominent and always within reach, beside the zoom controls. */
.rm2-fit{font-weight:700}
.rm2-filters-btn{font-weight:700}
.rm2-filters-btn[aria-expanded=true]{border-color:var(--text);background:var(--text);color:var(--bg)}

/* Portrait phones: the sideways map is replaced by a rotate prompt + a readable Browse list. */
.rm2-portrait{display:none}
.rm2-portrait-msg{margin:0 0 .85rem;font-size:.95rem;line-height:1.5;color:var(--text)}
.rm2-browse{font-weight:700;min-height:44px}
.rm2-listing .rm2-portrait{display:none}
@media (max-width:720px) and (orientation:portrait){
  .rm2-portrait{display:block;padding:1.4rem 0 .5rem}
  .rm2-layout{display:none}
}

/* Phone landscape: give the map most of the screen; keep the tool strip compact and one-row. */
@media (max-width:900px) and (orientation:landscape){
  .rm2-toolbar{padding:.35rem 0;margin:.5rem 0 .35rem;gap:.3rem .5rem}
  .rm2-toolbar [data-rm-controls],.rm2-toolbar [data-rm-tools]{gap:.3rem}
  .rm2-summary{display:none}
  .rm2-key{margin-top:.75rem}
}
