/* Scoped dark surface palette, generated from upgrade.css. */
:where(html[data-portal-theme="dark"]) body{background:radial-gradient(ellipse at top right,#1b2935 0,transparent 38%),#202730;color:var(--ink);}
:where(html[data-portal-theme="dark"]) .hero{background:radial-gradient(ellipse at 90% 5%,#1f759a 0,transparent 65%),linear-gradient(135deg,#132a44,#103e55 65%,#147e80);}
:where(html[data-portal-theme="dark"]) .hero:after{border:1px solid #ffffff25;}
:where(html[data-portal-theme="dark"]) .hero-actions .secondary{background:#ffffff16;color:white;border-color:#ffffff55;}
:where(html[data-portal-theme="dark"]) .panel,:where(html[data-portal-theme="dark"]) .labcard,:where(html[data-portal-theme="dark"]) .metrics>div{border:1px solid #41596d;}
:where(html[data-portal-theme="dark"]) .labcard{border-top:3px solid #148e88;}
:where(html[data-portal-theme="dark"]) .labcard[data-group="Python & IoT"]{border-top-color:#4176ce;}
:where(html[data-portal-theme="dark"]) .labcard[data-group="Pi practical"]{border-top-color:#d7863a;}
:where(html[data-portal-theme="dark"]) .featuretiles>a,:where(html[data-portal-theme="dark"]) .featuretiles>div{color:inherit;background:linear-gradient(155deg,#21222c,#1d2c32);border:1px solid #41596c;}
:where(html[data-portal-theme="dark"]) .featuretiles>a:hover{border-color:#087e79;}
:where(html[data-portal-theme="dark"]) .featuretiles small{color:#b8cad6;}
:where(html[data-portal-theme="dark"]) .tile-icon{background:#203332;color:#adf1ee;}
:where(html[data-portal-theme="dark"]) .filters{border:1px solid #41596c;background:#21222c;}
:where(html[data-portal-theme="dark"]) .filters input{border:0;background:#20282f;}
:where(html[data-portal-theme="dark"]) .broker-toggle{background:#202830;color:#bcd1e2;border:1px solid #405c6d;}
:where(html[data-portal-theme="dark"]) .broker-toggle.active{background:#087e79;color:white;border-color:#087e79;}
:where(html[data-portal-theme="dark"]) .sim{background:linear-gradient(150deg,#1d2e33,#20272f);border:1px solid #40626d;}
:where(html[data-portal-theme="dark"]) .stage{background:linear-gradient(135deg,#112c45,#19415c);color:#edf8ff;}
:where(html[data-portal-theme="dark"]) .stage .device{background:#ffffff0e;border:1px solid #ffffff25;color:#eaf6ff;}
:where(html[data-portal-theme="dark"]) .stage .device small{color:#c2dce9;}
:where(html[data-portal-theme="dark"]) .stage .symbol{color:#8ce5d3;}
:where(html[data-portal-theme="dark"]) .stage .wire{background:#ffffff35;}
:where(html[data-portal-theme="dark"]) .stage .packet{background:#234439;}
:where(html[data-portal-theme="dark"]) .simcontrols label{background:#21222c;border:1px solid #405d6e;}
:where(html[data-portal-theme="dark"]) .sim-metric{background:#21222c;border:1px solid #415e6d;}
:where(html[data-portal-theme="dark"]) .sim-metric small{color:#bbcad6;}
:where(html[data-portal-theme="dark"]) .sim-meter{background:#222c31;}
:where(html[data-portal-theme="dark"]) .simchart{background:#21222c;border:1px solid #415e6d;}
:where(html[data-portal-theme="dark"]) .model-meta{color:#bbcad6;}
:where(html[data-portal-theme="dark"]) .tutor-launch{border:0;background:#10384f;color:white;}
:where(html[data-portal-theme="dark"]) .tutor-launch span{background:#284944;color:#b9d8eb;}
:where(html[data-portal-theme="dark"]) .tutor-drawer{background:#21222c;border:1px solid #415d6c;}
:where(html[data-portal-theme="dark"]) .tutor-top{background:linear-gradient(135deg,#132e47,#087e79);color:white;}
:where(html[data-portal-theme="dark"]) .tutor-top .avatar,:where(html[data-portal-theme="dark"]) .bubble-avatar{background:#1f352f;color:#adf1ee;}
:where(html[data-portal-theme="dark"]) .tutor-top button{background:#ffffff20;color:white;border:1px solid #ffffff50;}
:where(html[data-portal-theme="dark"]) .tutor-select select{border:1px solid #425c6c;background:#1f2930;color:inherit;}
:where(html[data-portal-theme="dark"]) .tutor-suggestions button{background:#202c31;color:#bcd3e3;border:1px solid #3f5e6f;}
:where(html[data-portal-theme="dark"]) .chat-history{background:#202a30;}
:where(html[data-portal-theme="dark"]) .chatbubble{background:#21222c;}
:where(html[data-portal-theme="dark"]) .chatline.user .chatbubble{background:#203531;}
:where(html[data-portal-theme="dark"]) .chatbubble pre{background:#112c45;color:#e1f4ff;}
:where(html[data-portal-theme="dark"]) .chat-entry textarea{border:1px solid #415c6c;color:inherit;background:#21222c;}
:where(html[data-portal-theme="dark"]) .chat-note{color:#b9c7d3;}
:where(html[data-portal-theme="dark"]) .tutor-actions button{background:#202c31;color:#bcd3e3;border-color:#3f5e6f;}
:where(html[data-portal-theme="dark"]) .labcard .lab-icon{background:#212b30;color:#afd6e8;}
:where(html[data-portal-theme="dark"]) .labcard .lab-done{color:#adf1ee;}
:where(html[data-portal-theme="dark"]) .route-strip{background:#21222c;border:1px solid #415e6d;}
:where(html[data-portal-theme="dark"]) .route-strip>div{background:#1e2a32;}
:where(html[data-portal-theme="dark"]) .route-strip span{color:#adf1ee;}
:where(html[data-portal-theme="dark"]) .route-strip small{color:#b9c8d3;}
:where(html[data-portal-theme="dark"]) .route-strip i{color:#adf1ee;}