
:root{--bg:#f7f6f2;--panel:#fff;--fg:#1c1c1a;--mut:#6c6b65;--bd:#e3e1da;--acc:#2f5d8a;--acc2:#c0582b;--soft:#eef2f6;--bar:#cfdbe8;--bar2:#f0d6c8;--ok:#3f7a3a}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--bg:#151514;--panel:#1e1e1c;--fg:#ebeae4;--mut:#9a9992;--bd:#33332f;--acc:#7fb0e0;--acc2:#e0906a;--soft:#232a31;--bar:#2c4258;--bar2:#5a3a2a;--ok:#8fc48a}}
:root[data-theme="dark"]{--bg:#151514;--panel:#1e1e1c;--fg:#ebeae4;--mut:#9a9992;--bd:#33332f;--acc:#7fb0e0;--acc2:#e0906a;--soft:#232a31;--bar:#2c4258;--bar2:#5a3a2a;--ok:#8fc48a}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--fg);font:14px/1.45 system-ui,-apple-system,Segoe UI,sans-serif}
header{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;padding:12px 16px;border-bottom:1px solid var(--bd);background:var(--panel);position:sticky;top:0;z-index:5}
h1{font-size:17px;margin:0 8px 0 0} select,button,input{font:inherit;color:var(--fg);background:var(--panel);border:1px solid var(--bd);border-radius:6px;padding:4px 8px}
button{cursor:pointer} button.on{background:var(--acc);color:#fff;border-color:var(--acc)} .mut{color:var(--mut)} .small{font-size:12px}
nav{display:flex;gap:6px;flex-wrap:wrap;padding:10px 16px} main{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;padding:0 16px 40px}
.card{background:var(--panel);border:1px solid var(--bd);border-radius:10px;padding:12px 14px;min-width:0}
.row{display:flex;flex-wrap:wrap;gap:8px;align-items:center} .chips{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 10px}
.chip{background:var(--soft);border:1px solid var(--bd);border-radius:999px;padding:2px 10px;font-size:12px;cursor:pointer} .chip b{font-weight:600}
.stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;margin:8px 0}
.stat{background:var(--soft);border-radius:8px;padding:8px 10px} .stat .v{font-size:17px;font-weight:600} .stat .k{font-size:12px;color:var(--mut)}
.tw{overflow-x:auto} table{border-collapse:collapse;width:100%;font-size:13px} th,td{text-align:left;padding:5px 8px;border-bottom:1px solid var(--bd);white-space:nowrap}
th{font-weight:600;color:var(--mut);cursor:pointer;user-select:none} tr.click{cursor:pointer} tr.click:hover td{background:var(--soft)}
td.num{text-align:right;font-variant-numeric:tabular-nums} .barcell{position:relative;min-width:120px}
.barcell i{position:absolute;left:0;top:4px;bottom:4px;background:var(--bar);border-radius:3px} .barcell span{position:relative}
#drawer{position:fixed;top:0;right:0;bottom:0;width:min(720px,100%);background:var(--panel);border-left:1px solid var(--bd);box-shadow:-8px 0 24px rgba(0,0,0,.12);
  transform:translateX(105%);transition:transform .2s;z-index:10;overflow-y:auto;padding:14px 16px 40px} #drawer.open{transform:none}
#drawer h2{font-size:16px;margin:4px 0 8px} #drawer h3{font-size:14px;margin:16px 0 6px}
.kv{display:grid;grid-template-columns:minmax(120px,max-content) 1fr;gap:2px 12px;font-size:13px} .kv div:nth-child(odd){color:var(--mut)}
.pbar{display:inline-block;height:9px;border-radius:2px;vertical-align:middle;margin-right:4px}
.legend{font-size:12px;color:var(--mut)} .legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin:0 4px 0 10px;vertical-align:-1px}
pre{white-space:pre-wrap;word-break:break-word;background:var(--soft);border-radius:8px;padding:10px;font:12px/1.45 ui-monospace,Consolas,monospace;max-height:340px;overflow:auto}
details{border:1px solid var(--bd);border-radius:8px;padding:6px 10px;margin:6px 0} summary{cursor:pointer;font-size:13px}
.empty{color:var(--mut);padding:20px 0;text-align:center} .why{font-style:italic;color:var(--mut);margin:4px 0}
.lnk{color:var(--acc);cursor:pointer;text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--acc) 40%,transparent)}
.tl{list-style:none;padding:0;margin:0;font-size:13px} .tl li{padding:3px 0;border-bottom:1px dashed var(--bd)} .tl b{font-variant-numeric:tabular-nums;color:var(--mut);font-weight:500;margin-right:6px}
.net svg{width:100%;height:auto;display:block} .net text{font-size:10px;fill:var(--fg)} .net .node{cursor:pointer}
.heat td.num{min-width:58px} .toggles label{font-size:12px;margin-right:10px} #flowcard,#netcard{display:none} .ov{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px} .ov h3{font-size:14px;margin:4px 0 8px}
.form{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px 18px;margin:8px 0}
.form label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--mut)} .form input,.form select{width:100%}
.form .hint{font-size:11px;color:var(--mut)} .form input[readonly]{opacity:.6;cursor:default} .form input[type=range]{padding:0}
tr.total td{border-top:2px solid var(--bd)} .form .brk{grid-column:1/-1;height:0;margin-top:-10px} .form h4{grid-column:1/-1;margin:8px 0 0;font-size:13px;border-bottom:1px solid var(--bd);padding-bottom:3px}
.bar{height:14px;border-radius:7px;background:var(--bd);overflow:hidden;margin:8px 0 4px} .bar > i{display:block;height:100%;background:var(--acc);transition:width .4s}
.warn{color:var(--acc2)} .okc{color:var(--ok)} button.primary{background:var(--acc);color:#fff;border-color:var(--acc)} button:disabled{opacity:.55;cursor:default}
#notice{display:none;background:var(--acc);color:#fff;padding:10px 16px;font-size:14px;align-items:center;gap:12px;flex-wrap:wrap}
#notice.on{display:flex} #notice button{background:#fff;color:#222;border:0;font-weight:600} #notice button.x{background:transparent;color:#fff;font-weight:400;margin-left:auto}
.wide{container-type:inline-size} .split{display:grid;grid-template-columns:1fr;gap:14px;align-items:start}
@container (min-width:1000px){.split{grid-template-columns:minmax(0,680px) minmax(300px,1fr)}}
@media (min-width:760px){.ov > .wide, .ov > .mid{grid-column:span 2}}
@media (min-width:1500px){.ov > .wide{grid-column:span 3}}
@media (min-width:1100px){main{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}}

/* Site only, on top of the model explorer's own styles: nothing can be started from the website, so the
   controls for starting and watching runs are hidden. */
#newRunBtn, #notice, #tabs button[data-t="params"] { display: none !important; }
header a.small, .site-foot a { color: var(--acc); text-decoration: none; }
.site-foot { padding: 0 16px 28px; margin: 0; }
.site-foot a:hover { text-decoration: underline; }
.site-foot a { margin-right: 16px; }
header a.small:hover { text-decoration: underline; }
header a.small[hidden] { display: none; }
/* An Overview chart opens to fill the window, where the charts sit in more than one column (explorer-addon.js) */
.xchart { position: relative; }
.xchart-open { display: none; position: absolute; top: -2px; right: 0; padding: 0 6px; line-height: 1.5; color: var(--mut); background: var(--panel); }
.xchart-many .xchart-open { display: block; }
.xchart-many .xchart svg { cursor: zoom-in; }
.xchart-open:hover { color: var(--fg); }
#xchartFull { position: fixed; inset: 0; z-index: 50; background: var(--panel); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 16px 24px 20px; }
.xchart-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.xchart-bar b { font-size: 16px; }
.xchart-close { margin-left: auto; }
.xchart-big { min-height: 0; }
.xchart-big svg { display: block; width: 100% !important; max-width: none !important; height: 100%; }
/* On a wide screen the explorer keeps to the same width as the charts and the model document (1500px, centred):
   the bars stay full width and their contents are held in by padding. */
@media (min-width: 1532px) {
  header, nav, main, .site-foot { padding-left: calc((100vw - 1500px) / 2); padding-right: calc((100vw - 1500px) / 2); }
}
/* The scenario names are long: the Run dropdown shrinks to the screen instead of widening the page */
header label:has(#run) { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
#run { flex: 1 1 auto; min-width: 0; max-width: 34rem; text-overflow: ellipsis; }
