/* SPDX-License-Identifier: GPL-3.0-or-later. Scoped to coexist with Moodle themes. */
@font-face{font-family:Manrope;src:url('manrope.ttf') format('truetype');font-style:normal;font-weight:200 800;font-display:swap}
#opstudio-root{
 --bg:#14151a;--surface:#1b1d23;--raised:#23262e;--border:#353944;--text:#f0f2f5;--muted:#a8afbc;
 --accent:#a6df67;--ink:#203510;--soft:#273522;--danger:#ff9eaa;--warn:#e9c27e;
 --xs:.75rem;--sm:.875rem;--base:1rem;--lg:1.125rem;--xl:clamp(1.5rem,1.2rem + .8vw,2rem);
 --s1:4px;--s2:8px;--s3:12px;--s4:16px;--s5:20px;--s6:24px;--s8:32px;--s10:40px;
 font:400 var(--sm)/1.6 Manrope,system-ui,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;isolation:isolate;
}
#opstudio-root[data-theme=light]{--bg:#f2f4f0;--surface:#fff;--raised:#f3f5f1;--border:#d4dbd0;--text:#20261d;--muted:#596452;--accent:#3e6928;--ink:#fff;--soft:#ebf3e6;--danger:#a42137;--warn:#85601d}
#opstudio-root *{box-sizing:border-box}
#opstudio-root [hidden]{display:none!important}
#opstudio-root h1,#opstudio-root h2,#opstudio-root h3,#opstudio-root p{margin:0}
#opstudio-root h1{font-size:var(--xl);line-height:1.3;font-weight:750;letter-spacing:-.035em}
#opstudio-root h2{font-size:var(--lg);line-height:1.4;font-weight:700}
#opstudio-root h3{font-size:var(--base);font-weight:700}
#opstudio-root p{color:var(--muted)}
#opstudio-root button,#opstudio-root input,#opstudio-root select,#opstudio-root textarea{font:inherit;color:inherit;letter-spacing:normal}
#opstudio-root button{cursor:pointer;min-height:44px;padding:var(--s2) var(--s4);border:1px solid var(--border);background:var(--surface);border-radius:6px;line-height:1.4;transition:background .15s,border-color .15s;white-space:normal}
#opstudio-root button:hover{border-color:var(--muted);background:var(--raised)}
#opstudio-root button:disabled{opacity:.48;cursor:not-allowed}
#opstudio-root button.primary{background:var(--accent);border-color:var(--accent);color:var(--ink);font-weight:750}
#opstudio-root button.primary:hover{filter:brightness(1.05)}
#opstudio-root button.quiet{background:transparent;border-color:transparent}
#opstudio-root button.danger{color:var(--danger)}
#opstudio-root :focus-visible{outline:2px solid var(--accent);outline-offset:3px}
#opstudio-root input:not([type=checkbox]),#opstudio-root select,#opstudio-root textarea{display:block;width:100%;min-width:0;max-width:100%;background:var(--bg);border:1px solid var(--border);border-radius:6px;min-height:44px;padding:var(--s3);box-shadow:none;line-height:1.5;margin:0}
#opstudio-root select{height:auto;appearance:auto}
#opstudio-root select[multiple]{min-height:120px}
#opstudio-root textarea{resize:vertical;min-height:100px}
#opstudio-root input[type=checkbox]{accent-color:var(--accent);width:18px;height:18px;flex-shrink:0}
#opstudio-root label{display:flex;flex-direction:column;gap:var(--s2);margin:0;color:var(--text);font-weight:600;min-width:0}
#opstudio-root label small{font-weight:400;color:var(--muted);font-size:var(--xs)}
#opstudio-root label.check{flex-direction:row;align-items:flex-start;min-height:44px;font-weight:500}
#opstudio-root small{font-size:var(--xs)}
#opstudio-root .muted{color:var(--muted)}
#opstudio-root .mono{font-variant-numeric:tabular-nums;font-feature-settings:"tnum";font-size:var(--xs);letter-spacing:.02em}
#opstudio-root .eyebrow{text-transform:uppercase;font-size:var(--xs);font-weight:700;letter-spacing:.12em;color:var(--muted)}
#opstudio-root .badge{display:inline-flex;align-items:center;gap:var(--s1);padding:var(--s1) var(--s2);border-radius:4px;font-size:var(--xs);background:var(--raised);color:var(--muted);white-space:nowrap}
#opstudio-root .badge.green{background:var(--soft);color:var(--accent)}
#opstudio-root .badge.warn{color:var(--warn)}
#opstudio-root .topbar{display:flex;justify-content:space-between;align-items:center;gap:var(--s4);padding:var(--s4) var(--s6);border-bottom:1px solid var(--border);background:var(--surface)}
#opstudio-root .brand{display:flex;align-items:center;gap:var(--s3);min-width:0;max-width:100%;flex-shrink:1}
#opstudio-root .brand>div{min-width:0;overflow-wrap:anywhere}
#opstudio-root .brand svg{width:32px;height:32px;flex-shrink:0;color:var(--accent)}
#opstudio-root .brand b{font-size:var(--base);letter-spacing:-.03em}
#opstudio-root .topactions{display:flex;align-items:center;justify-content:flex-end;gap:var(--s2);flex-wrap:wrap}
#opstudio-root .save-status{font-size:var(--xs);color:var(--muted);max-width:240px}
#opstudio-root .save-status.error{color:var(--danger)}
#opstudio-root .workspace{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:calc(100vh - 80px)}
#opstudio-root .sidebar{padding:var(--s6) var(--s4);border-right:1px solid var(--border);background:var(--surface)}
#opstudio-root .sidebar-title{padding:0 var(--s3) var(--s5)}
#opstudio-root .sidebar nav{display:grid;gap:var(--s1)}
#opstudio-root .step{display:flex;text-align:left;align-items:flex-start;gap:var(--s3);border:0;background:transparent;padding:var(--s3);width:100%}
#opstudio-root .step.active{background:var(--soft);color:var(--accent)}
#opstudio-root .step-num{display:grid;place-items:center;border:1px solid var(--border);border-radius:5px;min-width:27px;height:27px;font-size:var(--xs);font-weight:700}
#opstudio-root .step.active .step-num{border-color:var(--accent)}
#opstudio-root .step-text{display:flex;flex-direction:column;gap:var(--s1);font-weight:650;line-height:1.45}
#opstudio-root .step-text small{color:var(--muted);font-weight:400}
#opstudio-root .sidebar-note{margin:var(--s8) var(--s3) 0;font-size:var(--xs);line-height:1.7;color:var(--muted)}
#opstudio-root main{min-width:0}
#opstudio-root .projectbar{display:flex;align-items:center;justify-content:space-between;gap:var(--s3);padding:var(--s4) var(--s8);border-bottom:1px solid var(--border)}
#opstudio-root .projectbar strong{display:block;overflow-wrap:anywhere}
#opstudio-root .content{padding:var(--s8);max-width:1500px;margin:0 auto}
#opstudio-root .pagehead{display:flex;gap:var(--s4);justify-content:space-between;align-items:flex-start;margin-bottom:var(--s6)}
#opstudio-root .pagehead h1{margin:var(--s2) 0 var(--s3)}
#opstudio-root .pagehead p{max-width:820px;font-size:var(--sm)}
#opstudio-root .bodygrid{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:var(--s6);align-items:start}
#opstudio-root .bodygrid.wide{grid-template-columns:minmax(0,1fr)}
#opstudio-root .panel{border:1px solid var(--border);border-radius:8px;background:var(--surface);padding:var(--s6);margin-bottom:var(--s5);min-width:0}
#opstudio-root .panel-head{display:flex;justify-content:space-between;align-items:center;gap:var(--s3);margin-bottom:var(--s5)}
#opstudio-root .panel-head p{margin-top:var(--s1)}
#opstudio-root .formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--s5)}
#opstudio-root .formgrid .span2{grid-column:1/-1}
#opstudio-root fieldset{margin:0;padding:0;border:0;min-width:0}
#opstudio-root .formgroup{margin-top:var(--s6)}
#opstudio-root .start-actions{margin-block:var(--s5)}
#opstudio-root .advanced{margin-bottom:var(--s5);min-width:0}
#opstudio-root summary{cursor:pointer;min-height:44px;padding:var(--s3);font-weight:650;overflow-wrap:anywhere}
#opstudio-root summary small{display:block;color:var(--muted);font-weight:400}
#opstudio-root .material{display:flex;justify-content:space-between;gap:var(--s4);padding:var(--s4) 0;border-bottom:1px solid var(--border);overflow-wrap:anywhere;min-width:0}
#opstudio-root .material>div{min-width:0}
#opstudio-root .material .badge{margin:var(--s2)}
#opstudio-root .proposal-card{padding:var(--s4);margin-bottom:var(--s4);border:1px solid var(--border);border-radius:6px;overflow-wrap:anywhere}
#opstudio-root .proposal-card p{margin-top:var(--s2)}
#opstudio-root .comparison{display:grid;grid-template-columns:1fr 1fr;gap:var(--s4);margin:var(--s3) 0}
#opstudio-root .comparison>div{min-width:0;background:var(--raised);padding:var(--s3);border-radius:4px}
#opstudio-root input[type=radio]{width:18px;height:18px;flex-shrink:0;accent-color:var(--accent)}
@media(max-width:600px){#opstudio-root .comparison{grid-template-columns:1fr}#opstudio-root .material{flex-direction:column}}
#opstudio-root .rail h2{margin-bottom:var(--s3)}
#opstudio-root .rail p{font-size:var(--xs);line-height:1.8}
#opstudio-root .rail ul{padding-left:var(--s4);color:var(--muted);margin:var(--s3) 0 0}
#opstudio-root .rail li{margin-bottom:var(--s2);font-size:var(--xs)}
#opstudio-root .statrow{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);border-radius:8px;overflow:hidden;margin-bottom:var(--s6);background:var(--surface)}
#opstudio-root .stat{padding:var(--s4) var(--s5);border-right:1px solid var(--border)}
#opstudio-root .stat:last-child{border:0}
#opstudio-root .stat b{display:block;font-size:var(--lg);font-weight:750}
#opstudio-root .stat small{color:var(--muted)}
#opstudio-root .actions{display:flex;gap:var(--s2);align-items:center;flex-wrap:wrap}
#opstudio-root .stagefooter{display:flex;justify-content:space-between;gap:var(--s3);border-top:1px solid var(--border);padding:var(--s5) 0;margin-top:var(--s6)}
#opstudio-root .stagefooter>div{display:flex;gap:var(--s2);flex-wrap:wrap}
#opstudio-root .empty{padding:var(--s10) var(--s6);text-align:center;border:1px dashed var(--border);border-radius:6px}
#opstudio-root .empty h3{margin-bottom:var(--s2)}
#opstudio-root .empty p{max-width:580px;margin:0 auto var(--s5)}
#opstudio-root .notice{padding:var(--s4);background:var(--raised);border:1px solid var(--border);border-radius:6px;color:var(--muted);font-size:var(--sm);margin-bottom:var(--s5);overflow-wrap:anywhere}
#opstudio-root .notice.error{color:var(--danger)}
#opstudio-root .notice.success{color:var(--accent);background:var(--soft)}
#opstudio-root .notice button{margin-top:var(--s3)}
#opstudio-root .tablewrap{max-width:100%;overflow:auto;max-height:650px;border:1px solid var(--border);border-radius:6px}
#opstudio-root table{border-collapse:collapse;width:100%;font-size:var(--sm);margin:0;color:var(--text);background:var(--surface)}
#opstudio-root th,#opstudio-root td{padding:var(--s3) var(--s4);border-bottom:1px solid var(--border);text-align:left;vertical-align:top;min-width:90px;max-width:400px;overflow-wrap:anywhere}
#opstudio-root th{font-size:var(--xs);font-weight:650;color:var(--muted);background:var(--raised);position:sticky;top:0;z-index:2}
#opstudio-root tbody tr:last-child td{border-bottom:0}
#opstudio-root td .actions{flex-wrap:nowrap}
#opstudio-root td button{padding:var(--s2);font-size:var(--xs)}
#opstudio-root td .actions button{white-space:nowrap;overflow-wrap:normal}
#opstudio-root td.long{min-width:250px}
#opstudio-root td.number{white-space:nowrap;font-variant-numeric:tabular-nums}
#opstudio-root .matrix th:first-child,#opstudio-root .matrix td:first-child{position:sticky;left:0;min-width:240px;max-width:280px;background:var(--surface);z-index:1}
#opstudio-root .matrix th:first-child{z-index:3;background:var(--raised)}
#opstudio-root .matrix td{text-align:center}
#opstudio-root .matrix td:first-child{text-align:left}
#opstudio-root .matrix button{min-width:44px;background:transparent}
#opstudio-root .matrix button.linked{background:var(--soft);color:var(--accent)}
#opstudio-root .outcome{display:grid;grid-template-columns:100px minmax(0,1fr) auto;gap:var(--s4);padding:var(--s5) 0;border-top:1px solid var(--border);align-items:start}
#opstudio-root .outcome:first-child{border-top:0}
#opstudio-root .outcome>.badge{min-width:0;white-space:normal;overflow-wrap:anywhere}
#opstudio-root .outcome p{color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere}
#opstudio-root .outcome small{display:block;color:var(--muted);margin-top:var(--s2)}
#opstudio-root .outcome.indicator{padding-left:var(--s6)}
#opstudio-root .tree-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:var(--s4);padding:var(--s4);border-bottom:1px solid var(--border);align-items:center}
#opstudio-root .tree-row:last-child{border:0}
#opstudio-root .tree-row strong{display:block;overflow-wrap:anywhere}
#opstudio-root .tree-row small{color:var(--muted)}
#opstudio-root .tree-row.container-row{background:var(--raised)}
#opstudio-root .tree-name{padding-left:calc(var(--depth,0) * 20px)}
#opstudio-root .tabs{display:flex;gap:var(--s2);flex-wrap:wrap;margin-bottom:var(--s5)}
#opstudio-root .tabs button.active{border-color:var(--accent);color:var(--accent);background:var(--soft)}
#opstudio-root .issue{padding:var(--s4);border-bottom:1px solid var(--border);display:flex;gap:var(--s3);align-items:flex-start}
#opstudio-root .issue:last-child{border:0}
#opstudio-root .issue .flag{color:var(--danger);font-size:var(--xs);font-weight:700;min-width:90px}
#opstudio-root .issue.warning .flag{color:var(--warn)}
#opstudio-root .issue p{color:var(--text);overflow-wrap:anywhere}
#opstudio-root .issue button{margin-left:auto;flex-shrink:0}
#opstudio-root .landing{max-width:1240px;margin:0 auto;padding:var(--s10) var(--s8)}
#opstudio-root .intro{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(280px,1fr);gap:var(--s10);align-items:start;padding:var(--s8) 0 var(--s10)}
#opstudio-root .intro h1{font-size:clamp(1.75rem,1.3rem + 1vw,2.25rem);margin:var(--s3) 0 var(--s5)}
#opstudio-root .intro p{max-width:540px;font-size:var(--base);margin-bottom:var(--s6)}
#opstudio-root .route{border-top:1px solid var(--border)}
#opstudio-root .route div{padding:var(--s3) 0;border-bottom:1px solid var(--border);display:flex;gap:var(--s4);color:var(--muted)}
#opstudio-root .route b{color:var(--text);font-weight:600}
#opstudio-root .projectlist{display:grid;gap:var(--s3)}
#opstudio-root .projectcard{display:flex;align-items:center;justify-content:space-between;gap:var(--s5);padding:var(--s5);background:var(--surface);border:1px solid var(--border);border-radius:8px}
#opstudio-root .projectcard h3{margin-bottom:var(--s1);overflow-wrap:anywhere}
#opstudio-root .projectcard small{color:var(--muted)}
#opstudio-root .bottomnote{display:flex;justify-content:space-between;gap:var(--s4);margin-top:var(--s8);font-size:var(--xs);color:var(--muted)}
#opstudio-root dialog{background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:10px;padding:0;width:min(820px,calc(100vw - 32px));max-height:90vh;box-shadow:0 24px 80px #0006;overflow:auto}
#opstudio-root dialog::backdrop{background:#101319b8}
#opstudio-root .dialoghead{display:flex;justify-content:space-between;align-items:center;gap:var(--s4);padding:var(--s5) var(--s6);border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface);z-index:5}
#opstudio-root .dialogbody{padding:var(--s6)}
#opstudio-root .dialogfoot{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--s3);padding:var(--s4) var(--s6);border-top:1px solid var(--border);position:sticky;bottom:0;background:var(--surface)}
#opstudio-root .dialogbody pre{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text);font:inherit}
#opstudio-root .skip{position:absolute;left:-9999px}
#opstudio-root .skip:focus{position:static}
#opstudio-root .history{display:grid;gap:var(--s3)}
#opstudio-root .history li{color:var(--muted);overflow-wrap:anywhere}
@media(max-width:1200px){
 #opstudio-root .bodygrid{grid-template-columns:minmax(0,1fr)}#opstudio-root .rail{display:none}
 #opstudio-root .workspace{grid-template-columns:215px minmax(0,1fr)}
 #opstudio-root .content{padding:var(--s6)}#opstudio-root .projectbar{padding:var(--s4) var(--s6)}
}
@media(max-width:760px){
 #opstudio-root .workspace{display:block}#opstudio-root .sidebar{border-right:0;border-bottom:1px solid var(--border);padding:var(--s3)}
 #opstudio-root .sidebar-title,#opstudio-root .sidebar-note{display:none}
 #opstudio-root .sidebar nav{display:flex;overflow:auto;padding-bottom:var(--s1)}
 #opstudio-root .step{width:190px;min-width:190px;padding:var(--s2);font-size:var(--xs)}
 #opstudio-root .topbar{padding:var(--s3) var(--s4);flex-wrap:wrap}
 #opstudio-root .topactions{width:100%;justify-content:flex-start}
 #opstudio-root .content,#opstudio-root .landing{padding:var(--s5) var(--s4)}
 #opstudio-root .projectbar{padding:var(--s3) var(--s4);flex-wrap:wrap}
 #opstudio-root .formgrid{grid-template-columns:1fr}
 #opstudio-root .panel{padding:var(--s4)}
 #opstudio-root .pagehead,#opstudio-root .panel-head{flex-wrap:wrap}
 #opstudio-root .statrow{grid-template-columns:repeat(2,minmax(0,1fr))}
 #opstudio-root .stat{border-bottom:1px solid var(--border)}
 #opstudio-root .stagefooter{flex-direction:column}
 #opstudio-root .intro{display:block;padding-top:var(--s4)}
 #opstudio-root .route{margin-top:var(--s8)}
 #opstudio-root .projectcard{flex-direction:column;align-items:flex-start}
 #opstudio-root .outcome{grid-template-columns:80px minmax(0,1fr)}
 #opstudio-root .outcome>.actions{grid-column:1/-1}
 #opstudio-root .tree-row{grid-template-columns:minmax(0,1fr) auto;gap:var(--s2)}
 #opstudio-root .tree-row>.actions{grid-column:1/-1}
 #opstudio-root .bottomnote{flex-direction:column}
 #opstudio-root .issue{flex-wrap:wrap}
 #opstudio-root .dialogbody{padding:var(--s4)}
 #opstudio-root .dialogfoot{padding:var(--s3) var(--s4);gap:var(--s2)}
 #opstudio-root .dialogfoot button{min-width:0;max-width:100%;flex:1 1 100px}
 #opstudio-root .dialogfoot .primary{flex-basis:100%}
}
@media(prefers-reduced-motion:reduce){#opstudio-root *{transition:none!important;scroll-behavior:auto!important}}

/* 0.3.5: Moodle theme heading colours must not override the studio theme */
#opstudio-root h1,#opstudio-root h2,#opstudio-root h3,#opstudio-root h4,#opstudio-root h5,#opstudio-root strong,#opstudio-root b,#opstudio-root summary,#opstudio-root legend,#opstudio-root dt{color:var(--text)}
#opstudio-root li,#opstudio-root dd,#opstudio-root pre,#opstudio-root td{color:var(--text)}
#opstudio-root .notice li,#opstudio-root .rail li{color:inherit}
#opstudio-root .plan-todo{margin:var(--s3) 0 0;padding-left:var(--s5);display:grid;gap:var(--s2)}
#opstudio-root .plan-todo small{color:var(--muted)}
#opstudio-root .issue-objects{display:block;color:var(--muted);font-size:var(--xs);margin-top:var(--s1)}
#opstudio-root .accepted-mark{display:inline-flex;align-items:center;min-height:44px;padding:var(--s2) var(--s4);border-radius:6px;background:var(--soft);color:var(--accent);font-weight:750;border:1px solid var(--accent)}
#opstudio-root .notice.error{border-color:var(--danger)}
