/* Radial Economics phone and tablet layer (13 Nov 2026). Loaded last, after css/brand.css.
   Everything here sits inside a media query, so the desktop site is untouched. Layout only: colours, fonts and
   the data colours come from tokens.css / brand.css / base.css as before.
   Breakpoints: 800 px = the page turns into one column (same as base.css), 520 px = phone-only tightening.
   Sections: frame and masthead, touch targets, tables, Home / Brief, Signals, Markets, System, Offshore, Map, Data, footer. */

@media(max-width:800px){
 /* ---- frame ---- */
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 body{overflow-wrap:anywhere}
 td,th,button,select,.seg,.hgz{overflow-wrap:normal}
 /* one column that may shrink below its content: without minmax(0,..) a wide table stretches the whole page sideways */
 main,body:not([data-tab="map"]) main{grid-template-columns:minmax(0,1fr)!important}
 main{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
 #strip{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
 #col,#home,#dash,#mkt,#sys,#flg,#nws,#dat,main>aside{min-width:0;max-width:100%}
 img,svg{max-width:100%}

 /* ---- masthead: wordmark and zone picker on the first row, the tabs on a second row that stays at the top while scrolling ---- */
 #mast{--m1:50px;display:block;position:sticky;top:calc(-1 * var(--m1));z-index:30;overflow:visible;
  background:var(--re-surface-100);padding:0;margin:0 -16px 16px;border-bottom:1px solid var(--re-line)}
 #mbrand{display:flex;align-items:center;height:var(--m1);padding:0 16px}
 #mbrand img{height:26px}
 #mast #tabs{display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:stretch;gap:0 14px;
  overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:0 16px}
 #mast #tabs::-webkit-scrollbar{display:none}
 #mast #tabs>button[data-t]{flex:none;padding:13px 0 12px;margin-bottom:0;font-size:14px;line-height:18px;border-bottom-width:2px}
 #mast #csw{position:absolute;top:0;right:16px;height:var(--m1);margin:0;padding:0;align-items:center}
 #csw .fsel{min-width:0}
 #mast #csw .fsb{max-width:46vw;padding:7px 10px;font-size:14px}
 #csw .fsp{position:fixed;left:16px;right:16px;top:auto;width:auto;max-width:none;margin-top:6px}
 .fsl{max-height:min(55vh,430px)}
 .fso{padding:10px 8px;font-size:15px}
 html{scroll-padding-top:56px}

 /* ---- touch: controls a finger can hit; 16 px form text so iOS does not zoom the page on focus ---- */
 select,input[type=text],input[type=search],input:not([type]),textarea,.fss{font-size:16px!important}
 select{min-height:40px;max-width:100%}
 .seg button{min-height:38px;padding:8px 13px}
 .seg{max-width:100%;flex-wrap:wrap}
 .lnk,.pmore summary,#footd summary,.srcd summary{padding-top:12px;padding-bottom:12px}
 .pblock>a{padding:13px 0}
 .sf2>div{gap:0}.sf2 a{padding:7px 0}
 input[type=range]{height:32px}
 a,button,summary,select,label{-webkit-tap-highlight-color:color-mix(in srgb,var(--re-navy) 14%,transparent)}
 #dtip,#tip{max-width:calc(100vw - 24px)}

 /* ---- tables wider than the screen scroll sideways inside their own box, never the page ---- */
 .tw,.ptw,.dw,.hbg{overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;max-width:100%}
 .tw{max-height:none}

 /* ---- headings ---- */
 .pgh{font-size:30px}
 h2{font-size:21px}
 .big{font-size:36px}
 .card h3{flex-wrap:wrap;gap:6px 12px}
 .card h3>span{min-width:0}
 .grid{grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr))}
 .card{min-width:0}
 .card.wide{overflow-x:auto}

 /* ---- Home / Daily brief ---- */
 .ph1{font-size:clamp(32px,9vw,44px);text-wrap:pretty}
 .hx{font-size:clamp(34px,9.6vw,48px)}
 .pdek{font-size:17px;line-height:27px}
 .pbody h2{font-size:26px}.pbody h3{font-size:22px}
 .pcrumb{margin-bottom:20px}
 .pcta .pbtn{flex:1 1 auto;justify-content:center}
 .pgrid{gap:36px}
 .hsec h2,.hband h2{font-size:28px;line-height:33px}
 .hband{margin:0 -16px;padding:40px 16px}
 .hgr{min-width:0}
 .hgr.wide{min-width:520px}
 .h3c{gap:24px}

 /* ---- Signals ---- */
 #flg .dt th{white-space:normal;vertical-align:bottom;min-width:76px}
 #flg .dt th:first-child,#flg .dt td:first-child{min-width:0;padding-left:8px;padding-right:8px}
 #flg .dt th,#flg .dt td{padding-left:8px;padding-right:8px}
 #flg .dt tr.fsr td{padding-top:9px;padding-bottom:9px}
 #flg .dt td.fxc{padding:0}
 #flg .dw{max-height:none}

 /* ---- Markets ---- */
 #mkt .hmsort{justify-content:flex-start}
 .captab th,.captab td{padding-left:4px;padding-right:4px}

 /* ---- System ---- */
 #sys .card h3>span:first-child{flex-wrap:wrap}
 .syswrap{grid-template-columns:repeat(auto-fill,minmax(min(320px,100%),1fr))}
 .mixtab{font-size:12px}
 .mixtab td,.mixtab th{padding-left:4px!important;padding-right:4px!important}
 .mixleg{gap:8px 14px;font-size:12.5px}

 /* ---- Offshore wind ---- */
 .hero{gap:14px 24px}
 .hero div b{font-size:30px}
 #dash label[style]{max-width:none!important;flex-wrap:wrap}

 /* ---- Map: shorter than the screen so the page can still be scrolled past it (the map itself takes every touch) ---- */
 #stage{height:62vh;height:min(62svh,620px);min-height:320px}
 body[data-tab="map"] main{padding-bottom:max(16px,env(safe-area-inset-bottom))}
 #zc button{width:42px;height:42px;font-size:20px}
 #bmlist{max-width:calc(100vw - 56px);max-height:52vh;overflow:auto}
 #attr{max-width:calc(100% - 120px)}
 main>aside{padding:16px 0;gap:16px}
 #leg .lc{padding-top:9px;padding-bottom:9px}
 #leg .lk{padding-top:7px;padding-bottom:7px;max-width:100%;margin-right:0}
 #leg .lrow{min-width:0}
 #mosel{display:flex;flex-wrap:nowrap}
 #mosel button{flex:1 1 auto;min-width:0;padding-left:6px;padding-right:6px;text-align:center}
 #mobar,#mobar *{overflow-wrap:normal}
 #mobar{flex-wrap:wrap}
 .mocl{flex-wrap:wrap}

 /* ---- Data (private edition) ---- */
 #dat .chip{padding:7px 11px;font-size:13px}
 #dat .vgh button{padding:6px 11px}
 #dat .dw{max-height:70vh}

 /* ---- footer ---- */
 #sitefoot{padding:32px 0 max(40px,env(safe-area-inset-bottom));gap:28px}
 .sf2{gap:28px 40px;width:100%}
 .sf3{flex-direction:column}
}

@media(max-width:520px){
 /* Signals fired: zone, signal, value and percentile; the typical range and day count are in the drill-down */
 #flg .dt.ft:has(th:nth-child(6)) tr.fsr td:nth-child(n+5),#flg .dt.ft:has(tr.fsr td:nth-child(6)) thead th:nth-child(n+5){display:none}
 #flg .dt.ft{font-size:12.5px}
 #flg .dt:has(tr.fsr) th{min-width:0}
 #flg .dt.ft tr.fsr td:first-child{white-space:normal;overflow-wrap:normal}
 #flg .dt.ft tr.fsr td:nth-child(2){white-space:normal;min-width:112px}
 #flg .dt.ft tr.fsr td:nth-child(3){white-space:normal}
 #flg .dt.ft tr.fsr td{padding-left:6px;padding-right:6px}
 /* generation mix table: the 24 h average column gives way; now, share and 24 h energy stay */
 .mixtab th:nth-child(4),.mixtab td:nth-child(4){display:none}
 .hfig{column-gap:14px}
 .pchk{margin-left:-16px;margin-right:-16px}
 #strip{font-size:10.5px}
}

/* the narrowest phones (320-360 px) */
@media(max-width:360px){
 #mbrand img{height:21px}
 #mast #csw .fsb{max-width:40vw;padding:6px 8px;font-size:13px}
 #mast #tabs{gap:0 16px}
 .card{min-width:0;padding-left:10px;padding-right:10px}
 .mixtab{font-size:11.5px}
 .mixtab td,.mixtab th{padding-left:3px!important;padding-right:3px!important}
 .hfig{grid-template-columns:minmax(0,1fr)}
}

/* phones held sideways: the map may use the whole height, the masthead stops sticking (too little room) */
@media(max-width:950px) and (max-height:480px) and (orientation:landscape){
 #mast{position:static}
 #stage{height:78vh;height:78svh;min-height:240px}
}
