/* Outage map: full-bleed WebGL map, floating search, control panel (bottom sheet + queue strip on phones) */
main:has(.mapshell) { padding-top: 0; padding-bottom: 0; }
main:has(.mapshell) .crumbs { display: none; }
.mapshell { --on: #ffc845; --off: #ff4d5e; --mixed: #ff8f3a; --unknown: #7d86ad; --unlisted: #4a5170; --dim: #1b2039;
            --glass: rgba(16, 21, 46, .92); --ink: #eef0fa; --muted: #a3abcf; --faint: #6f78a3;
            position: relative; width: 100vw; margin-left: calc(50% - 50vw); height: calc(100svh - 64px);
            min-height: 520px; background: #0a0d1d; overflow: hidden; color: var(--ink); }
#map { position: absolute; inset: 0; }
.mapshell button { font: inherit; cursor: pointer; }

/* Search */
.mp-search { position: absolute; z-index: 4; top: 14px; left: 14px; width: 380px; }
.mp-search input { width: 100%; height: 48px; padding: 0 16px 0 44px; border: 1px solid rgba(255, 200, 69, .35);
                   border-radius: 14px; background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23ffc845' stroke-width='2'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='m13 13 5 5'/%3E%3C/svg%3E") no-repeat 14px 50%;
                   color: var(--ink); font-size: 16px; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.mp-search input:focus { outline: none; border-color: var(--on); box-shadow: 0 0 0 3px rgba(255, 200, 69, .25), 0 10px 30px rgba(0, 0, 0, .35); }
.mp-search input::placeholder { color: #8d95bd; }
.mp-res { list-style: none; margin: 8px 0 0; padding: 6px; border-radius: 14px; background: rgba(16, 21, 46, .98);
          box-shadow: 0 14px 40px rgba(0, 0, 0, .45); max-height: 50vh; overflow: auto; }
.mp-res li { padding: 10px 12px; border-radius: 10px; cursor: pointer; line-height: 1.35; }
.mp-res li:hover, .mp-res li.active { background: #1f2853; }
.mp-res b { display: block; font-weight: 600; font-size: 15.5px; }
.mp-res small { display: block; color: var(--muted); font-size: 13.5px; }
.mp-res .q { display: inline-block; margin: 4px 4px 0 0; padding: 1px 8px; border-radius: 999px; font-size: 13px;
             font-weight: 700; color: #10142c; }

/* Panel */
.mp-panel { position: absolute; z-index: 3; top: 76px; left: 14px; width: 380px; max-height: calc(100% - 90px);
            overflow: auto; padding: 16px 18px 14px; border-radius: 18px; background: var(--glass);
            backdrop-filter: blur(12px); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .06);
            scrollbar-width: thin; }
.mp-panel h1 { font: 700 18px/1.25 var(--display, system-ui); color: #fff; margin: 0 0 2px; }
.mp-when { margin: 0 0 10px; color: #ffdc95; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.mp-handle { display: none; }

.mp-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-nums.three { grid-template-columns: 1fr 1fr 1fr; }
.mp-n { padding: 9px 11px; border-radius: 12px; background: #0f1433; border: 1px solid rgba(255, 255, 255, .06); line-height: 1.15; }
.mp-n b { display: flex; align-items: center; gap: 7px; font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mp-n b i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.mp-n span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-n.off b { color: #ff8a95; } .mp-n.on b { color: var(--on); } .mp-n.mixed b { color: #ffb27a; }
.mp-sub { margin: 7px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.mp-selline { margin: 0; font-size: 15px; line-height: 1.4; }
.mp-selline .mp-q { display: inline-block; padding: 1px 9px; border-radius: 999px; font-weight: 800; color: #10142c; margin-right: 4px; }
.mp-stat:empty { display: none; }
.mp-empty { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: #0f1433; border: 1px dashed rgba(255, 255, 255, .18);
            font-size: 14px; line-height: 1.45; color: var(--ink); }

.mp-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 2px; padding: 0; font-size: 13px; color: var(--muted); }
.mp-legend li { display: flex; align-items: center; gap: 6px; }
.mp-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }

.mp-body { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.mp-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 12px; }
.mp-chips button { padding: 8px 0; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); background: #141a3a;
                   color: var(--ink); font-weight: 700; font-size: 14.5px; display: flex; align-items: center; justify-content: center;
                   gap: 6px; font-variant-numeric: tabular-nums; transition: background .15s, border-color .15s; }
.mp-chips button i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.mp-chips button.off { background: rgba(255, 77, 94, .13); border-color: rgba(255, 77, 94, .35); }
.mp-chips button.on { background: rgba(255, 200, 69, .08); }
.mp-chips button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); background: #2b3566; }
.mp-chips button.all { grid-column: span 4; font-weight: 600; }
.mp-chips button.empty { border-style: dashed; border-color: rgba(255, 255, 255, .22); background: transparent; color: var(--muted); }
.mp-chips button.empty i { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--faint); }

.mp-seg { display: flex; padding: 3px; border-radius: 12px; background: #0c1030; gap: 3px; }
.mp-seg button { flex: 1; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 15px; }
.mp-seg button[aria-pressed="true"] { background: #2b3566; color: #fff; box-shadow: inset 0 -2px 0 var(--on); }
.mp-seg.small button { padding: 6px 10px; font-size: 14px; }
.mp-time { display: flex; align-items: center; gap: 8px; }
.mp-time .mp-seg { flex: 1; }
.mapshell .mp-ico, .mapshell .mp-now { height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: #141a3a; color: var(--ink); font-size: 14px; }
.mapshell .mp-ico { width: 40px; }
.mapshell .mp-now { padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; }
.mapshell .mp-now.live { border-color: var(--on); color: #ffdc95; }
.mapshell .mp-now.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--off); animation: mp-blink 1.6s infinite; }
@keyframes mp-blink { 50% { opacity: .25; } }
#mpslider { width: 100%; margin: 12px 0 0; accent-color: var(--on); }
.mp-ticks { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; margin: 2px 0 12px; }
.mp-check { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0 0; font-size: 14px; cursor: pointer; line-height: 1.35; }
.mp-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--on); flex: none; }
.mp-hint { margin: 4px 0 0 27px; font-size: 12.5px; color: var(--faint); line-height: 1.4; }
.mp-note { margin: 12px 0 0; font-size: 12px; color: var(--faint); line-height: 1.4; }
.mp-strip { display: none; }

/* Popup */
.maplibregl-popup-content { background: #10152e; color: var(--ink); border-radius: 14px; padding: 14px 16px;
                            box-shadow: 0 14px 40px rgba(0, 0, 0, .5); font: 15px/1.45 var(--font, system-ui); min-width: 240px; }
.maplibregl-popup-tip { border-top-color: #10152e !important; border-bottom-color: #10152e !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 22px; right: 6px; top: 4px; }
.mp-pop b { display: block; font-size: 16px; margin-right: 18px; }
.mp-pop .mp-note2 { color: #ffdc95; font-size: 13.5px; margin: 4px 0; }
.mp-pop .mp-row { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.mp-pop .mp-row.dim { opacity: .6; }
.mp-pop .mp-state { font-weight: 600; }
.mp-pop .mp-state.off { color: #ff8a95; } .mp-pop .mp-state.on { color: var(--on); }
.mp-pop .mp-q { display: inline-block; padding: 1px 9px; border-radius: 999px; font-weight: 800; color: #10142c; }
.mp-pop .mp-muted { flex-basis: 100%; color: var(--muted); font-size: 13.5px; }
.mp-pop .mp-label { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.mp-pop .mp-btns { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.mp-pop a.mp-btn { display: block; text-align: center; padding: 10px 12px; border-radius: 10px; background: var(--on); color: #1a1405;
                   font-weight: 700; text-decoration: none; font-size: 14.5px; }
.mp-pop a.mp-link { color: #9db5ff; font-size: 14px; }
.mp-pin { width: 22px; height: 22px; border-radius: 50%; background: var(--on); border: 3px solid #fff;
          box-shadow: 0 0 0 0 rgba(255, 200, 69, .7); animation: mp-pulse 1.8s infinite; }
@keyframes mp-pulse { 70% { box-shadow: 0 0 0 18px rgba(255, 200, 69, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 200, 69, 0); } }
.mp-loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; color: var(--muted); pointer-events: none; }
.maplibregl-ctrl-group { background: var(--glass) !important; }
.maplibregl-ctrl-group button + button { border-top-color: rgba(255, 255, 255, .08) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }
.maplibregl-ctrl-attrib { background: rgba(16, 21, 46, .7) !important; color: #8d95bd; }
.maplibregl-ctrl-attrib a { color: var(--muted); }
.map-below { margin-top: 36px; }

@media (max-width: 760px) {
  .mapshell { height: calc(100svh - 58px); min-height: 480px; }
  .mp-search { top: 10px; left: 10px; width: calc(100% - 20px); }
  .mp-search input { height: 46px; }
  .mp-strip { display: block; position: absolute; z-index: 3; top: 62px; left: 0; right: 0; padding: 0 10px 6px;
              overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mp-strip::-webkit-scrollbar { display: none; }
  .mp-strip .mp-chips { display: flex; gap: 6px; margin: 0; width: max-content; }
  .mp-strip .mp-chips button { padding: 7px 12px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px);
                               box-shadow: 0 4px 14px rgba(0, 0, 0, .35); font-size: 14px; }
  .mp-strip .mp-chips button.off { background: rgba(70, 18, 34, .92); }
  .mp-strip .mp-chips button.empty { background: rgba(16, 21, 46, .75); }
  .mp-strip .mp-chips button[aria-pressed="true"] { background: #2b3566; }
  .maplibregl-ctrl-top-right { top: 104px; }
  .maplibregl-ctrl-group:has(.maplibregl-ctrl-zoom-in) { display: none; }
  .mp-panel { top: auto; bottom: 0; left: 0; width: 100%; max-height: 72%; border-radius: 18px 18px 0 0;
              padding: 4px 14px calc(12px + env(safe-area-inset-bottom)); transition: transform .25s ease; }
  .mp-panel.collapsed { transform: translateY(calc(100% - var(--peek, 170px))); overflow: hidden; }
  .mp-handle { display: block; width: 100%; height: 22px; border: 0; background: transparent; }
  .mp-handle span { display: block; width: 44px; height: 5px; margin: 6px auto; border-radius: 3px; background: #3b4575; }
  .mp-panel h1 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mp-when { margin-bottom: 8px; }
  .mp-n { padding: 7px 10px; }
  .mp-n b { font-size: 19px; }
}
body.tg header.site, body.tg footer.site, body.tg .crumbs, body.tg .map-below, body.tg .faq { display: none !important; }
body.tg main { padding: 0 !important; }
body.tg .mapshell { height: 100svh; }
