:root{
  --gg-bg:#050505;
  --gg-panel:#0b0f17;
  --gg-line:#252b36;
  --gg-text:#f5f7fb;
  --gg-muted:#9aa3b6;
  --gg-cyan:#00ffff;
  --gg-magenta:#ff00e6;
  --gg-green:#00ff88;
  --gg-yellow:#ffcc00;
  --gg-orange:#ff9900;
  --gg-red:#ff4444;
}

body{background:var(--gg-bg)!important;color:var(--gg-text)!important;}
a{color:#7fdfff;}
.page-content,.wrapper,main{background:var(--gg-bg)!important;color:var(--gg-text)!important;}
.scada-grid,.v6-app{font-family:"Courier New",monospace;max-width:1280px;margin:0 auto;}
.scada-hero{border-bottom:1px solid var(--gg-line);padding:18px 0 12px;margin-bottom:18px;}
.scada-subtitle{letter-spacing:.28em;color:var(--gg-muted);font-size:14px;text-transform:uppercase;}
.scada-title{margin:10px 0 8px;color:var(--gg-text);font-size:clamp(28px,5vw,44px);line-height:1.1;font-weight:800;}
.scada-title-rule{height:1px;background:var(--gg-text);opacity:.75;margin:12px 0 0;}
.scada-live-row,.scada-live-pill,.scada-update-panel,.scada-intro,.scada-dev-note,.scada-status,.scada-gauges{display:none!important;}

.scada-live-summary{border:1px solid var(--gg-cyan);background:rgba(0,255,255,.04);border-radius:6px;padding:18px 16px;margin:18px 0 24px;box-shadow:0 0 18px rgba(0,255,255,.08);font-family:"Courier New",monospace;}
.scada-summary-title{color:var(--gg-cyan);text-transform:uppercase;letter-spacing:.16em;font-size:13px;margin-bottom:16px;text-align:center;}
.scada-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.scada-summary-grid div{border:1px solid var(--gg-line);background:rgba(255,255,255,.025);border-radius:4px;padding:14px 12px;text-align:center;}
.scada-summary-grid span{display:block;color:var(--gg-muted);text-transform:uppercase;letter-spacing:.14em;font-size:10px;margin-bottom:8px;}
.scada-summary-grid strong{display:inline-block;color:var(--gg-text);font-size:clamp(28px,5vw,46px);line-height:1.05;margin-right:6px;}
.scada-summary-grid em{font-style:normal;color:var(--gg-muted);font-size:13px;}
.scada-summary-time{margin-top:14px;color:var(--gg-muted);font-size:11px;line-height:1.45;text-align:center;}

.scada-mix-grid,.commodity-grid,.pump-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:18px;}
.scada-mini{background:var(--gg-panel);border:1px solid var(--gg-line);border-radius:6px;padding:12px 12px 10px;}
.scada-mini-top{display:flex;justify-content:space-between;gap:10px;align-items:baseline;}
.scada-mini-name{color:var(--gg-text);text-transform:uppercase;letter-spacing:.12em;font-size:12px;}
.scada-mini-value{color:var(--gg-cyan);font-size:13px;white-space:nowrap;}
.scada-mini-track{height:8px;border-radius:5px;background:rgba(255,255,255,.08);overflow:hidden;margin-top:10px;}
.scada-mini-fill{height:100%;border-radius:5px;transition:width .6s ease;}

.commodity-card{background:var(--gg-panel);border:1px solid var(--gg-line);border-radius:6px;padding:14px;}
.commodity-label{color:var(--gg-muted);text-transform:uppercase;letter-spacing:.16em;font-size:12px;}
.commodity-value{color:var(--gg-text);font-size:clamp(24px,5vw,38px);font-weight:800;margin-top:8px;}
.commodity-unit{color:var(--gg-muted);font-size:11px;margin-top:4px;}
.commodity-card.oil .commodity-value{color:var(--gg-orange);}
.commodity-card.metal .commodity-value{color:var(--gg-cyan);}

.section-title{color:#00ffff;text-transform:uppercase;letter-spacing:.12em;font-size:22px;margin-top:26px;}
.trend-panel{background:var(--gg-panel);border:1px solid var(--gg-line);border-radius:6px;padding:14px;margin-top:18px;}
.price-history-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:10px;}
.price-history-actions select,.price-history-actions input{background:#050505;color:var(--gg-cyan);border:1px solid var(--gg-line);padding:8px;font-family:"Courier New",monospace;border-radius:4px;}
.price-history-actions a,.price-history-actions button,.price-history-chart-nav button{border:1px solid var(--gg-line);border-radius:4px;padding:8px 11px;color:#00ffff;background:rgba(0,255,255,.05);font-family:"Courier New",monospace;cursor:pointer;}
.price-history-date-label{display:flex;gap:6px;align-items:center;color:var(--gg-muted);text-transform:uppercase;letter-spacing:.12em;font-size:11px;}

#electricity-price-history-panel .price-history-range-status,
#electricity-price-history-panel .unit-panel,
#electricity-price-history-panel .price-history-grid,
#electricity-price-history-panel .price-history-table-toggle{display:none!important;}
#electricity-price-history-panel .trend-panel{padding:12px;width:100%;max-width:100%;overflow:hidden;background:#070a10!important;border:1px solid #252b36!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.02),0 0 22px rgba(0,255,255,.05);}
#electricity-price-history-panel .price-history-actions::after{content:"Elexon System Price history · select start, period and hour filter · red markers show high and low";display:block;width:100%;color:var(--gg-muted);font-size:12px;letter-spacing:.08em;text-transform:uppercase;margin-top:4px;}
#electricity-price-history-panel #price-history-canvas{height:min(76dvh,760px)!important;min-height:520px!important;width:100%!important;display:block;touch-action:pan-y;background:#05070c!important;border:1px solid rgba(255,255,255,.06);border-radius:6px;}

.gg-machine-note{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.018);color:var(--gg-muted);font-size:10.5px;line-height:1.45;letter-spacing:.04em;padding:8px 10px;margin:8px 0 10px;border-radius:5px;}
.gg-machine-note strong{color:var(--gg-cyan);text-transform:uppercase;letter-spacing:.10em;display:block;margin-bottom:4px;}
.gg-machine-note span{display:block;}
.gg-machine-note b{color:var(--gg-text);}

.price-history-scroller{display:none!important;}
.price-history-time-tabs,.price-history-chart-nav{width:100%;border:1px solid var(--gg-line);background:rgba(255,255,255,.025);border-radius:6px;padding:10px 12px;margin:10px 0;box-sizing:border-box;}
.price-history-time-tabs{display:flex;gap:8px;align-items:center;flex-wrap:wrap;color:var(--gg-muted);font:11px "Courier New",monospace;text-transform:uppercase;letter-spacing:.08em;}
.price-history-time-tabs button.active{background:rgba(0,255,255,.18);box-shadow:0 0 10px rgba(0,255,255,.12);}
.price-history-chart-nav{display:grid;grid-template-columns:1fr 1fr;gap:10px;background:rgba(0,255,255,.025);}
.price-history-chart-nav button{min-height:42px;font-size:13px;letter-spacing:.04em;}

.price-history-discovery{border:1px solid rgba(0,255,255,.28);background:rgba(0,255,255,.035);border-radius:6px;padding:10px 12px;margin:10px 0;color:#9aa3b6;font:12px "Courier New",monospace;line-height:1.55;}
.price-history-discovery summary{cursor:pointer;color:#00ffff;text-transform:uppercase;letter-spacing:.12em;font-weight:800;}
.price-history-discovery strong{color:#f5f7fb;}
.price-history-discovery p{margin:8px 0 0;}

.scada-credit{font-size:12px;color:var(--gg-muted);margin-top:22px;line-height:1.5;}
.scada-credit h2{color:var(--gg-cyan);font-size:20px;letter-spacing:.06em;text-transform:uppercase;}

html.v5-chart-open,body.v5-chart-open{overflow:hidden!important;height:100dvh!important;}
.price-history-fullscreen-btn{border:1px solid #252b36!important;border-radius:4px;padding:7px 9px;color:#00ffff!important;background:rgba(0,255,255,.05)!important;font-family:"Courier New",monospace;cursor:pointer;}
.price-history-fullscreen-overlay{position:fixed;inset:0;display:none;z-index:9999;background:#000;padding:0;box-sizing:border-box;overflow:hidden;}
.price-history-fullscreen-overlay.open{display:block;overflow-y:auto;-webkit-overflow-scrolling:touch;}
.price-history-fullscreen-shell{position:relative;width:100vw;min-height:100dvh;border:0;background:#05070c;box-shadow:none;display:block;overflow:visible;transform:translateZ(0);will-change:transform;}
.price-history-fullscreen-toolbar{position:sticky;z-index:6;top:0;height:42px;display:flex;align-items:center;gap:8px;padding:0 max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left));background:rgba(0,0,0,.58);backdrop-filter:blur(4px);color:#f5f7fb;font-family:"Courier New",monospace;}
.price-history-fullscreen-toolbar strong{color:#00ffff;text-transform:uppercase;letter-spacing:.08em;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.price-history-fullscreen-toolbar span{display:none!important;}
.price-history-fullscreen-toolbar button{margin-left:auto;border:1px solid rgba(0,255,255,.22);border-radius:50%;width:34px;height:34px;color:#00ffff;background:rgba(0,255,255,.05);font:24px/1 "Courier New",monospace;cursor:pointer;flex:0 0 auto;}
.price-history-fullscreen-arrow{position:fixed;z-index:5;top:50%;transform:translateY(-50%);width:42px;height:72px;border:0;border-radius:999px;color:#00ffff;background:rgba(0,0,0,.18);font:42px/1 "Courier New",monospace;cursor:pointer;text-shadow:0 0 10px rgba(0,255,255,.65);opacity:.72;}
.price-history-fullscreen-arrow-left{left:max(6px,env(safe-area-inset-left));}
.price-history-fullscreen-arrow-right{right:max(6px,env(safe-area-inset-right));}
.price-history-fullscreen-arrow:active{background:rgba(0,255,255,.10);opacity:1;}
#price-history-fullscreen-canvas{width:100vw;height:calc(100dvh - 42px);min-height:620px;display:block;background:#05070c;touch-action:pan-y;transform:translateZ(0);will-change:transform;}
.price-history-fullscreen-note{display:none!important;}
.price-history-fullscreen-smallprint{font-family:"Courier New",monospace;color:var(--gg-muted);border-top:1px solid rgba(0,255,255,.25);background:#05070c;padding:18px max(18px,env(safe-area-inset-right)) calc(36px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));font-size:12px;line-height:1.55;letter-spacing:.03em;}
.price-history-fullscreen-smallprint h2{font-size:14px;color:#00ffff;text-transform:uppercase;letter-spacing:.12em;margin:0 0 10px;}
.price-history-fullscreen-smallprint p{margin:8px 0 0;max-width:920px;}
.price-history-fullscreen-smallprint strong{color:#f5f7fb;}
.price-history-fullscreen-smallprint a{color:#7fdfff;border-bottom:1px solid rgba(127,223,255,.35);text-decoration:none;}

@media(max-width:850px){
  .scada-summary-grid,.scada-mix-grid,.commodity-grid,.pump-grid{grid-template-columns:1fr;}
  #electricity-price-history-panel #price-history-canvas{min-height:580px!important;height:74dvh!important;}
  .price-history-chart-nav{grid-template-columns:1fr;}
  .price-history-time-tabs,.price-history-chart-nav{padding:9px!important;}
  .price-history-chart-nav button{min-height:44px;}
}

@media(orientation:landscape){
  .price-history-fullscreen-toolbar{height:36px;}
  .price-history-fullscreen-toolbar strong{font-size:11px;}
  .price-history-fullscreen-toolbar button{width:30px;height:30px;font-size:21px;}
  .price-history-fullscreen-arrow{width:54px;height:54px;font-size:38px;}
  #price-history-fullscreen-canvas{height:calc(100dvh - 36px);min-height:0;}
}

@media(orientation:landscape) and (max-height:520px){
  #electricity-price-history-panel #price-history-canvas{height:68dvh!important;min-height:260px!important;}
  #electricity-price-history-panel .trend-panel{padding:8px!important;}
  .price-history-time-tabs,.price-history-chart-nav{padding:7px 8px!important;margin:7px 0!important;}
}

/* V6 repair: restore V5 oil, road fuel, EV and frequency panel styling. */
.trend-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:10px;}
.trend-controls select{background:#050505;color:var(--gg-cyan);border:1px solid var(--gg-line);padding:8px;font-family:"Courier New",monospace;border-radius:4px;}
#oil-trend-canvas{width:100%;height:300px;display:block;border:1px solid rgba(255,255,255,.05);background:#070a10;touch-action:auto;}
.oil-chart-wrap{position:relative;}
.oil-tooltip{position:absolute;display:none;pointer-events:none;background:rgba(5,5,5,.94);border:1px solid var(--gg-cyan);color:var(--gg-text);padding:8px 10px;border-radius:4px;font-size:12px;line-height:1.45;box-shadow:0 0 18px rgba(0,255,255,.12);z-index:5;}
.oil-stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:10px;}
.oil-stat{border:1px solid var(--gg-line);background:rgba(255,255,255,.03);border-radius:4px;padding:9px;}
.oil-stat-label{color:var(--gg-muted);text-transform:uppercase;letter-spacing:.12em;font-size:10px;}
.oil-stat-value{color:var(--gg-cyan);font-size:16px;font-weight:800;margin-top:4px;}
.pump-grid{grid-template-columns:repeat(2,minmax(0,1fr));opacity:.86;}
.pump-card{background:rgba(255,255,255,.03);border:1px solid var(--gg-line);border-radius:6px;padding:12px;}
.pump-label{color:var(--gg-muted);text-transform:uppercase;letter-spacing:.14em;font-size:11px;}
.pump-value{color:var(--gg-yellow);font-size:24px;font-weight:800;margin-top:6px;}
.fuel-logic-panel,.ev-panel{border:1px solid var(--gg-line);background:rgba(255,255,255,.03);border-radius:6px;padding:14px;margin-top:14px;color:var(--gg-muted);font-size:13px;line-height:1.55;}
.fuel-logic-panel strong,.ev-panel strong{color:var(--gg-text);}
.fuel-source-links{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px;}
.fuel-source-links a{border:1px solid var(--gg-line);border-radius:4px;padding:7px 9px;color:#7fdfff;}
.ev-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px;}
.ev-card{border:1px solid var(--gg-line);background:var(--gg-panel);border-radius:6px;padding:12px;}
.ev-label{color:var(--gg-muted);text-transform:uppercase;letter-spacing:.14em;font-size:11px;}
.ev-value{color:var(--gg-green);font-size:22px;font-weight:800;margin-top:6px;}
@media(max-width:850px){.pump-grid,.ev-card-grid,.oil-stats-grid{grid-template-columns:1fr;}#oil-trend-canvas{height:320px;}}

/* V6 repair: mobile chart readability and cinematic fullscreen layout. */
#price-history-refresh{display:none!important;}

/* V6 repair: stabilise mobile chart after readability experiment. */
@media(max-width:850px) and (orientation:portrait){
  #electricity-price-history-panel #price-history-canvas{height:74dvh!important;min-height:580px!important;}
}