/* All color channels are taken from Port Team frontend/src/index.css. */
:root{color-scheme:dark;--ink:226 233 239;--text:168 182 194;--muted:132 148 163;--dim:106 121 135;--line:38 50 64;--raised:26 36 48;--panel:16 24 35;--bg:8 13 20;--brand:53 182 242;--brand-soft:122 205 247;--brand-bg:12 55 79;--good:125 196 147;--good-bg:15 32 39;--bad:219 160 166;--bad-bg:107 30 35;--warn:220 196 143;--warn-bg:68 55 25}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;max-width:100%;overflow-x:hidden}body{font:14px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;background:rgb(var(--bg));color:rgb(var(--ink));font-feature-settings:"tnum" 1}button,input,select,textarea{font:inherit}button{cursor:pointer;min-height:44px;border:0;color:inherit;background:transparent;border-radius:10px;padding:10px 14px;display:inline-flex;align-items:center;justify-content:center;gap:8px}button:hover{background:rgb(var(--raised))}button:disabled{opacity:.5;cursor:not-allowed}.primary{background:rgb(var(--brand));color:rgb(var(--bg));font-weight:700}.primary:hover{background:rgb(var(--brand-soft))}.secondary{background:rgb(var(--raised))}.danger{color:rgb(var(--bad));background:rgb(var(--bad-bg)/.45)}button.icon{width:44px;padding:10px;flex:none}svg{width:19px;height:19px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}:focus-visible{outline:2px solid rgb(var(--brand));outline-offset:3px}h1,h2,h3,p{margin:0}h1{font-size:26px;font-weight:600;letter-spacing:-.8px;line-height:1.25}h2{font-size:17px;font-weight:600}h3{font-size:14px;font-weight:600}a{color:rgb(var(--brand-soft))}.muted{color:rgb(var(--muted))}.small{font-size:12px}.overline{font-size:10px;text-transform:uppercase;letter-spacing:1.7px;color:rgb(var(--muted));font-weight:600}.boot{padding:40px}.skip{position:fixed;top:-80px;left:20px;z-index:20;padding:12px;background:rgb(var(--panel))}.skip:focus{top:8px}[hidden]{display:none!important}
.shell{display:grid;grid-template-columns:228px minmax(0,1fr);min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:228px;background:rgb(var(--panel));padding:25px 16px 16px;display:flex;flex-direction:column;z-index:5;overflow-y:auto}.brand{display:flex;align-items:center;gap:10px;padding:0 8px 29px;font-size:19px;font-weight:650;letter-spacing:-.7px}.brandmark{width:34px;height:34px;background:rgb(var(--brand-bg));color:rgb(var(--brand-soft));display:grid;place-items:center;border-radius:11px}.brandmark svg{width:23px;height:23px}.brand small{font-size:10px;letter-spacing:1px;color:rgb(var(--muted));font-weight:500;margin-left:auto}.nav-label{padding:20px 12px 7px}.nav-btn{width:100%;justify-content:flex-start;text-align:left;font-size:13px;gap:10px;color:rgb(var(--text));margin:2px 0}.nav-btn.active{background:rgb(var(--brand-bg)/.55);color:rgb(var(--brand-soft))}.nav-dot{width:8px;height:8px;background:rgb(var(--dim));border-radius:50%;margin:5px}.project-sub{margin:2px 0 8px 23px;padding-left:10px;border-left:1px solid rgb(var(--line))}.project-sub button{min-height:38px;font-size:12px;padding:6px 12px}.sidebar-bottom{margin-top:auto;padding-top:28px}.account{display:flex;align-items:center;gap:10px;padding:14px 6px 4px;min-width:0}.avatar{height:34px;width:34px;flex:none;border-radius:11px;background:rgb(var(--line));display:grid;place-items:center;font-size:13px;font-weight:600}.account-copy{min-width:0;flex:1}.account-copy strong{font-size:12px;display:block;overflow-wrap:anywhere}.account-copy span{font-size:11px;color:rgb(var(--muted))}.main{grid-column:2;min-width:0}.topbar{height:76px;padding:0 32px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 1px 0 rgb(var(--raised)/.6)}.breadcrumbs{display:flex;align-items:center;gap:12px;font-size:12px;color:rgb(var(--muted));min-width:0}.breadcrumbs span:last-child{color:rgb(var(--text));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-tools{display:flex;align-items:center;gap:12px}.source-pill{display:inline-flex;align-items:center;gap:7px;font-size:11px;color:rgb(var(--text));white-space:nowrap}.dot{display:inline-block;width:6px;height:6px;background:rgb(var(--dim));border-radius:50%;flex:none}.dot.ok{background:rgb(var(--good))}.dot.warn{background:rgb(var(--warn))}.dot.bad{background:rgb(var(--bad))}.mobile-menu{display:none}.content{padding:30px 32px 40px;max-width:1800px;margin:auto}.page-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:25px}.page-head p{margin-top:8px;font-size:12px;color:rgb(var(--muted))}.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.toolbar button{font-size:12px}.board-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;font-size:11px;color:rgb(var(--muted))}.chips{display:flex;gap:7px;flex-wrap:wrap}.chip{display:inline-flex;align-items:center;gap:6px;background:rgb(var(--panel));border-radius:7px;padding:5px 8px;color:rgb(var(--text));font-size:11px}
.board{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:64px;gap:14px;min-height:540px;align-content:start;position:relative}.board.editing{background-image:radial-gradient(rgb(var(--line)) 1px,transparent 1px);background-size:20px 20px;border-radius:20px;padding-bottom:78px}.widget{background:rgb(var(--panel));border-radius:20px;display:flex;flex-direction:column;min-width:0;overflow:hidden;position:relative;box-shadow:inset 0 1px 0 rgb(var(--ink)/.035)}.widget-head{padding:15px 18px 2px;display:flex;align-items:center;gap:9px;min-height:51px}.widget-head h2{font-size:12px;font-weight:500;flex:1;min-width:0;overflow-wrap:anywhere;color:rgb(var(--text))}.widget-head>svg{color:rgb(var(--muted));width:16px;height:16px}.widget-head button{min-height:32px;width:32px;padding:6px}.widget-body{padding:6px 20px 17px;flex:1;min-height:0;overflow:auto}.metric{font-size:38px;letter-spacing:-1.5px;font-weight:550;line-height:1.25;margin:6px 0 8px;color:rgb(var(--ink))}.metric.missing{color:rgb(var(--muted))}.widget-sub{font-size:11px;color:rgb(var(--muted));line-height:1.6}.widget-footer{font-size:10px;color:rgb(var(--muted));padding:0 20px 16px;display:flex;gap:6px;align-items:center}.data-row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:11px 0;box-shadow:0 1px 0 rgb(var(--raised)/.7);font-size:12px;min-width:0}.data-row:last-child{box-shadow:none}.data-row>span{min-width:0;overflow-wrap:anywhere}.right{color:rgb(var(--muted));font-size:11px;text-align:right}.empty-area{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;min-height:125px;height:100%;padding:14px;color:rgb(var(--muted));font-size:12px}.empty-icon{height:44px;width:44px;display:grid;place-items:center;border-radius:14px;background:rgb(var(--raised)/.6);color:rgb(var(--muted))}.empty-area p{max-width:260px;line-height:1.65}.empty-area strong{color:rgb(var(--ink));font-weight:500}.board-empty{grid-column:1/-1;min-height:320px}.grip{cursor:grab!important;touch-action:none}.grip:active{cursor:grabbing!important}.resize{position:absolute;right:5px;bottom:5px;cursor:nwse-resize;width:32px!important;min-height:32px!important;padding:8px;touch-action:none;color:rgb(var(--muted))}.dragging{opacity:.8;z-index:2;box-shadow:0 0 0 2px rgb(var(--brand))}.invalid{box-shadow:0 0 0 2px rgb(var(--bad))}.note-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;color:rgb(var(--text));line-height:1.7}.board-help{font-size:11px;line-height:1.7;color:rgb(var(--muted));margin-top:18px}
.page-panel{background:rgb(var(--panel));border-radius:20px;padding:8px 22px}.record{padding:18px 0;box-shadow:0 1px 0 rgb(var(--raised));display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0}.record:last-child{box-shadow:none}.record-main{min-width:0}.record h3{margin-bottom:5px;overflow-wrap:anywhere}.record p{font-size:12px;color:rgb(var(--muted));overflow-wrap:anywhere;white-space:pre-wrap}.record-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.badge{padding:4px 8px;border-radius:6px;font-size:10px;color:rgb(var(--text));background:rgb(var(--raised));display:inline-block}.badge.good{background:rgb(var(--good-bg));color:rgb(var(--good))}.badge.wait{background:rgb(var(--warn-bg));color:rgb(var(--warn))}.error-box{background:rgb(var(--bad-bg)/.45);padding:14px 18px;border-radius:12px;color:rgb(var(--bad));font-size:13px;margin:14px 0}.info-box{background:rgb(var(--raised)/.5);padding:14px 18px;border-radius:12px;color:rgb(var(--text));font-size:12px;line-height:1.7;margin:14px 0}.list-tools{margin-bottom:16px;display:flex;gap:10px}.list-tools input{flex:1}.veil{display:none}.login-screen{min-height:100svh;display:grid;place-items:center;padding:24px}.login-form{width:100%;max-width:380px}.login-form .brand{padding:0 0 42px}.login-form h1{font-size:29px;margin-bottom:8px}.login-form>p{color:rgb(var(--muted));font-size:13px;margin-bottom:28px}.login-form .primary{width:100%;margin-top:12px}.login-foot{font-size:11px;margin-top:25px;color:rgb(var(--muted))}label{display:block;font-size:12px;color:rgb(var(--text));margin-bottom:7px}input,select,textarea{width:100%;min-width:0;background:rgb(var(--raised));color:rgb(var(--ink));border:1px solid transparent;border-radius:10px;padding:11px 12px;font-size:16px;min-height:44px}textarea{resize:vertical;min-height:100px}input[type=checkbox]{width:18px;height:18px;min-height:18px;accent-color:rgb(var(--brand));flex:none}.field{margin-bottom:17px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.check-label{display:flex;align-items:center;gap:9px;min-height:34px}.field-hint{font-size:11px;color:rgb(var(--muted));margin-top:6px}dialog{border:0;border-radius:22px;background:rgb(var(--panel));color:rgb(var(--ink));width:min(560px,calc(100% - 28px));max-height:calc(100svh - 32px);padding:24px;box-shadow:0 20px 80px rgb(var(--bg)/.9)}dialog::backdrop{background:rgb(var(--bg)/.8)}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:22px}.dialog-head h2{font-size:19px;letter-spacing:-.3px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding-top:12px;flex-wrap:wrap}.dialog-actions .danger{margin-right:auto}.grant{padding:14px 0;box-shadow:0 1px 0 rgb(var(--line));margin-bottom:14px}.grant .actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:10px}.grant .check-label{font-size:11px}#notice{position:fixed;bottom:22px;left:calc(50% + 100px);transform:translateX(-50%);z-index:30;background:rgb(var(--line));border-radius:12px;padding:12px 20px;box-shadow:0 8px 30px rgb(var(--bg)/.7);font-size:13px;max-width:calc(100% - 30px);display:none}#notice.visible{display:block}.search-form{display:flex;gap:8px}.spacer{margin-top:20px}
@media(min-width:1500px){.content{padding:38px 48px}.topbar{padding:0 48px}.board{grid-auto-rows:74px}}
@media(max-width:1000px){.shell{grid-template-columns:196px minmax(0,1fr)}.sidebar{width:196px;padding-left:10px;padding-right:10px}.content{padding:25px 22px}.topbar{padding:0 22px}.page-head{align-items:flex-start;flex-direction:column;gap:14px}.board{gap:10px}.widget-body{padding-left:14px;padding-right:14px}.widget-head{padding-left:14px;padding-right:10px}.metric{font-size:32px}}
@media(max-width:700px){.shell{display:block}.sidebar{transform:translateX(-100%);width:260px;transition:transform .16s ease}.shell.menu-open .sidebar{transform:translateX(0)}.shell.menu-open .veil{display:block;position:fixed;inset:0;background:rgb(var(--bg)/.8);z-index:4;border-radius:0}.main{width:100%}.mobile-menu{display:inline-flex}.topbar{height:64px;padding:0 14px}.top-tools{gap:4px}.source-pill{font-size:10px}.breadcrumbs{gap:8px;font-size:11px}.breadcrumbs>span:first-child{display:none}.content{padding:24px 16px 36px}.page-head{gap:17px;margin-bottom:22px}h1{font-size:25px}.toolbar{width:100%}.toolbar button{flex:1;padding:10px}.toolbar .icon{flex:0 0 44px}.board-meta{align-items:flex-start}.board-meta>span{font-size:10px;max-width:88px;text-align:right}.board{display:flex;flex-direction:column;gap:12px;min-height:0}.widget{min-height:200px}.widget[data-kind=nodes],.widget[data-kind=tasks]{min-height:270px}.widget-head{padding:12px 18px 0}.widget-body{padding:6px 20px 17px}.widget-footer{padding-bottom:18px}.board.editing{padding:8px}.board.editing .widget{flex-shrink:0}.resize{display:none}.metric{font-size:38px}.page-panel{padding:4px 16px}.record{align-items:flex-start;flex-direction:column;gap:12px}.record-actions{width:100%}.record-actions button{flex:1}.grant .form-grid{grid-template-columns:1fr}.list-tools{flex-wrap:wrap}dialog{padding:20px}#notice{left:50%;width:max-content}.top-tools>.icon{display:none}}
.stat-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:10px}.source-explainer{margin:4px 0 28px}.project-stat{margin-top:30px}.project-stat-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.stat-card{background:rgb(var(--panel));border-radius:18px;padding:20px;min-width:0}.stat-card h3{font-size:12px;font-weight:500;color:rgb(var(--text));margin:9px 0}.stat-value{font-size:32px;letter-spacing:-.7px;line-height:1.25;margin:12px 0}.stat-value span{font-size:13px;letter-spacing:0;color:rgb(var(--muted))}.stat-card p{font-size:11px;color:rgb(var(--muted));min-height:36px;overflow-wrap:anywhere;margin:8px 0}.charts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}.chart-panel{background:rgb(var(--panel));border-radius:20px;padding:22px;min-width:0}.chart-panel h3{margin-bottom:15px}.chart-heading{display:flex;justify-content:space-between;gap:10px;color:rgb(var(--muted));font-size:11px;margin:5px 0 12px}.chart-heading strong{font-weight:500}.script-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.script-card{background:rgb(var(--panel));padding:23px;border-radius:20px;min-width:0;display:flex;flex-direction:column;gap:14px}.script-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px}.script-card h2{font-size:18px}.script-card>p{font-size:12px;color:rgb(var(--text));line-height:1.75;flex:1}.script-card-actions{display:flex;gap:8px;align-items:center;margin-top:5px}.script-card-actions .secondary{flex:1}.section-title{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:32px 0 14px}.step-editor{padding:18px 0;margin:8px 0;box-shadow:0 1px 0 rgb(var(--line))}.step-editor textarea{min-height:72px}.run-steps{padding-left:24px;margin:22px 0}.run-steps li{padding:0 0 20px 6px}.run-steps li::marker{color:rgb(var(--brand-soft));font-size:12px}.run-steps h3{margin-bottom:8px}.run-steps p{color:rgb(var(--muted));font-size:11px;margin-top:8px;overflow-wrap:anywhere}pre{font:12px/1.65 ui-monospace,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;margin:10px 0;color:rgb(var(--text))}.run-output{padding:14px 0;box-shadow:0 1px 0 rgb(var(--line));max-height:260px;overflow:auto}.run-output h3{font-size:12px}.widget-head button{min-height:44px;width:44px}.resize{min-height:44px!important;width:44px!important}.project-sub button{min-height:44px}
@media(min-width:1500px){.stat-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1000px){.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.charts-grid{grid-template-columns:1fr}}
@media(max-width:700px){.stat-filters{grid-template-columns:1fr;gap:0}.project-stat-head{align-items:flex-start;flex-direction:column;gap:8px}.stat-card{padding:16px}.stat-value{font-size:28px}.stat-card .overline{font-size:9px;letter-spacing:1px}.stat-card h3{min-height:36px}.stat-card p{min-height:45px}.script-list{grid-template-columns:1fr}.section-title{align-items:flex-start;flex-direction:column;gap:7px}.chart-panel{padding:18px}}
.system-stamp{margin-bottom:22px}.system-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.system-summary-item{background:rgb(var(--panel));border-radius:17px;padding:18px;min-width:0;display:flex;flex-direction:column;gap:12px}.system-summary-item>span{font-size:11px;color:rgb(var(--muted))}.system-summary-item>strong{font-size:28px;font-weight:550;letter-spacing:-.6px}.system-summary-item small{font-size:11px;font-weight:400;color:rgb(var(--muted));letter-spacing:0}.system-summary-item .text-status{font-size:15px;letter-spacing:0;line-height:1.6;overflow-wrap:anywhere}.node-filters{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:14px}.node-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.node-card{background:rgb(var(--panel));padding:20px;border-radius:18px;min-width:0}.node-title{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:18px}.node-title>div{min-width:0}.node-title h3{overflow-wrap:anywhere;margin-bottom:4px}.node-title .badge{flex:none;max-width:135px;white-space:normal;text-align:center}.node-readings{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:14px 0 18px}.node-readings>div{min-width:0;display:flex;flex-direction:column;gap:7px}.node-readings span{font-size:10px;color:rgb(var(--muted));line-height:1.5}.node-readings strong{font-size:14px;font-weight:500;overflow-wrap:anywhere}.node-timestamp{color:rgb(var(--muted));font-size:10px;margin-top:10px;line-height:1.7}.resources-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.resources-grid .node-readings{grid-template-columns:repeat(3,minmax(0,1fr))}.system-section .section-title .small{max-width:390px;text-align:right}.node-card>p{line-height:1.7}
@media(max-width:1100px){.node-list{grid-template-columns:1fr}.resources-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.system-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.system-summary-item{padding:16px}.node-filters{grid-template-columns:1fr;gap:0}.node-readings{grid-template-columns:repeat(2,minmax(0,1fr))}.node-title{gap:8px}.node-title .badge{max-width:122px}.resources-grid{grid-template-columns:1fr}.system-section .section-title .small{text-align:left;max-width:100%}}
.badge.bad{background:rgb(var(--bad-bg)/.55);color:rgb(var(--bad))}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Scenario catalogue and execution protocol: preserve the existing HQ tokens. */
.scenario-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,260px);gap:16px;align-items:end}
#scenario-count{margin:0 0 16px}
.script-meta{display:flex;flex-wrap:wrap;gap:6px 12px;font-size:12px;color:rgb(var(--muted));margin-top:auto}
.script-meta .protocol-draft{color:rgb(var(--warn))}
.run-history-heading{align-items:end;gap:20px}.run-history-heading .field{margin:0;min-width:210px}.run-history-heading p{margin-top:5px}
.execution-protocol{padding:20px 0;margin:20px 0;border-top:1px solid rgb(var(--line));border-bottom:1px solid rgb(var(--line));overflow-wrap:anywhere}
.protocol-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.protocol-heading h3{font-size:16px}
.protocol-mode{color:rgb(var(--muted));font-size:12px;margin:10px 0 18px;text-wrap:pretty}
.protocol-columns{display:grid;grid-template-columns:1fr 1fr;gap:24px}.protocol-columns h4{margin:0 0 7px;font-size:12px;color:rgb(var(--ink))}.protocol-columns h4:not(:first-child){margin-top:16px}
.protocol-columns p,.protocol-columns ul{font-size:12px;color:rgb(var(--text));margin:0;line-height:1.65}.protocol-columns ul{padding-left:18px}.protocol-columns li+li{margin-top:6px}
.protocol-missing{margin-top:16px;padding:12px 14px;border-radius:10px;background:rgb(var(--warn-bg));color:rgb(var(--warn));font-size:12px}
.step-editor-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:12px}.step-position{font-size:13px;color:rgb(var(--muted))}.step-order{display:flex;gap:6px}.move-step{background:rgb(var(--raised));min-width:44px;padding:8px;font-size:18px}
.run-progress{margin:18px 0 12px;display:grid;gap:8px;color:rgb(var(--muted));font-size:12px;font-variant-numeric:tabular-nums}.run-progress progress{width:100%;height:6px;accent-color:rgb(var(--brand))}
@media(max-width:700px){.scenario-filters,.protocol-columns{grid-template-columns:minmax(0,1fr);gap:12px}.run-history-heading{align-items:stretch;flex-direction:column}.run-history-heading .field{min-width:0;width:100%}.execution-protocol{padding:16px 0}.protocol-heading{flex-wrap:wrap}.script-meta{gap:4px 12px}}

#dialog:has(.execution-protocol),#dialog:has(.step-editor){width:min(720px,calc(100% - 28px))}
#dialog:has(.execution-protocol) .dialog-actions,#dialog:has(.step-editor) .dialog-actions{position:sticky;bottom:0;background:rgb(var(--panel));padding:16px 0 8px;box-shadow:0 -10px 20px rgb(var(--panel))}
.protocol-steps{list-style:none;padding:0}.protocol-steps li{padding:0;border-bottom:1px solid rgb(var(--line))}.protocol-steps summary{cursor:pointer;min-height:48px;padding:12px 0;display:flex;align-items:center;gap:12px;font-weight:600}.step-index{color:rgb(var(--muted));font-size:12px;font-variant-numeric:tabular-nums;flex:none}.protocol-steps summary:after{content:'+';margin-left:auto;color:rgb(var(--muted));font-size:18px}.protocol-steps details[open]>summary:after{content:'−'}.step-body{padding:0 0 18px 30px}.protocol-steps summary:focus-visible{outline-offset:-2px}

/* Widgets have one content budget; overflow is opened explicitly, never scrolled inside. */
.widget{container-type:inline-size}.widget-body{overflow:hidden;display:flex;flex-direction:column}.widget-head h2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4}.widget-head .widget-open{width:44px;min-height:44px;padding:10px;flex:none}.widget-footer{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.widget .metric{font-size:clamp(24px,10cqi,52px);flex:none}.widget[data-density=compact] .widget-head{padding:6px 12px 0;min-height:44px}.widget[data-density=compact] .widget-head h2{-webkit-line-clamp:1}.widget[data-density=compact] .widget-body{padding:0 14px 6px}.widget[data-density=compact] .metric{font-size:clamp(24px,10cqi,32px);margin:0;line-height:1.2}.widget[data-density=compact] .widget-sub{display:none}.widget[data-density=compact] .widget-footer{padding:0 14px 8px}.widget[data-density=spacious] .metric{font-size:clamp(32px,13cqi,72px)}
.widget-body>.spacer{margin-top:auto}.widget-summary{display:flex;align-items:baseline;gap:8px;font-size:12px;color:rgb(var(--muted))}.widget-summary strong{font-size:32px;line-height:1.1;color:rgb(var(--ink));font-variant-numeric:tabular-nums}.widget-body .data-row{height:44px;min-height:44px;flex:none;padding:6px 0}.row-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:16px}.node-value{flex:none;font-variant-numeric:tabular-nums}.widget-overflow-note{font-size:11px;color:rgb(var(--muted));line-height:20px;margin-top:4px}.widget .note-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--note-lines,3);overflow:hidden;line-height:22px}.widget .empty-area{min-height:0;max-height:100%;padding:0;overflow:hidden}.widget[data-density=compact] .empty-area .empty-icon,.widget[data-density=compact] .empty-area p{display:none}.widget-expanded .line-chart{height:220px}.widget-expanded .data-row{min-height:44px}.widget-expanded .note-text{display:block;line-height:1.7}
.line-chart{display:block;width:100%;height:160px;min-height:20px;overflow:visible;color:rgb(var(--brand));flex:1}.line-chart path{fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.line-chart circle{fill:currentColor}.chart-axis{display:flex;justify-content:space-between;gap:12px;font-size:10px;color:rgb(var(--muted));flex:none}.chart-heading{flex:none;min-height:20px;gap:8px}.chart-heading strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chart-heading span{flex:none}.chart-note{margin-top:8px}.widget .chart-note{display:none}.chart-empty{font-size:12px;color:rgb(var(--muted));padding:12px 0}
@media(max-width:700px){.widget{height:260px;min-height:0;max-height:none}.widget[data-kind=note]{height:260px}.widget[data-kind=chart]{height:300px}.widget-expanded .line-chart{height:160px}}

.node-group{grid-column:1/-1;min-width:0}.node-group-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:8px 0 14px}.node-group-heading h3{font-size:18px}.node-group-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}.group-hint{margin:-4px 0 14px}.node-ownership{font-size:11px;color:rgb(var(--text));margin:12px 0}.node-architecture{border-top:1px solid rgb(var(--line));margin-top:14px;padding-top:2px}.node-architecture>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:600;font-size:12px}.node-architecture>summary:after{content:'+';margin-left:auto}.node-architecture[open]>summary:after{content:'−'}.architecture-purpose{font-size:13px;color:rgb(var(--text));line-height:1.7;margin:8px 0 18px}.architecture-chain{list-style:none;margin:12px 0;padding:0}.architecture-chain li{position:relative;display:flex;flex-direction:column;gap:5px;border-left:2px solid rgb(var(--brand-bg));padding:0 0 22px 18px;margin-left:5px}.architecture-chain li:before{content:'';position:absolute;left:-5px;top:3px;width:8px;height:8px;background:rgb(var(--brand));border-radius:50%}.architecture-chain li:last-child{padding-bottom:4px}.architecture-chain code{font-size:12px;overflow-wrap:anywhere;color:rgb(var(--brand-soft))}.architecture-chain span,.architecture-chain p{font-size:12px;color:rgb(var(--text));overflow-wrap:anywhere}.architecture-source{font-size:11px;color:rgb(var(--muted));margin:16px 0;line-height:1.7}.routing-rules,.node-facts{margin:10px 0 18px}.routing-rules>div{padding:9px 0;border-bottom:1px solid rgb(var(--line))}.routing-rules dt,.node-facts dt{font-size:11px;color:rgb(var(--muted))}.routing-rules dd,.node-facts dd{margin:3px 0 0;font-size:12px;overflow-wrap:anywhere}.node-facts{display:grid;grid-template-columns:1fr 1fr;gap:12px}.node-projects{border:0;padding:0;margin:20px 0 8px}.node-projects legend{font-size:13px;margin-bottom:8px}.hop-editor,.route-editor{padding:18px 0;border-bottom:1px solid rgb(var(--line));margin:8px 0 18px}.move-hop{min-width:44px;font-size:18px}.node-architecture h4{font-size:13px;margin:20px 0 8px}#dialog:has(.node-projects){width:min(720px,calc(100% - 28px))}#dialog:has(.node-projects) .dialog-actions{position:sticky;bottom:0;background:rgb(var(--panel));padding:16px 0;box-shadow:0 -10px 20px rgb(var(--panel))}
@media(max-width:1000px){.node-group-grid{grid-template-columns:minmax(0,1fr)}}
.widget-footer .dot{margin-right:6px}

.ui-update{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:40;display:flex;align-items:center;gap:16px;padding:12px 16px;max-width:calc(100% - 28px);background:rgb(var(--panel));box-shadow:0 8px 30px rgb(var(--bg)/.7);border-radius:14px;font-size:12px}.ui-update span{min-width:0}.ui-update button{flex:none}@media(max-width:700px){.ui-update{width:calc(100% - 28px);gap:10px}.ui-update button{padding:8px 10px;font-size:12px}}

.daily-chart{overflow:visible;min-height:40px}.daily-chart text{stroke:none;fill:rgb(var(--text));font-family:inherit;font-size:10px;font-variant-numeric:tabular-nums}.daily-chart .day-date{fill:rgb(var(--muted));font-size:9px}.daily-chart .previous-month{stroke:rgb(var(--muted));stroke-width:1.5;stroke-dasharray:4 5;opacity:.7}.daily-chart .day-point{fill:rgb(var(--brand));stroke:rgb(var(--panel));stroke-width:1.5;vector-effect:non-scaling-stroke}.daily-chart .day-point:focus{outline:none;r:5;stroke:rgb(var(--ink))}.widget .chart-axis{gap:5px;font-size:9px}.widget .chart-heading{font-size:10px;gap:5px}
.mirror-collections,.mirror-records{display:flex;flex-direction:column;gap:10px}.mirror-collection{display:flex;align-items:center;justify-content:space-between;gap:16px;text-align:left;background:rgb(var(--panel));border:0;border-radius:16px;padding:16px 20px;color:rgb(var(--ink));min-height:74px}.mirror-collection>span:first-child,.mirror-record summary>span:first-child{display:flex;flex-direction:column;gap:6px;min-width:0}.mirror-collection small,.mirror-record small{color:rgb(var(--muted));overflow-wrap:anywhere}.mirror-collection>span:last-child{display:flex;align-items:center;gap:14px;flex:none}.mirror-record{background:rgb(var(--panel));border-radius:16px;padding:0 20px}.mirror-record summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:78px;cursor:pointer;list-style:none}.mirror-record summary::-webkit-details-marker{display:none}.mirror-record summary strong{overflow-wrap:anywhere}.mirror-fields{margin:0;padding:0 0 16px}.mirror-fields>div,.mirror-nested>div{padding:10px 0;box-shadow:0 -1px 0 rgb(var(--line)/.3)}.mirror-fields dt{color:rgb(var(--muted));font-size:12px;margin-bottom:7px;overflow-wrap:anywhere}.mirror-fields dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.6}.mirror-nested{padding-left:14px}.mirror-pages{margin-top:20px;flex-wrap:wrap}.mirror-pages input{width:90px}.mirror-collection:focus-visible,.mirror-record summary:focus-visible{outline:2px solid rgb(var(--brand));outline-offset:3px}
.mirror-nested{margin:0}.mirror-secret{padding-bottom:20px}.mirror-secret-value{white-space:pre-wrap;overflow-wrap:anywhere;padding:14px;background:rgb(var(--base));border-radius:10px}
.widget[data-density=compact] .chart-heading{margin:0}.widget[data-density=compact] .daily-chart{min-height:20px}
.node-saved{margin-top:18px;padding-top:14px;box-shadow:0 -1px 0 rgb(var(--line)/.45)}.node-saved>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:13px;gap:10px}.node-saved>summary::before{content:'+';color:rgb(var(--brand));font-size:20px}.node-saved[open]>summary::before{content:'−'}.node-saved>summary:focus-visible{outline:2px solid rgb(var(--brand));outline-offset:4px;border-radius:6px}.node-saved>summary::-webkit-details-marker{display:none}.node-saved-fields{margin:12px 0 18px}.node-saved-fields>div{padding:10px 0;box-shadow:0 1px 0 rgb(var(--line)/.3)}.node-saved-fields dt{font-size:11px;color:rgb(var(--muted));margin-bottom:5px}.node-saved-fields dd{margin:0;font-size:13px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.node-saved-stamp{margin:8px 0 12px}.node-saved-record{margin:10px 0 20px}.node-saved-record h4{font-size:13px;margin:14px 0}.node-saved-record .toolbar{flex-wrap:wrap}.node-saved-record .toolbar button{white-space:normal;text-align:left;min-height:44px}
.node-saved-note>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:rgb(var(--brand))}.node-saved-note p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}

.manual-current{margin-top:18px;padding:18px;background:rgb(var(--raised)/.55);border-radius:14px;min-width:0}.manual-current h3{margin:8px 0 14px}.manual-copy{font-size:13px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;margin:12px 0}.manual-actions{display:flex;gap:8px;flex-wrap:wrap}.manual-actions button{flex:1;white-space:normal;min-height:44px}.manual-history{margin-top:18px}.manual-history>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:rgb(var(--brand));font-size:13px}.manual-current textarea{min-height:80px}.manual-history summary:focus-visible{outline:2px solid rgb(var(--brand));outline-offset:3px}
@media(max-width:500px){.manual-actions{flex-direction:column}.manual-actions button{width:100%;flex:auto}}
