/* PGV plot map — layout + SVG polygon overlay + zoom/pan */
.plotmap-stage{
    position:relative; display:block; width:100%; max-width:100%;
    background:#f1f5f9; border-radius:14px; overflow:hidden;
    border:1px solid #e2e8f0; min-height:240px; touch-action:none;
}
.plotmap-viewport{ position:relative; transform-origin:0 0; will-change:transform; }
.plotmap-layout{ display:block; width:100%; height:auto; user-select:none; -webkit-user-drag:none; }
.plotmap-svg{ position:absolute; inset:0; width:100%; height:100%; }
.plotmap-stage[data-tool="pan"]{ cursor:grab; }
.plotmap-stage[data-tool="plot"], .plotmap-stage[data-tool="pen"]{ cursor:crosshair; }
.plotmap-stage[data-tool="text"]{ cursor:text; }
.plotmap-stage[data-tool="eraser"]{ cursor:cell; }
.plotmap-stage.is-panning{ cursor:grabbing !important; }
.plotmap-poly{ transition:fill-opacity .15s ease; }
.plotmap-poly:hover{ fill-opacity:.5 !important; }
.plotmap-labels{ position:absolute; inset:0; pointer-events:none; }
.plotmap-label{
    position:absolute; transform:translate(-50%,-50%);
    font-size:10px; font-weight:700; line-height:1; color:#0f172a;
    background:rgba(255,255,255,.82); border-radius:4px; padding:2px 4px;
    white-space:nowrap; box-shadow:0 1px 2px rgba(0,0,0,.12);
}
/* draft vertex handles (fixed pixel size — never distort) */
.plotmap-handles{ position:absolute; inset:0; pointer-events:none; z-index:4; }
.plotmap-handle{
    position:absolute; width:11px; height:11px; transform:translate(-50%,-50%);
    border-radius:50%; background:#6366f1; border:2px solid #fff;
    box-shadow:0 0 0 1px rgba(15,23,42,.25);
}
.plotmap-handle.first{ width:15px; height:15px; background:#4f46e5; box-shadow:0 0 0 3px rgba(99,102,241,.3); }
/* draggable corner handle for the pending / candidate-being-edited polygon */
.plotmap-handle.edit{ pointer-events:auto; cursor:move; width:14px; height:14px; background:#4f46e5; box-shadow:0 0 0 3px rgba(99,102,241,.28); }
.plotmap-handle.edit:hover{ background:#4338ca; box-shadow:0 0 0 4px rgba(99,102,241,.35); }
.plotmap-empty{
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    min-height:320px; color:#94a3b8; gap:10px; text-align:center; padding:24px;
}
.plotmap-empty i,.plotmap-empty svg{ width:40px; height:40px; }

/* zoom controls */
.plotmap-controls{
    position:absolute; top:10px; right:10px; z-index:5;
    display:flex; flex-direction:column; gap:6px;
}
.plotmap-controls button{
    width:34px; height:34px; border:0; border-radius:9px; cursor:pointer;
    background:rgba(255,255,255,.95); color:#1e293b; font-size:18px; line-height:1;
    box-shadow:0 2px 6px rgba(15,23,42,.18); display:flex; align-items:center; justify-content:center;
    transition:background .12s ease, transform .06s ease;
}
.plotmap-controls button:hover{ background:#fff; }
.plotmap-controls button:active{ transform:scale(.94); }
.plotmap-controls button:disabled{ opacity:.45; cursor:default; }

/* annotation text */
.plotmap-anno-text{ background:transparent !important; box-shadow:none !important; font-weight:700; font-size:.8rem; padding:0; text-shadow:0 1px 2px rgba(255,255,255,.9); }
/* auto-detected candidate badge */
.plotmap-cand-label{ background:#f59e0b !important; color:#fff !important; font-weight:800 !important; width:16px; height:16px; display:flex; align-items:center; justify-content:center; border-radius:50% !important; padding:0 !important; font-size:11px !important; }
.plotmap-cand:hover{ fill-opacity:.28 !important; }
/* per-suggestion dismiss (×) — clickable even though the labels layer ignores pointers */
.plotmap-cand-dismiss{ pointer-events:auto !important; cursor:pointer; background:#ef4444 !important; color:#fff !important; width:17px; height:17px; display:flex; align-items:center; justify-content:center; border-radius:50% !important; padding:0 !important; font-size:13px !important; line-height:1; font-weight:800; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.plotmap-cand-dismiss:hover{ background:#dc2626 !important; transform:translate(-50%,-50%) scale(1.12); }

/* floating tool palette (Excalidraw-style pill) */
.plotmap-wrap{ position:relative; }
.plotmap-toolbar{
    position:absolute; top:14px; left:50%; transform:translateX(-50%); z-index:6;
    display:inline-flex; align-items:center; gap:4px; padding:6px;
    background:#fff; border:1px solid #e5e7eb; border-radius:14px;
    box-shadow:0 8px 24px rgba(15,23,42,.16);
}
.plotmap-toolbar .sep{ width:1px; height:24px; background:#e5e7eb; margin:0 3px; }
.plotmap-tool{
    width:38px; height:38px; border:0; background:transparent; border-radius:10px; cursor:pointer;
    display:flex; align-items:center; justify-content:center; color:#334155; transition:background .12s ease;
}
.plotmap-tool:hover{ background:#f1f5f9; }
.plotmap-tool.active{ background:#eef2ff; color:#4f46e5; box-shadow:inset 0 0 0 1px #c7d2fe; }
.plotmap-tool i,.plotmap-tool svg{ width:19px; height:19px; }
.plotmap-tool[disabled]{ opacity:.4; cursor:default; }
.plotmap-color{ position:relative; width:38px; height:38px; border-radius:10px; overflow:hidden; cursor:pointer; }
.plotmap-color input{ position:absolute; inset:-4px; width:46px; height:46px; border:0; padding:0; cursor:pointer; background:none; }

/* legend */
.plotmap-legend{ display:flex; flex-wrap:wrap; gap:14px; font-size:.8rem; }
.plotmap-legend span{ display:inline-flex; align-items:center; gap:6px; color:#475569; }
.plotmap-legend i{ width:12px; height:12px; border-radius:3px; display:inline-block; }
