/* Power Cut Map Live (tools/power-cut-map). Theme-aware via the site tokens. */
.pcm-status { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 16px; align-items: center; padding: 14px 18px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); border-left: 6px solid var(--pc, #16a34a); margin-top: 8px; }
.pcm-status-l { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.pcm-status-t { color: var(--muted); }
.pcm-status-u { color: var(--muted); white-space: nowrap; }
.pcm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pc, #16a34a); box-shadow: 0 0 0 0 var(--pc); animation: pcm-pulse 2s infinite; }
.pcm-calm { --pc: #16a34a; } .pcm-elevated { --pc: #d9a706; } .pcm-surge { --pc: #ea580c; } .pcm-major { --pc: #dc2626; } .pcm-unknown { --pc: #64748b; }
@keyframes pcm-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc) 55%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .pcm-dot { animation: none; } }
@media (max-width: 760px) { .pcm-status { grid-template-columns: 1fr; } .pcm-status-u { white-space: normal; } }

.pcm-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (max-width: 900px) { .pcm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pcm-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.pcm-tile-l { font-size: .8rem; color: var(--muted); }
.pcm-tile-v { font-size: 1.55rem; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }
.pcm-tile-s { font-size: .78rem; color: var(--muted); min-height: 1em; }

.pcm-search { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.pcm-search input { flex: 1 1 260px; min-width: 0; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1rem; }
.pcm-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 10px; }
.pcm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pcm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .85rem; cursor: pointer; }
.pcm-chip[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.pcm-chip-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.pcm-chip-stale { border-style: dashed; }
.pcm-sel, .pcm-chk { font-size: .88rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.pcm-sel select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.pcm-msg { margin: 8px 0 0; min-height: 1.2em; color: var(--muted); }

.pcm-mapgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; margin-top: 12px; }
@media (max-width: 960px) { .pcm-mapgrid { grid-template-columns: 1fr; } }
.pcm-mapwrap { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #0f172a; }
.pcm-map { height: 68vh; min-height: 420px; }
.pcm-mapwrap.pcm-full { position: fixed; inset: 0; z-index: 1000; border-radius: 0; }
.pcm-mapwrap.pcm-full .pcm-map { height: 100dvh; }
.pcm-mapbtns { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 5; }
.pcm-mb { padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(15, 23, 42, .82); color: #f8fafc; font-size: .85rem; cursor: pointer; }
.pcm-legend { position: absolute; left: 10px; bottom: 34px; z-index: 4; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 5px 10px; border-radius: 8px; background: rgba(15, 23, 42, .78); color: #e2e8f0; font-size: .75rem; pointer-events: none; }
.pcm-lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #facc15; margin-right: 5px; vertical-align: -1px; }
.pcm-lg-new { background: #ef4444; }
.pcm-cut circle { stroke: rgba(15, 23, 42, .85); stroke-width: 1; }
.pcm-cut-new circle { stroke: #fff; stroke-width: 1.6; }
.pcm-cut-sel circle { stroke: #fff; stroke-width: 3; }
.pcm-cut-t { fill: #fff; font: 700 9px/1 system-ui, sans-serif; paint-order: stroke; stroke: rgba(15, 23, 42, .85); stroke-width: 2.5px; pointer-events: none; }
.pcm-me { fill: #2563eb; stroke: #fff; stroke-width: 3; }
.pcm-me-t { fill: #fff; font: 700 12px/1 system-ui, sans-serif; paint-order: stroke; stroke: #1e3a8a; stroke-width: 3px; }

.pcm-side { display: flex; flex-direction: column; min-height: 0; max-height: 68vh; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
@media (max-width: 960px) { .pcm-side { max-height: 420px; } }
.pcm-side-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.pcm-list { list-style: none; margin: 0; padding: 0; overflow: auto; }
.pcm-li { padding: 9px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.pcm-li:hover, .pcm-li:focus { background: var(--bg-2); outline: none; }
.pcm-li.on { background: color-mix(in srgb, #0ea5e9 14%, transparent); box-shadow: inset 4px 0 0 #0ea5e9; }
.pcm-li-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pcm-li-c { color: var(--muted); font-size: .88rem; }
.pcm-li-a { font-size: .9rem; margin-top: 2px; overflow-wrap: anywhere; }
.pcm-li-m { color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.pcm-li-more { padding: 10px 14px; color: var(--muted); }
.pcm-li-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; margin-right: 4px; vertical-align: -1px; }
.pcm-pill { font-size: .68rem; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; background: #ef4444; color: #fff; }
.pcm-pill-late { background: #b45309; }

.pcm-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin: 26px 0 10px; }
.pcm-head h2 { margin: 0; font-size: 1.15rem; }
.pcm-nets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .pcm-nets { grid-template-columns: 1fr; } }
.pcm-net { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--nc); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.pcm-net-h { display: flex; align-items: center; gap: 8px; }
.pcm-net-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--nc); }
.pcm-warn { color: #b45309; }
.pcm-range { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pcm-range button { padding: 5px 11px; border: 0; background: var(--surface); color: var(--text); font-size: .84rem; cursor: pointer; }
.pcm-range button[aria-pressed="true"] { background: var(--link); color: #fff; }
.pcm-chart { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-height: 120px; }
.pcm-svg { display: block; width: 100%; height: auto; }
.pcm-grid { stroke: var(--border); stroke-width: 1; }
.pcm-ax { fill: var(--muted); font: 11px/1 system-ui, sans-serif; }
.pcm-area { fill-opacity: .78; stroke: none; }
.pcm-cross { stroke: var(--text); stroke-opacity: .4; stroke-dasharray: 3 3; }
.pcm-tip { position: absolute; top: 38px; z-index: 3; white-space: pre-line; font-size: .8rem; padding: 7px 10px; border-radius: 8px; background: rgba(15, 23, 42, .92); color: #f8fafc; pointer-events: none; min-width: 170px; }
.pcm-legend2 { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.pcm-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 860px) { .pcm-two { grid-template-columns: 1fr; } }
.pcm-restore { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.pcm-restore p { margin: 6px 0; }
.pcm-tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.pcm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.pcm-table th, .pcm-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.pcm-table th { position: sticky; top: 0; background: var(--bg-2); cursor: pointer; white-space: nowrap; font-size: .82rem; }
.pcm-table th[aria-sort="descending"]::after { content: ' ▼'; } .pcm-table th[aria-sort="ascending"]::after { content: ' ▲'; }
.pcm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pcm-table td { overflow-wrap: anywhere; }
.pcm-late { color: #b45309; font-weight: 600; }
.pcm-more { margin-top: 10px; }
[data-theme="dark"] .pcm-warn, [data-theme="dark"] .pcm-late { color: #fbbf24; }
