:root{color-scheme:only light;--ink:#191919;--muted:#555555;--line:#dddddd;--paper:#f5f5f5;--primary:#171717;--soft:#ededed;--white:#ffffff;--radius:12px}
*{box-sizing:border-box}
body{margin:0;height:100dvh;display:flex;flex-direction:column;overflow:hidden;background:var(--paper);color:var(--ink);font:14px/1.45 system-ui,-apple-system,sans-serif}
button,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
button:disabled{opacity:.45;cursor:default}
[hidden]{display:none!important}
#startup-status{display:grid;flex:1;place-items:center;color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
[data-icon]{display:inline-flex;align-items:center}
[data-icon] svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.top{position:relative;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:10px;padding-inline:var(--toolbar-inset);background:var(--white);border-bottom:1px solid var(--line)}
.brand,.top-right{display:flex;align-items:center;gap:8px}
.top-left,.top-nav{display:flex;align-items:center;gap:8px}
.top-left{align-items:baseline;gap:16px}
.top-left .brand,.top-nav{align-items:baseline}
.top-left .mark{align-self:center}
.brand{font-weight:750;letter-spacing:-.7px;white-space:nowrap}
.brand>span>span{color:var(--primary)}
.mark svg{width:19px;height:19px}
.mark{display:grid;place-items:center;width:33px;height:33px;border-radius:9px;background:var(--primary);color:#fff;font-size:23px;font-weight:400}
.board-name{position:absolute;left:50%;transform:translateX(-50%);color:var(--muted);font-size:13px}
#board-name{display:block;max-width:100%;padding:4px 6px;border:0;border-radius:6px;background:none;color:inherit;font:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#board-name:hover{background:var(--soft)}
#board-name-input{width:min(240px,100%);padding:4px 6px;border:1px solid var(--line);border-radius:6px;color:var(--ink);font:inherit}
.outline,.quiet,.modes button{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;background:transparent}
.outline{min-height:36px;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--white);font-size:13px;font-weight:650;white-space:nowrap}
.outline:hover,.quiet:hover,.account-toggle:hover{background:var(--soft)}
.chat-toggle,.object-toggle{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));width:52px;height:52px;border-radius:50%;background:var(--primary);border-color:var(--primary);color:#fff;box-shadow:0 3px 12px #0003}
.chat-toggle{right:max(16px,env(safe-area-inset-right))}
.object-toggle{right:calc(max(16px,env(safe-area-inset-right)) + 62px)}
.chat-toggle:hover,.object-toggle:hover{background:#383838}
.chat-toggle svg,.object-toggle svg{width:23px;height:23px}
.object-tree{position:absolute;z-index:1;right:max(16px,env(safe-area-inset-right));bottom:calc(max(16px,env(safe-area-inset-bottom)) + 62px);width:min(300px,calc(100% - 32px));max-height:min(55%,400px);overflow:auto;overscroll-behavior:contain;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--white);box-shadow:0 3px 12px #0003}
.object-tree h2,.object-tree p{margin:4px 0 6px;overflow-wrap:anywhere}
.object-tree h2{font-size:15px}
.object-tree .object-frame{font-weight:650}
.object-tree .object-part{padding:4px 10px;color:var(--muted);font-size:13px;overflow-wrap:anywhere}
.object-tree ul{margin:0;padding:0;list-style:none}
.object-tree ul ul,.object-tree .screen-objects{padding-inline-start:10px;border-inline-start:1px solid var(--line)}
.object-tree button{justify-content:flex-start;width:100%;min-height:40px;text-align:start;overflow-wrap:anywhere;color:var(--ink);font-size:13px}
.object-tree button[aria-pressed=true]{background:var(--soft);color:var(--primary);font-weight:650}
#object-group-actions{display:flex;flex:none;flex-wrap:wrap;gap:6px;padding:8px 14px;border-bottom:1px solid var(--line)}
#object-group-actions button{width:auto;min-height:32px}
.object-group > button{font-weight:650}
.properties-toggle{position:absolute;right:calc(max(16px,env(safe-area-inset-right)) + 124px);bottom:max(16px,env(safe-area-inset-bottom));display:block;width:max-content;max-width:calc(100% - max(16px,env(safe-area-inset-right)) - 140px);height:52px;overflow:hidden;text-overflow:ellipsis;border-radius:26px;padding-inline:16px}
.object-properties{position:relative;z-index:3;flex:none;--properties-limit:min(92%,calc(100% - 56px));height:clamp(min(235px,var(--properties-limit)),var(--properties-height,34dvh),var(--properties-limit));border:1px solid var(--line);border-bottom:0;border-radius:16px 16px 0 0;background:var(--white);box-shadow:0 -6px 24px #0002}
.object-properties{-webkit-tap-highlight-color:transparent}
#object-text-form{display:flex;flex-direction:column;height:100%}
.properties-grip{display:grid;place-items:center;flex:0 0 24px;cursor:ns-resize;touch-action:none;user-select:none}
.properties-grip::before{content:'';width:36px;height:4px;border-radius:4px;background:var(--muted);opacity:.55}
.properties-grip:hover::before,.properties-grip:active::before{opacity:1}
.properties-grip:focus-visible{outline:2px solid #7663d5;outline-offset:-3px;border-radius:12px}
.properties-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 16px}
.properties-heading{border-bottom:1px solid var(--line)}
.properties-heading #delete-block{margin-inline-start:auto}
.properties-heading h2{margin:0;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.properties-switch{display:flex;flex:none;gap:6px;padding:8px 14px;border-bottom:1px solid var(--line)}
.properties-switch button{flex:1;font-size:13px}
.properties-switch button[aria-pressed=true]{background:#e8e4ff;color:#352584}
#object-description{height:180px;max-height:none;border:1px solid var(--line);border-radius:8px;background:var(--white)}
.properties-fields{--property-tile:40px;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:10px 16px max(10px,env(safe-area-inset-bottom))}
.properties-fields fieldset{min-width:0;margin:0 0 10px;padding:0;border:0}
.properties-fields legend,.property-text-input,#object-items label{font-size:12px;font-weight:650;color:var(--muted)}
.properties-fields legend{padding:0 0 4px}
.property-tools{display:flex;flex-wrap:wrap;align-items:center;gap:5px}
.property-tile,.property-color{width:var(--property-tile);height:var(--property-tile);border:1px solid var(--line);border-radius:8px;background:var(--soft);cursor:pointer}
.property-tile{position:relative;display:grid;place-items:center}
.property-tile-label{width:auto;padding-inline:10px;font-size:13px}
.property-tile input{position:absolute;width:1px;height:1px;opacity:0}
.property-tile:hover,.property-color:hover{border-color:var(--muted)}
.property-tile:has(:checked){color:#4237a2;background:#e8e4ff;border-color:#8e80de}
.property-tile:has(:focus-visible),.property-color:focus-visible{outline:2px solid #7663d5;outline-offset:2px}
.property-tile [data-icon] svg{width:19px;height:19px;stroke-width:1.9}
.property-tile [data-icon=shape-filled] svg{fill:currentColor}
.property-visibility:has(:checked) [data-icon=eye-off],.property-visibility:not(:has(:checked)) [data-icon=eye]{display:none}
.property-color{padding:4px}
.property-color::-webkit-color-swatch-wrapper{padding:0}
.property-color::-webkit-color-swatch{border:1px solid #0003;border-radius:4px}
.property-color::-moz-color-swatch{border:1px solid #0003;border-radius:4px}
.property-text-input,#object-items label{display:grid;gap:4px;margin:8px 0}
.property-checkbox{display:flex;align-items:center;gap:8px;min-height:40px;cursor:pointer}
.property-checkbox input{width:18px;height:18px;margin:0;accent-color:#4237a2}
.property-text-input :is(input,select),#object-items input{width:100%;min-width:0;min-height:38px;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:var(--white);font:inherit;font-size:16px;font-weight:400;color:var(--ink)}
.property-action{width:40px;height:40px;padding:0}
.chat-toggle.is-working::after{content:'';position:absolute;inset:-4px;border:3px solid #7692ff;border-right-color:transparent;border-radius:50%;animation:generate-spin .8s linear infinite;pointer-events:none}
main{position:relative;flex:1;min-height:0;display:flex}
.board{position:relative;min-width:0;flex:1;display:flex;flex-direction:column;background:#ffffff radial-gradient(#d6d6d6 1px,transparent 1px) 0 0/19px 19px}
.board-top{align-self:center;max-width:100%;padding:12px 10px 0}
.board-top:not(:has(.modes:not([hidden]))){display:none}
.canvas{position:relative;flex:1;min-height:0;overflow:hidden}
#diagram{position:absolute;inset:0;overflow:auto;display:flex;padding:16px 20px 68px}
#diagram:has(> svg){touch-action:none}
#diagram > img{display:block;max-width:100%;max-height:100%;object-fit:contain;margin:auto}
#diagram svg{display:block;flex:none;width:var(--scale,100%);height:var(--scale,100%);max-width:var(--diagram-limit,1100px);margin:auto;transform:translate(var(--pan-x,0px),var(--pan-y,0px))}
#diagram svg:has([data-block]){overflow:visible}
#diagram [data-block]{cursor:grab;user-select:none}
#diagram:focus,#diagram [data-block]:focus{outline:none}
#diagram [data-block],#diagram [data-block] *{touch-action:none}
#diagram .diagram-shape{pointer-events:all}
#diagram .diagram-selection{fill:none;stroke:none;pointer-events:none}
#diagram [data-block=heading]:is([aria-pressed=true],:focus-visible) text{text-decoration:underline;text-decoration-color:#4765d0}
#diagram [data-block]:not([data-block^=line-]):is([aria-pressed=true],:focus-visible) > :is(.diagram-selection,.element-hit){stroke:#4765d0;stroke-width:1.5;vector-effect:non-scaling-stroke}
#diagram [data-block^=line-]:focus-visible:not([aria-pressed=true]) [data-object-surface]{stroke:#4765d0}
#diagram .is-editing-text text,#diagram .is-editing-text > .element-hit{visibility:hidden}
.prototype #diagram [data-block]{cursor:pointer}
.prototype #diagram [data-block]:not([data-layout-part])[aria-pressed=true]{cursor:grab}
.prototype #diagram .element-hit{pointer-events:all}
#diagram [data-block^=line-] > .element-hit{pointer-events:none}
#diagram.is-dragging [data-block]{cursor:grabbing}
#selection-box{position:absolute;z-index:1;pointer-events:none;border:1px solid #4765d0;background:#4765d01a}
#inline-object-text{position:absolute;z-index:3;transform:translateY(-50%);min-height:0;max-height:none;padding:3px 5px;border:1px solid #4765d0;border-radius:4px;outline:none;background:var(--white);resize:none;overflow-wrap:anywhere}
#delete-block svg{width:20px;height:20px}
#resize-handles{position:absolute;z-index:1;inset:0;pointer-events:none}
.resize-handle{position:absolute;display:grid;place-items:center;width:min(36px,var(--grip-width));height:min(36px,var(--grip-height));transform:translate(-50%,-50%);pointer-events:auto;touch-action:none;cursor:nwse-resize}
.resize-handle[data-corner=ne],.resize-handle[data-corner=sw]{cursor:nesw-resize}
.resize-handle[data-corner=e],.resize-handle[data-corner=w]{cursor:ew-resize}
.resize-handle[data-corner=n],.resize-handle[data-corner=s]{cursor:ns-resize}
.resize-handle::after{content:'';box-sizing:border-box;width:9px;height:9px;border:1px solid #4765d0;background:var(--white)}
.resize-handle.line-handle{width:26px;height:26px;cursor:crosshair}
.resize-handle[data-route-handle]{cursor:ew-resize}
.resize-handle[data-route-handle=lane]{cursor:ns-resize}
.line-handle::after{width:11px;height:11px;border-radius:50%}
.line-handle[data-line-handle=middle]{cursor:grab}
.line-handle[data-line-handle=middle]::after{border:0;background:#b9a8f4}
.canvas-toolbar{position:absolute;z-index:1;top:10px;left:10px;display:flex;gap:10px;pointer-events:none}
.canvas-toolbar [role=group]{display:flex;gap:4px}
.canvas-toolbar button{width:44px;height:44px;padding:0;pointer-events:auto}
.canvas-toolbar svg{width:21px;height:21px}
.add-objects{position:absolute;z-index:1;left:max(16px,env(safe-area-inset-left));bottom:max(16px,env(safe-area-inset-bottom))}
#add-object-toggle{width:52px;height:52px;padding:0;border-radius:50%;box-shadow:0 3px 12px #0003}
#add-object-toggle[aria-expanded=true]{background:var(--soft)}
.add-objects svg{width:23px;height:23px}
#add-object-panel{position:absolute;left:0;bottom:calc(100% + 10px);width:192px;max-width:calc(100vw - 32px);max-height:50dvh;overflow:auto;padding:10px;border:1px solid var(--line);border-radius:var(--radius);background:var(--white);box-shadow:0 3px 12px #0003}
#add-object-panel h2{margin:2px 8px 6px;font-size:15px}
#add-object-panel button{justify-content:flex-start;width:100%;min-height:44px;padding:6px 8px;border-radius:8px;font-size:13px}
.board:has(.add-objects:not([hidden])) .properties-toggle{max-width:calc(100% - max(16px,env(safe-area-inset-right)) - max(16px,env(safe-area-inset-left)) - 184px)}
.prototype #diagram{align-items:flex-start}
.prototype #diagram svg{width:min(var(--scale),var(--prototype-width));height:auto;max-width:none;margin:auto}
.welcome{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:13px;padding:18px;text-align:center;pointer-events:none}
.welcome-mark{width:142px;margin-bottom:3px}
.welcome-mark svg{display:block;width:100%}
.welcome p{margin:0;max-width:290px;color:var(--muted)}
.welcome .welcome-title{font:normal clamp(39px,6vw,65px)/1.05 Georgia,serif;letter-spacing:-.06em;color:var(--primary)}
.welcome button{pointer-events:auto;margin-top:5px}
.modes{display:inline-flex;gap:3px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--white);box-shadow:0 3px 9px #00000010}
.modes button{min-height:32px;min-width:32px;border-radius:6px}
.modes button{padding:5px 8px;font-size:12px;white-space:nowrap}
.modes button:hover{background:var(--soft)}
.modes button[aria-pressed=true]{background:var(--primary);color:var(--white)}
.agent{z-index:2;display:flex;flex-direction:column;min-height:0;background:var(--white);border-left:1px solid var(--line);box-shadow:-7px 0 20px #00000010}
.sidebar-icon{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:9px;background:var(--soft);color:var(--primary)}
.object-tree .sidebar-icon{display:none}
a.outline,a.quiet{text-decoration:none}
.quiet{min-height:32px;padding:4px 8px;border-radius:6px;color:var(--muted);font-size:12px}
.close-chat{align-self:flex-end;flex:none;margin:6px 8px 0;font-size:16px;min-width:36px}
.account-menu{position:relative}
.account-toggle{width:var(--account-button-size);cursor:pointer;list-style:none}
.account-toggle::-webkit-details-marker{display:none}
.account-panel{position:absolute;top:calc(100% + 8px);right:0;width:min(280px,calc(100vw - 20px));padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--white);box-shadow:0 6px 20px #0002}
.account-panel h2{margin:0;font-size:15px}
.account-panel .workspace-label{margin:6px 0;font-size:13px;white-space:normal;overflow-wrap:anywhere}
.account-actions{display:flex;flex-wrap:wrap;gap:6px}
.account-actions:not(:has(:not([hidden]))){display:none}
.workspace-label{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:11px}
.workspace-label:empty{display:none}
#chat-selection:not([hidden]){display:inline-flex;align-items:center;gap:4px;max-width:100%;padding-left:8px;border:1px solid var(--line);border-radius:7px;background:var(--paper)}
#clear-chat-selection{flex:none}
.agent-scroll{flex:1;min-height:0;overflow:auto;padding:14px}
.conversation{display:flex;flex-direction:column;gap:8px}
.message{margin:0;max-width:94%;padding:8px 10px;border-radius:9px;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
.message.assistant{align-self:flex-start;background:var(--soft)}
.message.user{align-self:flex-end;background:var(--paper);border:1px solid var(--line)}
.message-object{display:block;margin-bottom:3px;color:var(--muted);font-size:11px}
.board-heading{display:flex;align-items:center;justify-content:center;gap:10px;min-width:0}
.composer{padding:9px 13px max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--line)}
.input-wrap{margin-top:8px;border:1px solid var(--line);border-radius:9px;background:var(--paper);display:flex;flex-direction:column}
.input-wrap:focus-within{border-color:var(--primary)}
textarea{width:100%;height:74px;min-height:60px;max-height:22dvh;padding:8px 10px;border:0;resize:vertical;background:transparent;line-height:1.45}
.input-wrap textarea:focus{outline:none}
.input-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0 5px 5px}
#queue-count{margin-right:auto;padding-left:5px;font-size:12px;color:var(--muted)}
#queue-count:empty{display:none}
.generation,.provider-head,.provider-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}
.generation{margin-top:8px;color:var(--muted);font-size:12px}
.generation select,.provider-form input,.provider-form select,#provider-choice{min-width:0;background:var(--paper);border:1px solid var(--line);border-radius:7px;padding:5px 7px;font:inherit}
.generation select{max-width:76%}
.ai-status{margin:5px 0;color:var(--muted);font-size:12px}
.ai-status:empty{display:none}
#generate{position:relative;display:grid;place-items:center;width:44px;height:44px;flex:none;padding:0;border:0;border-radius:8px;background:var(--primary);color:#fff}
#generate svg{width:20px;height:20px}
#generate [data-icon=stop] svg{width:14px;height:14px;fill:currentColor;stroke:none}
#generate.is-working::before{content:'';position:absolute;inset:5px;border:2px solid #ffffff50;border-top-color:currentColor;border-radius:50%;animation:generate-spin .8s linear infinite;pointer-events:none}
@keyframes generate-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#generate.is-working::before,.chat-toggle.is-working::after{animation:none}}
#generate:hover:not(:disabled){background:#383838}
.admin-page{height:auto;min-height:100dvh;overflow:auto}
.admin-page .top{--toolbar-inset:18px;min-height:62px;padding-block:9px}
.admin-page .top-right{min-width:0}
@media(max-width:700px){.admin-page .top{--toolbar-inset:10px;min-height:54px;padding-block:7px}}
@media(max-width:480px){.admin-page .top{--toolbar-inset:8px}.admin-page .top-right{gap:4px}}
.admin-page #login{white-space:nowrap}
.admin-content{display:block;width:min(100%,560px);margin:0 auto;padding:24px 16px}
.admin-content h1{margin:0;font-size:24px}
#add-provider{width:42px;height:42px;font-size:24px;line-height:1}
#add-provider[aria-expanded=true]{background:var(--soft)}
#provider-picker{margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:var(--radius)}
#provider-picker label,.provider-form label{display:grid;gap:2px;font-size:12px}
#new-provider-form .provider-form{margin-top:10px;padding-bottom:0}
.provider-info{color:var(--muted);font-size:13px;margin:8px 0 14px}
.provider-form{display:grid;gap:7px;padding:10px 0;border-top:1px solid var(--line)}
.provider-actions{flex-wrap:wrap}
.provider-form input,.provider-form select,#provider-choice{width:100%;min-height:36px;font-size:16px}
.provider-state{color:var(--muted);font-size:12px}
@media(prefers-reduced-motion:no-preference){
  .object-tree{
    transform-origin:bottom right;
    transition:transform 180ms ease,display 180ms allow-discrete;
  }
  .object-tree[hidden]{transform:translateY(8px) scale(.98);pointer-events:none}
  @starting-style{
    .object-tree:not([hidden]){transform:translateY(8px) scale(.98)}
  }
}
@media(max-height:540px){.welcome-mark{width:90px}.welcome{gap:7px}.composer{padding-top:3px}.agent-scroll{padding-block:7px}textarea{height:55px;min-height:42px}}

#project-dialog{width:min(460px,calc(100% - 32px));max-height:calc(100dvh - 32px);padding:20px;border:1px solid var(--line);border-radius:var(--radius);color:var(--ink);background:var(--white)}
#project-dialog::backdrop{background:#0005}
.project-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.project-heading h2{margin:0;font-size:18px}
#close-projects{width:36px;min-height:36px}
.project-actions{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
#project-title{flex:1;min-width:0;padding:6px 10px;border:1px solid var(--line);border-radius:8px;font:inherit}
#project-status{margin:8px 0;color:var(--muted);overflow-wrap:anywhere}

#save-project{width:var(--account-button-size);padding:0}
#save-project[data-state=saving]{opacity:.65}
#save-project[data-state=error]{border-color:#bb4545;color:#a72f2f}

.board:has(#object-properties:not([hidden])) .edit-actions{display:none}

#agent-chat{display:flex;flex:1;flex-direction:column;min-height:0}
.property-palette{display:flex;flex-wrap:wrap;align-items:center;gap:5px}
.property-palette > :is(.property-swatch,.property-color){width:30px;height:30px;border-radius:7px}
.property-swatch{min-height:0;padding:0;border:1px solid #0002;background:var(--swatch)}
.property-swatch.transparent{background:repeating-conic-gradient(#e8e8e8 0% 25%,#fff 0% 50%) 0 0/12px 12px}
.property-swatch[aria-pressed=true],.property-color.is-custom{outline:2px solid #6255c7;outline-offset:1px}
.property-palette > .property-color{margin-inline-start:5px;padding:2px}
.stroke-sample{display:block;width:18px;border-top:1px solid currentColor}
.stroke-sample.medium{border-width:2px}
.stroke-sample.thick{border-width:4px;border-radius:4px}
.stroke-sample.dotted{border-top:2px dotted currentColor}
.property-text-input input[type=range]{height:24px;min-height:0;margin:0;padding:0;border:0;accent-color:#6255c7}
.property-slider-heading{display:flex;justify-content:space-between;gap:8px}

#diagram :is(.arrow-hit,.line-hit){fill:none;stroke:transparent;stroke-width:14;vector-effect:non-scaling-stroke;pointer-events:stroke}
#diagram [data-block^=link-]{cursor:pointer}
#diagram [data-block]:is([aria-pressed=true],:focus-visible) > .arrow-hit{stroke:#4765d055}
.opacity-scale{display:flex;justify-content:space-between;padding-inline:2px;font-size:12px;color:var(--muted)}
.property-tools-vertical{margin-top:8px}
.property-tile:has(input[name=fontSize]){font-size:16px}

#task-sidebar{grid-area:palette;align-self:start;min-width:0;max-height:100%;overflow:auto;overscroll-behavior:contain;padding:12px 2px 12px 12px}
#task-panel,#task-selection{padding:12px;border:1px solid var(--line);border-radius:var(--radius);background:var(--white);box-shadow:0 2px 8px #00000012}
#task-panel h2{margin:0;font-size:15px}
#task-panel p{margin:6px 0 10px;color:var(--muted);font-size:12px}
#task-panel #task-feedback{margin:8px 0 0}
#task-feedback[data-solved=true]{color:#1e6947;font-weight:700}
.task-cards{display:flex;flex-wrap:wrap;gap:5px}
.task-cards button{min-height:34px;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:start;cursor:grab}
.task-cards button[aria-pressed=true]{border-color:#6255c7;background:#eeebff;color:#352584}
.task-option{display:flex;align-items:center;gap:5px;margin:10px 0 6px;font-size:13px;cursor:pointer}
.task-actions{display:flex;align-items:center;gap:7px;margin-top:10px}
#task-check{color:#fff;background:var(--primary)}
#task-check:hover{background:#383838}
.task-active .board{display:grid;grid-template:"palette drawing" minmax(0,1fr)/var(--task-sidebar-width,clamp(148px,19vw,230px)) minmax(0,1fr)}
.task-active .canvas{grid-area:drawing}
.task-active :is(#properties-sidebar,.edit-actions,.object-toggle,.properties-toggle,#show-tree,#object-tree){display:none}
.task-active [data-task-slot]{cursor:pointer;outline:none}
.task-active [data-task-slot] .task-slot-shape{pointer-events:all}
.task-active [data-task-slot]:is(:hover,:focus-visible,[aria-pressed=true]) .task-slot-shape{stroke:#6255c7;stroke-width:2.5}
.task-active #diagram svg{overflow:visible}
.task-active [data-task-slot]{cursor:grab;user-select:none}
.task-active #diagram.task-moving-slot,.task-active #diagram.task-moving-slot [data-task-slot]{cursor:grabbing}
#task-panel.task-return-target{outline:2px solid #6255c7;outline-offset:-2px}
#task-selection{position:absolute;z-index:2;inset:auto 0 12px;margin-inline:auto;width:min(420px,calc(100% - 32px));max-height:55%;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere}
#task-selection header{display:flex;align-items:center;justify-content:space-between;gap:8px}
#task-selection h3{margin:0;font-size:14px}
#task-close{flex:none;width:32px;height:32px;padding:0;border-radius:8px}
#task-selection:has(h3[hidden]) #task-close{position:absolute;top:8px;right:8px}
#task-selection:has(h3[hidden]) #task-selection-description{padding-right:32px}
#task-selection-description{margin:4px 0;color:var(--muted);white-space:pre-wrap}
#task-remove{margin-top:8px}
.task-active [data-task-edge]{cursor:pointer;outline:none}
.task-active .task-edge-slot{fill:#fff;stroke:#6255c7;stroke-dasharray:3 2}
.task-active .task-edge-hint{stroke:transparent;stroke-width:5}
.task-active [data-task-edge]:is(:hover,:focus-visible,[aria-pressed=true]) .task-edge-hint{stroke:#6255c7}
.task-active [data-task-edge]:is(:hover,:focus-visible) .task-edge-slot{fill:#eeebff}
[data-task-route-handle]{visibility:hidden;fill:#fff;stroke:#6255c7;stroke-width:2;cursor:ns-resize;touch-action:none}
[data-task-route-handle="x"]{cursor:ew-resize}
[data-task-edge][aria-pressed=true] [data-task-route-handle]{visibility:visible}

.task-cards [data-task-card^="links:"] > span{color:#6255c7;font-size:17px;line-height:1}
.task-active .task-edge-guide{stroke:#77718d;stroke-dasharray:5 5}
.task-active [data-task-correct] .task-slot-shape{stroke-width:2}
.task-active [data-task-correct] text{fill:#145332}
.task-fill-cover{visibility:hidden;stroke:none;pointer-events:none;transform-box:fill-box}
.task-active .task-verified-arrow{fill:none;stroke:#218653;stroke-width:2.7;pointer-events:none}
.task-checking .task-verified-arrow{stroke-dasharray:1;animation:task-trace .55s ease-out both}
.task-checking .task-fill-cover{animation:task-fill .45s ease-out}
@keyframes task-trace{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes task-fill{
  from{visibility:visible;clip-path:inset(0)}
  to{visibility:visible;clip-path:inset(0 0 100% 0)}
}
.task-victory{position:absolute;z-index:1;inset:0;display:grid;place-items:center;pointer-events:none;animation:task-victory-fade 1.65s linear both}
.task-victory-badge{display:grid;place-items:center;width:62px;height:62px;border:3px solid #fff;border-radius:50%;background:#218653;color:#fff;box-shadow:0 4px 24px #164f3a45;font-size:32px;animation:task-victory-pop .42s .4s cubic-bezier(.18,.8,.35,1.35) both}
.task-victory i{position:absolute;width:8px;height:12px;border-radius:2px;background:#4db67a;animation:task-confetti .8s .5s ease-out both}
.task-victory i:nth-child(3n){background:#edb940}
.task-victory i:nth-child(3n + 1){background:#8b76df}
@keyframes task-victory-pop{from{opacity:0;transform:scale(.4)}to{opacity:1;transform:scale(1)}}
@keyframes task-victory-fade{0%,76%{opacity:1}100%{opacity:0}}
@keyframes task-confetti{
  from{opacity:1;transform:scale(.5)}
  75%{opacity:1}
  to{opacity:0;transform:translate(var(--x),var(--y)) rotate(180deg)}
}
@media(prefers-reduced-motion:reduce){
  .task-checking .task-verified-arrow,.task-checking .task-fill-cover{animation:none}
  .task-victory{visibility:hidden}
}

.catalog-page a{color:inherit;text-decoration:none}
.top-nav{gap:clamp(12px,2vw,20px)}
.top-nav a{display:inline-flex;align-items:center;min-height:44px;color:var(--muted);font-size:13px;font-weight:650;text-decoration:none;white-space:nowrap}
.top-nav a:hover,.top-nav a[aria-current="page"]{color:var(--ink);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:6px}
.catalog-page{--toolbar-inset:clamp(16px,4vw,48px)}
.catalog-page .top{min-height:62px;flex-wrap:wrap;padding-block:8px}
.catalog-page .top-left{flex-wrap:wrap;gap:0 16px;min-width:0}
.catalog-page .account-menu{margin-inline-start:auto}
.catalog-main{flex:1;min-height:0;overflow:auto}
.catalog-content{width:min(100%,1024px);margin-inline:auto;padding:clamp(20px,5vw,56px) var(--toolbar-inset)}
.catalog-heading{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.catalog-heading h1{margin:0;font-size:clamp(26px,4vw,38px);line-height:1.15}
#catalog-status{color:var(--muted)}
#catalog-status:empty,.catalog-list:empty{display:none}
.catalog-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:10px;margin:24px 0;padding:0;list-style:none}
.catalog-list a{display:flex;align-items:center;min-height:76px;height:100%;padding:14px 16px;border:1px solid var(--line);border-radius:var(--radius);background:var(--white);font-weight:650;overflow-wrap:anywhere}
.catalog-list a:hover{border-color:#999;background:#fafafa}
.catalog-list .project-card{position:relative;min-width:0}
.catalog-list .project-card a{padding-inline-end:90px}
.project-delete{position:absolute;top:50%;right:8px;transform:translateY(-50%);min-height:36px;padding:4px 8px;border-radius:7px;color:var(--muted);font-size:12px}
.project-delete:hover{color:#a72f2f}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 16px;
  margin: 24px 0;
}
.plan-card {
  padding: 20px;
  border: 1px solid currentColor;
  border-radius: 14px;
}
.plan-card h2 { margin-top: 0; }
.plan-card ul { padding-left: 20px; line-height: 1.65; }
.plan-card-plus { background: rgb(128 128 128 / 7%); }
