/* DHE research map prototype; independent of the production site stylesheet. */
.map-page { width: min(calc(100% - 40px), 1500px); margin: 0 auto; padding-bottom: 68px; }
.map-heading { width: 100%; max-width: none; margin: 0; padding: 60px 0 26px; text-align: left; }
.map-heading .back-link { display: block; width: max-content; margin: 0 0 26px; }
.map-heading .kicker { margin-bottom: 12px; }
.map-heading h1 { font-size: clamp(2.4rem, 4.6vw, 3.8rem); margin: 0 0 16px; line-height: 1.1; }
.map-lede { max-width: none; margin: 0 0 15px; font-size: 1.06rem; line-height: 1.58; }
.map-disclaimer { max-width: none; margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.48; font-style: italic; }
.map-tools { width: 100%; max-width: none; margin: 0 0 18px; }
.map-search-label { display:block; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--green-soft); font-weight: 700; margin-bottom: 6px; }
.map-search-row { display:flex; gap: 10px; }
.map-search-row input { flex: 1; min-width: 0; border: 1px solid var(--rule); background: #fff; border-radius: 4px; font: inherit; font-size: 16px; padding: 9px 12px; }
.map-search-row input:focus { outline: 2px solid var(--green-soft); outline-offset: 1px; }
.map-search-row button { cursor:pointer; border: 1px solid var(--rule); background: var(--panel); color: var(--green); border-radius: 4px; padding: 7px 16px; font: inherit; font-size: .9rem; }
.map-search-row button:hover, .map-search-row button:focus-visible { background: #eae8e2; }
.map-totals { font-size:.82rem; color:var(--muted); margin: 9px 0 0; text-align: left; }
.diagram-shell { border-top: 1px solid var(--rule); padding-top: 14px; }
.diagram-guide { display:flex; align-items:center; justify-content: space-between; gap:20px; color:var(--muted); font-size:.86rem; padding: 0 6px 12px; }
.diagram-guide a, .data-note a { color:var(--green); }
.diagram-actions { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:22px; }
.diagram-actions button { font:inherit; cursor:pointer; color:var(--green); background:var(--panel); border:1px solid var(--rule); padding:6px 12px; border-radius:4px; }
.diagram-actions button:hover, .diagram-actions button:focus-visible { background:#e6eee7; }
.diagram-actions button[hidden] { display:none; }
.diagram-canvas.focused svg { min-width:0; }
.diagram-canvas.focused .edge { opacity:.63; stroke-width:1.5; }
.diagram-canvas.focused .edge.phase-edge { opacity:.8; }
.diagram-canvas.focused .node-label { font-size:15px; }
.diagram-canvas.focused .system-label { font-size:13px; }
.diagram-canvas.focused .system-count { font-size:12px; }
.diagram-canvas.focused .map-node .node-rect { stroke-width:1.35; }
.diagram-canvas .focus-no-systems { font:italic 15px Arial,sans-serif; fill:#64675f; text-anchor:middle; }

.diagram-canvas { width:100%; overflow-x:auto; border:1px solid #d9d7d0; background:#fffefa; border-radius: 5px; }
.diagram-canvas svg { display:block; width:100%; min-width: 1100px; height:auto; }
.diagram-canvas .edge { fill:none; stroke-width: 1.05; opacity:.25; pointer-events:none; transition: opacity .12s ease; }
.diagram-canvas .edge.phase-edge { opacity: .64; stroke-width:1.55; }
.diagram-canvas .edge.dimmed { opacity: .035; }
.diagram-canvas .edge.emphasized { opacity: .94; stroke-width: 2.2; }
.diagram-canvas .map-node { cursor:pointer; text-decoration: none; }
.diagram-canvas .map-node .node-rect { stroke-width:1.1; rx: 4; }
.diagram-canvas .map-node:hover .node-rect, .diagram-canvas .map-node:focus-visible .node-rect { stroke-width:2.6; }
.diagram-canvas .map-node:focus-visible { outline: none; }
.diagram-canvas .map-node:focus-visible .node-rect { stroke:#173d2a; }
.diagram-canvas .map-node.dimmed { opacity:.2; }
.diagram-canvas .map-node.emphasized .node-rect { stroke-width:2.2; }
.diagram-canvas .column-label { font: 700 20px Arial, sans-serif; fill:#252525; text-anchor:middle; }
.diagram-canvas .column-sub { font: 700 12px Arial, sans-serif; fill:#697067; text-anchor:middle; letter-spacing:.12em; }
.diagram-canvas .node-label { fill:#20221e; font: 600 13px Arial, sans-serif; text-anchor:middle; dominant-baseline:middle; }
.diagram-canvas .system-label { font-size:11px; font-weight:400; }
.diagram-canvas .system-count { fill:#666b66; font-size:10px; font-weight:400; }
.diagram-feedback { text-align:center; margin: 8px 0 4px; color:var(--muted); font-size:.85rem; }
.data-note { max-width:none; margin:22px 0 0; color:var(--muted); font-size:.81rem; text-align:left; line-height:1.6; }
.data-note code { font-size:.9em; }
/* The visual map is also the mobile default; the text explorer remains available by toggle. */
.map-view-toggle, .mobile-map-hint { display:none; }
.mobile-explorer { display:none; }
@media(max-width:1100px) {
  .map-view-toggle { display:flex; width:min(100%,480px); margin:10px auto 14px; border:1px solid var(--rule); border-radius:5px; overflow:hidden; }
  .map-view-toggle button { flex:1; padding:12px 10px; background:var(--panel); color:var(--green); border:0; font:inherit; font-size:.9rem; cursor:pointer; }
  .map-view-toggle button + button { border-left:1px solid var(--rule); }
  .map-view-toggle button.active, .map-view-toggle button[aria-pressed="true"] { background:var(--green); color:#fffefb; font-weight:700; }
  .map-view-toggle button:focus-visible { outline:2px solid var(--green-soft); outline-offset:-3px; }
  .mobile-map-hint { display:block; text-align:center; color:var(--muted); font-size:.83rem; line-height:1.5; margin:0 auto 16px; max-width:620px; }
  .diagram-guide { flex-wrap:wrap; }
  .diagram-actions { justify-content:flex-start; }
  /* Keep the diagram readable: pan horizontally instead of shrinking every label. */
  .diagram-canvas { -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; touch-action:pan-x pan-y; }
  .diagram-canvas svg { min-width:1320px; }
  .diagram-canvas.focused svg { min-width:1050px; }
  .map-page[data-mobile-view="explorer"] .diagram-shell,
  .map-page[data-mobile-view="explorer"] .mobile-map-hint { display:none; }
  .mobile-explorer { display:none; max-width:800px; margin:16px auto 0; padding-top:22px; border-top:1px solid var(--rule); }
  .map-page[data-mobile-view="explorer"] .mobile-explorer { display:block; }
  .mobile-explorer h2 { margin: 0 0 6px; font-size:1.7rem; }
  .mobile-explorer > p, .mobile-system-directory > p { margin:0 0 16px; color:var(--muted); }
  .mobile-phase { border-top:1px solid var(--rule); padding: 13px 0; }
  .mobile-phase > summary { font-weight:700; cursor:pointer; padding:10px 4px; color:var(--green); font-size:1.06rem; }
  .mobile-phase > .phase-open { display:block; font-size:.9rem; margin:0 0 10px 18px; }
  .mobile-paper { margin: 10px 0 10px 18px; border-left: 2px solid var(--rule); padding-left:12px; }
  .mobile-paper summary { cursor:pointer; padding:10px 0; }
  .mobile-paper summary strong { font-size:1rem; }
  .mobile-paper .paper-open { display:inline-block; margin:5px 0 12px; color:var(--green); }
  .mobile-paper .system-row { display:flex; flex-wrap:wrap; gap:8px; padding-bottom:12px; }
  .mobile-paper .system-row a { border:1px solid var(--rule); border-radius:3px; padding:6px 9px; font-size:.84rem; text-decoration:none; color:var(--green); }
  .mobile-system-directory { margin-top:28px; border-top:1px solid var(--rule); padding-top:26px; }
  .mobile-systems-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap: 7px 20px; }
  .mobile-systems-grid a { text-decoration:none; border-bottom:1px solid #ddd9d2; padding:9px 4px; font-size:.9rem; display:flex; gap:8px; justify-content:space-between; }
  .mobile-systems-grid a span { color:var(--muted); }
}
@media(max-width:640px) {
  .map-page { width:calc(100% - 28px); }
  .map-heading { padding-top:38px; }
  .map-heading h1 { font-size:2.3rem; }
  .map-heading .back-link { margin-bottom:18px; }
  .map-lede { font-size:1rem; }
  .map-search-row button { padding-inline:12px; }
  .mobile-phase > summary { min-height:44px; }
}
/* Click-to-focus and connection depth controls */
.map-depth-row[hidden] {display:none;}
.map-depth-row {display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:12px 13px 14px;margin:0 0 10px;background:#f2f4ee;border:1px solid #d1d9cd;border-radius:4px;color:var(--green);font-size:.9rem;}
.map-depth-row label {font-weight:700;white-space:nowrap;}
.map-depth-row label strong {font-weight:400;color:var(--muted);font-size:.8rem;}
.map-depth-row input {accent-color:var(--green);flex:1;min-width:150px;max-width:330px;cursor:pointer;}
.map-depth-row span {flex:1 1 225px;color:var(--muted);font-size:.82rem;}
.diagram-canvas.focused .selected-root .node-rect {stroke:#162d20;stroke-width:3;}
.diagram-canvas.focused .node-label {font-size:14px;}
.diagram-canvas.focused .system-label {font-size:12px;}
.diagram-canvas.focused .system-count {font-size:11px;}
.mobile-phase .phase-tagline {font-style:italic;color:var(--muted);margin:0 0 12px 4px;}
.mobile-paper .paper-tagline {display:block;font-weight:400;color:var(--muted);font-style:italic;font-size:.9rem;margin-top:5px;line-height:1.55;}
.mobile-systems-grid .mobile-system-link {display:block;padding:12px 5px;text-decoration:none;}
.mobile-system-header {display:flex;justify-content:space-between;align-items:baseline;gap:12px;}
.mobile-system-header strong {font-weight:700;color:var(--green);line-height:1.3;}
.mobile-systems-grid .mobile-system-description {display:block;color:var(--muted);font-size:.86rem;font-style:italic;margin-top:5px;line-height:1.45;}
.mobile-system-header .mobile-system-count {color:var(--muted);font-size:.76rem;white-space:nowrap;}
.mobile-paper[hidden],.mobile-phase[hidden],.mobile-system-link[hidden] {display:none!important;}

