:root{color-scheme:dark;--bg:#080b12;--panel:#0e1420;--panel2:#121a28;--border:#263249;--text:#e8edf7;--muted:#8c98ad;--active:#8b5cf6;--execution:#32c5ff;--inertia:#ff9f43;--rest:#4ade80;--completed:#4ade9b;--needs:#ff6177;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-size:14px}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.4;cursor:not-allowed}.app{display:flex;min-height:100vh}.panel{background:var(--panel);border:1px solid var(--border);box-shadow:0 12px 38px #0002}.sidebar{width:240px;min-width:240px;min-height:100vh;border-width:0 1px 0 0;padding:24px 15px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}.brand{display:flex;align-items:center;gap:11px;margin:2px 8px 30px}.brand-mark{display:grid;place-items:center;width:36px;height:36px;border-radius:12px;background:#8b5cf622;color:#aa86ff;font-size:24px}.brand strong{font-size:14px;letter-spacing:.16em}.brand small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.primary{background:linear-gradient(120deg,#7750e5,#9f69f9);color:white;border:1px solid #a278fb;border-radius:10px;padding:10px 14px;font-weight:650;box-shadow:0 6px 20px #8b5cf633}.primary:hover{filter:brightness(1.13)}.wide{width:100%}.sidebar-label,.eyebrow{font-size:10px;font-weight:800;letter-spacing:.15em;color:#7f90a9}.sidebar-label{margin:31px 10px 9px}.filter-list,.root-list{display:grid;gap:3px}.filter-list button,.root-list button{width:100%;background:transparent;border:0;border-radius:9px;color:#aab5c6;text-align:left;padding:9px 11px;display:flex;justify-content:space-between;gap:8px}.filter-list button:hover,.root-list button:hover,.filter-list button.selected{background:#20223a;color:#e7dfff}.filter-list span{color:var(--muted)}.root-list button{align-items:center}.root-list button:before{content:"◆";font-size:9px;color:#8b5cf6}.root-list button span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.root-list small{color:var(--muted)}.sidebar-bottom{margin-top:auto;display:grid;gap:7px}.sidebar-bottom p{color:#627086;font-size:11px;line-height:1.5;margin:6px 4px}.ghost{background:#151e2d;border:1px solid #2a374c;border-radius:9px;color:#bac6d8;padding:8px 11px}.ghost:hover{border-color:#697a9c;color:white;background:#1d293a}.main{min-width:0;flex:1;padding:19px 22px 25px;max-width:1900px}.topbar{border-radius:15px;display:flex;justify-content:space-between;align-items:center;padding:14px 20px;margin-bottom:14px}.title-block h1{font-size:20px;margin:2px 0 0;letter-spacing:-.025em}.top-actions{display:flex;gap:8px}.mode-panel{border-radius:15px;display:flex;align-items:center;gap:22px;justify-content:space-between;padding:15px 20px;min-height:94px;position:relative;overflow:hidden}.mode-panel:before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:var(--active)}.mode-panel.mode-execution:before{background:var(--execution)}.mode-panel.mode-inertia{background:linear-gradient(110deg,#211b1c,var(--panel) 36%)}.mode-panel.mode-inertia:before{background:var(--inertia)}.mode-panel.mode-rest:before{background:var(--rest)}.mode-left{min-width:230px}.mode-live{display:flex;align-items:center;gap:10px;margin-top:5px}.mode-live strong{font-size:19px;letter-spacing:.05em}.mode-live #mode-timer{font-variant-numeric:tabular-nums;font-size:20px;color:#c7d3e5;margin-left:6px}.mode-dot{width:10px;height:10px;border-radius:50%;background:var(--active);box-shadow:0 0 12px currentColor}.mode-task{font-size:11px}.muted{color:var(--muted)}.mode-controls{display:flex;flex-wrap:wrap;justify-content:center;gap:7px}.mode-controls button{background:#162031;border:1px solid #2b3952;color:#c4cede;padding:9px 12px;border-radius:9px}.mode-controls button:hover{filter:brightness(1.25)}.mode-controls button.selected{background:#8b5cf622;border-color:var(--active);color:#d9c8ff}.mode-controls button[data-mode=execution].selected{background:#32c5ff20;border-color:var(--execution);color:#aeeaff}.mode-controls button[data-mode=inertia].selected{background:#ff9f4320;border-color:var(--inertia);color:#ffd1a6}.mode-controls button[data-mode=rest].selected{background:#4ade8020;border-color:var(--rest);color:#c2ffd4}.inertia-alert{color:#ffd0a8;white-space:nowrap;font-size:12px}.inertia-alert .ghost{display:block;margin-top:5px;color:#ffbd83;border-color:#835037}.tabs{display:flex;gap:5px;border-bottom:1px solid var(--border);margin:17px 0 15px}.tabs button{background:transparent;color:var(--muted);border:0;border-bottom:2px solid transparent;padding:11px 15px;font-weight:650}.tabs button.active{color:#d9c8ff;border-color:var(--active)}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:14px;height:calc(100vh - 255px);min-height:560px}.graph-wrap{border-radius:15px;min-width:0;display:flex;flex-direction:column;overflow:hidden}.graph-toolbar{height:48px;padding:8px 15px;display:flex;justify-content:space-between;align-items:center;gap:8px;border-bottom:1px solid var(--border);color:var(--muted);font-size:12px}.graph-toolbar>div{display:flex;align-items:center;gap:5px;white-space:nowrap}.graph-toolbar .ghost{padding:5px 9px}.graph-toolbar .icon{width:28px;font-size:17px;padding:1px}#zoom-label{width:42px;text-align:center;font-variant-numeric:tabular-nums}#graph-viewport{position:relative;flex:1;overflow:hidden;cursor:grab;background-color:#0b101a;background-image:radial-gradient(#2b3547 1px,transparent 1px);background-size:24px 24px;outline:0}#graph-viewport.panning{cursor:grabbing}#graph-viewport.connecting{cursor:crosshair}#graph-world{position:absolute;left:0;top:0;width:1px;height:1px;transform-origin:0 0}#edge-svg{position:absolute;left:0;top:0;width:4000px;height:3000px;overflow:visible;pointer-events:none}#edge-svg marker path{fill:#506783}#arrow-active path{fill:#8b5cf6!important}#arrow-completed path{fill:#4ade9b!important}.edge-hit{fill:none;stroke:transparent;stroke-width:18;pointer-events:stroke;cursor:pointer}.edge-visible{fill:none;stroke:#506783;stroke-width:2.2;pointer-events:none}.edge-visible.active_path{stroke:#8b5cf6;stroke-width:2.8;stroke-dasharray:9 7;animation:flow 1s linear infinite;filter:drop-shadow(0 0 4px #8b5cf666)}.edge-visible.completed{stroke:var(--completed)}.edge-visible.selected{stroke-width:4;filter:drop-shadow(0 0 5px #fff8)}@keyframes flow{to{stroke-dashoffset:-16}}#nodes-layer{position:absolute;inset:0}.node{position:absolute;width:186px;min-height:69px;padding:11px 12px;background:#172234;border:1px solid #3a4a65;border-radius:12px;box-shadow:0 9px 20px #0005;cursor:grab;user-select:none;transition:border-color .15s,box-shadow .15s,opacity .15s}.node:hover{border-color:#8ca0c3;box-shadow:0 0 17px #7496c331}.node.selected{border-color:#9b78ff;box-shadow:0 0 0 2px #8b5cf633,0 0 24px #8b5cf655}.node.needs_action{border-color:#ff6177;box-shadow:0 0 16px #ff617733}.node.completed{opacity:.7}.node.dim{opacity:.25}.node.root{width:200px;min-height:80px;background:#1c2440}.node-title{font-weight:700;line-height:1.3;overflow-wrap:anywhere}.node-title .node-icon{margin-right:4px}.node-sub{font-size:11px;color:#9caec4;margin-top:8px}.node.needs_action .node-sub{color:#ff9dad}.node.completed .node-sub{color:#8de7bc}.node.quick-add{padding:9px}.node.quick-add input{width:100%;background:#0e1420;border:1px solid #8b5cf6;border-radius:6px;padding:7px;color:white}.graph-legend{height:39px;display:flex;align-items:center;gap:16px;padding:0 15px;border-top:1px solid var(--border);color:#90a0b5;font-size:11px;flex-wrap:wrap}.graph-legend span{white-space:nowrap}.legend-dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:5px}.legend-dot.active{background:var(--active)}.legend-dot.needs{background:var(--needs)}.legend-line{display:inline-block;width:17px;border-top:2px solid;margin-right:5px;vertical-align:middle}.legend-line.path{color:var(--active);border-style:dashed}.legend-line.done{color:var(--completed)}.inspector{border-radius:15px;overflow:auto;padding:17px}.inspector h2{font-size:18px;margin:7px 0 18px}.inspector label,.modal label{display:block;font-size:11px;color:#91a0b8;font-weight:650;margin:13px 0}.inspector input,.inspector textarea,.inspector select,.modal input:not([type=checkbox]),.modal textarea,.modal select{display:block;width:100%;background:#0c1320;color:var(--text);border:1px solid #31405a;border-radius:8px;padding:9px 10px;margin-top:6px;outline:0}.inspector input:focus,.inspector textarea:focus,.inspector select:focus,.modal input:focus,.modal textarea:focus{border-color:var(--active)}.inspector textarea{resize:vertical;min-height:72px}.inspector-section{margin-top:22px;padding-top:16px;border-top:1px solid var(--border)}.inspector-section .eyebrow{display:block;margin-bottom:10px}.inspector-list{display:grid;gap:5px}.inspector-list button,.edge-row{background:#151f2e;border:1px solid #29384d;border-radius:8px;padding:8px;color:#c2cee0;text-align:left;width:100%}.edge-row{display:flex;align-items:center;gap:5px;margin:5px 0}.edge-row button{border:0;background:none;color:#a8b7cd;padding:3px;cursor:pointer}.edge-row button:hover{color:white}.edge-row .edge-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.edge-row select{width:98px;padding:4px;margin:0;font-size:11px}.danger{color:#ff8799!important}.inspector-actions{display:flex;gap:6px;flex-wrap:wrap}.inspector-actions button{font-size:12px}.inspector-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#7d8da5}.inspector-empty .empty-icon{font-size:36px;color:#7b60be}.inspector-empty h2{color:#e8edf7;margin:13px 0 2px}.inspector-empty p{line-height:1.5;max-width:220px}.time-row{display:flex;justify-content:space-between;margin:9px 0;color:#b7c4d7}.time-row strong{color:var(--text)}.analytics{padding:7px 0 30px}.analytics-head{display:flex;justify-content:space-between;align-items:end;gap:15px;margin-bottom:18px}.analytics-head h2{font-size:23px;margin:3px 0 0}.segmented{display:flex;background:#111b29;border:1px solid var(--border);border-radius:10px;padding:4px;gap:2px;flex-wrap:wrap}.segmented button{background:none;border:0;border-radius:7px;color:#91a0b7;padding:7px 10px;font-size:12px}.segmented button.active{color:white;background:#34425a}.analytics-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:14px}.analytics-main,.analytics-side{display:grid;align-content:start;gap:14px}.analytics-card{border-radius:15px;padding:19px}.card-top{display:flex;justify-content:space-between;align-items:center}.analytics-card h2{font-size:25px;margin:9px 0 5px}.analytics-card p{line-height:1.5}.score{color:#b7c7e0;font-size:12px}.score strong{font-size:17px;color:white}.stacked-bar{height:23px;display:flex;overflow:hidden;border-radius:7px;background:#1c293b;margin:20px 0 13px}.stacked-bar div{height:100%;min-width:0;transition:width .3s}.stacked-bar .active{background:var(--active)}.stacked-bar .execution{background:var(--execution)}.stacked-bar .inertia{background:var(--inertia)}.profile-values{display:flex;gap:16px;flex-wrap:wrap}.profile-values span{font-size:12px;color:#b4c2d5}.profile-values b{color:white}.profile-values i{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:5px}.rest-separate{margin-top:15px;color:#a8e8bc;font-size:12px}.disclaimer{font-size:11px;color:#7989a0;border-top:1px solid var(--border);padding-top:12px;margin:18px 0 0}.link-button{border:0;background:none;color:#a78bfa;font-size:12px}.target-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:16px}.target-item{background:#151f2e;border:1px solid #29374b;border-radius:10px;padding:13px}.target-item strong{display:block;font-size:22px;margin:8px 0 3px}.target-item small{display:block;color:#91a0b7}.target-item .target-status{margin-top:8px;line-height:1.4}.target-status.good{color:#84e5b5}.target-status.up,.target-status.down{color:#ffbc82}.dynamics-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:15px 0}.metric{background:#151f2e;border-radius:9px;padding:11px}.metric small{display:block;color:#90a0b6;font-size:11px}.metric strong{display:block;margin-top:5px;font-size:18px}.metric em{display:block;font-size:11px;font-style:normal;margin-top:3px;color:#b9a3ff}.outcome-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;border-top:1px solid var(--border);padding-top:14px}.outcome-grid .metric strong{font-size:20px}.analytics-side .time-row{border-bottom:1px solid #253247;padding-bottom:8px}.analytics-side .time-row:last-child{border:0}.today-bar{display:flex;height:8px;border-radius:5px;overflow:hidden;background:#1d2939;margin:15px 0}.today-bar span{display:block}.insight{color:#aebed1;line-height:1.5;font-size:12px;margin-top:14px}.transition-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:14px}.transition-cell{background:#151f2e;border-radius:8px;text-align:center;padding:10px 3px}.transition-cell small{display:block;color:#8799af;font-size:10px}.transition-cell strong{display:block;font-size:17px;margin-top:4px}.transition-insights{display:flex;gap:16px;flex-wrap:wrap;color:#aebed1;font-size:12px;margin-top:16px}.timeline-item{display:flex;align-items:center;gap:8px;border-bottom:1px solid #233044;padding:9px 0;font-size:12px}.timeline-item:last-child{border:0}.timeline-item time{color:#92a2b8;font-variant-numeric:tabular-nums;min-width:83px}.timeline-item strong{font-size:11px}.timeline-item small{color:#75849a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.timeline-empty{color:#8b99ad;margin-top:13px;font-size:12px}.modal{width:min(440px,calc(100vw - 30px));background:#111a29;border:1px solid #34435b;border-radius:16px;color:var(--text);padding:21px;box-shadow:0 24px 80px #000a}.modal::backdrop{background:#03060ab9}.modal.small{width:min(380px,calc(100vw - 30px))}.modal-head{display:flex;justify-content:space-between;align-items:start}.modal-head h2{margin:4px 0 13px;font-size:21px}.modal-head .ghost{padding:4px 8px}.modal textarea{resize:vertical}.modal .check-row{display:flex;align-items:center;gap:7px;color:#c7d2e3;font-size:12px}.modal .check-row input{accent-color:var(--active)}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:22px}.range-row{display:grid;grid-template-columns:1fr 65px 65px;align-items:end;gap:8px}.range-row label{margin:7px 0}.range-row input{text-align:center}.form-error{color:#ff8da0;font-size:12px}#toast{position:fixed;bottom:21px;left:50%;transform:translateX(-50%) translateY(15px);background:#25344a;border:1px solid #61718c;border-radius:9px;padding:10px 15px;color:white;opacity:0;pointer-events:none;transition:.2s;z-index:10;box-shadow:0 12px 30px #0008}#toast.show{opacity:1;transform:translateX(-50%)}[hidden]{display:none!important}@media(max-width:1100px){.workspace,.analytics-grid{grid-template-columns:minmax(0,1fr) 270px}.sidebar{width:205px;min-width:205px}.mode-panel{flex-wrap:wrap}.mode-controls{justify-content:flex-end}.inertia-alert{margin-left:auto}}@media(max-width:850px){.app{display:block}.sidebar{position:static;width:auto;height:auto;min-height:0;padding:14px;display:block}.brand{display:inline-flex;margin:0 15px 12px 0}.sidebar>.primary{width:auto}.sidebar-label,.filter-list,.root-list,.sidebar-bottom{display:none}.main{padding:12px}.workspace,.analytics-grid{display:block;height:auto}.graph-wrap{height:65vh;min-height:440px}.inspector{margin-top:12px;min-height:200px}.analytics-side{margin-top:14px}.topbar{padding:12px}.mode-panel{gap:13px}.mode-controls{justify-content:flex-start}.analytics-head{display:block}.segmented{margin-top:12px}.target-grid,.dynamics-grid,.outcome-grid{grid-template-columns:repeat(2,1fr)}}
#inertia-options{display:flex;gap:5px;margin-top:6px}#inertia-options button{background:#251e1b;border:1px solid #75472e;color:#ffd0a8;border-radius:7px;padding:5px 8px;font-size:11px}.inertia-big{font-size:12px;color:#97a8bc;margin:15px 0}.inertia-big strong{font-size:25px;color:#ffbd7f;margin-right:5px}
#graph-viewport{touch-action:none}
@media(min-width:851px){.workspace{grid-template-columns:minmax(0,1fr) 270px;height:calc(100vh - 215px);min-height:560px}}#graph-wrap:fullscreen{width:100vw;height:100vh!important;max-width:none;border-radius:0;box-shadow:none}#graph-wrap:fullscreen #graph-viewport{min-height:0}#graph-wrap:fullscreen .graph-toolbar{height:54px;flex:none}#graph-wrap:fullscreen .graph-legend{height:44px;flex:none}
html[data-theme="light"]{color-scheme:light;--bg:#f4f5f7;--panel:#ffffff;--panel2:#f8f9fb;--border:#e1e4e9;--text:#24272d;--muted:#6d7480;--active:#7654d4;--execution:#0783aa;--inertia:#c86816;--rest:#21854d;--completed:#238454;--needs:#d94b60}
html[data-theme="light"] body{background:var(--bg);color:var(--text)}
html[data-theme="light"] .panel{box-shadow:0 5px 18px #1822300a}
html[data-theme="light"] .brand-mark{background:#f0ebff;color:#7250ce}
html[data-theme="light"] .sidebar-label,html[data-theme="light"] .eyebrow{color:#737c89}
html[data-theme="light"] .filter-list button,html[data-theme="light"] .root-list button{color:#505966}
html[data-theme="light"] .filter-list button:hover,html[data-theme="light"] .root-list button:hover,html[data-theme="light"] .filter-list button.selected{background:#f0edfa;color:#533ba1}
html[data-theme="light"] .filter-list span,html[data-theme="light"] .root-list small{color:#7b8491}
html[data-theme="light"] .ghost{background:#fff;border-color:#d8dde5;color:#4d5561}
html[data-theme="light"] .ghost:hover{background:#f3f4f6;border-color:#b9c0cb;color:#20242b}
html[data-theme="light"] .mode-panel.mode-inertia{background:linear-gradient(110deg,#fff8f1,#fff 48%)}
html[data-theme="light"] .mode-live #mode-timer{color:#414853}
html[data-theme="light"] .mode-controls button{background:#f7f8fa;border-color:#dce1e8;color:#505966}
html[data-theme="light"] .mode-controls button.selected{background:#f0ebff;border-color:var(--active);color:#583ca7}
html[data-theme="light"] .mode-controls button[data-mode=execution].selected{background:#e8f7fb;border-color:var(--execution);color:#006b8a}
html[data-theme="light"] .mode-controls button[data-mode=inertia].selected{background:#fff1e4;border-color:var(--inertia);color:#a44e08}
html[data-theme="light"] .mode-controls button[data-mode=rest].selected{background:#eaf7ed;border-color:var(--rest);color:#176d3c}
html[data-theme="light"] .inertia-alert{color:#a44e08}
html[data-theme="light"] .inertia-alert .ghost{color:#a44e08;border-color:#e9c6a6;background:#fff9f3}
html[data-theme="light"] .tabs button.active{color:#583ca7}
html[data-theme="light"] #graph-viewport{background-color:#fbfcfd;background-image:radial-gradient(#d9dee7 1px,transparent 1px)}
html[data-theme="light"] #edge-svg marker path{fill:#8994a4}
html[data-theme="light"] #arrow-active path{fill:#7654d4!important}
html[data-theme="light"] #arrow-completed path{fill:#238454!important}
html[data-theme="light"] .edge-visible{stroke:#9ba5b3}
html[data-theme="light"] .edge-visible.active_path{stroke:#7654d4;filter:drop-shadow(0 0 3px #7654d433)}
html[data-theme="light"] .edge-visible.completed{stroke:#238454}
html[data-theme="light"] .node{background:#fff;border-color:#d9dee7;box-shadow:0 5px 14px #26324418;color:#24272d}
html[data-theme="light"] .node:hover{border-color:#9b8ac9;box-shadow:0 0 16px #7654d422}
html[data-theme="light"] .node.selected{border-color:#7654d4;box-shadow:0 0 0 2px #7654d422,0 5px 18px #26324418}
html[data-theme="light"] .node.root{background:#f1effb;border-color:#cfc5ed}
html[data-theme="light"] .node.needs_action{background:#fff8f8;border-color:#d94b60;box-shadow:0 0 13px #d94b6022}
html[data-theme="light"] .node-sub{color:#727d8d}
html[data-theme="light"] .graph-legend{color:#687384}
html[data-theme="light"] .inspector label,html[data-theme="light"] .modal label{color:#606a78}
html[data-theme="light"] .inspector input,html[data-theme="light"] .inspector textarea,html[data-theme="light"] .inspector select,html[data-theme="light"] .modal input:not([type=checkbox]),html[data-theme="light"] .modal textarea,html[data-theme="light"] .modal select{background:#fff;color:#24272d;border-color:#d8dee7}
html[data-theme="light"] .inspector-list button,html[data-theme="light"] .edge-row,html[data-theme="light"] .metric,html[data-theme="light"] .target-item,html[data-theme="light"] .transition-cell{background:#f6f7f9;border-color:#e1e5eb;color:#46505d}
html[data-theme="light"] .inspector-empty{color:#778190}
html[data-theme="light"] .inspector-empty h2{color:#24272d}
html[data-theme="light"] .segmented{background:#f0f1f4;border-color:#dce1e8}
html[data-theme="light"] .segmented button{color:#626c79}
html[data-theme="light"] .segmented button.active{color:#303540;background:#fff;box-shadow:0 1px 4px #1520301a}
html[data-theme="light"] .stacked-bar{background:#e8ebf0}
html[data-theme="light"] .profile-values span{color:#586271}
html[data-theme="light"] .profile-values b,html[data-theme="light"] .target-item strong,html[data-theme="light"] .metric strong,html[data-theme="light"] .transition-cell strong{color:#252a32}
html[data-theme="light"] .target-item small,html[data-theme="light"] .metric small,html[data-theme="light"] .transition-cell small{color:#687384}
html[data-theme="light"] .dynamics-grid .metric em{color:#674bb7}
html[data-theme="light"] .disclaimer{color:#727c89}
html[data-theme="light"] .today-bar{background:#e8ebf0}
html[data-theme="light"] .timeline-item time,html[data-theme="light"] .timeline-item small{color:#687384}
html[data-theme="light"] .transition-insights,html[data-theme="light"] .insight{color:#566170}
html[data-theme="light"] .modal{background:#fff;border-color:#d9dee6;color:#24272d;box-shadow:0 24px 80px #1a243344}
html[data-theme="light"] .modal .check-row{color:#414a56}
html[data-theme="light"] .modal .muted{color:#6d7480}
html[data-theme="light"] #inertia-options button{background:#fff4ea;border-color:#e8c6a5;color:#9e4d09}
html[data-theme="light"] #toast{background:#fff;border-color:#cdd4df;color:#24272d;box-shadow:0 8px 24px #1a243322}
.graph-toolbar{height:auto;min-height:58px;padding:8px 12px;flex-wrap:wrap;justify-content:space-between;gap:8px}.tool-palette{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.tool-button{display:inline-flex;align-items:center;gap:6px;background:#131c2a;border:1px solid #2a374c;border-radius:8px;color:#aebbd0;padding:7px 9px;font-size:12px;white-space:nowrap}.tool-button:hover{background:#1d293a;color:#fff}.tool-button.active{background:#29213e;border-color:#8b5cf6;color:#d9c8ff;box-shadow:0 0 0 1px #8b5cf622}.graph-controls{display:flex;align-items:center;gap:5px;white-space:nowrap}.graph-controls .ghost{padding:6px 9px}#graph-hint{flex:1;min-width:150px;text-align:center;color:var(--muted);font-size:11px}#graph-viewport[data-tool=cursor]{cursor:default}#graph-viewport[data-tool=task]{cursor:copy}#graph-viewport[data-tool=link]{cursor:crosshair}#graph-viewport[data-tool=hand]{cursor:grab}#graph-viewport[data-tool=hand].panning,#graph-viewport.panning{cursor:grabbing}#graph-wrap:fullscreen .graph-toolbar{height:auto;min-height:58px;flex:none}
html[data-theme="light"] .tool-button{background:#fff;border-color:#dce1e8;color:#505966}html[data-theme="light"] .tool-button:hover{background:#f3f4f7;color:#292e36}html[data-theme="light"] .tool-button.active{background:#f0ebff;border-color:#7654d4;color:#583ca7;box-shadow:0 0 0 1px #7654d422}
@media(max-width:850px){.graph-toolbar{justify-content:flex-start}.graph-toolbar #graph-hint{order:3;flex-basis:100%;text-align:left}.graph-controls{margin-left:auto}.tool-button{padding:6px 7px;font-size:11px}}
:root{--sleep:#a5b4fc}html[data-theme="light"]{--sleep:#6279bb}
.mode-panel.mode-sleep:before{background:var(--sleep)}html[data-theme="light"] .mode-panel.mode-sleep{background:linear-gradient(110deg,#f3f5ff,#fff 48%)}
.mode-controls button[data-mode=sleep].selected{background:#929cfb22;border-color:var(--sleep);color:#d5d9ff}html[data-theme="light"] .mode-controls button[data-mode=sleep].selected{background:#edf0ff;border-color:var(--sleep);color:#4a5f9f}
#inertia-options button[data-mode=sleep]{border-color:#515b9a;color:#d5d9ff}html[data-theme="light"] #inertia-options button[data-mode=sleep]{background:#edf0ff;border-color:#bcc7ef;color:#4a5f9f}
.sleep-separate{margin-top:8px;color:var(--sleep);font-size:12px}html[data-theme="light"] .sleep-separate{color:#536da9}
.dynamics-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.transition-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
.history-view{max-width:1120px;margin:6px auto 35px}.history-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin:10px 2px 16px}.history-head h2{margin:5px 0;font-size:24px}.history-head p{margin:6px 0 0}.history-head label{color:var(--muted);font-size:12px}.history-head select{display:block;min-width:180px;margin-top:6px;background:var(--panel);border:1px solid var(--border);border-radius:8px;color:var(--text);padding:8px 10px}.history-summary{color:var(--muted);font-size:12px;margin:0 3px 10px}.history-list{max-height:calc(100vh - 330px);min-height:180px;overflow:auto;border-radius:14px;padding:8px 20px 15px}.history-day-title{position:sticky;top:0;z-index:1;background:var(--panel);color:var(--muted);font-size:12px;font-weight:700;text-transform:capitalize;margin:0;padding:15px 4px 9px;border-bottom:1px solid var(--border)}.history-item{position:relative;display:flex;gap:15px;padding:12px 6px 13px 4px;border-bottom:1px solid var(--border)}.history-marker{position:relative;z-index:1;flex:none;width:12px;height:12px;margin:5px 0 0 1px;border-radius:50%;background:var(--mode-color);box-shadow:0 0 0 4px color-mix(in srgb,var(--mode-color) 16%,transparent)}.history-item:not(:last-child) .history-marker:after{content:"";position:absolute;top:16px;left:5px;width:2px;height:calc(100% + 20px);background:var(--border)}.history-content{flex:1;min-width:0}.history-item-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.history-item-top time{font-variant-numeric:tabular-nums;font-weight:650;color:var(--text)}.history-duration{color:var(--muted);font-size:12px;white-space:nowrap}.history-item-meta{display:flex;gap:12px;align-items:center;margin-top:5px;font-size:12px}.history-mode{font-weight:700}.history-task{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-empty{padding:40px 10px;text-align:center;color:var(--muted)}
@media(max-width:1000px){.dynamics-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.transition-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.history-head{align-items:stretch;flex-direction:column;gap:12px}.history-head select{width:100%}.history-list{max-height:none;padding:5px 13px 12px}.history-item-meta{align-items:flex-start;flex-direction:column;gap:3px}.history-item-top{align-items:flex-start;flex-direction:column;gap:4px}}

/* Category roots and per-category color themes */
.add-category-button{margin-top:7px}
.category-list{margin-top:0}
.category-list button:before{display:none}
.category-list button{padding-left:9px}
.category-list button.selected{background:color-mix(in srgb,var(--category-color) 16%,transparent);color:var(--text)}
.category-dot{display:inline-block;width:9px;height:9px;flex:none;border-radius:50%;background:var(--category-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--category-color) 18%,transparent)}
.category-empty{font-size:11px;padding:5px 10px}
.category-root{position:absolute;width:205px;min-height:82px;padding:12px 13px;background:color-mix(in srgb,var(--category-color) 14%,var(--panel));border:1px solid color-mix(in srgb,var(--category-color) 70%,var(--border));border-left:5px solid var(--category-color);border-radius:13px;box-shadow:0 10px 22px #0004;cursor:grab;user-select:none}
.category-root:hover{box-shadow:0 0 18px color-mix(in srgb,var(--category-color) 40%,transparent)}
.category-root.selected{outline:2px solid color-mix(in srgb,var(--category-color) 56%,transparent);outline-offset:2px}
.category-root-title{font-size:14px;font-weight:750;line-height:1.3;overflow-wrap:anywhere}
.category-root-title span{color:var(--category-color);margin-right:6px}
.category-root-count{font-size:10px;color:var(--muted);margin-top:8px}
.category-edge{fill:none;stroke:var(--category-color);stroke-width:2;stroke-dasharray:5 5;opacity:.72;pointer-events:none}
.node{border-left:4px solid var(--category-color);background:color-mix(in srgb,var(--category-color) 8%,var(--panel2))}
.node.root{background:color-mix(in srgb,var(--category-color) 15%,var(--panel2))}
.node.needs_action{border-left-color:var(--category-color)}
.node.selected{border-left-color:var(--category-color)}
.category-delete-note{font-size:11px;line-height:1.45}
.inspector .color-field input[type=color],.modal .color-field input[type=color]{width:68px;height:39px;padding:4px;cursor:pointer}
html[data-theme="light"] .category-list button.selected{background:color-mix(in srgb,var(--category-color) 14%,white);color:var(--text)}
html[data-theme="light"] .category-root{box-shadow:0 7px 18px #18223014}
html[data-theme="light"] .node{background:color-mix(in srgb,var(--category-color) 8%,white);border-color:#d1d7e0;border-left-color:var(--category-color)}
html[data-theme="light"] .node.root{background:color-mix(in srgb,var(--category-color) 14%,white)}
html[data-theme="light"] .node.needs_action{border-color:#d94b60;border-left-color:var(--category-color)}
html[data-theme="light"] .node-title{color:#24272d}
html[data-theme="light"] .node-sub{color:#697382}
html[data-theme="light"] .category-root-count{color:#687180}
html[data-theme="light"] .category-edge{opacity:.82}
@media(max-width:850px){.sidebar-label{display:block;margin:12px 5px 5px}.category-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));max-height:96px;overflow:auto;margin-top:7px}.category-list button{min-width:0}}

/* Full-screen editor and process-specific arrows */
#graph-wrap:fullscreen{position:relative}
#graph-wrap:fullscreen #inspector{position:absolute;top:72px;right:15px;bottom:15px;width:min(320px,calc(100vw - 30px));min-height:0;margin:0;z-index:5;background:var(--panel);box-shadow:0 18px 42px #0008}
#graph-wrap:fullscreen.inspector-hidden #inspector{display:none}
@media(max-width:700px){#graph-wrap:fullscreen #inspector{top:110px;bottom:12px;right:12px;width:min(320px,calc(100vw - 24px))}}
#graph-wrap:fullscreen .graph-legend{height:auto;min-height:44px;flex:none}
.graph-legend{height:auto;min-height:39px;padding:7px 15px;gap:12px}
.legend-line.planned{color:#8092aa;border-style:dotted}
.legend-line.attention{color:var(--needs);border-style:dashed}
.legend-line.done{border-top-width:3px;border-style:double}
.uncategorized-label{color:var(--muted)}
#arrow-normal path{fill:none!important;stroke:#8293aa;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#arrow-active path{fill:var(--active)!important;stroke:none}
#arrow-completed path{fill:none!important;stroke:var(--completed);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
#arrow-attention path:first-child{fill:var(--needs)!important;stroke:var(--needs);stroke-width:1.5;stroke-linejoin:round}
#arrow-attention path:last-child{fill:none!important;stroke:var(--panel);stroke-width:1.8;stroke-linecap:round}
.edge-visible{stroke-linecap:round;stroke-linejoin:round}
.edge-visible.normal{stroke:#8293aa;stroke-width:2;stroke-dasharray:2 8}
.edge-visible.active_path{stroke:var(--active);stroke-width:3;stroke-dasharray:12 7;animation:edgeFlow 1.15s linear infinite;filter:drop-shadow(0 0 5px color-mix(in srgb,var(--active) 60%,transparent))}
.edge-visible.completed{stroke:var(--completed);stroke-width:2.8;stroke-dasharray:none}
.edge-visible.needs_action{stroke:var(--needs);stroke-width:2.8;stroke-dasharray:3 4 11 4;animation:attentionPulse 1.4s ease-in-out infinite;filter:drop-shadow(0 0 4px color-mix(in srgb,var(--needs) 45%,transparent))}
.edge-visible.selected{stroke-width:4.5}
.edge-flow-dot{fill:#fff;stroke:var(--active);stroke-width:2;pointer-events:none;filter:drop-shadow(0 0 5px var(--active))}
@keyframes edgeFlow{to{stroke-dashoffset:-38}}
@keyframes attentionPulse{50%{opacity:.5;stroke-width:3.8}}
@media(prefers-reduced-motion:reduce){.edge-visible.active_path,.edge-visible.needs_action{animation:none}.edge-flow-dot{display:none}}

/* Account gate and cloud status */
body:not(.app-ready) .app{visibility:hidden;pointer-events:none}
.auth-gate{position:fixed;inset:0;z-index:20;display:grid;place-items:center;padding:20px;background:var(--bg)}
.auth-card{width:min(410px,100%);border-radius:18px;padding:28px}
.auth-card .brand{margin:0 0 28px}
.auth-card h1{font-size:23px;margin:0 0 8px}
.auth-card p{line-height:1.5}
.auth-card form{display:grid;gap:13px;margin-top:23px}
.auth-card label{display:grid;gap:6px;color:var(--muted);font-size:12px;font-weight:650}
.auth-card input{width:100%;background:#101929;color:var(--text);border:1px solid #34435b;border-radius:9px;padding:11px 12px}
.auth-card form button{margin-top:8px}
.auth-card .link-button{margin-top:15px;padding-left:0}
.auth-card #export-local{display:block;margin-top:6px}
.auth-message{min-height:20px;margin-bottom:0;color:#9dcbb4;font-size:12px}
.auth-message.error{color:#ff8da0}
.sync-status{font-size:11px;color:#9caec7;line-height:1.4;padding:8px 5px}
.account-label{display:block;color:var(--muted);font-size:11px;margin-top:4px;word-break:break-all}
.conflict-actions{flex-wrap:wrap}
html[data-theme="light"] .auth-card input{background:#fff;color:#24272d;border-color:#d8dee7}
@media(max-width:850px){.sidebar-bottom{display:grid}.top-actions{flex-wrap:wrap;justify-content:flex-end}.top-actions .ghost{font-size:11px;padding:7px}.auth-card{padding:22px}}
html[data-theme="light"] #arrow-normal path{stroke:#8793a3}
html[data-theme="light"] #arrow-active path{fill:var(--active)!important}
html[data-theme="light"] #arrow-completed path{fill:none!important;stroke:var(--completed)}
html[data-theme="light"] .edge-visible.normal{stroke:#8793a3}
html[data-theme="light"] .edge-visible.active_path{stroke:var(--active)}
html[data-theme="light"] .edge-visible.completed{stroke:var(--completed)}
html[data-theme="light"] .edge-visible.needs_action{stroke:var(--needs)}
html[data-theme="light"] #graph-wrap:fullscreen #inspector{box-shadow:0 14px 36px #18223032}
@media(max-width:700px){#graph-wrap:fullscreen #inspector{top:auto;left:12px;right:12px;bottom:12px;width:auto;max-height:42vh;min-height:0}}
@media(max-width:700px){#graph-wrap:fullscreen #inspector{height:min(42vh,440px)}}
@media(min-width:701px) and (max-width:1000px){#graph-wrap:fullscreen #inspector{top:112px}}
