:root{
--bg:#0b1120;--panel:#121a2b;--panel-2:#0f172a;--text:#e5e7eb;--muted:#94a3b8;--border:rgba(255,255,255,.08);
--gas:#3b82f6;--solar:#f59e0b;--wind:#10b981;--nuclear:#cbd5e1;--imports:#a855f7;--biomass:#84cc16;--hydro:#06b6d4;--coal:#6b7280;--other:#f97316;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:linear-gradient(180deg,#09101c,#0b1120);color:var(--text);font-family:Arial,Helvetica,sans-serif}
body{padding:24px}
.page{max-width:1240px;margin:0 auto}
.site-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:20px}
h1{margin:0 0 6px;font-size:34px}
.tagline{margin:0;color:var(--muted)}
.status-pill{display:flex;align-items:center;gap:10px;background:rgba(16,185,129,.12);border:1px solid rgba(16,185,129,.25);color:#c7f9df;border-radius:999px;padding:10px 14px;font-size:14px}
.dot{width:10px;height:10px;border-radius:50%;background:#10b981;display:inline-block}
.top-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:16px}
.metric-card,.panel{background:var(--panel);border:1px solid var(--border);border-radius:18px;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.metric-card{padding:18px 20px}
.metric-label{color:var(--muted);font-size:13px;text-transform:uppercase;letter-spacing:.06em;margin-bottom:10px}
.metric-value{font-size:34px;font-weight:700}
.metric-value span{font-size:16px;color:var(--muted);font-weight:400}
.metric-help{margin-top:8px;color:var(--muted);font-size:13px;line-height:1.35}
.clean-card{position:relative}
.metric-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;position:relative}
.clean-badge{display:inline-block;margin-top:10px;padding:6px 10px;border-radius:999px;font-size:12px;font-weight:700;letter-spacing:.03em;background:rgba(16,185,129,.12);border:1px solid rgba(16,185,129,.28);color:#bbf7d0}
.info-icon-button{position:relative;flex:0 0 auto;width:22px;height:22px;padding:0;margin:0;border:0;outline:none;background:transparent;appearance:none;-webkit-appearance:none;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border-radius:999px}
.info-icon-glow{position:absolute;inset:2px;border-radius:999px;background:rgba(56,189,248,.16);box-shadow:0 0 10px rgba(56,189,248,.35),0 0 18px rgba(56,189,248,.18);transition:all .2s ease}
.info-icon-symbol{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;border:1px solid rgba(147,197,253,.45);background:rgba(15,23,42,.95);color:#bfdbfe;font-size:12px;font-weight:700;line-height:1;text-transform:none}
.info-icon-button:hover .info-icon-glow,.info-icon-button:focus-visible .info-icon-glow{background:rgba(56,189,248,.24);box-shadow:0 0 12px rgba(56,189,248,.45),0 0 22px rgba(56,189,248,.22)}
.tooltip-panel{position:absolute;top:28px;right:0;width:260px;background:#0f172a;border:1px solid rgba(255,255,255,.1);border-radius:12px;padding:12px 14px;box-shadow:0 14px 30px rgba(0,0,0,.45);opacity:0;visibility:hidden;transform:translateY(8px) scale(.98);transition:opacity .22s ease,transform .22s ease,visibility .22s ease;z-index:20;pointer-events:none}
.clean-card.tooltip-open .tooltip-panel{opacity:1;visibility:visible;transform:translateY(0) scale(1);pointer-events:auto}
.tooltip-title{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#93c5fd;margin-bottom:8px}
.tooltip-text{font-size:12px;line-height:1.45;color:#e5e7eb;text-transform:none;letter-spacing:0;white-space:normal}
.panel{padding:18px 18px 22px;margin-bottom:16px}
.panel-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px}
.panel-head h2{margin:0;font-size:20px}
.panel-subtitle{color:var(--muted);font-size:13px}
.flow-board{display:grid;grid-template-columns:220px 1fr 220px;gap:18px;align-items:stretch;min-height:580px}
.flow-col{display:grid;gap:12px}
.flow-box{position:relative;border-radius:16px;padding:16px;background:var(--panel-2);border:1px solid var(--border);min-height:96px;display:flex;flex-direction:column;justify-content:center;z-index:2}
.flow-name{font-size:13px;color:var(--muted);margin-bottom:6px}
.flow-num{font-size:22px;font-weight:700;line-height:1.1}
.flow-num span{font-size:14px;color:var(--muted);font-weight:400}
.flow-pct{margin-top:6px;color:#cbd5e1;font-size:14px}
.flow-box.gas{border-color:rgba(59,130,246,.35)}
.flow-box.solar{border-color:rgba(245,158,11,.35)}
.flow-box.wind{border-color:rgba(16,185,129,.35)}
.flow-box.nuclear{border-color:rgba(203,213,225,.28)}
.flow-box.imports{border-color:rgba(168,85,247,.35)}
.flow-box.biomass{border-color:rgba(132,204,22,.35)}
.flow-box.hydro{border-color:rgba(6,182,212,.35)}
.flow-box.coal{border-color:rgba(107,114,128,.35)}
.flow-box.other{border-color:rgba(249,115,22,.35)}
.flow-center{position:relative;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;padding-top:0;min-height:580px;overflow:visible}
.flow-svg{position:absolute;inset:0;width:100%;height:100%;z-index:1;overflow:visible}
.flow-line{fill:none;stroke-width:2.5;opacity:.7}
.flow-line.imports{stroke:var(--imports)}
.flow-line.wind{stroke:var(--wind)}
.flow-line.solar{stroke:var(--solar)}
.flow-line.hydro{stroke:var(--hydro)}
.flow-line.other{stroke:var(--other)}
.flow-line.nuclear{stroke:var(--nuclear)}
.flow-line.gas{stroke:var(--gas)}
.flow-line.biomass{stroke:var(--biomass)}
.flow-line.coal{stroke:var(--coal)}
.flow-dot{filter:drop-shadow(0 0 6px currentColor)}
.flow-dot.imports{fill:var(--imports);color:var(--imports)}
.flow-dot.wind{fill:var(--wind);color:var(--wind)}
.flow-dot.solar{fill:var(--solar);color:var(--solar)}
.flow-dot.hydro{fill:var(--hydro);color:var(--hydro)}
.flow-dot.other{fill:var(--other);color:var(--other)}
.flow-dot.nuclear{fill:var(--nuclear);color:var(--nuclear)}
.flow-dot.gas{fill:var(--gas);color:var(--gas)}
.flow-dot.biomass{fill:var(--biomass);color:var(--biomass)}
.flow-dot.coal{fill:var(--coal);color:var(--coal)}
.summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;position:relative;z-index:3;margin-top:-6px;margin-bottom:2px}
.summary-card{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06);border-radius:14px;padding:14px;text-align:center}
.summary-card span{display:block;color:var(--muted);font-size:13px;margin-bottom:6px}
.summary-card strong{font-size:22px}
.demand-core{display:flex;justify-content:center;align-items:center;position:relative;z-index:3;min-height:360px;margin-top:-10px}
.demand-ring{width:280px;height:280px;border-radius:50%;padding:8px;background:linear-gradient(135deg,#f59e0b,#ef4444)}
.demand-inner{width:100%;height:100%;border-radius:50%;background:#111827;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;box-shadow:0 0 40px rgba(249,115,22,.2)}
.demand-title{font-size:16px;color:var(--muted);margin-bottom:10px}
.demand-value{font-size:38px;font-weight:700}
.mix-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.mix-card{background:var(--panel-2);border:1px solid var(--border);border-radius:16px;padding:16px}
.mix-card-title{font-size:14px;color:var(--muted);margin-bottom:10px}
.mix-card-value{font-size:28px;font-weight:700;margin-bottom:12px}
.mix-card-value span{font-size:14px;color:var(--muted);font-weight:400}
.mix-track{height:12px;background:#1e293b;border-radius:999px;overflow:hidden;margin-bottom:8px}
.mix-fill{height:100%;border-radius:999px}
.mix-fill.gas{background:var(--gas)}
.mix-fill.solar{background:var(--solar)}
.mix-fill.wind{background:var(--wind)}
.mix-fill.nuclear{background:var(--nuclear)}
.mix-fill.imports{background:var(--imports)}
.mix-fill.biomass{background:var(--biomass)}
.mix-fill.hydro{background:var(--hydro)}
.mix-fill.coal{background:var(--coal)}
.mix-fill.other{background:var(--other)}
.mix-percent{font-size:14px;color:var(--muted)}
.chart-panel canvas{width:100% !important;height:320px !important}
.site-footer{margin-top:24px;padding:18px 0 4px;color:var(--muted);font-size:14px;border-top:1px solid var(--border)}
.site-footer p{margin:7px 0}
.site-footer a{color:#93c5fd;text-decoration:none}
.site-footer a:hover{text-decoration:underline}
@media (max-width: 1080px){
.top-grid{grid-template-columns:repeat(3,1fr)}
.flow-board{grid-template-columns:1fr;min-height:auto}
.flow-center{min-height:540px}
.summary-grid{grid-template-columns:1fr}
.mix-grid{grid-template-columns:repeat(2,1fr)}
.tooltip-panel{right:auto;left:0}
}
@media (max-width: 640px){
body{padding:14px}
.site-header{flex-direction:column}
.top-grid,.mix-grid{grid-template-columns:1fr}
.metric-value{font-size:28px}
.flow-num{font-size:20px}
.demand-ring{width:220px;height:220px}
.demand-value{font-size:32px}
.flow-center{min-height:480px}
.tooltip-panel{width:220px}
}

/* 2026 UX refresh additions */
.eyebrow{margin:0 0 8px;color:#67e8f9;font-size:12px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.empty-state{display:flex;flex-direction:column;gap:6px;margin-bottom:16px;padding:16px 18px;border:1px solid rgba(245,158,11,.32);background:rgba(245,158,11,.1);border-radius:16px;color:#fde68a}
.empty-state span{color:#fef3c7}
.insight-panel{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(300px,.9fr);gap:18px;align-items:center;margin-bottom:16px;padding:20px;background:linear-gradient(135deg,rgba(20,184,166,.14),rgba(59,130,246,.08));border:1px solid rgba(125,211,252,.16);border-radius:22px;box-shadow:0 14px 36px rgba(0,0,0,.22)}
.insight-kicker{display:inline-flex;margin-bottom:8px;color:#a7f3d0;font-size:12px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.insight-panel h2{margin:0 0 8px;font-size:26px;line-height:1.16}
.insight-panel p{margin:0;color:#cbd5e1;line-height:1.5}
.source-accent.wind{color:var(--wind)}.source-accent.solar{color:var(--solar)}.source-accent.gas{color:var(--gas)}.source-accent.nuclear{color:var(--nuclear)}.source-accent.imports{color:var(--imports)}.source-accent.hydro{color:var(--hydro)}.source-accent.biomass{color:var(--biomass)}.source-accent.coal{color:var(--coal)}.source-accent.other{color:var(--other)}
.clean-vs-fossil{background:rgba(15,23,42,.72);border:1px solid rgba(255,255,255,.08);border-radius:16px;padding:14px}
.bar-labels{display:flex;justify-content:space-between;gap:10px;margin-bottom:9px;color:#e5e7eb;font-size:13px;font-weight:700}
.clean-bar{height:16px;background:linear-gradient(90deg,rgba(239,68,68,.65),rgba(249,115,22,.65));border-radius:999px;overflow:hidden;border:1px solid rgba(255,255,255,.08)}
.clean-bar-fill{height:100%;background:linear-gradient(90deg,#10b981,#22c55e,#a3e635);border-radius:999px;transition:width .5s ease}
.clean-vs-fossil small{display:block;margin-top:8px;color:var(--muted);font-size:12px;line-height:1.4}
.metric-card{transition:transform .18s ease,border-color .18s ease,background .18s ease}
.metric-card:hover{transform:translateY(-2px);border-color:rgba(125,211,252,.18);background:#151f33}
.rank-pill{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:22px;padding:0 8px;border-radius:999px;background:rgba(255,255,255,.08);color:#f8fafc;font-size:12px;font-weight:800}
.mix-card-title.with-icon{display:flex;align-items:center;gap:8px}
.mix-card.top-source{box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),0 10px 28px rgba(0,0,0,.16)}
.noscript-note{position:fixed;left:16px;right:16px;bottom:16px;z-index:50;padding:12px 14px;border-radius:12px;background:#111827;color:#f8fafc;border:1px solid rgba(255,255,255,.12);box-shadow:0 16px 32px rgba(0,0,0,.35)}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}.flow-dot{display:none}}
@media (max-width: 860px){.top-grid{grid-template-columns:1fr}.insight-panel{grid-template-columns:1fr}.insight-panel h2{font-size:22px}}
@media (max-width: 640px){h1{font-size:30px}.insight-panel{padding:16px}.bar-labels{font-size:12px}}

/* Premium SaaS polish: applied to the reverted no-clean-box layout */
:root{
  --bg:#070d18;
  --panel:#111827;
  --panel-2:#0c1524;
  --text:#f3f7fb;
  --muted:#a8b3c5;
  --border:rgba(148,163,184,.14);
  --glow:rgba(45,212,191,.18);
}
html,body{
  background:
    radial-gradient(circle at 20% -10%, rgba(34,197,94,.16), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(59,130,246,.12), transparent 32%),
    linear-gradient(180deg,#060b14 0%,#09101d 55%,#070d18 100%);
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
body{padding:28px 18px}.page{max-width:1280px}
.site-header{align-items:center;margin-bottom:22px;padding:18px 20px;border:1px solid var(--border);border-radius:24px;background:rgba(9,16,29,.58);box-shadow:0 18px 48px rgba(0,0,0,.22);backdrop-filter:blur(14px)}
h1{font-size:clamp(32px,4vw,52px);letter-spacing:-.04em;line-height:.98}.tagline{font-size:16px;max-width:720px;line-height:1.55}.eyebrow{color:#86efac}.status-pill{background:rgba(15,23,42,.78);border-color:rgba(34,197,94,.28);box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 0 26px rgba(34,197,94,.08)}
.dot{box-shadow:0 0 0 6px rgba(16,185,129,.12),0 0 18px rgba(16,185,129,.75)}
.insight-panel,.metric-card,.panel{backdrop-filter:blur(14px);box-shadow:0 20px 60px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.035)}
.insight-panel{border-radius:26px;background:linear-gradient(135deg,rgba(16,185,129,.16),rgba(59,130,246,.08) 52%,rgba(15,23,42,.72));border-color:rgba(45,212,191,.18)}
.insight-panel h2{font-size:clamp(22px,2.6vw,34px);letter-spacing:-.03em}.clean-vs-fossil{background:rgba(6,13,24,.72);border-color:rgba(148,163,184,.14)}
.top-grid{gap:18px}.metric-card{position:relative;overflow:hidden;border-radius:22px;padding:22px;background:linear-gradient(180deg,rgba(17,24,39,.92),rgba(12,21,36,.92));min-height:148px}.metric-card:before{content:"";position:absolute;inset:-1px;background:radial-gradient(circle at 18% 12%,rgba(34,197,94,.18),transparent 35%);opacity:.85;pointer-events:none}.metric-card > *{position:relative}.metric-label{font-weight:800;color:#98a6bb}.metric-value{font-size:clamp(32px,4vw,46px);letter-spacing:-.04em}.metric-card-clean .metric-value{color:#bbf7d0}.metric-help{font-size:14px;color:#b7c3d2}
.panel{border-radius:24px;background:linear-gradient(180deg,rgba(17,24,39,.9),rgba(10,18,31,.94));padding:22px;margin-bottom:18px}.panel-head h2{font-size:22px;letter-spacing:-.02em}.panel-subtitle{color:#9aa8ba}
.flow-box,.mix-card,.summary-card{background:rgba(15,23,42,.72);border-color:rgba(148,163,184,.12);box-shadow:inset 0 1px 0 rgba(255,255,255,.035)}.flow-box{border-radius:18px}.flow-box:hover,.mix-card:hover{border-color:rgba(125,211,252,.2);transform:translateY(-1px)}.flow-box,.mix-card{transition:transform .18s ease,border-color .18s ease,background .18s ease}.flow-line{stroke-width:3;opacity:.62}.demand-ring{background:conic-gradient(from 180deg,#22c55e,#f59e0b,#ef4444,#22c55e);box-shadow:0 0 45px rgba(245,158,11,.14)}.demand-inner{background:radial-gradient(circle at 50% 34%,#172033,#0d1625 68%)}
.summary-grid{grid-template-columns:repeat(4,1fr);gap:10px}.summary-card{border-radius:16px}.summary-card strong{font-size:clamp(17px,1.8vw,22px)}
.mix-grid{gap:16px}.mix-card{border-radius:18px}.mix-card.top-source{background:linear-gradient(180deg,rgba(20,184,166,.1),rgba(15,23,42,.76));border-color:rgba(45,212,191,.16)}.rank-pill{background:rgba(45,212,191,.14);color:#d1fae5;border:1px solid rgba(45,212,191,.18)}.mix-track,.clean-bar{box-shadow:inset 0 1px 3px rgba(0,0,0,.35)}
.chart-panel canvas{height:340px!important}.site-footer{display:grid;grid-template-columns:1fr 1fr;gap:8px 18px;color:#9aa8ba}.site-footer a{color:#a7f3d0}
@media (max-width:1080px){.summary-grid{grid-template-columns:repeat(2,1fr)}.site-footer{grid-template-columns:1fr}}
@media (max-width:860px){body{padding:14px}.site-header{align-items:flex-start}.status-pill{align-self:flex-start}.summary-grid{grid-template-columns:1fr}.metric-card{min-height:auto}.flow-center{min-height:500px}}

/* Three-way clean / fossil / other generation split */
.generation-split{
  background:rgba(6,13,24,.72);
  border:1px solid rgba(148,163,184,.14);
  border-radius:16px;
  padding:14px;
}
.split-labels{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin-bottom:9px;
}
.split-labels span{
  display:flex;
  flex-direction:column;
  gap:2px;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.split-labels strong{
  color:#e5e7eb;
  font-size:15px;
  letter-spacing:0;
  text-transform:none;
}
.split-bar{
  display:flex;
  height:16px;
  background:#1e293b;
  border-radius:999px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:inset 0 1px 3px rgba(0,0,0,.35);
}
.split-bar-fill{
  height:100%;
  min-width:0;
  transition:width .5s ease;
}
.split-clean{background:linear-gradient(90deg,#10b981,#22c55e,#a3e635)}
.split-fossil{background:linear-gradient(90deg,#f97316,#fb923c)}
.split-other{background:linear-gradient(90deg,#8b5cf6,#6366f1)}
.split-totals{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:9px;
  color:#cbd5e1;
  font-size:12px;
}
.split-totals span{display:flex;align-items:center;gap:6px;white-space:nowrap}
.legend-dot{display:inline-block;width:8px;height:8px;border-radius:999px;flex:0 0 auto}
.legend-dot.clean{background:#22c55e}.legend-dot.fossil{background:#f97316}.legend-dot.other{background:#6366f1}
.generation-split small{display:block;margin-top:8px;color:var(--muted);font-size:12px;line-height:1.4}
@media (max-width:640px){.split-labels,.split-totals{grid-template-columns:1fr}.split-labels span{flex-direction:row;justify-content:space-between}.split-totals span{white-space:normal}}

/* Top 3 source summary, replacing the full Generation Mix grid */
.top-sources-panel{
  margin:-2px 0 18px;
  padding:18px 20px;
  border:1px solid rgba(148,163,184,.14);
  border-radius:24px;
  background:linear-gradient(180deg,rgba(17,24,39,.82),rgba(10,18,31,.9));
  box-shadow:0 20px 60px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter:blur(14px);
}
.top-sources-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  margin-bottom:14px;
}
.top-sources-head p{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.top-sources-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
}
.top-source-card{
  position:relative;
  overflow:hidden;
  min-height:102px;
  padding:16px;
  border:1px solid rgba(148,163,184,.12);
  border-radius:18px;
  background:rgba(15,23,42,.72);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
  transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.top-source-card:before{
  content:"";
  position:absolute;
  inset:-1px;
  background:radial-gradient(circle at 14% 8%,rgba(45,212,191,.16),transparent 38%);
  pointer-events:none;
}
.top-source-card:hover{
  transform:translateY(-1px);
  border-color:rgba(125,211,252,.22);
  background:rgba(18,28,46,.82);
}
.top-source-card > *{position:relative}
.top-source-card.gas{border-color:rgba(59,130,246,.22)}
.top-source-card.solar{border-color:rgba(245,158,11,.22)}
.top-source-card.wind{border-color:rgba(16,185,129,.22)}
.top-source-card.nuclear{border-color:rgba(203,213,225,.2)}
.top-source-card.imports{border-color:rgba(168,85,247,.24)}
.top-source-card.biomass{border-color:rgba(132,204,22,.22)}
.top-source-card.hydro{border-color:rgba(6,182,212,.22)}
.top-source-card.coal{border-color:rgba(107,114,128,.22)}
.top-source-card.other{border-color:rgba(249,115,22,.22)}
.top-source-rank{
  position:absolute;
  top:12px;
  right:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:24px;
  padding:0 9px;
  border-radius:999px;
  background:rgba(45,212,191,.14);
  color:#d1fae5;
  border:1px solid rgba(45,212,191,.18);
  font-size:12px;
  font-weight:900;
}
.top-source-main{
  display:flex;
  align-items:center;
  gap:12px;
  padding-right:36px;
}
.top-source-main h3{
  margin:0 0 6px;
  font-size:18px;
  letter-spacing:-.02em;
}
.top-source-main p{
  margin:0;
  color:#cbd5e1;
  font-size:14px;
}
@media (max-width:860px){
  .top-sources-grid{grid-template-columns:1fr}
  .top-sources-head{display:block}
  .top-sources-head p{margin-top:4px}
}

/* Ranked flow nodes: top generation sources are shown directly in the existing flow cards. */
.flow-rank-badge{
  position:absolute;
  top:10px;
  right:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:30px;
  height:24px;
  padding:0 8px;
  border-radius:999px;
  background:rgba(45,212,191,.14);
  border:1px solid rgba(45,212,191,.24);
  color:#d1fae5;
  font-size:12px;
  font-weight:800;
  letter-spacing:.02em;
  box-shadow:0 0 18px rgba(45,212,191,.08);
}
.flow-box.ranked-source{
  background:linear-gradient(180deg,rgba(20,184,166,.08),rgba(15,23,42,.72));
  border-color:rgba(45,212,191,.18);
}

/* Final live insight headline upgrade */
.insight-panel{
  position:relative;
  overflow:hidden;
}
.insight-panel::before{
  content:"";
  position:absolute;
  inset:-40% auto auto -10%;
  width:340px;
  height:340px;
  border-radius:999px;
  opacity:.22;
  filter:blur(8px);
  pointer-events:none;
  background:radial-gradient(circle, rgba(34,197,94,.85), transparent 64%);
}
.insight-panel > *{position:relative;z-index:1}
.insight-panel.insight-clean{
  background:linear-gradient(135deg,rgba(16,185,129,.20),rgba(59,130,246,.08) 52%,rgba(15,23,42,.76));
  border-color:rgba(34,197,94,.28);
}
.insight-panel.insight-fossil{
  background:linear-gradient(135deg,rgba(249,115,22,.16),rgba(59,130,246,.07) 52%,rgba(15,23,42,.78));
  border-color:rgba(251,146,60,.28);
}
.insight-panel.insight-fossil::before{
  background:radial-gradient(circle, rgba(249,115,22,.78), transparent 64%);
}
.insight-panel.insight-other{
  background:linear-gradient(135deg,rgba(139,92,246,.16),rgba(59,130,246,.08) 52%,rgba(15,23,42,.78));
  border-color:rgba(139,92,246,.30);
}
.insight-panel.insight-other::before{
  background:radial-gradient(circle, rgba(139,92,246,.78), transparent 64%);
}
.insight-panel [data-live-headline]{
  max-width:850px;
}
.insight-panel [data-live-headline-detail]{
  max-width:820px;
  font-size:15px;
}

/* 15-minute update countdown */
.update-pill strong{
  color:#ffffff;
  font-weight:900;
}
.update-pill [data-next-update-countdown]{
  font-variant-numeric:tabular-nums;
}
@media (max-width: 640px){
  .update-pill{
    width:100%;
    justify-content:center;
    text-align:center;
  }
}

/* Source card readability/status upgrade */
.flow-box{
  min-height:112px;
  padding:18px 16px 16px;
}
.flow-name.with-icon{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
  color:#cbd5e1;
}
.flow-title{
  font-size:14px;
  font-weight:700;
  color:#dbeafe;
}
.flow-num{
  font-size:30px;
  letter-spacing:-.04em;
  margin-bottom:4px;
}
.flow-num span{
  margin-left:3px;
  font-size:14px;
  letter-spacing:0;
}
.flow-meta{
  display:flex;
  align-items:baseline;
  gap:5px;
  color:#94a3b8;
  font-size:13px;
}
.flow-pct{
  margin:0;
  display:inline-flex;
  align-items:center;
  padding:3px 8px;
  border-radius:999px;
  background:rgba(148,163,184,.11);
  color:#e5e7eb;
  font-weight:800;
}
.flow-status{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid rgba(148,163,184,.14);
  font-size:13px;
  font-weight:800;
  line-height:1.2;
}
.flow-status span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border-radius:999px;
  background:rgba(255,255,255,.07);
  font-size:13px;
}
.flow-status-high{color:#4ade80}
.flow-status-moderate{color:#facc15}
.flow-status-typical{color:#38bdf8}
.flow-status-low{color:#fb923c}
.flow-status-minimal{color:#f87171}
.flow-status-reliance{color:#c084fc}
.flow-status-good{color:#34d399}
.flow-status-night{color:#fde047}
.flow-box.imports .flow-pct{background:rgba(168,85,247,.16)}
.flow-box.wind .flow-pct{background:rgba(16,185,129,.16)}
.flow-box.solar .flow-pct{background:rgba(245,158,11,.16)}
.flow-box.hydro .flow-pct{background:rgba(6,182,212,.16)}
.flow-box.other .flow-pct{background:rgba(249,115,22,.16)}
.flow-box.nuclear .flow-pct{background:rgba(203,213,225,.14)}
.flow-box.gas .flow-pct{background:rgba(59,130,246,.16)}
.flow-box.biomass .flow-pct{background:rgba(132,204,22,.16)}
.flow-box.coal .flow-pct{background:rgba(107,114,128,.16)}
@media (max-width:640px){
  .flow-box{min-height:104px}
  .flow-num{font-size:26px}
}


/* Restore connected desktop Power Flow layout
   The original CSS collapsed the flow board at 1080px, which breaks the
   source cards away from the animated lines on phone/tablet desktop views.
   Keep the three-column connected layout until genuinely small mobile widths. */
@media (min-width: 641px) and (max-width: 1080px){
  .flow-board{
    display:grid !important;
    grid-template-columns:220px minmax(420px, 1fr) 220px !important;
    gap:18px !important;
    align-items:stretch !important;
    min-height:580px !important;
  }

  .flow-col{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
  }

  .flow-center{
    position:relative !important;
    display:flex !important;
    flex-direction:column !important;
    justify-content:flex-start !important;
    gap:8px !important;
    padding-top:0 !important;
    min-height:580px !important;
    overflow:visible !important;
  }

  .flow-svg{
    display:block !important;
    position:absolute !important;
    inset:0 !important;
    width:100% !important;
    height:100% !important;
    z-index:1 !important;
    overflow:visible !important;
  }

  .summary-grid{
    display:grid !important;
    grid-template-columns:repeat(4,1fr) !important;
    gap:10px !important;
    position:relative !important;
    z-index:3 !important;
    margin-top:-6px !important;
    margin-bottom:2px !important;
  }

  .summary-card{
    padding:11px 8px !important;
    min-width:0 !important;
  }

  .summary-card span{
    font-size:11px !important;
  }

  .summary-card strong{
    font-size:16px !important;
  }

  .demand-core{
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    position:relative !important;
    z-index:3 !important;
    min-height:360px !important;
    margin-top:-10px !important;
  }

  .demand-ring{
    width:260px !important;
    height:260px !important;
  }

  .demand-value{
    font-size:34px !important;
  }

  .flow-box{
    width:auto !important;
    max-width:none !important;
    min-height:96px !important;
  }
}

/* Only stack the Power Flow section on true small mobile screens. */
@media (max-width: 640px){
  .flow-board{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:16px !important;
    min-height:auto !important;
  }

  .flow-center{
    min-height:480px !important;
  }

  .summary-grid{
    grid-template-columns:1fr !important;
  }
}


/* Power Flow centre summary removed
   Gives the animated flow diagram enough vertical space and keeps source cards aligned
   with their lines. */
.flow-center{
  padding-top:0;
}

.flow-center .demand-core{
  min-height:500px;
  margin-top:0;
}

.flow-center .flow-svg{
  inset:0;
  height:100%;
}

@media (min-width:641px) and (max-width:1080px){
  .flow-center .demand-core{
    min-height:500px !important;
    margin-top:0 !important;
  }

  .flow-svg{
    inset:0 !important;
    height:100% !important;
  }
}


/* First row: 3 equal cards */
.top-grid-new-boxes > .metric-card:nth-child(1){
  grid-column:1 / span 2;
}
.top-grid-new-boxes > .metric-card:nth-child(2){
  grid-column:3 / span 2;
}
.top-grid-new-boxes > .metric-card:nth-child(3){
  grid-column:5 / span 2;
}

/* Second row: 2 equal cards centred */
.top-grid-new-boxes > .metric-card:nth-child(4){
  grid-column:2 / span 2;
}
.top-grid-new-boxes > .metric-card:nth-child(5){
  grid-column:4 / span 2;
}

/* Keep Power Flow exactly like original layout */
.flow-board{
  display:grid;
  grid-template-columns:220px 1fr 220px;
  gap:18px;
  align-items:stretch;
  min-height:580px;
}

.flow-center{
  min-height:580px;
}

@media (max-width:1080px){
  .top-grid-new-boxes{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }

  .top-grid-new-boxes > .metric-card{
    grid-column:auto !important;
  }

  .top-grid-new-boxes > .metric-card:nth-child(5){
    grid-column:1 / -1 !important;
  }
}

@media (max-width:640px){
  .top-grid-new-boxes{
    grid-template-columns:1fr !important;
  }

  .top-grid-new-boxes > .metric-card{
    grid-column:auto !important;
    min-height:auto;
  }

  .balance-note{
    align-items:flex-start;
  }
}


/* Import / Export top box final fix
   Keeps 5 cards neat without affecting GB Power Flow. */
.top-grid-new-boxes{
  display:grid !important;
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  gap:18px !important;
  margin-bottom:18px !important;
}

/* Row 1: Demand | Generation | Clean */
.top-grid-new-boxes > .metric-card:nth-child(1){grid-column:1 / span 2 !important;}
.top-grid-new-boxes > .metric-card:nth-child(2){grid-column:3 / span 2 !important;}
.top-grid-new-boxes > .metric-card:nth-child(3){grid-column:5 / span 2 !important;}

/* Row 2: Exports | Net Balance centred */
.top-grid-new-boxes > .metric-card:nth-child(4){grid-column:2 / span 2 !important;}
.top-grid-new-boxes > .metric-card:nth-child(5){grid-column:4 / span 2 !important;}

.metric-card-export{
  border-color:rgba(56,189,248,.25) !important;
}
.metric-card-export:before{
  background:radial-gradient(circle at 18% 12%,rgba(56,189,248,.20),transparent 36%) !important;
}
.metric-card-export .metric-label,
.metric-card-export .metric-value{
  color:#38bdf8 !important;
}

.metric-card-balance{
  border-color:rgba(251,146,60,.25) !important;
}
.metric-card-balance:before{
  background:radial-gradient(circle at 18% 12%,rgba(251,146,60,.20),transparent 36%) !important;
}
.metric-card-balance .metric-label,
.metric-card-balance .metric-value{
  color:#fb923c !important;
}

.metric-card-balance.exporting{
  border-color:rgba(56,189,248,.25) !important;
}
.metric-card-balance.exporting:before{
  background:radial-gradient(circle at 18% 12%,rgba(56,189,248,.20),transparent 36%) !important;
}
.metric-card-balance.exporting .metric-label,
.metric-card-balance.exporting .metric-value{
  color:#38bdf8 !important;
}
.metric-card-balance.balanced .metric-label,
.metric-card-balance.balanced .metric-value{
  color:#86efac !important;
}

/* Fix the import/export explanation note */
.balance-note{
  display:flex !important;
  align-items:center !important;
  gap:12px !important;
  margin:-2px 0 18px !important;
  padding:12px 16px !important;
  border:1px solid rgba(148,163,184,.16) !important;
  border-radius:16px !important;
  background:rgba(15,23,42,.72) !important;
  color:#dbeafe !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035) !important;
  line-height:1.35 !important;
}
.note-icon{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:22px !important;
  height:22px !important;
  min-width:22px !important;
  border-radius:999px !important;
  border:1px solid rgba(56,189,248,.36) !important;
  color:#7dd3fc !important;
  font-size:13px !important;
  font-weight:900 !important;
  flex:0 0 22px !important;
}

/* Desktop-site-on-phone/tablet: keep the nice 3 + 2 layout */
@media (min-width:641px) and (max-width:1080px){
  .top-grid-new-boxes{
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  }
  .top-grid-new-boxes > .metric-card:nth-child(1){grid-column:1 / span 2 !important;}
  .top-grid-new-boxes > .metric-card:nth-child(2){grid-column:3 / span 2 !important;}
  .top-grid-new-boxes > .metric-card:nth-child(3){grid-column:5 / span 2 !important;}
  .top-grid-new-boxes > .metric-card:nth-child(4){grid-column:2 / span 2 !important;}
  .top-grid-new-boxes > .metric-card:nth-child(5){grid-column:4 / span 2 !important;}
}

/* True small phone screens */
@media (max-width:640px){
  .top-grid-new-boxes{
    grid-template-columns:1fr !important;
  }
  .top-grid-new-boxes > .metric-card{
    grid-column:auto !important;
  }
  .balance-note{
    align-items:flex-start !important;
  }
}


/* Dynamic flow line polish
   JS anchors each line to the demand ring and updates width by GW value. */
.flow-center{
  overflow:visible !important;
}

.flow-svg{
  overflow:visible !important;
  pointer-events:none;
}

.flow-line{
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
  filter:drop-shadow(0 0 7px currentColor);
  transition:stroke-width .25s ease, opacity .25s ease, filter .25s ease;
}

.flow-line-highlight{
  opacity:1 !important;
  stroke-width:7px !important;
  filter:drop-shadow(0 0 14px currentColor) drop-shadow(0 0 24px currentColor);
}

.flow-box.flow-card-hover{
  transform:translateY(-2px);
  border-color:rgba(125,211,252,.35) !important;
  box-shadow:0 18px 42px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05);
}

.demand-core{
  z-index:4 !important;
}

.demand-ring{
  position:relative !important;
  z-index:5 !important;
}


/* Interconnector clarity + metric tooltips */
.metric-label-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.metric-info-button{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid rgba(125,211,252,.36);
  background:rgba(15,23,42,.74);
  color:#7dd3fc;
  width:20px;
  height:20px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-size:12px;
  font-weight:900;
  line-height:1;
  cursor:pointer;
}
.metric-card-info{
  overflow:visible;
}
.metric-tooltip{
  position:absolute;
  left:18px;
  right:18px;
  top:calc(100% - 12px);
  z-index:50;
  opacity:0;
  visibility:hidden;
  transform:translateY(8px);
  transition:opacity .18s ease, transform .18s ease, visibility .18s ease;
  padding:12px 13px;
  border-radius:14px;
  border:1px solid rgba(148,163,184,.18);
  background:#0b1220;
  box-shadow:0 18px 42px rgba(0,0,0,.38);
  color:#dbeafe;
  font-size:12px;
  line-height:1.45;
}
.metric-card-info.tooltip-open .metric-tooltip{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}
@media (max-width:640px){
  .metric-tooltip{
    position:relative;
    left:auto;
    right:auto;
    top:auto;
    margin-top:12px;
    opacity:1;
    visibility:visible;
    transform:none;
    display:none;
  }
  .metric-card-info.tooltip-open .metric-tooltip{
    display:block;
  }
}


/* Launch polish: clearer tooltips, trends and subtler flow lines */
@media (max-width:640px){
  .metric-tooltip{
    display:none !important;
    opacity:1 !important;
    visibility:visible !important;
    transform:none !important;
  }
  .metric-card-info.tooltip-open .metric-tooltip{
    display:block !important;
  }
}

.flow-line{
  opacity:.74;
}
.flow-line-highlight{
  opacity:1 !important;
}

.today-stats-panel{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin:0 0 18px;
}
.today-stat{
  padding:18px 20px;
  border:1px solid rgba(148,163,184,.14);
  border-radius:20px;
  background:linear-gradient(180deg,rgba(17,24,39,.88),rgba(12,21,36,.9));
  box-shadow:0 16px 42px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.035);
}
.today-stat span{
  display:block;
  color:#98a6bb;
  font-size:12px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  margin-bottom:8px;
}
.today-stat strong{
  display:block;
  color:#f8fafc;
  font-size:28px;
  letter-spacing:-.04em;
  line-height:1.1;
}
.today-stat small{
  display:block;
  margin-top:8px;
  color:#a8b3c5;
  font-size:13px;
  line-height:1.35;
}
.trend-up{color:#fb923c !important}
.trend-down{color:#34d399 !important}

@media (max-width:860px){
  .today-stats-panel{
    grid-template-columns:1fr;
  }
}


/* Final launch polish */
.today-stats-panel{
  margin-top:10px;
  margin-bottom:20px;
}

.metric-tooltip{
  font-size:11px;
  line-height:1.42;
}

.flow-line{
  opacity:.7;
}

.flow-line-highlight{
  opacity:1 !important;
}

.demand-label-sub{
  margin-top:6px;
  color:#7dd3fc;
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  opacity:.82;
}

.balance-note{
  margin-top:4px;
}

/* SEO explainer content */
.seo-content-panel{
  margin:18px 0;
  padding:22px;
  border:1px solid rgba(148,163,184,.14);
  border-radius:24px;
  background:linear-gradient(180deg,rgba(17,24,39,.82),rgba(10,18,31,.9));
  box-shadow:0 20px 60px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.035);
  color:#dbeafe;
}
.seo-content-panel h2{margin:0 0 10px;font-size:22px;letter-spacing:-.02em}
.seo-content-panel p{margin:0;color:#a8b3c5;line-height:1.6}
.seo-content-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:18px}
.seo-content-grid article{padding:16px;border:1px solid rgba(148,163,184,.12);border-radius:18px;background:rgba(15,23,42,.62)}
.seo-content-grid h3{margin:0 0 8px;font-size:16px;color:#f8fafc}
.seo-content-grid p{font-size:14px}
@media (max-width:860px){.seo-content-grid{grid-template-columns:1fr}}

/* Standalone UK grid map page */
.map-page{max-width:1480px}.map-header{align-items:center}.map-header-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:flex-end}.map-back-link{display:inline-flex;align-items:center;justify-content:center;height:42px;padding:0 16px;border-radius:999px;border:1px solid rgba(148,163,184,.16);background:rgba(15,23,42,.72);color:#dbeafe;text-decoration:none;font-weight:700}.map-layout{display:grid;grid-template-columns:320px minmax(0,1fr);gap:18px;margin-bottom:18px}.map-side-panel{display:flex;flex-direction:column;gap:12px}.map-stat-card,.map-mini-list,.uk-map-panel,.map-note-panel{border:1px solid rgba(148,163,184,.14);border-radius:22px;background:linear-gradient(180deg,rgba(17,24,39,.84),rgba(10,18,31,.92));box-shadow:0 20px 60px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.035)}.map-stat-card{padding:20px}.map-stat-card span,.map-mini-list h2{display:block;margin:0 0 8px;color:#98a6bb;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.map-stat-card strong{display:inline-block;color:#86efac;font-size:42px;line-height:1;letter-spacing:-.05em}.map-stat-card small{color:#a8b3c5;font-size:15px;margin-left:6px}.map-mini-list{padding:18px 20px}.map-mini-list div{display:flex;justify-content:space-between;gap:14px;padding:10px 0;border-bottom:1px solid rgba(148,163,184,.12)}.map-mini-list span{color:#dbeafe}.map-mini-list strong{color:#7dd3fc}.map-mini-list p{margin:12px 0 0;color:#a8b3c5;font-size:13px;line-height:1.45}.uk-map-panel{padding:18px;overflow:hidden}.map-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:12px}.map-title-row h2{margin:0 0 4px;font-size:24px;letter-spacing:-.03em}.map-title-row p{margin:0;color:#a8b3c5}.map-legend{display:flex;gap:12px;flex-wrap:wrap;justify-content:flex-end;color:#cbd5e1;font-size:13px}.map-legend span{display:inline-flex;align-items:center;gap:6px}.map-legend i{width:10px;height:10px;border-radius:999px}.legend-import{background:#86efac}.legend-export{background:#a78bfa}.legend-region{background:#38bdf8}.map-stage{position:relative;min-height:620px;border-radius:20px;overflow:hidden;background:radial-gradient(circle at 45% 40%,rgba(34,197,94,.14),transparent 28%),radial-gradient(circle at 70% 30%,rgba(59,130,246,.10),transparent 24%),linear-gradient(180deg,#07111f,#081120 70%,#06101d);border:1px solid rgba(148,163,184,.12)}.grid-map-svg{width:100%;height:100%;min-height:620px;display:block}.nearby-land,.ireland-land{fill:rgba(15,43,71,.34);stroke:rgba(56,189,248,.25);stroke-width:1.2}.uk-shape{fill:url(#ukFill);stroke:rgba(134,239,172,.5);stroke-width:2;filter:drop-shadow(0 0 24px rgba(34,197,94,.18))}.map-flow{fill:none;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 9px currentColor);transition:stroke-width .3s ease,opacity .3s ease;stroke-dasharray:10 10;animation:mapFlow 1.5s linear infinite}.map-flow.import{stroke:#86efac;color:#86efac;animation-direction:reverse}.map-flow.export{stroke:#a78bfa;color:#a78bfa}@keyframes mapFlow{to{stroke-dashoffset:-40}}.country-label rect{fill:rgba(15,23,42,.86);stroke:rgba(148,163,184,.22)}.country-label text{fill:#f8fafc;font-size:14px;font-weight:800}.country-label text:nth-of-type(2){fill:#86efac;font-size:18px}.country-label.netherlands text:nth-of-type(2),.country-label.belgium text:nth-of-type(2){fill:#c4b5fd}.region-marker circle{fill:rgba(15,23,42,.72);stroke:rgba(56,189,248,.28);filter:drop-shadow(0 0 14px rgba(56,189,248,.16))}.region-marker text{text-anchor:middle;fill:#f8fafc;font-size:12px;font-weight:900;text-transform:uppercase}.region-marker text:nth-of-type(2){fill:#86efac;font-size:16px}.map-note-panel{padding:14px 18px;color:#cbd5e1;line-height:1.5}.map-note-panel strong{color:#f8fafc}@media(max-width:1080px){.map-layout{grid-template-columns:1fr}.map-side-panel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.map-mini-list{grid-column:1/-1}}@media(max-width:720px){.map-header{align-items:flex-start}.map-header-actions{justify-content:flex-start}.map-side-panel{grid-template-columns:1fr}.map-title-row{display:block}.map-legend{justify-content:flex-start;margin-top:12px}.map-stage,.grid-map-svg{min-height:520px}}


/* Polished dashboard / map navigation */
.view-switcher{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px;
  border:1px solid rgba(148,163,184,.16);
  border-radius:999px;
  background:rgba(15,23,42,.72);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

.view-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 14px;
  border-radius:999px;
  color:#a8b3c5;
  font-size:13px;
  font-weight:800;
  text-decoration:none;
  letter-spacing:.01em;
  transition:background .18s ease, color .18s ease, box-shadow .18s ease;
}

.view-link:hover{
  color:#f8fafc;
  background:rgba(125,211,252,.08);
}

.view-link.active{
  color:#06111f;
  background:linear-gradient(135deg,#86efac,#38bdf8);
  box-shadow:0 8px 22px rgba(56,189,248,.18);
}

.site-header > div:last-child,
.map-header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
}

.map-back-link{
  display:none;
}

@media (max-width:720px){
  .site-header > div:last-child,
  .map-header-actions{
    justify-content:flex-start;
  }

  .view-switcher{
    order:-1;
  }

  .view-link{
    min-height:32px;
    padding:0 12px;
  }
}


/* Grid action insight panel */
.grid-action-panel{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(300px,.8fr);
  gap:16px;
  align-items:center;
  margin:0 0 16px;
  padding:18px 20px;
  border:1px solid rgba(148,163,184,.14);
  border-radius:24px;
  background:linear-gradient(135deg,rgba(15,23,42,.88),rgba(12,21,36,.92));
  box-shadow:0 20px 60px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.035);
  overflow:hidden;
}
.grid-action-panel:before{
  content:"";
  position:absolute;
  inset:-80px auto auto -70px;
  width:220px;
  height:220px;
  border-radius:999px;
  opacity:.18;
  filter:blur(4px);
  pointer-events:none;
  background:#38bdf8;
}
.grid-action-main{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:16px;
}
.grid-action-badge{
  flex:0 0 auto;
  width:48px;
  height:48px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(56,189,248,.14);
  border:1px solid rgba(56,189,248,.26);
  color:#7dd3fc;
  font-size:30px;
  line-height:1;
  box-shadow:0 0 28px rgba(56,189,248,.12);
}
.grid-action-kicker{
  margin:0 0 5px;
  color:#98a6bb;
  font-size:12px;
  font-weight:900;
  letter-spacing:.11em;
  text-transform:uppercase;
}
.grid-action-panel h2{
  margin:0 0 6px;
  font-size:24px;
  letter-spacing:-.03em;
}
.grid-action-panel p{
  margin:0;
  color:#cbd5e1;
  line-height:1.45;
}
.grid-action-reasons{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}
.grid-action-reasons div{
  padding:12px 10px;
  border:1px solid rgba(148,163,184,.12);
  border-radius:16px;
  background:rgba(15,23,42,.62);
  text-align:center;
}
.grid-action-reasons span{
  display:block;
  color:#98a6bb;
  font-size:11px;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  margin-bottom:5px;
}
.grid-action-reasons strong{
  display:block;
  color:#f8fafc;
  font-size:16px;
}
.grid-action-why{
  grid-column:1 / -1;
  position:relative;
  z-index:1;
  padding-top:12px;
  border-top:1px solid rgba(148,163,184,.12);
  color:#a8b3c5 !important;
  font-size:13px;
}
.grid-action-clean{
  border-color:rgba(34,197,94,.24);
  background:linear-gradient(135deg,rgba(34,197,94,.13),rgba(15,23,42,.9));
}
.grid-action-clean:before{background:#22c55e}
.grid-action-clean .grid-action-badge{background:rgba(34,197,94,.14);border-color:rgba(34,197,94,.28);color:#86efac}
.grid-action-good{
  border-color:rgba(56,189,248,.24);
}
.grid-action-good:before{background:#38bdf8}
.grid-action-normal{
  border-color:rgba(148,163,184,.16);
}
.grid-action-stressed{
  border-color:rgba(251,146,60,.30);
  background:linear-gradient(135deg,rgba(251,146,60,.13),rgba(15,23,42,.9));
}
.grid-action-stressed:before{background:#fb923c}
.grid-action-stressed .grid-action-badge{background:rgba(251,146,60,.14);border-color:rgba(251,146,60,.30);color:#fdba74}
@media (max-width:860px){
  .grid-action-panel{
    grid-template-columns:1fr;
    padding:16px;
  }
  .grid-action-reasons{
    grid-template-columns:1fr;
  }
  .grid-action-panel h2{
    font-size:21px;
  }
}


/* Insight de-duplication + best time indicator */
.best-time-card{
  position:relative;
  z-index:1;
  padding:14px 16px;
  border:1px solid rgba(148,163,184,.14);
  border-radius:18px;
  background:rgba(15,23,42,.66);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.best-time-card span{
  display:block;
  color:#98a6bb;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:5px;
}
.best-time-card strong{
  display:block;
  font-size:18px;
  color:#f8fafc;
  letter-spacing:-.02em;
}
.best-time-card small{
  display:block;
  margin-top:5px;
  color:#a8b3c5;
  line-height:1.35;
}
.best-time-good{
  border-color:rgba(34,197,94,.26);
  background:linear-gradient(135deg,rgba(34,197,94,.12),rgba(15,23,42,.68));
}
.best-time-good strong{color:#86efac}
.best-time-normal{
  border-color:rgba(56,189,248,.20);
}
.best-time-normal strong{color:#7dd3fc}
.best-time-avoid{
  border-color:rgba(251,146,60,.28);
  background:linear-gradient(135deg,rgba(251,146,60,.12),rgba(15,23,42,.68));
}
.best-time-avoid strong{color:#fdba74}

@media (min-width:861px){
  .grid-action-panel{
    grid-template-columns:minmax(0,1.05fr) minmax(230px,.45fr) minmax(300px,.75fr);
  }
  .grid-action-why{
    grid-column:1 / -1;
  }
}


/* New clean dashboard layout */
.legacy-insight-panel{
  display:none !important;
}

.grid-action-panel{
  margin-top:18px;
  margin-bottom:18px;
}

@media (min-width:861px){
  .grid-action-panel{
    grid-template-columns:minmax(0,1.05fr) minmax(230px,.45fr) minmax(320px,.85fr);
  }
}

.best-time-card{
  position:relative;
  z-index:1;
  padding:14px 16px;
  border:1px solid rgba(148,163,184,.14);
  border-radius:18px;
  background:rgba(15,23,42,.66);
}
.best-time-card span{
  display:block;
  color:#98a6bb;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:5px;
}
.best-time-card strong{
  display:block;
  color:#f8fafc;
  font-size:18px;
}
.best-time-card small{
  display:block;
  margin-top:5px;
  color:#a8b3c5;
  line-height:1.35;
}
.best-time-good{
  border-color:rgba(34,197,94,.26);
  background:linear-gradient(135deg,rgba(34,197,94,.12),rgba(15,23,42,.68));
}
.best-time-good strong{color:#86efac}
.best-time-normal strong{color:#7dd3fc}
.best-time-avoid{
  border-color:rgba(251,146,60,.28);
  background:linear-gradient(135deg,rgba(251,146,60,.12),rgba(15,23,42,.68));
}
.best-time-avoid strong{color:#fdba74}

.top-grid-new-boxes{
  display:grid !important;
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  gap:18px !important;
  margin-bottom:18px !important;
}
.top-grid-new-boxes > .metric-card{
  min-height:140px;
}
.top-grid-new-boxes > .metric-card:nth-child(1),
.top-grid-new-boxes > .metric-card:nth-child(2),
.top-grid-new-boxes > .metric-card:nth-child(3),
.top-grid-new-boxes > .metric-card:nth-child(4),
.top-grid-new-boxes > .metric-card:nth-child(5),
.top-grid-new-boxes > .metric-card:nth-child(6){
  grid-column:span 1 !important;
}
.metric-card-carbon-top{
  border-color:rgba(167,139,250,.22);
}
.metric-card-carbon-top:before{
  background:radial-gradient(circle at 18% 12%,rgba(167,139,250,.20),transparent 36%);
}
.metric-card-carbon-top .metric-label,
.metric-card-carbon-top .metric-value{
  color:#c4b5fd;
}

.compact-mix-panel{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(320px,.8fr);
  gap:18px;
  align-items:center;
  margin:0 0 18px;
  padding:20px;
  border:1px solid rgba(148,163,184,.14);
  border-radius:24px;
  background:linear-gradient(135deg,rgba(17,24,39,.84),rgba(10,18,31,.92));
  box-shadow:0 20px 60px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.035);
}
.compact-mix-panel h2{
  margin:0 0 6px;
  font-size:24px;
  letter-spacing:-.03em;
}
.compact-mix-panel p{
  margin:0;
  color:#a8b3c5;
  line-height:1.45;
}
.compact-mix-bars{
  display:grid;
  gap:12px;
}
.compact-mix-row{
  display:grid;
  grid-template-columns:70px 70px 1fr;
  align-items:center;
  gap:10px;
  color:#cbd5e1;
  font-size:13px;
}
.compact-mix-row strong{
  color:#f8fafc;
  text-align:right;
}
.compact-mix-row i{
  display:block;
  height:10px;
  border-radius:999px;
  background:rgba(148,163,184,.12);
  position:relative;
  overflow:hidden;
}
.compact-mix-row i:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:var(--w);
  border-radius:inherit;
}
.mix-clean:before{background:#34d399}
.mix-fossil:before{background:#fb923c}
.mix-other:before{background:#8b5cf6}

@media (max-width:1180px){
  .top-grid-new-boxes{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
}
@media (max-width:860px){
  .compact-mix-panel{
    grid-template-columns:1fr;
  }
  .top-grid-new-boxes{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media (max-width:640px){
  .top-grid-new-boxes{
    grid-template-columns:1fr !important;
  }
  .compact-mix-row{
    grid-template-columns:64px 60px 1fr;
  }
}

/* Final five polish tweaks */
.grid-action-panel{
  margin-bottom:12px !important;
}

.insight-panel,
.compact-mix-panel{
  margin-top:10px;
}

.best-time-good strong::before{
  content:"● ";
  color:#22c55e;
}

.best-time-normal strong::before{
  content:"● ";
  color:#38bdf8;
}

.best-time-avoid strong::before{
  content:"● ";
  color:#fb923c;
}

/* Tiny visual nudge so the flow lines meet the centre ring more naturally */
.demand-core{
  transform:translateY(6px);
}

@media (max-width:640px){
  .demand-core{
    transform:none;
  }
}

/* More recognisable embedded UK SVG map shape */
.uk-shape{
  fill:url(#ukFill);
  stroke:rgba(134,239,172,.56);
  stroke-width:2;
  filter:drop-shadow(0 0 22px rgba(34,197,94,.18));
}
.uk-shape.scotland-shape{
  fill:rgba(18,48,38,.92);
}
.uk-shape.england-shape{
  fill:rgba(16,36,58,.92);
}
.uk-shape.wales-shape,
.uk-shape.southwest-shape,
.uk-shape.ni-shape{
  fill:rgba(18,54,53,.88);
}
.uk-shape-outline{
  fill:none;
  stroke:rgba(125,211,252,.18);
  stroke-width:4;
  opacity:.48;
}
