/* elradar.no – stilark v2
   Nattblå kraftstasjon, høyspent-amber for strøm, isbre-cyan for vann.
   Bakgrunnen følger sola og årstiden. Archivo (bred, tung) for tall og titler, IBM Plex Sans for tekst. */

:root {
  --night: #060504;
  --night-2: #0E0B09;
  --panel: rgba(14, 11, 9, 0.84);
  --panel-solid: #16120F;
  --line: rgba(255, 140, 50, 0.17);
  --ink: #F6F2EC;
  --soft: #DCD3C8;
  --muted: #A89C8F;
  --volt: #FF7A00;
  --volt-glow: rgba(255, 122, 0, 0.6);
  --volt-soft: rgba(255, 122, 0, 0.16);
  --water: #4FD1E8;
  --water-soft: rgba(79, 209, 232, 0.16);
  --cheap: #36D399;
  --dear: #FF4D5E;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 18px;
  --r-sm: 8px;
  --gap: clamp(14px, 2.4vw, 24px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--night); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.55; min-height: 100vh;
  font-variant-numeric: tabular-nums;
}
a { color: var(--water); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; }

/* ================= bakgrunn som følger døgnet ================= */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--night); }
.bg-img {
  position: absolute; inset: -3%; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 3s ease, filter 3s ease; transform: scale(1.03);
  animation: drift 120s ease-in-out infinite alternate;
}
.bg-img.show { opacity: 1; }
@keyframes drift { to { transform: scale(1.09) translate(-1%, -1%); } }
.bg-veil, .bg-tint { position: absolute; inset: 0; transition: background 4s ease, opacity 4s ease; }
.bg-grid {
  position: absolute; inset: 0; opacity: 0.07;
  background-image: linear-gradient(var(--volt) 1px, transparent 1px), linear-gradient(90deg, var(--volt) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 15%, #000 15%, transparent 70%);
}

/* Natt: mørkt og kaldt */
body[data-phase="night"] .bg-img { filter: saturate(0.85) brightness(0.8); }
body[data-phase="night"] .bg-veil { background: linear-gradient(180deg, rgba(0, 0, 0, 0.70) 0%, rgba(0, 0, 0, 0.88) 50%, rgba(0, 0, 0, 0.96) 100%); }
body[data-phase="night"] .bg-tint { background: radial-gradient(90% 60% at 70% 0%, rgba(255, 110, 0, 0.12), transparent 60%); }
/* Morgen: rosa og gyllent lys fra øst */
body[data-phase="morning"] .bg-img { filter: saturate(1.05) brightness(1); }
body[data-phase="morning"] .bg-veil { background: linear-gradient(180deg, rgba(12, 9, 7, 0.42) 0%, rgba(8, 6, 5, 0.80) 55%, rgba(8, 6, 5, 0.94) 100%); }
body[data-phase="morning"] .bg-tint { background: radial-gradient(110% 70% at 85% 5%, rgba(255, 150, 120, 0.22), transparent 60%); }
/* Dag: lyst, mest av bildet synlig */
body[data-phase="day"] .bg-img { filter: saturate(1.15) brightness(1.08); }
body[data-phase="day"] .bg-veil { background: linear-gradient(180deg, rgba(40, 26, 14, 0.18) 0%, rgba(10, 8, 6, 0.62) 50%, rgba(8, 6, 5, 0.90) 100%); }
body[data-phase="day"] .bg-tint { background: radial-gradient(120% 70% at 50% 0%, rgba(255, 220, 180, 0.14), transparent 60%); }
/* Kveld: amber og fiolett */
body[data-phase="evening"] .bg-img { filter: saturate(1.1) brightness(0.95); }
body[data-phase="evening"] .bg-veil { background: linear-gradient(180deg, rgba(22, 10, 4, 0.42) 0%, rgba(10, 7, 5, 0.82) 55%, rgba(8, 6, 5, 0.95) 100%); }
body[data-phase="evening"] .bg-tint { background: radial-gradient(110% 70% at 15% 5%, rgba(255, 150, 60, 0.24), transparent 60%); }
body[data-phase="day"] { --panel: rgba(16, 12, 9, 0.74); }
body[data-season="winter"] .bg-grid { opacity: 0.09; }

/* ================= topp ================= */
.top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 4vw, 40px); padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(5, 4, 3, 0.80); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg.logo { height: 42px; width: auto; display: block; filter: drop-shadow(0 0 10px rgba(255, 122, 0, 0.35)); }
@media (max-width: 760px) { .brand svg.logo { height: 34px; } }
.brand .sweep { transform-origin: 32px 32px; transform-box: view-box; animation: sweep 6s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.brand-word { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 1.6rem; letter-spacing: -0.03em; line-height: 1; }
.brand-word span { color: var(--volt); text-shadow: 0 0 18px var(--volt-glow); }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; white-space: nowrap; padding: 6px 11px; border-radius: 999px; font-size: 0.92rem; }
.nav a:hover { color: var(--ink); background: rgba(168, 156, 143, 0.12); }
.pulse { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.pulse i { width: 8px; height: 8px; border-radius: 50%; background: var(--cheap); box-shadow: 0 0 0 0 rgba(54, 211, 153, 0.6); animation: beat 2s infinite; }
.pulse.stale i { background: var(--volt); animation: none; }
@keyframes beat { 70% { box-shadow: 0 0 0 9px rgba(54, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(54, 211, 153, 0); } }
@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 8px 12px; }
  .nav { order: 3; width: 100%; margin-left: -8px; }
  .pulse { margin-left: auto; }
}

/* ================= layout ================= */
main { width: min(1280px, 100%); margin: 0 auto; padding: var(--gap) clamp(14px, 4vw, 40px) 48px; }
section { margin-top: clamp(36px, 6vw, 72px); }
.hero { margin-top: 6px; display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.hero > section { margin-top: 0; }
@media (min-width: 980px) { .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }

h2.sec {
  font-family: var(--display); font-stretch: 118%; font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 8px;
}
h2.sec::after {
  content: ""; display: block; width: 56px; height: 4px; margin-top: 10px; border-radius: 2px;
  background: var(--volt); box-shadow: 0 0 14px var(--volt-glow);
}
#magasin h2.sec::after { background: var(--water); box-shadow: 0 0 14px rgba(79, 209, 232, 0.55); }
.lede { color: var(--soft); margin: 0 0 18px; max-width: 64ch; }
h3 { font-family: var(--display); font-stretch: 112%; font-size: 1.12rem; margin: 0 0 12px; }

.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(16px, 2.6vw, 26px); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.panel.water { border-top: 2px solid var(--water); }

.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(168, 156, 143, 0.12); }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; }
.tabs button[aria-pressed="true"] { background: var(--volt); color: #120800; box-shadow: 0 0 16px var(--volt-glow); }
.tabs button:disabled { opacity: 0.4; cursor: not-allowed; }
.note { color: var(--muted); font-size: 0.85rem; margin: 8px 0 0; }
.skeleton { color: var(--muted); }

/* ================= prisen nå ================= */
.now { display: flex; flex-direction: column; gap: 14px; border-top: 2px solid var(--volt); }
.zones { display: flex; flex-wrap: wrap; gap: 6px; }
.zone-btn { border: 1px solid var(--line); background: rgba(8, 6, 5, 0.4); cursor: pointer; padding: 7px 12px; border-radius: 999px; font-size: 0.9rem; color: var(--muted); }
.zone-btn b { font-weight: 700; color: var(--ink); margin-right: 5px; }
.zone-btn[aria-pressed="true"] { border-color: var(--volt); background: var(--volt-soft); color: var(--ink); box-shadow: 0 0 14px rgba(255, 122, 0, 0.25); }
.now-where { color: var(--soft); margin: 6px 0 0; font-size: 1.05rem; }
.now-price {
  font-family: var(--display); font-stretch: 125%; font-weight: 900;
  font-size: clamp(4.8rem, 15vw, 9rem); line-height: 0.88; letter-spacing: -0.05em;
  margin: 4px 0 0; display: flex; align-items: baseline; gap: 12px; transition: color .8s;
  text-shadow: 0 0 34px color-mix(in srgb, currentColor 45%, transparent);
}
.now-price small { font-family: var(--body); font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--muted); text-shadow: none; }
.now-sub { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 0.95rem; }
.now-sub strong { color: var(--ink); font-weight: 600; }
.spark { height: 54px; }
.spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--volt); width: 16px; height: 16px; }
.explain { border-top: 1px solid var(--line); padding-top: 16px; }
.explain h2 { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 1.35rem; line-height: 1.2; margin: 0 0 6px; }
.explain p { margin: 0; max-width: 62ch; color: var(--soft); }
.explain .by { margin-top: 8px; font-size: 0.82rem; color: var(--muted); }

/* ================= det store kartet ================= */
.mapwrap { display: flex; flex-direction: column; gap: 12px; }
.map-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.map-head h2.sec { margin: 0; }
.bigmap { position: relative; width: 100%; aspect-ratio: 554 / 720; max-height: 86vh; margin: 0 auto; }
.bigmap svg { position: relative; width: 100%; height: 100%; display: block; overflow: visible; }
.radar {
  position: absolute; inset: 6% 4%; border-radius: 50%; pointer-events: none; z-index: 1; opacity: 0.55;
  background: conic-gradient(from 0deg, rgba(255, 122, 0, 0) 0deg, rgba(255, 122, 0, 0) 300deg, rgba(255, 122, 0, 0.18) 355deg, rgba(255, 122, 0, 0) 360deg);
  animation: sweep 9s linear infinite; mix-blend-mode: screen;
  mask-image: radial-gradient(circle, #000 55%, transparent 71%);
}
.land { fill: rgba(30, 24, 20, 0.78); stroke: rgba(110, 88, 70, 0.45); stroke-width: 0.7; }
.zonep { stroke: rgba(8, 6, 5, 0.95); stroke-width: 1.2; cursor: pointer; transition: fill .9s ease, fill-opacity .9s ease; }
.zonep.sel { stroke: #fff; stroke-width: 2; }
.zonep:hover { fill-opacity: 1 !important; }
.cable-base { fill: none; stroke: rgba(4, 10, 22, 0.85); stroke-linecap: round; }
.cable { fill: none; stroke-linecap: round; opacity: 0.9; }
.cable-idle { fill: none; stroke: rgba(168, 156, 143, 0.25); stroke-width: 1.4; stroke-dasharray: 3 5; }
.ext circle { fill: #060504; stroke: var(--muted); stroke-width: 1.5; }
.ext text { font: 600 11px var(--body); fill: var(--soft); paint-order: stroke; stroke: rgba(0, 0, 0, 0.95); stroke-width: 4px; }
.mw { font: 700 11px var(--display); font-stretch: 112%; paint-order: stroke; stroke: rgba(0, 0, 0, 0.95); stroke-width: 4px; }
.zlabel { cursor: pointer; }
.zlabel .code { font: 700 12px var(--display); font-stretch: 112%; fill: var(--soft); paint-order: stroke; stroke: rgba(0, 0, 0, 0.95); stroke-width: 4px; }
.zlabel .val { font: 900 30px var(--display); font-stretch: 125%; letter-spacing: -0.03em; paint-order: stroke; stroke: rgba(0, 0, 0, 0.95); stroke-width: 6px; }
.zlabel .unit { font: 600 11px var(--body); fill: var(--muted); paint-order: stroke; stroke: rgba(0, 0, 0, 0.95); stroke-width: 4px; }
.leader { stroke: rgba(238, 243, 250, 0.45); stroke-width: 1; fill: none; }
.anchor { fill: #fff; }
.map-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.legend-bar { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--muted); }
.legend-bar .grad { width: 140px; height: 8px; border-radius: 4px; }
.legend-bar .dotl { display: inline-flex; align-items: center; gap: 6px; }
.legend-bar .dotl i { width: 9px; height: 9px; border-radius: 50%; }
.netto { font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 1.1rem; }
.netto.exp { color: var(--volt); text-shadow: 0 0 14px var(--volt-glow); }
.netto.imp { color: var(--water); }
.mix { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.mix div { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.mix b { display: block; font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 1.25rem; }
.mix span { color: var(--muted); font-size: 0.85rem; }

/* ================= prisutvikling ================= */
.hist-controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.zchips { display: flex; flex-wrap: wrap; gap: 6px; }
.zchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--muted); font-size: 0.88rem; }
.zchip i { width: 12px; height: 3px; border-radius: 2px; }
.zchip[aria-pressed="true"] { color: var(--ink); border-color: rgba(238, 243, 250, 0.35); }
.zchip[aria-pressed="false"] i { opacity: 0.3; }
.hist-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hstat span { display: block; color: var(--muted); font-size: 0.85rem; }
.hstat b { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.05; }
.hstat em { font-style: normal; font-size: 0.9rem; font-weight: 600; margin-left: 6px; }
.up { color: var(--dear); } .down { color: var(--cheap); }
.hchart { position: relative; height: clamp(240px, 38vw, 380px); touch-action: pan-y; }
.hchart svg { width: 100%; height: 100%; display: block; }
.hchart .ylab { position: absolute; left: 0; font-size: 0.75rem; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.hchart .cross { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(238, 243, 250, 0.5); pointer-events: none; display: none; }
.hchart .htip { position: absolute; top: 6px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 0.82rem; pointer-events: none; display: none; white-space: nowrap; z-index: 3; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.hchart .htip b { display: block; margin-bottom: 4px; }
.hchart .htip span { display: flex; justify-content: space-between; gap: 14px; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.75rem; margin-top: 8px; }

/* ================= time for time ================= */
#priser .tabs { margin-bottom: 16px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: clamp(180px, 30vw, 270px); position: relative; padding-top: 26px; }
.bar { flex: 1; position: relative; border-radius: 4px 4px 1px 1px; min-height: 3px; transition: height .6s ease, background .4s; }
.bar.now { box-shadow: 0 0 0 2px var(--ink), 0 0 22px rgba(255, 255, 255, 0.45); }
.bar.cheap3::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--cheap); box-shadow: 0 0 8px var(--cheap); }
.bar .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line); padding: 3px 7px; border-radius: 6px; font-size: 0.78rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.bar:hover .tip, .bar:focus .tip, .bar.now .tip { opacity: 1; }
.hours { display: flex; gap: 3px; margin-top: 14px; color: var(--muted); font-size: 0.75rem; }
.hours span { flex: 1; text-align: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.fact { background: rgba(168, 156, 143, 0.08); border-radius: var(--r-sm); padding: 10px 12px; }
.fact span { color: var(--muted); font-size: 0.85rem; display: block; }
.fact b { font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 1.25rem; }
.zonegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.zcard { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.zcard[aria-pressed="true"] { border-color: var(--volt); box-shadow: 0 0 18px rgba(255, 122, 0, 0.2); }
.zcard .zn { color: var(--muted); font-size: 0.85rem; }
.zcard .zp { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 1.9rem; line-height: 1.1; display: block; }
.zcard .zd { font-size: 0.82rem; color: var(--muted); }

/* ================= magasin ================= */
.mag { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 980px) { .mag { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.tanks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (min-width: 560px) and (max-width: 979px) { .tanks { grid-template-columns: repeat(6, 1fr); } }
.tank { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; background: none; border: 0; padding: 0; }
.tank .glass { position: relative; width: 100%; max-width: 100px; aspect-ratio: 3 / 4; border-radius: 14px; border: 1px solid rgba(79, 209, 232, 0.4); overflow: hidden; background: rgba(79, 209, 232, 0.06); box-shadow: inset 0 0 18px rgba(79, 209, 232, 0.12); }
.tank[aria-pressed="true"] .glass { border-color: var(--water); box-shadow: 0 0 0 1px var(--water), 0 0 22px rgba(79, 209, 232, 0.35); }
.tank .water { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, rgba(79, 209, 232, 0.92), rgba(24, 104, 160, 0.95)); transition: height 1.8s cubic-bezier(.2, .8, .2, 1); }
.tank .water::before { content: ""; position: absolute; left: -50%; top: -7px; width: 200%; height: 14px; background: radial-gradient(circle at 10px -3px, transparent 9px, rgba(79, 209, 232, 0.92) 10px) 0 0 / 20px 14px repeat-x; animation: wave 4s linear infinite; }
@keyframes wave { to { transform: translateX(20px); } }
.tank .median { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed rgba(255, 255, 255, 0.9); }
.tank .pct { position: absolute; inset: auto 0 8px; text-align: center; font-family: var(--display); font-stretch: 118%; font-weight: 900; font-size: 1.3rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.tank .nm { font-size: 0.85rem; text-align: center; line-height: 1.2; }
.tank .chg { font-size: 0.78rem; color: var(--muted); }
.chg.up { color: var(--cheap); } .chg.down { color: var(--dear); }
.magchart svg { width: 100%; height: clamp(220px, 32vw, 300px); display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 0.85rem; color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; border-radius: 2px; }
.mag-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-bottom: 16px; color: var(--soft); }
.mag-sum strong { color: var(--water); font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1; text-shadow: 0 0 22px rgba(79, 209, 232, 0.45); }

/* ================= lading ================= */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(1.8rem, 4.6vw, 2.6rem); line-height: 1.02; color: var(--volt); text-shadow: 0 0 20px var(--volt-glow); }
.stat span { color: var(--soft); font-size: 0.88rem; }
.charge-top, .charge { display: grid; gap: var(--gap); grid-template-columns: 1fr; margin-bottom: var(--gap); }
@media (min-width: 980px) { .charge-top { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } .charge { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); } }
.mbars { display: flex; align-items: flex-end; gap: 3px; height: 180px; }
.mbar { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.mbar .a { background: rgba(79, 209, 232, 0.55); border-radius: 3px 3px 0 0; }
.mbar .f { background: var(--volt); box-shadow: 0 0 10px var(--volt-glow); }
.mbar .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line); padding: 3px 7px; border-radius: 6px; font-size: 0.75rem; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 2; }
.mbar:hover .tip, .mbar:focus .tip { opacity: 1; }
.zrow { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.9rem; }
.zrow .track { height: 10px; border-radius: 5px; background: rgba(168, 156, 143, 0.12); overflow: hidden; display: flex; }
.zrow .track i { display: block; height: 100%; }
.zrow b { font-family: var(--display); font-stretch: 118%; }
.tabs#chargeFilter { margin-bottom: 14px; }
.map { height: clamp(360px, 62vh, 580px); border-radius: 12px; overflow: hidden; background: var(--night-2); }
.map .leaflet-tile-pane { filter: invert(1) grayscale(1) brightness(0.62) contrast(1.1) sepia(0.25); }
.leaflet-container { font-family: var(--body); background: var(--night-2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-solid); color: var(--ink); }
.leaflet-popup-content { margin: 12px 14px; font-size: 0.9rem; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: rgba(8, 6, 5, 0.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(8, 6, 5, 0.9); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(255, 122, 0, 0.25) !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: rgba(255, 122, 0, 0.9) !important; color: #120800; font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.list li:last-child { border-bottom: 0; }
.list .m, .sources .m { color: var(--muted); font-size: 0.82rem; }
.list .m { display: block; }
.side { display: flex; flex-direction: column; gap: var(--gap); }
.opbar { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 0.88rem; margin-bottom: 8px; }
.opbar i { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--volt); display: block; }

/* ================= vær ================= */
.wx { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.wxc { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.wxc .c { color: var(--muted); font-size: 0.85rem; }
.wxc .t { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 2.1rem; line-height: 1.1; display: block; }
.wxc .p { font-size: 0.85rem; color: var(--water); }

/* ================= bunn ================= */
footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 28px clamp(14px, 4vw, 40px) calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.88rem; background: rgba(0, 0, 0, 0.6); }
.foot { width: min(1280px, 100%); margin: 0 auto; display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .foot { grid-template-columns: 2fr 1fr; } }
.sources { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 18px; }
.sources li { display: flex; align-items: baseline; gap: 8px; }
.sources i { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); transform: translateY(-1px); }
.sources i.ok { background: var(--cheap); } .sources i.bad { background: var(--dear); } .sources i.wait { background: var(--volt); }
.credit { font-size: 0.8rem; }

/* ================= oppstart: strømmen slås på ================= */
.boot .brand .bolt { animation: flicker 1.2s steps(1) 1; }
.boot .now-price { animation: flicker 1.2s steps(1) 1; }
@keyframes flicker { 0%, 22%, 48% { opacity: 0.15; } 12%, 35%, 60%, 100% { opacity: 1; } }
.zap { animation: zap .9s ease-out 1; }
@keyframes zap { 0% { text-shadow: 0 0 60px #fff, 0 0 30px currentColor; } 100% { text-shadow: 0 0 34px color-mix(in srgb, currentColor 45%, transparent); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .radar { display: none; }
}

/* ================= om-side ================= */
.prose { max-width: 68ch; }
.prose h1 { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; letter-spacing: -0.03em; margin: 12px 0 18px; }
.prose h2 { font-family: var(--display); font-stretch: 112%; font-size: 1.3rem; margin: 32px 0 8px; }
.prose li { margin-bottom: 6px; }

/* ================= lyn ================= */
.lynbadge {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 230, 128, 0.14); border: 1px solid rgba(255, 230, 128, 0.5); color: #FFE680;
  font-weight: 600; font-size: 0.88rem; text-decoration: none; animation: badge 2.4s ease-in-out infinite;
}
@keyframes badge { 0%, 100% { box-shadow: 0 0 0 rgba(255, 230, 128, 0); } 50% { box-shadow: 0 0 18px rgba(255, 230, 128, 0.45); } }
.lynalert {
  border-radius: 12px; padding: 10px 14px; background: rgba(255, 230, 128, 0.12); border: 1px solid rgba(255, 230, 128, 0.55);
  color: #FFF3C2; font-weight: 600; display: flex; gap: 10px; align-items: center;
}
.lynalert svg { width: 22px; height: 22px; flex: none; filter: drop-shadow(0 0 6px #FFE680); }
.strike { animation: strike 3.2s steps(1) infinite; }
@keyframes strike { 0% { opacity: 1; } 4% { opacity: 0.25; } 7% { opacity: 1; } 10%, 100% { opacity: 0.55; } }
.alertpoly { stroke-dasharray: 5 4; stroke-width: 1.4; }
.lyn-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 980px) { .lyn-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.lynstats .stat b { color: #FFE680; text-shadow: 0 0 20px rgba(255, 230, 128, 0.55); }
.lynstats .stat { background: rgba(255, 230, 128, 0.05); }
.nearrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.nearrow:last-child { border-bottom: 0; }
.nearrow b { font-family: var(--display); font-stretch: 118%; }
.nearrow.close b { color: #FFE680; }
.alert { border-left: 4px solid; padding: 6px 0 8px 12px; margin-bottom: 12px; }
.alert.yellow { border-color: #FFD60A; } .alert.orange { border-color: #FF8C1A; } .alert.red { border-color: #FF3B3B; }
.alert strong { display: block; }
.alert span { color: var(--muted); font-size: 0.85rem; }
.alert p { margin: 4px 0 0; font-size: 0.9rem; color: var(--soft); }
.calm { color: var(--soft); margin: 0; }


#lyn h2.sec::after, .lynpage h2.sec::after { background: #FFE680; box-shadow: 0 0 14px rgba(255, 230, 128, 0.6); }
.cta {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  background: #FFE680; color: #1A1404; text-decoration: none; box-shadow: 0 0 20px rgba(255, 230, 128, 0.4);
}
.cta:hover { color: #1A1404; background: #FFF0A8; }
a.lynalert { text-decoration: none; }

/* ================= lynsiden ================= */
.lynhero { display: grid; gap: var(--gap); grid-template-columns: 1fr; margin-top: 6px; }
@media (min-width: 980px) { .lynhero { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); } }
.lynmap { height: clamp(420px, 72vh, 760px); border-radius: 14px; overflow: hidden; background: var(--night-2); }
.lynmap .leaflet-tile-pane { filter: invert(1) grayscale(1) brightness(0.55) contrast(1.1) sepia(0.25); }
.lyn-icon { filter: drop-shadow(0 0 6px #FFE680) drop-shadow(0 0 12px rgba(255, 230, 128, 0.7)); }
.lyn-icon.fresh { animation: strike 3.2s steps(1) infinite; }
.lyn-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.btn { border: 1px solid var(--line); background: rgba(8, 6, 5, 0.5); border-radius: 999px; padding: 8px 14px; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: #FFE680; }
.lynbig { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(3.6rem, 11vw, 6.5rem); line-height: 0.9; letter-spacing: -0.04em; color: #FFE680; text-shadow: 0 0 34px rgba(255, 230, 128, 0.55); margin: 0; }
.lynbig small { display: block; font-family: var(--body); font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--soft); text-shadow: none; margin-top: 8px; }
.hbars { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.hbars div { flex: 1; background: #FFE680; border-radius: 3px 3px 0 0; min-height: 2px; box-shadow: 0 0 10px rgba(255, 230, 128, 0.35); position: relative; }
.hbars div .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; font-size: 0.75rem; white-space: nowrap; opacity: 0; pointer-events: none; }
.hbars div:hover .tip, .hbars div:focus .tip { opacity: 1; }
.strikes td, .strikes th { padding: 8px 10px 8px 0; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.strikes th { color: var(--muted); font-weight: 500; }
.strikes { width: 100%; border-collapse: collapse; }
.tablewrap { overflow-x: auto; }
.mynear { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 230, 128, 0.08); border: 1px solid rgba(255, 230, 128, 0.35); }

/* ================= lenker i ladeseksjonen ================= */
.links { list-style: none; margin: 0; padding: 0; }
.links li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.links li:last-child { border-bottom: 0; }
.links a { font-weight: 600; color: var(--volt); }
.links span { display: block; color: var(--muted); font-size: 0.84rem; }
.acts { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 5px; font-size: 0.84rem; }
.acts a, .acts button { color: var(--volt); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; font-size: inherit; }
.acts a:hover, .acts button:hover { color: var(--ink); }
.opbar a { color: var(--ink); }
.opbar a:hover { color: var(--volt); }
.leaflet-popup-content .acts a { color: var(--volt); }

/* ================= lyn: jevnere rutenett og rolig tilstand ================= */

.lynpage .side .lynstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lynstats .stat { padding: 12px 14px; }
.lynstats .stat b { font-size: clamp(1.6rem, 4vw, 2.2rem); }

.lynbig small { max-width: 34ch; line-height: 1.4; }
#lynAlerts .calm { padding: 2px 0; }

/* ================= retting: én linje, pris som passer, skjulte elementer ================= */
[hidden] { display: none !important; }
.now { container-type: inline-size; }
.zones { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.zone-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px; border-radius: 12px; line-height: 1.15; min-width: 0; }
.zone-btn b { margin: 0; font-size: 0.85rem; }
.zone-btn span { font-size: 0.82rem; white-space: nowrap; }
.now-price { flex-wrap: wrap; row-gap: 4px; font-size: clamp(3rem, 18cqi, 7.6rem); }
.now-price small { white-space: nowrap; }

/* ================= lynboksen på forsiden ================= */
.lynteaser {
  display: grid; gap: clamp(16px, 3vw, 32px); align-items: center; text-decoration: none; color: var(--ink);
  grid-template-columns: auto 1fr; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 50%, rgba(255, 230, 128, 0.10), transparent 55%), var(--panel);
  border: 1px solid rgba(255, 230, 128, 0.22); transition: border-color .3s, box-shadow .3s;
}
.lynteaser:hover { color: var(--ink); border-color: rgba(255, 230, 128, 0.6); box-shadow: 0 0 40px rgba(255, 230, 128, 0.12); }
@media (min-width: 980px) { .lynteaser { grid-template-columns: auto minmax(0, 5fr) minmax(0, 6fr); } }
.lt-data { grid-column: 1 / -1; }
@media (min-width: 980px) { .lt-data { grid-column: auto; } }
.lt-bolt svg { width: clamp(72px, 11vw, 120px); height: auto; display: block; overflow: visible; }
.lt-ring { fill: none; stroke: rgba(255, 230, 128, 0.35); stroke-width: 1.6; }
.lt-ring2 { fill: none; stroke: rgba(255, 230, 128, 0.18); stroke-width: 1.4; }
.lt-flash { fill: #FFE680; stroke: #060504; stroke-width: 1.5; stroke-linejoin: round; filter: drop-shadow(0 0 10px rgba(255, 230, 128, 0.8)); transform-origin: 32px 32px; }
.lynteaser[data-state="calm"] .lt-flash { fill: #4a4236; filter: none; }
.lynteaser[data-state="calm"] .lt-ring { stroke: rgba(168, 156, 143, 0.35); }
.lynteaser[data-state="now"] .lt-flash { animation: strike 2.6s steps(1) infinite; }
.lynteaser[data-state="now"] .lt-ring { animation: ringpulse 2.6s ease-out infinite; transform-origin: 32px 32px; }
@keyframes ringpulse { 0% { stroke-opacity: 1; transform: scale(.85); } 100% { stroke-opacity: 0; transform: scale(1.15); } }
.lt-kicker { color: #FFE680; font-weight: 600; font-size: 0.9rem; }
.lt-state { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(2rem, 5.5vw, 3.2rem); line-height: 1; letter-spacing: -0.03em; margin: 4px 0 8px; }
.lynteaser[data-state="now"] .lt-state { color: #FFE680; text-shadow: 0 0 26px rgba(255, 230, 128, 0.55); }
.lt-sum { color: var(--soft); margin: 0 0 12px; max-width: 46ch; }
.lt-cta { display: inline-block; font-weight: 600; color: #FFE680; border-bottom: 1px solid rgba(255, 230, 128, 0.5); padding-bottom: 1px; }
.lynteaser:hover .lt-cta { border-color: #FFE680; }
.lt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-bottom: 14px; }
.lt-stats div { padding: 0 14px; border-left: 1px solid var(--line); }
.lt-stats div:first-child { padding-left: 0; border-left: 0; }
.lt-stats b { display: block; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(1.7rem, 4.5vw, 2.6rem); line-height: 1.05; }
.lynteaser:not([data-state="calm"]) .lt-stats b { color: #FFE680; text-shadow: 0 0 18px rgba(255, 230, 128, 0.45); }
.lt-stats span { color: var(--muted); font-size: 0.85rem; }
.lt-hist { display: flex; align-items: flex-end; gap: 2px; height: 46px; }
.lt-hist i { flex: 1; border-radius: 2px 2px 0 0; background: rgba(168, 156, 143, 0.22); }
.lt-hist i.on { background: #FFE680; box-shadow: 0 0 8px rgba(255, 230, 128, 0.5); }
.lt-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.75rem; margin-top: 6px; }

/* ================= negativ pris ================= */
.negbanner { border-radius: 12px; padding: 12px 14px; background: linear-gradient(90deg, rgba(54, 211, 153, 0.22), rgba(54, 211, 153, 0.06)); border: 1px solid rgba(54, 211, 153, 0.6); display: grid; gap: 2px; animation: badge 2.4s ease-in-out infinite; }
.negbanner b { font-family: var(--display); font-stretch: 118%; font-weight: 900; font-size: 1.15rem; color: var(--cheap); }
.negbanner span { color: var(--soft); font-size: 0.92rem; }

/* ================= når bør jeg …? ================= */
.plangrid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 980px) { .plangrid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.devices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 16px; }
.dev { text-align: left; border: 1px solid var(--line); background: rgba(8, 6, 5, 0.4); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.dev b { display: block; font-weight: 600; }
.dev span { color: var(--muted); font-size: 0.82rem; }
.dev[aria-pressed="true"] { border-color: var(--volt); background: var(--volt-soft); box-shadow: 0 0 16px rgba(255, 122, 0, 0.2); }
.custom { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.planres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px) { .planres { grid-template-columns: 1fr; } }
.planres > div span { display: block; color: var(--muted); font-size: 0.85rem; }
.planres > div b { display: block; font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.05; }
.planres > div em { font-style: normal; color: var(--muted); font-size: 0.82rem; }
.pr-main b { color: var(--volt); text-shadow: 0 0 20px var(--volt-glow); }
b.good { color: var(--cheap); }
b.bad { color: var(--dear); }
.plantl { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.plantl i { flex: 1; background: rgba(168, 156, 143, 0.25); border-radius: 2px 2px 0 0; }
.plantl i.on { background: var(--volt); box-shadow: 0 0 10px var(--volt-glow); }
.costs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cost { background: rgba(168, 156, 143, 0.07); border-radius: 10px; padding: 10px 12px; }
.cost b { display: block; font-family: var(--display); font-stretch: 118%; font-weight: 900; font-size: 1.4rem; color: var(--volt); }
.cost span { display: block; font-size: 0.9rem; }
.cost em { font-style: normal; color: var(--muted); font-size: 0.78rem; }
.fld { display: grid; gap: 4px; margin-bottom: 12px; font-size: 0.9rem; color: var(--soft); }
.fld.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.fld input, .fld select, select.mini, input.mini, .search {
  background: rgba(8, 6, 5, 0.6); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit;
}
.fld input:focus, .fld select:focus, .search:focus, .mini:focus { border-color: var(--volt); outline: none; box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.25); }
.fld.inline input { width: 90px; }
input.mini { width: 70px; padding: 3px 6px; }
select.mini { padding: 3px 6px; }

/* ================= rekorder ================= */
.records { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: -4px 0 18px; }
.rec { border-left: 3px solid var(--volt); padding: 2px 0 2px 12px; }
.rec span { display: block; color: var(--muted); font-size: 0.85rem; }
.rec b { font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 1.3rem; }
.rec em { display: block; font-style: normal; color: var(--muted); font-size: 0.8rem; }
.rec-note { grid-column: 1 / -1; margin: 0; }

/* ================= mer på elradar ================= */
.morecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mcard { display: block; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; transition: border-color .2s, box-shadow .2s; }
.mcard:hover { color: var(--ink); border-color: var(--volt); box-shadow: 0 0 22px rgba(255, 122, 0, 0.18); }
.mcard b { display: block; font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 1.15rem; margin-bottom: 4px; }
.mcard span { color: var(--muted); font-size: 0.9rem; }

/* ================= undersider ================= */
.subpage main > h2.sec:first-child { margin-top: 6px; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--volt-soft); }
.statusbox { border-radius: 12px; padding: 12px 16px; margin-bottom: var(--gap); border: 1px solid var(--line); background: var(--panel); }
.statusbox.ok { border-color: rgba(54, 211, 153, 0.6); color: #CFF7E6; }
.statusbox.bad { border-color: rgba(255, 77, 94, 0.6); color: #FFD3D8; }
.vgrid, .npgrid, .obgrid, .kvgrid, .eugrid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 980px) {
  .vgrid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .npgrid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .obgrid, .kvgrid { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .eugrid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
.checks { border: 0; padding: 0; margin: 4px 0 16px; display: grid; gap: 10px; }
.checks legend { color: var(--soft); margin-bottom: 8px; font-size: 0.9rem; }
.chk { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.chk input[type="checkbox"] { accent-color: var(--volt); width: 18px; height: 18px; margin-top: 2px; }
.chk b { display: block; }
.chk span { color: var(--soft); font-size: 0.92rem; }
.chk.inline { display: inline-flex; padding: 6px 10px; gap: 6px; align-items: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cta.big { font-size: 1.05rem; padding: 12px 22px; border: 0; cursor: pointer; background: var(--volt); color: #120800; box-shadow: 0 0 22px var(--volt-glow); }
.cta.big:disabled { opacity: 0.6; cursor: wait; }
.mailprev { background: #16120F; border: 1px solid #3a2410; border-top: 3px solid var(--volt); border-radius: 12px; padding: 14px 16px; }
.mailprev .mp-logo { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 1.2rem; margin-bottom: 6px; }
.mailprev .mp-logo span, .mailprev .mp-logo small { color: var(--volt); }
.mailprev p { color: var(--soft); font-size: 0.9rem; margin: 6px 0; }
.mp-bars { display: flex; align-items: flex-end; gap: 2px; height: 50px; margin: 8px 0 4px; }
.mp-bars i { flex: 1; border-radius: 2px 2px 0 0; }
.mp-small { font-size: 0.8rem !important; color: var(--muted) !important; }
.facts4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.facts4 .fact b { font-size: 1.5rem; }
.facts4 .fact em { display: block; font-style: normal; color: var(--muted); font-size: 0.82rem; }
.upload { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; display: grid; gap: 8px; }
.upload input[type="file"] { color: var(--soft); }
.np-verdict { font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: clamp(1.4rem, 3.4vw, 2rem); line-height: 1.2; margin: 0 0 16px; }
.np-verdict b.good { color: var(--cheap); } .np-verdict b.bad { color: var(--dear); }
.np-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.np-bars { display: flex; align-items: stretch; gap: 6px; height: 200px; }
.npm { flex: 1; display: flex; flex-direction: column; position: relative; }
.npm .pair { flex: 1; display: flex; align-items: flex-end; gap: 2px; }
.npm .pair i { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.npm em { font-style: normal; text-align: center; color: var(--muted); font-size: 0.72rem; margin-top: 4px; }
.npm .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line); padding: 3px 7px; border-radius: 6px; font-size: 0.75rem; white-space: nowrap; opacity: 0; pointer-events: none; z-index: 3; }
.npm:hover .tip, .npm:focus .tip { opacity: 1; }
.search { min-width: 220px; flex: 1; }
.eumap svg { width: 100%; height: auto; display: block; max-height: 80vh; }
.eulab { font: 800 12px var(--display); font-stretch: 112%; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, 0.85); stroke-width: 3px; }
.eulab.no { font-size: 11px; }
.eulist li { display: flex; justify-content: space-between; gap: 10px; }
.eulist li.no b, .eulist li.no span { color: var(--volt); font-weight: 700; }
.legend-bar a { color: var(--volt); }

/* =====================================================================
   EFFEKTER v3: levende strømnett, gnister, ticker, energikanter
   (kartene er ikke berørt)
   ===================================================================== */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.bg-fx { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.bg::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 60% at 50% 10%, rgba(255, 238, 170, 0.22), transparent 70%); opacity: 0; }
.bg.flash::after { animation: skyflash 0.9s steps(1) 1; }
@keyframes skyflash { 0% { opacity: 0.9; } 8% { opacity: 0.1; } 14% { opacity: 0.7; } 22%, 100% { opacity: 0; } }
.bg-grid { animation: griddrift 40s linear infinite; }
@keyframes griddrift { to { background-position: 56px 56px, 56px 56px; } }
.spark-fx { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }

/* topp: ticker, spenningsmåler og prischip */
.top { flex-wrap: wrap; }
.has-ticker main { padding-top: calc(var(--gap) + 34px); }
html { scroll-padding-top: 110px; }
.volt-meter { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; z-index: 2; }
.volt-meter i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--volt), #FFD089); box-shadow: 0 0 10px var(--volt-glow), 0 0 22px var(--volt-glow); }
.ticker {
  position: absolute; left: 0; right: 0; top: 100%; height: 30px; overflow: hidden;
  background: rgba(6, 5, 4, 0.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.ticker-track { display: flex; width: max-content; animation: tick var(--dur, 45s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.tk-run { display: flex; align-items: center; white-space: nowrap; }
.tk { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; height: 30px; font-size: 0.82rem; color: var(--soft); font-variant-numeric: tabular-nums; }
.tk b { color: var(--volt); font-weight: 700; }
.tk.water b { color: var(--water); } .tk.lyn b { color: #FFE680; } .tk.neg b { color: var(--cheap); }
.tk em { font-style: normal; font-size: 0.7rem; color: var(--muted); } .tk em.up { color: var(--dear); } .tk em.down { color: var(--cheap); }
.tk-sep { color: var(--volt); opacity: 0.55; font-size: 0.75rem; }
.price-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  border: 1px solid rgba(255, 122, 0, 0.55); background: rgba(255, 122, 0, 0.1); color: var(--soft); font-size: 0.85rem;
  box-shadow: 0 0 18px rgba(255, 122, 0, 0.18), inset 0 0 12px rgba(255, 122, 0, 0.12);
}
.price-chip b { font-family: var(--display); font-stretch: 118%; font-weight: 900; color: var(--volt); font-size: 1rem; text-shadow: 0 0 12px var(--volt-glow); }
.price-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--volt); box-shadow: 0 0 8px var(--volt); animation: beat 2s infinite; }
.price-chip.neg { border-color: rgba(54, 211, 153, 0.6); } .price-chip.neg b { color: var(--cheap); }
.price-chip:hover { color: var(--ink); border-color: var(--volt); }
@media (max-width: 760px) { .price-chip { order: 2; margin-left: auto; } .pulse { display: none; } .has-ticker main { padding-top: calc(var(--gap) + 32px); } }

/* energikant som løper rundt de viktigste panelene */
.now, .lynteaser, .vform, .npres { isolation: isolate; }
.now::before, .lynteaser::before, .vform::before, .npres::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: -1;
  background: conic-gradient(from var(--ang), transparent 0 64%, rgba(255, 122, 0, 0.0) 66%, var(--volt) 78%, #FFE3B8 80%, var(--volt) 82%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spinang 5s linear infinite;
}
.lynteaser::before { background: conic-gradient(from var(--ang), transparent 0 66%, #FFE680 80%, #fff 81%, #FFE680 83%, transparent 93%); animation-duration: 3.6s; }
@keyframes spinang { to { --ang: 360deg; } }
.mcard { position: relative; overflow: hidden; }
.mcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 180, 90, 0.16) 48%, transparent 66%); transform: translateX(-120%); transition: transform 0.7s ease; pointer-events: none; }
.mcard:hover::after { transform: translateX(120%); }

/* glitch på det store pristallet innimellom */
.now-price > span { display: inline-block; animation: glitch 11s steps(1) infinite; }
@keyframes glitch {
  0%, 95.9%, 100% { transform: none; text-shadow: none; opacity: 1; }
  96% { transform: translateX(-3px) skewX(-8deg); text-shadow: 3px 0 #FF3B3B, -3px 0 #4FD1E8; opacity: 0.85; }
  96.6% { transform: translateX(2px); text-shadow: -2px 0 #FF3B3B, 2px 0 #4FD1E8; opacity: 1; }
  97.2% { transform: none; opacity: 0.4; }
  97.6% { opacity: 1; }
}

/* overskrifter: strøm i understreken */
h2.sec::after { background: linear-gradient(90deg, var(--volt), #FFE3B8 45%, var(--volt) 55%, var(--volt)); background-size: 220% 100%; animation: current 2.6s linear infinite; width: 72px; }
#magasin h2.sec::after { background: linear-gradient(90deg, var(--water), #E6FBFF 45%, var(--water) 55%, var(--water)); background-size: 220% 100%; }
#lyn h2.sec::after, .lynpage h2.sec::after { background: linear-gradient(90deg, #FFE680, #fff 45%, #FFE680 55%, #FFE680); background-size: 220% 100%; }
@keyframes current { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* aktive knapper puster */
.tabs button[aria-pressed="true"], .dev[aria-pressed="true"], .zone-btn[aria-pressed="true"] { animation: pressedglow 2.8s ease-in-out infinite; }
@keyframes pressedglow { 0%, 100% { box-shadow: 0 0 10px rgba(255, 122, 0, 0.35); } 50% { box-shadow: 0 0 24px rgba(255, 122, 0, 0.7); } }
.cta, .cta.big { position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%); transform: translateX(-130%); animation: sheen 3.8s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 60% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

/* «power-on»: seksjoner lyser opp første gang de kommer til syne */
.unpowered { position: relative; }
.unpowered:not(.powered) .panel, .unpowered:not(.powered) .stat, .unpowered:not(.powered) .mcard { opacity: 0.35; filter: saturate(0.4); }
.powered .panel, .powered .stat, .powered .mcard, .powered.panel { animation: poweron 0.9s steps(1) 1; }
@keyframes poweron { 0% { opacity: 0.35; } 10% { opacity: 1; } 18% { opacity: 0.5; } 28%, 100% { opacity: 1; } }
.powered::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none; z-index: 5; border-radius: 18px;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 150, 60, 0.0) 40%, rgba(255, 150, 60, 0.16) 49%, rgba(255, 230, 190, 0.35) 50%, transparent 51%) 0 -100% / 100% 200% no-repeat;
  animation: scan 1.2s ease-out 1 forwards;
}
@keyframes scan { from { background-position: 0 -100%; opacity: 1; } 90% { opacity: 1; } to { background-position: 0 100%; opacity: 0; } }

/* tall som endres får en gnist */
.zing { animation: zing 0.8s ease-out 1; }
@keyframes zing { 0% { text-shadow: 0 0 0 transparent; filter: brightness(1); } 15% { text-shadow: 0 0 22px #fff, 0 0 40px var(--volt); filter: brightness(1.6); } 100% { filter: brightness(1); } }

@media (prefers-reduced-motion: reduce) {
  .unpowered:not(.powered) .panel, .unpowered:not(.powered) .stat, .unpowered:not(.powered) .mcard { opacity: 1; filter: none; }
  .ticker-track { animation: none; }
  .ticker { overflow-x: auto; }
}

/* ================= strømradioen i forklaringsboksen ================= */
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ex-kicker { font-size: 0.82rem; font-weight: 600; color: var(--volt); letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 7px; }
.ex-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: beat 2s infinite; }
.explain[data-kind="live"] .ex-kicker { color: var(--cheap); }
.explain[data-kind="fact"] .ex-kicker { color: var(--water); }
.explain[data-kind="insight"] .ex-kicker { color: #FFD089; }
.ex-ctrl { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.ex-ctrl button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: rgba(8, 6, 5, 0.5); color: var(--soft); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.ex-ctrl button:hover { border-color: var(--volt); color: var(--ink); }
.explain h2 { min-height: 1.2em; }
.explain[data-kind="fact"] h2, .explain[data-kind="live"] h2, .explain[data-kind="insight"] h2 { font-size: 1.2rem; line-height: 1.3; font-weight: 700; }
.ex-prog { height: 2px; margin-top: 12px; background: rgba(168, 156, 143, 0.15); border-radius: 2px; overflow: hidden; }
.ex-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--volt), #FFD089); box-shadow: 0 0 8px var(--volt-glow); animation: exprog var(--dur, 72s) linear 1 forwards; }
.explain:hover .ex-prog i, .explain:focus-within .ex-prog i { animation-play-state: paused; }
@keyframes exprog { to { width: 100%; } }
.ex-in h2, .ex-in p:not(.by) { animation: exin 0.7s steps(1) 1, exslide 0.5s ease-out 1; }
@keyframes exin { 0% { opacity: 0; } 15% { opacity: 1; } 25% { opacity: 0.3; } 35%, 100% { opacity: 1; } }
@keyframes exslide { from { transform: translateY(6px); filter: blur(2px); } to { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .ex-prog i { animation: exprog var(--dur, 72s) linear 1 forwards !important; } }

/* «Mer på elradar»: alle seks kortene på én linje på store skjermer, aldri et kort alene */
.morecards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .morecards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .morecards { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; } .mcard { padding: 14px 14px; } .mcard b { font-size: 1.02rem; } .mcard span { font-size: 0.84rem; } }
.mcard { display: flex; flex-direction: column; }
