:root{
  color-scheme:dark;
  --ink:#e4eaf0;--muted:#a2afbd;--line:#344251;
  --accent:#96b9d9;--accent-hover:#b0cce5;--accent-soft:#24374a;--on-accent:#172839;
  --canvas:#111820;--surface:#19232e;--apply:#203246;--stack:#2b3948;
  --board-line:#283542;--tag-line:#45596d;--selection-line:#6c8aa7;--disabled:#637282;
  --danger:#eea29a;--danger-hover:#ffb4ac;--danger-soft:#36272b;--danger-line:#67474b;
  --success:#a2cbb0;--success-soft:#23372d;--success-line:#42614e;
  --focus-ring:#96b9d933;--shadow:#00000040;--backdrop:#060b12b3;
}
:root[data-theme=light]{
  color-scheme:light;
  --ink:#26313b;--muted:#697582;--line:#dce3e9;
  --accent:#466e91;--accent-hover:#355976;--accent-soft:#edf3f8;--on-accent:#fff;
  --canvas:#f5f7f9;--surface:#fff;--apply:#eef5fb;--stack:#e0e7ee;
  --board-line:#e6ebf0;--tag-line:#c9d4de;--selection-line:#94adc1;--disabled:#b7c1ca;
  --danger:#a33c36;--danger-hover:#842c27;--danger-soft:#fff1ef;--danger-line:#efd9d3;
  --success:#3d744b;--success-soft:#edf8ef;--success-line:#d8eadb;
  --focus-ring:#466e911f;--shadow:#26313b26;--backdrop:#26313b4d;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;color:var(--ink);background:var(--canvas);font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
h1,h2,h3,p{margin:0}
a{color:inherit}
form{margin:0}
button,input,select,textarea{font:inherit}
button,.button{display:inline-flex;gap:8px;align-items:center;justify-content:center;min-height:38px;padding:8px 13px;border:1px solid transparent;border-radius:9px;background:var(--accent);color:var(--on-accent);cursor:pointer;font-weight:600;font-size:13px;text-decoration:none}
button:hover,.button:hover{background:var(--accent-hover)}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.icon{display:block;width:18px;height:18px;flex-shrink:0}
.primary{background:var(--accent)}
.secondary{color:var(--ink);background:var(--surface);border-color:var(--line)}
.secondary:hover,.subtle:hover{background:var(--accent-soft);color:var(--ink)}
.subtle{background:transparent;color:var(--muted)}
.danger{color:var(--danger)}
.danger:hover{color:var(--danger-hover);background:var(--danger-soft)}
label{display:block;color:var(--muted);font-size:12px;font-weight:600}
input,select,textarea{display:block;width:100%;min-height:41px;margin-top:7px;padding:10px 12px;background:var(--surface);border:1px solid var(--line);border-radius:8px;outline:none;color:var(--ink)}
input:focus,select:focus,textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}
textarea{min-height:170px;color:var(--ink);background:var(--canvas);font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;resize:vertical}
.topbar{display:flex;align-items:center;justify-content:space-between;height:74px;padding:0 28px;background:var(--surface);border-bottom:1px solid var(--line)}
.brand{display:inline-flex;align-items:center;gap:11px;font-size:20px;font-weight:650;text-decoration:none}
.brand-mark{display:grid;place-items:center;width:34px;height:34px;color:var(--surface);background:var(--ink);border-radius:10px}
.account,.workspace-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.account-name{max-width:180px;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:13px}
.theme-toggle{width:36px;min-height:36px;padding:8px;flex-shrink:0}
.theme-dark-icon,:root[data-theme=light] .theme-light-icon{display:none}
:root[data-theme=light] .theme-dark-icon{display:block}
.login-theme-toggle{position:absolute;top:20px;right:24px}
.studio-shell{display:grid;grid-template-columns:300px minmax(0,1fr);gap:26px;max-width:1600px;margin:auto;padding:26px}
.sidebar{position:sticky;top:26px;align-self:start;max-height:calc(100svh - 126px);overflow-y:auto;padding:22px 14px 16px;background:var(--surface);border:1px solid var(--line);border-radius:16px}
.eyebrow{margin-bottom:6px;font-size:10px;font-weight:650;letter-spacing:1.1px;text-transform:uppercase;color:var(--muted)}
.entity-list,.flow-list{margin:0;padding:0;list-style:none}
.entity-item{margin-bottom:4px}
.entity-button{display:flex;align-items:center;min-height:48px;width:100%;gap:10px;padding:9px 10px;text-align:left;background:transparent;color:var(--muted);text-decoration:none}
.entity-button:hover{background:var(--accent-soft);color:var(--ink)}
.entity-item.selected>.entity-button{background:var(--accent-soft);color:var(--accent)}
.entity-symbol{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;flex-shrink:0}
.entity-app{color:var(--accent);background:var(--accent-soft)}
.entity-store{color:var(--muted);background:var(--canvas)}
.entity-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.flow-list{margin:7px 0 8px 28px;padding-left:10px;border-left:1px solid var(--line)}
.flow-link{display:flex;align-items:center;gap:8px;padding:8px 7px;border-radius:7px;color:var(--muted);font-size:11px;text-decoration:none}
.flow-link:hover,.flow-link.active{background:var(--accent-soft);color:var(--accent)}
.flow-link .icon{width:13px;height:13px}
.flow-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tree-empty{padding:10px 7px;color:var(--muted);font-size:12px}
.inline-add{display:flex;align-items:center;gap:8px;min-height:36px;margin:5px 10px 8px;padding:0 9px;color:var(--muted);background:var(--canvas);border:1px solid var(--line);border-radius:8px}
.inline-add:hover{color:var(--accent);background:var(--accent-soft)}
.inline-add:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}
.inline-add>.icon{width:14px;height:14px}
.inline-add>input{min-width:0;min-height:34px;margin:0;padding:7px 0;color:inherit;background:transparent;border:0;border-radius:0;box-shadow:none;font-size:11px}
.inline-add>input:focus{border:0;box-shadow:none}
.workspace-column{min-width:0}
.workspace-heading{display:flex;align-items:center;justify-content:flex-end;flex-direction:row;gap:20px;margin-bottom:18px;padding:10px 2px 0}
.muted{color:var(--muted)}
.empty-panel{padding:70px 32px;text-align:center;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:16px}
.empty-panel>.icon{width:34px;height:34px;margin:0 auto 18px;color:var(--muted)}
.empty-panel h1,.empty-panel h2{margin-bottom:9px;color:var(--ink);font-size:22px}
.welcome-panel{min-height:390px;display:grid;place-content:center}
.store-panel>.entity-symbol{width:52px;height:52px;margin:0 auto 20px}
.notice{display:flex;gap:10px;align-items:center;margin:0 0 16px;padding:12px 16px;color:var(--danger);background:var(--danger-soft);border:1px solid var(--danger-line);border-radius:10px}
.notice.success{color:var(--success);background:var(--success-soft);border-color:var(--success-line)}
.notice-error{display:block}
.notice-error>p,.editor-form-error>p{margin:0}
.error-list{max-height:40vh;margin:10px 0 0;padding-left:20px;overflow:auto;overflow-wrap:anywhere}
.error-list li+li{margin-top:8px}
.error-list strong{font-weight:600}
.login-shell{display:grid;place-items:center;min-height:100svh;padding:24px}
.login-card{width:100%;max-width:408px;padding:36px;border:1px solid var(--line);border-radius:20px;background:var(--surface);text-align:center}
.login-card .brand-mark{margin:0 auto 20px;width:42px;height:42px}
.login-card>.muted{margin:10px 0 25px}
.login-card label{margin-top:20px;text-align:left}
.login-card .full-width{width:100%;margin-top:24px}
@media(max-width:900px){.studio-shell{grid-template-columns:260px minmax(0,1fr);padding:18px;gap:18px}
}
@media(max-width:680px){.studio-shell{grid-template-columns:1fr;padding:14px}
.topbar{height:auto;min-height:74px;padding:12px 18px;gap:12px}
.sidebar{position:static;max-height:420px}
}
.inline-add>select{width:auto;max-width:74px;min-height:34px;margin:0;padding:7px 0;color:inherit;background:transparent;border:0;border-radius:0;box-shadow:none;font-size:11px}
.inline-add>select:focus{border:0;box-shadow:none}
.nav-section+.nav-section{margin-top:18px}
.nav-section-heading{display:flex;align-items:center;justify-content:space-between;padding:0 6px 7px 10px}
.nav-section-heading h2{min-width:0;color:var(--muted);font-size:11px;font-weight:600;overflow-wrap:anywhere}
.section-add{width:26px;min-height:26px;padding:0;color:var(--muted);background:transparent;border:0;border-radius:7px}
.section-add:hover{color:var(--accent);background:var(--accent-soft)}
.section-add:disabled{color:var(--disabled);background:transparent;cursor:not-allowed}
.section-add .icon{width:14px;height:14px}
.workspace-actions{justify-content:flex-end;margin-left:auto}
.entity-control{position:relative;display:flex;align-items:stretch;min-width:0}
.entity-link{display:inline-flex;align-items:center;gap:8px;min-height:38px;max-width:320px;padding:8px 11px 8px 13px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:9px 0 0 9px;font-size:13px;font-weight:600;text-decoration:none}
.entity-link:hover,.entity-picker>summary:hover{color:var(--ink);background:var(--accent-soft)}
.entity-link span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.entity-link .icon{width:16px;height:16px}
.entity-picker{position:relative}
.entity-picker>summary{display:grid;place-items:center;width:39px;height:38px;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-left:0;border-radius:0 9px 9px 0;cursor:pointer;list-style:none}
.entity-picker>summary::-webkit-details-marker{display:none}
.entity-picker>summary .icon{width:16px;height:16px}
.entity-menu{position:absolute;z-index:10;top:46px;right:0;display:grid;width:min(300px,calc(100vw - 28px));gap:12px;padding:14px;background:var(--surface);border:1px solid var(--line);border-radius:11px;box-shadow:0 14px 36px var(--shadow)}
.entity-menu button{width:100%}
@media(max-width:680px){.workspace-heading{padding-top:0}
.workspace-actions{width:100%}
.entity-control{max-width:100%}
.entity-link{max-width:calc(100vw - 125px)}
}

.editor-panel{padding:24px 26px;min-width:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.editor-settings,.editor-close,.editor-back{display:inline-flex;align-items:center;justify-content:center;padding:8px;min-width:34px;min-height:34px;color:var(--muted);background:transparent;border:0}
.editor-settings:hover,.editor-close:hover,.editor-back:hover{color:var(--accent);background:var(--accent-soft)}
.editor-settings .icon,.editor-close .icon,.editor-back .icon{width:16px;height:16px}
.editor-back .icon{transform:rotate(180deg)}
.editor-toolbar{display:flex;align-items:flex-start;gap:20px;margin-bottom:32px}
.editor-toolbar-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.type-selector{display:grid;flex:1;gap:8px;min-width:0}
.type-selector-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.type-mode-selector{display:inline-flex;border:1px solid var(--line);border-radius:6px;overflow:hidden}
.type-mode-selector>.type-toggle{border:0;border-radius:0}
.type-mode-selector>.type-toggle+.type-toggle{border-left:1px solid var(--line)}
.type-toggle{display:inline-flex;align-items:center;gap:4px;padding:4px 9px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--muted);font-size:12px;text-decoration:none}
a.type-toggle:hover,.type-toggle.selected{border-color:var(--selection-line);background:var(--accent-soft);color:var(--accent)}
.type-toggle.selected{font-weight:600}
.type-symbol{display:inline-flex;align-items:center;justify-content:center;height:18px}
.type-symbol>.icon{width:14px;height:14px}
.resource-board-scroll{overflow-x:auto}
.resource-board{display:grid;justify-items:start;width:max-content;gap:32px;padding:8px 0 28px}
.resource-row{display:grid;gap:32px;padding:24px;border:4px solid var(--board-line);border-radius:16px}
.resource-row-header{display:flex;align-items:center;justify-content:flex-start}
.resource-implicit-toggle{display:inline-flex;align-items:center;gap:8px;min-height:32px;font-size:12px;font-weight:400;cursor:pointer}
.resource-implicit-toggle>input{width:15px;height:15px;min-height:15px;margin:0;padding:0;accent-color:var(--accent);cursor:pointer}
.resource-implicit-toggle>input:focus-visible{outline:2px solid var(--accent);outline-offset:3px;box-shadow:none}
.resource-implicit-toggle:has(>input:disabled){opacity:.65;cursor:wait}
.resource-row-columns{display:flex;align-items:flex-start;gap:48px}
.resource-column{width:270px;flex-shrink:0}
.resource-column-name{margin:0 0 20px;color:var(--muted);font-size:11px;font-weight:500;line-height:16px;text-align:center}
.resource-column-cards{display:grid;gap:32px}
.resource-card{width:100%;margin:0;padding-bottom:20px;min-width:0}
.resource-card-content{background:var(--surface);border:1px solid var(--line);border-radius:12px}
.resource-card.is-list{position:relative;isolation:isolate;padding:14px 0 34px}
.resource-card.is-list::before{content:"";position:absolute;inset:0 6px 20px;z-index:-1;border-radius:12px;background:var(--stack);pointer-events:none}
.resource-body:has(>[data-role=collect]){border-top:1px solid var(--line)}
.resource-title{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:12px 16px}
.resource-identity{display:flex;align-items:center;flex:1 1 auto;gap:8px;min-width:0;color:var(--muted)}
.resource-actions{display:flex;align-items:center;justify-content:flex-end;flex-shrink:0;gap:4px;margin-left:auto}
.resource-format{color:var(--muted);font-size:11px;font-weight:500;letter-spacing:.06em}
.resource-source{display:inline-flex}
.resource-source>.icon{width:20px;height:20px;stroke-width:1.7}
.resource-name{flex:1 1 auto;min-width:0;color:var(--ink);font-size:14px;font-weight:400;line-height:20px;overflow-wrap:anywhere}
.resource-name strong{font-weight:600}
.resource-identity>button.resource-name{justify-content:flex-start;min-height:28px;padding:0;border:0;background:transparent;text-align:left}
.resource-identity>button.resource-name:hover{color:var(--accent)}
.resource-fields{display:grid;margin:0;padding:16px;list-style:none}
.resource-fields[data-role=apply]{min-height:64px;padding-top:32px;border-top:1px solid var(--line);border-radius:0 0 11px 11px;background:var(--apply)}
.resource-goal-boundary{position:relative;height:0;margin-top:16px;z-index:1}
.resource-goal{position:absolute;top:1px;left:50%;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;transform:translate(-50%,-50%);color:var(--accent);background:var(--apply)}
.resource-goal>.icon{width:26px;height:26px;stroke-width:1.8}
.resource-goal.is-rim>.icon{width:40px;height:40px;stroke-width:1.1;overflow:visible}
.resource-fields button{display:flex;align-items:center;justify-content:flex-start;gap:8px;min-width:0;min-height:32px;width:100%;padding:5px 0;border:0;border-radius:5px;background:transparent;color:var(--ink);font:inherit;font-size:13px;line-height:20px;text-align:left;overflow-wrap:anywhere}
.resource-type-tags>button{width:auto;max-width:100%;min-height:0;padding:0}
.resource-type-field+li{margin-top:16px}
.resource-fields[data-role=apply] button{justify-content:flex-end;text-align:right}
.resource-fields button:hover{background:var(--accent-soft);color:var(--accent)}
.resource-attribute-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 14px;height:20px;color:var(--muted)}
.resource-attribute-icon>.icon{width:14px;height:14px}
.resource-attribute-name{min-width:0}
.resource-attribute-name strong{font-weight:600}
.resource-type-tags{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.resource-type-tag{display:inline-flex;align-items:stretch;max-width:100%;border:1px solid var(--tag-line);border-radius:6px;background:transparent;color:var(--ink);font-size:12px;font-weight:500;line-height:20px;text-align:left}
.resource-type-tag>span+span{border-inline-start:1px solid var(--tag-line)}
.resource-type-label{min-width:0;padding:4px 10px}
.resource-type-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;color:var(--muted)}
.resource-type-icon>.icon{width:18px;height:18px;stroke-width:1.7}
.resource-fields[data-role=apply] .resource-type-tags{justify-content:flex-end}
.resource-add{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;min-width:32px;height:32px;min-height:32px;margin:4px auto;padding:0;border:1px solid var(--line);border-radius:50%;color:var(--muted);background:var(--surface)}
.resource-add:hover{color:var(--accent);background:var(--accent-soft);border-color:var(--accent)}
.resource-add .icon{width:16px;height:16px;stroke-width:2}
.resource-dialog{width:min(540px,calc(100vw - 32px));max-width:100%;max-height:calc(100dvh - 40px);padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);box-shadow:0 16px 75px var(--shadow);overflow:auto}
.resource-dialog:has([data-for-kind=php]:not([hidden])){width:min(760px,calc(100vw - 32px))}
.resource-dialog::backdrop{background:var(--backdrop)}
.resource-dialog>header{display:flex;align-items:center;gap:10px;margin-bottom:24px}
.resource-dialog>header h2{flex:1;min-width:0;font-size:16px;font-weight:500;overflow-wrap:anywhere}
.resource-dialog .editor-close{flex-shrink:0}
.editor-form,.editor-form>fieldset,.editor-option-fields{display:grid;gap:18px;min-width:0}
.editor-form fieldset{border:0;padding:0;margin:0}
.editor-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;min-width:0}
.editor-form label{min-width:0}
.editor-form input,.editor-form select,.editor-form textarea{min-width:0;max-width:100%}
.editor-form textarea{resize:vertical;max-height:60dvh;font-size:13px}
.editor-form small{display:block;margin-top:7px;font-size:11px;font-weight:400;line-height:1.5;color:var(--muted)}
.editor-code{min-height:220px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.editor-calculation{min-height:90px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}
.editor-checks{display:flex;flex-wrap:wrap;gap:14px}
.editor-check{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:400}
.editor-check input{width:16px;min-height:16px;margin:0;flex-shrink:0}
.editor-options>summary{padding-block:4px;color:var(--muted);font-size:12px;cursor:pointer}
.editor-options[open]>summary{margin-bottom:16px}
.editor-option-fields{padding-top:4px}
.editor-attribute-list,.editor-choices{display:grid;gap:7px;min-width:0}
.editor-choice,.editor-attribute-choice{justify-content:flex-start;min-height:38px;padding:10px 12px;border:1px solid var(--line);background:transparent;color:var(--ink);font:inherit;font-size:13px;text-align:left;overflow-wrap:anywhere}
.editor-choice:hover,.editor-attribute-choice:hover{background:var(--accent-soft)}
.editor-attribute-choice{display:flex;align-items:center;justify-content:space-between}
.editor-text-button{justify-content:flex-start;justify-self:start;padding:7px 0;background:transparent;color:var(--accent);font-size:12px}
.editor-text-button:hover{background:var(--accent-soft);color:var(--accent-hover)}
.editor-fixed-resource{margin:0;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.editor-form-error{padding:8px 0;color:var(--danger);font-size:13px;overflow-wrap:anywhere}
.editor-form footer{display:flex;align-items:center;justify-content:flex-end;gap:12px;margin-top:6px}
.editor-form .editor-delete{order:-1;margin-right:auto;padding-left:0;background:transparent;font-weight:400;font-size:12px}
.editor-delete .icon{width:14px;height:14px}
.store-object-editor textarea{min-height:55vh;font-family:monospace;font-size:13px;resize:vertical}
.store-object-editor footer{display:flex;gap:12px;justify-content:flex-end}
@media(max-width:680px){.editor-panel{padding:17px}.editor-toolbar{flex-wrap:wrap}.type-selector{flex-basis:100%}.resource-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:18px}.editor-form-grid{grid-template-columns:1fr}.editor-form footer{position:sticky;bottom:-18px;background:var(--surface);padding:12px 0 0}}
@media(pointer:coarse){.editor-settings,.editor-close,.editor-back,.resource-add,.resource-identity>button.resource-name{min-width:44px;min-height:44px}.resource-fields button{min-height:36px}.resource-dialog input,.resource-dialog select,.resource-dialog textarea{font-size:16px}.editor-choice,.editor-attribute-choice,.editor-text-button{min-height:44px}}
.editor-repeat{display:grid;gap:14px;min-width:0}
.editor-row,.editor-rule{display:grid;gap:14px;min-width:0;padding:14px;border:1px solid var(--line);border-radius:10px}
.editor-row-heading{display:flex;align-items:flex-start;gap:10px;min-width:0}
.editor-row-heading>label{flex:1}
.editor-row-remove{flex:0 0 28px;width:28px;min-height:28px;margin-top:18px;padding:5px;color:var(--muted);background:transparent;border:0}
.editor-row-remove:hover{color:var(--danger-hover);background:var(--danger-soft)}
.editor-row-remove>.icon{width:14px;height:14px}
.editor-inputs{display:grid;gap:8px;margin-top:18px}
.editor-inputs>h3{font-size:12px;font-weight:500;color:var(--muted)}
.editor-input-group{min-width:0;border-top:1px solid var(--line)}
.editor-input-group>summary{display:flex;justify-content:space-between;gap:12px;padding:11px 0;color:var(--ink);font-size:12px;cursor:pointer}
.editor-input-group>summary>span{color:var(--muted);font-size:11px}
.editor-input-group[open]{padding-bottom:10px}
.editor-input-row{display:grid;gap:10px;min-width:0;padding-bottom:12px;border-bottom:1px solid var(--line)}
.editor-input-row .editor-row-remove{margin-top:18px}
.editor-impact{display:grid;gap:9px;margin:0;padding-left:20px;max-height:45dvh;overflow:auto;font-size:13px;overflow-wrap:anywhere}
@media(max-width:680px){.editor-row,.editor-rule{padding:12px}.editor-row-heading{gap:5px}}
@media(pointer:coarse){.editor-row-remove{min-width:36px;min-height:36px}}
