#lyn-wrap-helgeland{
    --ly-ink:#0f172a;
    --ly-muted:#66758b;
    --ly-shell-bg:
      radial-gradient(920px 240px at 100% -70px, rgba(70, 116, 173, 0.12), transparent 52%),
      radial-gradient(760px 220px at -10% 100%, rgba(33, 77, 122, 0.08), transparent 56%),
      linear-gradient(180deg, rgba(247,249,252,0.98), rgba(239,244,249,0.96));
    --ly-shell-border:rgba(148,163,184,.18);
    --ly-shell-shadow:
      0 24px 44px rgba(15,23,42,.12),
      0 10px 24px rgba(15,23,42,.08),
      inset 0 1px 0 rgba(255,255,255,.7);
    --ly-head-bg:linear-gradient(135deg, rgba(255,244,231,.97), rgba(249,232,212,.95));
    --ly-head-border:rgba(191,141,92,.24);
    --ly-map-bg:#edf3fb;
    --ly-map-border:rgba(148,163,184,.18);
    --panel-bg:rgba(255,255,255,.84);
    --panel-border:rgba(148,163,184,.24);
    --ly-panel-shadow:0 18px 34px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.68);
    --ly-field-bg:#eef9f0;
    --ly-field-border:rgba(109,155,125,.28);
    --ly-count-bg:linear-gradient(180deg, rgba(221,235,253,.96), rgba(203,224,250,.96));
    --ly-count-border:rgba(59,130,246,.26);
    --ly-legend-pill-bg:linear-gradient(180deg, rgba(241,245,249,.96), rgba(229,236,244,.96));
    --ly-legend-pill-border:rgba(148,163,184,.24);
    --text:var(--ly-ink);
    --chip:#e7ecf8;
    --ic:#287EFF;
    --cg:#FF4B4B;
    --super:#FFD54A;
    --poly:#111;
    --btn:#0d6efd;
    --btn-hover:#0b5ed7;
    --shadow:0 16px 30px rgba(15,23,42,.14);
    color-scheme:light;
    font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Noto Sans",sans-serif;
    color:var(--text);
    display:grid;
    gap:.95rem;
    width:100%;
    max-width:none;
    margin:0;
  }
  :root[data-theme="dark"] #lyn-wrap-helgeland{
    --ly-ink:#e5edf5;
    --ly-muted:#b9c5d4;
    --ly-shell-bg:
      radial-gradient(980px 260px at 100% -70px, rgba(93, 132, 178, 0.18), transparent 54%),
      radial-gradient(760px 220px at -10% 100%, rgba(36, 77, 118, 0.12), transparent 56%),
      linear-gradient(180deg, rgba(20,24,29,0.98), rgba(15,19,24,0.96));
    --ly-shell-border:rgba(148,163,184,.18);
    --ly-shell-shadow:
      0 26px 50px rgba(0,0,0,.30),
      0 12px 26px rgba(0,0,0,.16),
      inset 0 1px 0 rgba(255,255,255,.04);
    --ly-head-bg:linear-gradient(135deg, rgba(24,29,34,.97), rgba(18,23,28,.94));
    --ly-head-border:rgba(148,163,184,.18);
    --ly-map-bg:#11161d;
    --ly-map-border:rgba(148,163,184,.16);
    --panel-bg:linear-gradient(180deg, rgba(24,29,34,.94), rgba(18,23,28,.92));
    --panel-border:rgba(148,163,184,.24);
    --ly-panel-shadow:0 20px 36px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.05);
    --ly-field-bg:linear-gradient(180deg, rgba(47,53,58,.96), rgba(37,43,48,.96));
    --ly-field-border:rgba(132,184,149,.28);
    --ly-count-bg:linear-gradient(180deg, rgba(22,47,90,.90), rgba(18,38,72,.90));
    --ly-count-border:rgba(96,165,250,.34);
    --ly-legend-pill-bg:linear-gradient(180deg, rgba(24,29,34,.94), rgba(18,23,28,.92));
    --ly-legend-pill-border:rgba(148,163,184,.22);
    --chip:#1d2535;
    --ic:#287EFF;
    --cg:#FF4B4B;
    --super:#ffe37a;
    --poly:#111;
    --btn:#3b82f6;
    --btn-hover:#2563eb;
    --shadow:0 20px 34px rgba(0,0,0,.28);
    color-scheme:dark;
  }
  @media (prefers-color-scheme:dark){
    :root:not([data-theme]) #lyn-wrap-helgeland{
      --ly-ink:#e5edf5;
      --ly-muted:#b9c5d4;
      --ly-shell-bg:
        radial-gradient(980px 260px at 100% -70px, rgba(93, 132, 178, 0.18), transparent 54%),
        radial-gradient(760px 220px at -10% 100%, rgba(36, 77, 118, 0.12), transparent 56%),
        linear-gradient(180deg, rgba(20,24,29,0.98), rgba(15,19,24,0.96));
      --ly-shell-border:rgba(148,163,184,.18);
      --ly-shell-shadow:
        0 26px 50px rgba(0,0,0,.30),
        0 12px 26px rgba(0,0,0,.16),
        inset 0 1px 0 rgba(255,255,255,.04);
      --ly-head-bg:linear-gradient(135deg, rgba(24,29,34,.97), rgba(18,23,28,.94));
      --ly-head-border:rgba(148,163,184,.18);
      --ly-map-bg:#11161d;
      --ly-map-border:rgba(148,163,184,.16);
      --panel-bg:linear-gradient(180deg, rgba(24,29,34,.94), rgba(18,23,28,.92));
      --panel-border:rgba(148,163,184,.24);
      --ly-panel-shadow:0 20px 36px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.05);
      --ly-field-bg:linear-gradient(180deg, rgba(47,53,58,.96), rgba(37,43,48,.96));
      --ly-field-border:rgba(132,184,149,.28);
      --ly-count-bg:linear-gradient(180deg, rgba(22,47,90,.90), rgba(18,38,72,.90));
      --ly-count-border:rgba(96,165,250,.34);
      --ly-legend-pill-bg:linear-gradient(180deg, rgba(24,29,34,.94), rgba(18,23,28,.92));
      --ly-legend-pill-border:rgba(148,163,184,.22);
      --chip:#1d2535;
      --ic:#287EFF;
      --cg:#FF4B4B;
      --super:#ffe37a;
      --poly:#111;
      --btn:#3b82f6;
      --btn-hover:#2563eb;
      --shadow:0 20px 34px rgba(0,0,0,.28);
      color-scheme:dark;
    }
  }

  .ly-page-shell{
    display:flex;
    flex-direction:column;
    gap:1rem;
    padding:clamp(.9rem,2vw,1.15rem) 0 0;
    border-radius:20px;
    border:1px solid var(--ly-shell-border);
    background:var(--ly-shell-bg);
    box-shadow:var(--ly-shell-shadow);
    overflow:hidden;
  }
  .ly-page-head{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:0;
    width:100%;
    padding:0 clamp(.9rem,2vw,1.15rem);
    box-sizing:border-box;
    border:0;
    background:none;
    text-align:center;
  }
  #lyn-wrap-helgeland h1{
    margin:0;
    text-align:center;
    font-size:clamp(1.18rem,2.2vw,1.62rem);
    line-height:1.04;
    font-weight:800;
    color:var(--text);
  }
  #lyn-wrap-helgeland .leaflet-pane.leaflet-popup-pane{z-index:1200 !important}

  #map{
    width:100%;
    height:clamp(480px,82vh,88vh);
    min-height:480px;
    border-radius:18px;
    overflow:hidden;
    box-shadow:var(--shadow);
    background:var(--ly-map-bg);
    border:1px solid var(--ly-map-border);
    position:relative;
  }

  .panel{ z-index:650; }
  .legend{ z-index:640; }

  .panel{
    position:relative;
    inset:auto;
    background:
      linear-gradient(180deg, rgba(8, 13, 23, 0.48), rgba(8, 13, 23, 0.68)),
      url("/images/lightning-fjord-panel.webp?v=20260429") center center / 100% 112% no-repeat,
      var(--ly-head-bg);
    border:1px solid var(--ly-head-border);
    border-radius:16px;
    backdrop-filter:saturate(160%) blur(10px);
    box-shadow:var(--ly-panel-shadow);
    padding:.44rem .58rem .5rem;
    display:grid;
    grid-template-columns:max-content max-content max-content;
    gap:.24rem .34rem;
    align-items:end;
    justify-content:center;
    width:100%;
    max-width:none;
    margin:0 auto;
  }
  .panel-title{
    grid-column:1 / -1;
    padding:0 0 .08rem;
  }
  .panel-title h1{
    color:#f8fafc !important;
    text-shadow:0 2px 8px rgba(0,0,0,.78);
  }
  .panel-lead{
    max-width:34rem;
    margin:.18rem auto 0;
    color:rgba(248,250,252,.84);
    font-size:.68rem;
    line-height:1.24;
    text-align:center;
    text-shadow:0 1px 5px rgba(0,0,0,.72);
  }
  .row{display:contents;}
  .hdr{
    font-size:.62rem;
    font-weight:800;
    letter-spacing:.1em;
    text-transform:uppercase;
    color:rgba(248,250,252,.88);
    text-align:left;
    justify-self:start;
    text-shadow:0 1px 5px rgba(0,0,0,.72);
  }
  .hdr--empty{
    visibility:hidden;
  }
  .hdr--mun,
  #munSel{
    grid-column:1 / -1;
  }
  .hdr--mun{
    justify-self:center;
  }

  .count{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:1.95rem;
    background:var(--ly-count-bg);
    color:var(--text);
    padding:.14rem .54rem;
    border-radius:999px;
    font-weight:800;
    font-size:.78rem;
    border:1px solid var(--ly-count-border);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.2);
  }
  .count[aria-busy="true"]{opacity:.65}
  .count--map{
    position:absolute;
    top:0;
    right:calc(100% + .18rem);
    min-height:1.72rem;
    min-width:4.9rem;
    padding:.12rem .5rem;
    font-size:.74rem;
    white-space:nowrap;
    box-shadow:0 10px 18px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.22);
  }

  .panel select{
    min-width:0;
    width:auto;
    min-height:2.18rem;
    margin-top:-1px;
    padding:.28rem .58rem;
    border-radius:.72rem;
    border:1px solid var(--ly-field-border);
    background:var(--ly-field-bg) !important;
    color:var(--text) !important;
    font-size:.88rem;
    font-weight:600;
    line-height:1.1;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
  }
  .sr-only{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0, 0, 0, 0) !important;
    white-space:nowrap !important;
    border:0 !important;
  }
  .panel select option{
    background:#fff;
    color:#0f172a;
  }
  .panel select option:checked,
  .panel select option:hover{
    background:#f8fafc;
    color:#0f172a;
  }
  :root[data-theme="dark"] #lyn-wrap-helgeland .panel select option{
    background:#f8fafc !important;
    color:#11161b !important;
  }
  :root[data-theme="dark"] #lyn-wrap-helgeland .panel select option:checked,
  :root[data-theme="dark"] #lyn-wrap-helgeland .panel select option:hover{
    background:rgb(226, 232, 240) !important;
    color:#11161b !important;
  }
  #munSel{
    justify-self:center;
    min-width:11.6rem;
    max-width:min(100%, 18rem);
  }
  #typeSel{min-width:6.2rem;}
  #timeSel{min-width:8.1rem;}

  .panel button{
    min-height:2.18rem;
    margin-top:-1px;
    padding:.3rem .72rem;
    border:1px solid color-mix(in oklab, var(--btn) 26%, transparent);
    border-radius:.78rem;
    background:linear-gradient(180deg, color-mix(in oklab, var(--btn) 82%, #fff), var(--btn));
    color:#fff;
    font-weight:700;
    font-size:.88rem;
    cursor:pointer;
    box-shadow:0 10px 18px color-mix(in oklab, var(--btn) 22%, transparent);
    justify-self:end;
  }
  .panel button:hover{background:var(--btn-hover)}
  .panel button:disabled{opacity:.74;cursor:wait}

  .legend{
    position:absolute;
    inset:10px 10px auto auto;
    width:max-content;
    max-width:calc(100% - 20px);
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:.18rem;
    pointer-events:none;
  }
  .lg-row{
    display:inline-flex;
    align-items:center;
    gap:.38rem;
    min-height:1.72rem;
    width:100%;
    max-width:100%;
    padding:.24rem .58rem;
    box-sizing:border-box;
    border-radius:999px;
    border:1px solid var(--ly-legend-pill-border);
    background:var(--ly-legend-pill-bg);
    box-shadow:0 14px 26px rgba(15,23,42,.12);
    font-size:.8rem;
    font-weight:600;
    line-height:1.1;
    justify-content:flex-start;
  }
  .lg-label{
    flex:1 1 auto;
    min-width:0;
    text-align:left;
  }
  .lg-side{
    flex:0 0 auto;
    margin-left:auto;
    text-align:right;
    white-space:nowrap;
  }
  .sw{width:14px;height:14px;border-radius:50%; position:relative; overflow:hidden}
  .sw.ic{background:var(--ic)} .sw.cg{background:var(--cg)}
  .sw.super{
    background:center/100% 100% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Ccircle cx='7' cy='7' r='6.4' fill='%23ffd84a' stroke='%23fff4b8' stroke-width='1'/%3E%3Ccircle cx='5.2' cy='5.1' r='2.2' fill='%23fff8bf' fill-opacity='.94'/%3E%3C/svg%3E");
    border:none;
    box-shadow:
      0 0 0 1px rgba(92,68,0,.22),
      0 0 10px 2px color-mix(in oklab, #ffe15a 72%, transparent);
  }

  @media (min-width:970px){
    .legend{
      inset:10px auto auto 56px;
      align-items:flex-start;
    }
    .legend .count--map{
      right:auto;
      left:calc(100% + .28rem);
    }
  }

  /* Superbolt pulse ring */
  .sb-pulse{pointer-events:none}
  .sb-pulse .ring{
    position:absolute;left:-14px;top:-14px;width:28px;height:28px;border-radius:50%;
    border:2px solid var(--super);opacity:.9;transform-origin:center;animation:sb-p 1.8s ease-out forwards;
  }
  @keyframes sb-p{0%{transform:scale(.6);opacity:.9}70%{transform:scale(2.3);opacity:.25}100%{transform:scale(2.6);opacity:0}}
  @media (prefers-reduced-motion:reduce){ .sb-pulse .ring{animation:none;opacity:.55} }

  /* Popup - darker premium */
  .leaflet-popup-content-wrapper{
    border-radius:14px;
    border:1px solid #3b4556;
    background:linear-gradient(180deg, #1d2635 0%, #101722 100%);
    box-sizing:border-box;
    overflow:hidden;
    box-shadow:
      0 16px 34px rgba(2,6,23,.52),
      inset 0 1px 0 rgba(255,255,255,.06);
  }
  .leaflet-popup-tip{
    background:#121a27;
    box-shadow:-1px 1px 0 #3b4556;
  }
  .leaflet-popup-close-button{
    position:absolute;
    top:8px;
    right:8px;
    width:26px;
    height:26px;
    border:1px solid #6a7f9e !important;
    border-radius:50%;
    background:#0f1726;
    color:#d3ddef !important;
    font-size:17px !important;
    font-weight:700;
    line-height:24px !important;
    text-align:center;
    box-sizing:border-box;
    padding:0 !important;
    text-decoration:none;
    box-shadow:
      0 0 0 1px rgba(10,18,31,.55),
      inset 0 1px 0 rgba(255,255,255,.12);
  }
  .leaflet-popup-close-button:hover{
    color:#fff !important;
    background:#18253b;
    border-color:#89a7d2 !important;
  }
  .leaflet-popup-close-button:focus-visible{
    outline:2px solid #8fc7ff;
    outline-offset:1px;
  }
  .leaflet-popup-content{margin:.7rem .82rem .78rem;width:clamp(238px, 70vw, 296px);max-width:calc(100vw - 86px);font-size:1rem;line-height:1.5;box-sizing:border-box;overflow:hidden}
  .ly-popup{
    --accent:var(--cg);
    width:100%;
    max-width:100%;
    position:relative;
    border-radius:11px;
    padding:.1rem .15rem .08rem;
    box-sizing:border-box;
    overflow:hidden;
    color:#ecf2ff;
    background-color:#161e2c;
    background-image:
      linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0)),
      radial-gradient(130% 90% at 0% 100%, rgba(255, 197, 92, .18), transparent 56%),
      radial-gradient(120% 90% at 100% 0%, rgba(120, 182, 255, .16), transparent 58%),
      linear-gradient(180deg, #242f41 0%, #161e2c 100%);
    border:1px solid rgba(255,255,255,.08);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.09),
      inset 0 -1px 0 rgba(255,255,255,.04);
  }
  .ly-popup::before{
    content:"";
    position:absolute;
    left:7px; right:7px; top:0;
    height:2px;
    border-radius:8px;
    background-image:linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity:.9;
  }
  .ly-popup::after{
    content:"";
    position:absolute;
    inset:0;
    border-radius:11px;
    pointer-events:none;
    background:linear-gradient(120deg, rgba(255,255,255,.08) 0 15%, transparent 30% 70%, rgba(255,255,255,.05) 85% 100%);
    mix-blend-mode:screen;
    opacity:.4;
  }
  .ly-popup .head{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:.72rem;margin:0 0 .36rem;padding-top:.14rem}
  .ly-popup .left{display:flex;align-items:center;gap:.58rem}
  .ly-popup .bolt{
    width:29px;height:29px;border-radius:8px;display:grid;place-items:center;
    font-size:16px;font-weight:900;color:#6b3f00;
    background:linear-gradient(180deg, #fff7b7 0%, #ffd95d 58%, #e7a90f 100%);
    border:1px solid #d79a0a;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.84),0 0 12px rgba(245,177,24,.35),0 4px 9px rgba(0,0,0,.32);
  }
  .ly-popup .kA-row{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap;row-gap:2px}
  .ly-popup .kA{
    font:900 1.3rem/1.04 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Noto Sans",sans-serif;letter-spacing:.2px;
    color:color-mix(in oklab, var(--accent) 76%, #fff);
    text-shadow:
      0 1px 0 rgba(0,0,0,.58),
      0 0 12px color-mix(in oklab, var(--accent) 52%, transparent);
  }
  .ly-popup.is-cg .kA{color:#ff9f9f}
  .ly-popup.is-ic .kA{color:#9ad8ff}
  .ly-popup .sb-tag{
    display:inline-flex;align-items:center;padding:2px 9px;border-radius:999px;
    font:900 .76rem/1 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Noto Sans",sans-serif;
    letter-spacing:.5px;text-transform:uppercase;color:#6e4300;border:1px solid #d8a313;
    background:linear-gradient(180deg, #fff7c8 0%, #ffd860 100%);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.65),0 0 10px rgba(255,204,77,.35);
    margin-top:1px;
  }
  .ly-popup.is-super .kA-row{display:grid;grid-template-columns:max-content 1fr;column-gap:.45rem;align-items:center}
  .ly-popup.is-super .kA-row .sb-tag{position:static;transform:none;justify-self:center;margin-top:0;white-space:nowrap}
  .ly-popup .sub{font-size:.89rem;color:#e1e8f5;margin-top:1px}
  .ly-popup .text{min-width:0}
  .ly-popup .chip{font-weight:800;border-radius:999px;padding:2px 9px;background:color-mix(in oklab, var(--accent) 22%, #0f172a);color:#ecf2ff;border:1px solid color-mix(in oklab, var(--accent) 52%, transparent);box-shadow:0 0 8px color-mix(in oklab, var(--accent) 32%, transparent)}
  .ly-popup .hr{height:2px;border-radius:2px;margin:.58rem 0 .56rem;background:linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 82%, #fff), transparent);opacity:.95}
  .ly-popup .cg-meta{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.42rem;margin:0 0 .46rem;position:relative;z-index:1}
  .ly-popup .geo-pill{display:inline-flex;align-items:center;gap:.4rem;padding:3px 10px;border-radius:999px;border:1px solid color-mix(in oklab, var(--accent) 42%, transparent);background:color-mix(in oklab, var(--accent) 14%, #0f172a);color:#edf3ff;font-size:.82rem;line-height:1.1;white-space:nowrap}
  .ly-popup .geo-pill .k{font-weight:700;opacity:.84}
  .ly-popup .geo-pill .v{font-weight:800;letter-spacing:.1px}
  .ly-popup .stats{display:grid;grid-template-columns:auto 1fr;gap:.3rem .72rem;position:relative;z-index:1}
  .ly-popup .lab{font-weight:800;color:#e8eefb}
  .ly-popup .mono{font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:nowrap;letter-spacing:0;color:#e6ecf8}
  .ly-popup .num{font-variant-numeric:tabular-nums;font-weight:800;white-space:nowrap;letter-spacing:0;color:#f3f7ff}
  .ly-popup .dt{margin-top:.56rem;padding-top:.46rem;border-top:1px solid rgba(255,255,255,.12);text-align:center;font-size:.84rem;color:#d4dceb;line-height:1.23;white-space:normal}

  @media (max-width:700px){
    .ly-page-head{
      align-items:center;
      text-align:center;
    }
    #lyn-wrap-helgeland h1{
      text-align:center;
    }
  }
  @media (max-width:540px){
    #lyn-wrap-helgeland{
      gap:.8rem;
    }
    .ly-page-shell{
      padding:.8rem 0 0;
    }
    .ly-page-head{
      gap:0;
      padding:0 .8rem;
    }
    .panel{
      width:100%;
      padding:.56rem .6rem;
      gap:.32rem .36rem;
    }
    .hdr{
      font-size:.64rem;
    }
    .count{
      min-height:1.82rem;
      padding:.1rem .48rem;
      font-size:.74rem;
    }
    .count--map{
      min-height:1.58rem;
      min-width:4.5rem;
      padding:.08rem .42rem;
      font-size:.7rem;
    }
    .panel select{
      min-height:2.02rem;
      margin-top:-1px;
      padding:.24rem .5rem;
      font-size:.84rem;
    }
    #munSel{
      min-width:10.6rem;
    }
    .panel button{
      min-height:2.02rem;
      margin-top:-1px;
      padding:.24rem .62rem;
      font-size:.84rem;
    }
    .legend{
      inset:10px 10px auto auto;
    }
    .lg-row{
      font-size:.76rem;
      padding:.22rem .5rem;
    }
  }
