.map-body { min-width: 320px; }
.map-topbar { align-items: flex-start; }
.map-page { max-width: 1580px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 42px) 70px; }
.map-intro { margin-top: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.map-intro h2 { margin: 4px 0 8px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.map-intro p { max-width: 900px; margin: 0; color: var(--muted); }
.map-legend { display: grid; gap: 10px; min-width: 230px; font-size: 12px; font-weight: 750; }
.map-legend span { display: flex; align-items: center; gap: 9px; }
.map-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-dot.unmatched { background: #2563eb; }
.map-dot.matched { background: #16a34a; }
.map-dot.representative { background: #fff; border: 3px solid #111827; }
.association-panel { margin-top: 16px; }
.map-table-wrap { width: 100%; overflow: auto; }
.map-table-wrap.tall { max-height: 670px; }
.map-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.map-table th, .map-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.map-table th:first-child, .map-table td:first-child { text-align: left; }
.map-table thead th { position: sticky; top: 0; z-index: 1; color: #53605a; background: #f5f4ef; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.map-table tbody tr[data-paper], .map-table tbody tr[data-cluster] { cursor: pointer; }
.map-table tbody tr:hover { background: #f5f8f6; }
.map-table tbody tr.active { background: var(--green-soft); }
.map-table tbody tr.total { font-weight: 800; background: #f0efe9; }
.map-table.compact td, .map-table.compact th { padding: 8px 9px; }
.map-workspace { margin-top: 16px; display: grid; grid-template-columns: 240px minmax(520px, 1fr) 340px; gap: 16px; align-items: start; }
.map-workspace > .panel { margin-top: 0; }
.map-sidebar { position: sticky; top: 12px; }
.map-sidebar label, .control-label { display: block; margin-bottom: 7px; color: #57625d; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.map-sidebar select { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.map-sidebar .resolution-label { margin-top: 14px; }
.paper-meta { margin-top: 14px; }
.paper-meta h3 { margin: 0 0 7px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; line-height: 1.25; }
.paper-meta p { margin: 4px 0; color: var(--muted); font-size: 11px; }
.paper-meta a { color: var(--green); font-weight: 750; text-decoration: none; }
.map-sidebar hr { margin: 18px 0; border: 0; border-top: 1px solid var(--line); }
.map-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.map-filter button, .reset-button { border: 1px solid var(--line); border-radius: 8px; padding: 8px 7px; color: #59645f; background: white; cursor: pointer; font-size: 11px; font-weight: 750; }
.map-filter button.active { color: white; border-color: #244f3d; background: #244f3d; }
.reset-button { width: 100%; margin-top: 10px; }
.projection-note { margin: 16px 0 0; color: var(--muted); font-size: 10px; }
.plot-panel { min-width: 0; }
.plot-heading-actions { display: grid; justify-items: end; gap: 8px; }
.zoom-controls { display: inline-flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #f6f6f1; }
.zoom-controls button { min-width: 30px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; color: #47534d; background: white; cursor: pointer; font-size: 12px; font-weight: 800; }
.zoom-controls button:hover { color: white; background: #315b87; }
.zoom-controls span { min-width: 43px; color: var(--muted); text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.scatter-wrap { position: relative; overflow: hidden; border: 1px solid #d9ddd8; border-radius: 12px; background: radial-gradient(circle at center, #fff 0, #fbfcfa 60%, #f3f5f2 100%); }
#cluster-scatter { width: 100%; height: auto; min-height: 480px; display: block; }
.scatter-background { fill: transparent; cursor: grab; }
#cluster-scatter.panning, #cluster-scatter.panning .scatter-background { cursor: grabbing; }
.cluster-boundary { fill: rgba(49, 91, 135, .035); stroke: #70869c; stroke-width: 1.3; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; cursor: pointer; transition: opacity .15s, stroke-width .15s; }
.cluster-boundary.association-one { stroke: #7f9d89; }
.cluster-boundary.association-multiple { fill: rgba(22, 163, 74, .045); stroke: #4f8f68; }
.cluster-boundary.inactive { opacity: .06; pointer-events: none; }
.cluster-boundary.highlighted { opacity: 1; stroke: #111827; stroke-width: 3; stroke-dasharray: none; }
.candidate-point { stroke: rgba(255,255,255,.9); stroke-width: 1.4; cursor: pointer; transition: opacity .12s, r .12s, stroke-width .12s; }
.candidate-point.unmatched { fill: #2563eb; }
.candidate-point.matched { fill: #16a34a; }
.candidate-point.representative { stroke: #111827; stroke-width: 3; }
.candidate-point.inactive { opacity: .05; pointer-events: none; }
.candidate-point.dimmed { opacity: .10; }
.candidate-point.highlighted { opacity: 1; stroke: #f59e0b; stroke-width: 4; r: 8px; }
.selection-status { min-height: 38px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; color: #59645f; background: #f4f5f1; font-size: 12px; }
.detail-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.detail-panel h3 { margin: 6px 0 10px; font-family: Georgia, serif; font-size: 22px; font-weight: 500; line-height: 1.3; }
.detail-panel p { white-space: pre-wrap; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.detail-section { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.detail-section h4 { margin: 0 0 7px; color: #59645f; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.detail-section p { margin: 0; font-size: 12px; }
.match-link { width: 100%; margin: 5px 0; padding: 8px 9px; border: 0; border-radius: 7px; display: block; text-align: left; color: #0f603b; background: var(--green-soft); cursor: pointer; font-size: 11px; }
.diagnostic-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; }
.diagnostic-grid > .panel { min-width: 0; }
.assoc-pill { padding: 3px 6px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.assoc-pill.none { color: #6b7280; background: #eef0f2; }
.assoc-pill.one { color: #315b87; background: var(--blue-soft); }
.assoc-pill.multiple { color: #12633e; background: var(--green-soft); }
.rep-result.good { color: var(--green); }
.rep-result.bad { color: var(--red); }
.ground-truth-list { max-height: 670px; overflow: auto; display: grid; gap: 8px; }
.gt-item { width: 100%; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 9px; text-align: left; color: var(--ink); background: white; cursor: pointer; }
.gt-item:hover, .gt-item.active { background: var(--green-soft); }
.gt-item strong { display: block; font-size: 12px; line-height: 1.45; }
.gt-item span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
@media (max-width: 1180px) {
  .map-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .detail-panel { position: static; grid-column: 1 / -1; max-height: none; }
}
@media (max-width: 800px) {
  .map-topbar, .map-intro { display: block; }
  .site-nav { margin-top: 16px; flex-wrap: wrap; }
  .map-legend { margin-top: 18px; }
  .map-workspace, .diagnostic-grid { grid-template-columns: 1fr; }
  .map-sidebar { position: static; }
  #cluster-scatter { min-height: 360px; }
  .plot-heading-actions { justify-items: start; }
}
