:root{font-family:"Yu Gothic UI","Meiryo",sans-serif;color:#263747;background:#f6f8fa;font-synthesis:none;font-size:16px;--ink:#263747;--muted:#647588;--line:#dce3ea;--accent:#285777;--light:#ecf3f8;--warn:#856021}*{box-sizing:border-box}body{margin:0;height:100dvh;display:flex;flex-direction:column;overflow:hidden}button,input,select,textarea{font:inherit}button{cursor:pointer;background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:5px;min-height:32px;padding:5px 10px;font-size:14px;white-space:nowrap}button:hover{background:#f0f4f8;border-color:#adbdca}button:disabled{opacity:.4;cursor:default}button.primary{background:var(--accent);border-color:var(--accent);color:white}button.danger{color:#ac3b35}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:2px solid #3781b4;outline-offset:2px}input,select,textarea{color:var(--ink);border:1px solid #cad4df;background:#fff;border-radius:4px;padding:7px 9px;font-size:14px;min-width:0}textarea{resize:vertical;line-height:1.6;width:100%}input[type=checkbox]{accent-color:var(--accent)}[hidden]{display:none!important}.toolbar{z-index:5;background:#fff;border-bottom:1px solid var(--line);flex:none}.bar-main,.bar-sub{display:flex;align-items:center;gap:12px;padding:10px 20px}.bar-main{padding-bottom:8px}h1{font-size:17px;letter-spacing:.03em;font-weight:650;margin:0 10px 0 0;white-space:nowrap}h1 span{font-weight:400;color:var(--muted);margin-left:5px}.search-wrap{position:relative;max-width:280px;flex:1}.search-wrap input{width:100%;height:33px}.search-results{position:absolute;top:39px;left:0;width:380px;max-height:360px;overflow:auto;background:white;border:1px solid var(--line);box-shadow:0 8px 24px #24384c20;border-radius:6px;z-index:20;padding:5px}.search-results button{display:block;width:100%;border:0;text-align:left;white-space:normal;line-height:1.6}.search-results small{display:block;color:var(--muted)}#save-status{font-size:12px;color:var(--muted);margin-left:auto;white-space:nowrap}#save-status.error{color:#ac3b35}.bar-sub{padding-top:0;padding-bottom:9px;justify-content:space-between;gap:8px}#filters{display:flex;gap:3px;overflow:auto}#filters button{border-color:transparent;padding:5px 11px}#filters button[aria-pressed=true]{background:var(--light);color:#244f70;font-weight:650;border-color:#ccdae5}.tools{display:flex;gap:5px;align-items:center}.tools button{padding-inline:8px}.separator{height:18px;border-left:1px solid var(--line);margin:0 3px}#workspace{display:flex;flex:1;min-height:0;position:relative}#canvas{flex:1;position:relative;overflow:hidden;touch-action:none;background-image:radial-gradient(#d8e0e8 .8px,transparent .8px);background-size:20px 20px;outline:none;cursor:grab}#canvas.panning{cursor:grabbing}#world{position:absolute;inset:0;transform-origin:0 0;pointer-events:none}#nodes{position:absolute;inset:0;pointer-events:none}#edges{position:absolute;overflow:visible;width:1px;height:1px;pointer-events:none}.edge-line{fill:none;stroke:#93a6b7;stroke-width:1.8;marker-end:url(#arrow);pointer-events:none}.edge-hit{fill:none;stroke:transparent;stroke-width:20;pointer-events:stroke;cursor:pointer}.edge-label{font-size:12px;fill:#647588;paint-order:stroke;stroke:#f6f8fa;stroke-width:5px;stroke-linejoin:round;pointer-events:none}.edge.conditional .edge-line{stroke-dasharray:7 4}.edge.reference .edge-line{stroke-dasharray:3 5}.edge.satisfied .edge-line{stroke:#43806e}.edge.selected .edge-line,.edge.path .edge-line{stroke:#356a92;stroke-width:2.8}.edge.dim{opacity:.18}.node{position:absolute;width:304px;height:132px;background:#fff;border:1px solid #cbd6e0;border-radius:7px;box-shadow:0 2px 4px #26374706;pointer-events:auto;padding:10px 14px;cursor:grab;user-select:none;touch-action:none;display:flex;flex-direction:column;gap:5px}.node:hover{border-color:#8aa6ba}.node.selected{border-color:var(--accent);box-shadow:0 0 0 2px #28577725}.node.path{border-color:#92b0c5}.node.dim{opacity:.28}.node[data-status="候補"]{border-style:dashed}.node-meta{font-size:12px;color:var(--muted);display:flex;justify-content:space-between;line-height:16px}.node-title{font-size:16px;font-weight:650;line-height:1.45;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.node-content{font-size:14px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:40px;color:#536476}.node-bottom{font-size:12px;line-height:16px;display:flex;align-items:center;gap:8px;color:var(--muted);margin-top:auto}.state{color:#3b5266}.state.active{color:#285777;font-weight:650}.state.done{color:#37705a}.warning{color:var(--warn)}.port{position:absolute;width:13px;height:13px;min-height:0;border:2px solid #7794ab;background:#fff;border-radius:50%;padding:0;top:59px;cursor:crosshair;z-index:2}.port.in{left:-7px}.port.out{right:-7px}.port:hover{background:#285777;border-color:#285777;transform:scale(1.25)}.hidden-parent{padding:0;border:0;font-size:12px;background:transparent;color:#356a92;min-height:0;margin-left:auto}.canvas-controls{position:absolute;left:20px;bottom:18px;display:flex;gap:0;box-shadow:0 2px 8px #2637470b}.canvas-controls button{border-radius:0;min-width:36px}.canvas-controls button:first-child{border-radius:5px 0 0 5px}.canvas-controls button:last-child{border-radius:0 5px 5px 0}.canvas-controls button+button{border-left:0}#empty{position:absolute;inset:45% 0 auto;text-align:center;color:var(--muted);font-size:15px}footer{display:flex;gap:20px;align-items:center;padding:7px 20px;border-top:1px solid var(--line);background:#fff;min-height:34px;font-size:12px;color:var(--muted)}footer label{margin-left:auto;display:flex;align-items:center;gap:4px;white-space:nowrap}#panel{width:390px;flex:none;overflow:auto;background:#fff;border-left:1px solid var(--line);padding:0 18px 20px;z-index:4}.panel-heading{position:sticky;top:0;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:15px 0 12px;border-bottom:1px solid var(--line);margin-bottom:14px;z-index:3}.panel-heading h2{font-size:16px;margin:0}.panel-heading small{color:var(--muted);font-weight:400;margin-left:8px}.field{display:flex;flex-direction:column;gap:5px;margin-bottom:12px;font-size:13px;color:#536476}.field input,.field select{width:100%}.row{display:grid;grid-template-columns:1fr 1fr;gap:10px}.field-help,.note{font-size:12px;color:var(--muted);line-height:1.7;margin:4px 0 12px}.section-title{margin:20px 0 10px;padding-top:14px;border-top:1px solid var(--line);font-size:14px;font-weight:650}.check-row{display:flex;gap:7px;align-items:flex-start;font-size:14px;margin:9px 0;line-height:1.55}.check-row input[type=checkbox]{margin-top:5px;flex:none}.check-row .text{flex:1;min-width:0}.check-row input[type=text]{width:100%}.small-btn{font-size:12px;padding:3px 6px;min-height:26px}.action-row{display:flex;gap:7px;flex-wrap:wrap;margin:12px 0}.preview-text{border-left:3px solid #adc0cf;padding:7px 10px;line-height:1.7;font-size:14px;color:#42576a;background:#f7f9fb;white-space:pre-wrap;overflow-wrap:anywhere}.requirements{background:#f7f9fb;padding:10px;font-size:13px;line-height:1.7;border-radius:4px}.requirements ul{padding-left:18px;margin:4px 0}.dep-row{font-size:13px;line-height:1.7;border-bottom:1px solid #edf0f3;padding:8px 0;display:flex;align-items:center;gap:7px}.dep-row button{white-space:normal;text-align:left;flex:1;font-size:13px;border:0;background:#f7f9fb}.dep-row .result{font-size:12px;white-space:nowrap}.pill{font-size:12px;padding:2px 6px;border-radius:3px;background:var(--light);color:#355973}.tag-list{display:flex;flex-wrap:wrap;gap:9px}.tag-list label{font-size:13px;display:flex;align-items:center;gap:4px}.wide{width:100%}dialog{border:1px solid #cbd6e0;border-radius:9px;padding:24px;width:min(500px,calc(100% - 24px));max-height:85dvh;overflow:auto;color:var(--ink);box-shadow:0 18px 70px #26374728}dialog::backdrop{background:#1e33434a}dialog h2{font-size:18px;margin:0 0 14px}dialog p{font-size:14px;line-height:1.8;white-space:pre-wrap}dialog .action-row{justify-content:flex-end;margin-bottom:0}dialog li{font-size:14px;line-height:1.9;margin-bottom:5px}#toast{position:fixed;bottom:53px;left:50%;transform:translateX(-50%);background:#263e53;color:white;border-radius:5px;padding:11px 17px;font-size:14px;max-width:80%;z-index:30;box-shadow:0 4px 15px #26374725}#toast.error{background:#854831}.form-error{color:#ad3933;font-size:13px;line-height:1.6}.edge-draft{fill:none;stroke:#285777;stroke-width:2;stroke-dasharray:6 4}.selection-note{padding:8px 10px;font-size:13px;background:var(--light);line-height:1.7}.connection-banner{position:absolute;top:14px;left:50%;transform:translateX(-50%);padding:8px 14px;background:#285777;color:#fff;border-radius:4px;font-size:13px;pointer-events:none}.option-note{font-size:13px;line-height:1.7;color:var(--warn)}
@media(max-width:1180px){.bar-sub{flex-wrap:wrap}.tools{margin-left:auto}.bar-main,.bar-sub{padding-left:14px;padding-right:14px}.footer-hint{display:none}#panel{width:360px}}
@media(max-width:740px){h1{font-size:15px;margin:0}h1 span{display:none}.bar-main{gap:8px;flex-wrap:wrap}.bar-main .search-wrap{max-width:none;min-width:140px}.bar-main #save-status{order:4;margin-left:0}.bar-main #help{margin-left:auto}#filters{width:100%}#filters button{padding:5px 9px;font-size:13px}.tools{width:100%;overflow:auto;margin:0}.tools button{font-size:13px}.bar-sub{padding-bottom:7px}.search-results{width:min(350px,80vw)}#panel{position:absolute;right:0;top:0;bottom:0;width:min(390px,94vw);box-shadow:-5px 0 18px #26374712}footer{padding:6px 10px;gap:8px}footer label{font-size:11px}.node{font-size:16px}.canvas-controls{left:12px;bottom:12px}}


.tools .history-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;min-width:36px;padding:5px}
.history-icon svg{display:block;pointer-events:none}
.task-number{font-family:ui-monospace,Consolas,monospace;white-space:pre;min-width:5ch;flex-shrink:0}.series-editor{padding:12px 0;border-bottom:1px solid #dce5ed}.series-editor button{margin-right:8px}.number-editor{padding:10px;background:#f3f7fb;border-radius:8px;margin:10px 0}
.synthesis-result{padding:12px;background:#fff1dd;border:1px solid #efd1a5;border-radius:5px;margin-bottom:10px}.synthesis-result strong{display:block;font-size:15px;line-height:1.8}.synthesis-result .note{white-space:pre-line;margin:6px 0 0}.synthesis-material{border:1px solid #dce5ed;border-radius:5px;margin:12px 0;padding:12px}.synthesis-material legend{font-size:14px}.source-link{display:block;font-size:12px;margin:6px 0;color:#285777}

/* Task silhouettes preserve the existing 304 x 132 connection geometry. */
.node[data-type="周回"]{border-radius:0}
.node[data-type="強化"]{border-radius:999px;padding-inline:32px}
.node[data-type="合成"]{background:transparent;border:0;border-radius:0;box-shadow:none;padding:19px 28px 18px;gap:2px;align-items:center;--shape-fill:var(--node-fill);--shape-stroke:var(--node-border)}
.node[data-type="合成"] .task-shape{position:absolute;inset:0;width:304px;height:132px;overflow:visible;pointer-events:none;z-index:-1}
.node[data-type="合成"]{isolation:isolate}
.task-shape polygon{fill:var(--shape-fill);stroke:var(--shape-stroke);stroke-width:1.5;stroke-linejoin:round}
.node[data-type="合成"] .node-meta{justify-content:center;width:100px}
.node[data-type="合成"] .node-meta>span:first-child{display:none}
.node[data-type="合成"] .node-title{max-width:205px;text-align:center;flex-shrink:0}
.node[data-type="合成"] .node-content{min-height:20px;max-width:240px;-webkit-line-clamp:1;text-align:center;flex-shrink:0;font-size:13px}
.node[data-type="合成"] .node-bottom{max-width:165px;justify-content:center;gap:5px;white-space:nowrap;font-size:11px}
.node[data-type="合成"] .hidden-parent{font-size:10px}
.node[data-type="合成"][data-status="候補"] .task-shape polygon{stroke-dasharray:6 4}
.node[data-type="合成"]:hover{--shape-stroke:#8aa6ba}
.node[data-type="合成"].selected,.node[data-type="合成"].path{--shape-stroke:#285777}
.node[data-type="合成"].selected .task-shape polygon{stroke-width:3}

/* Content stays inside the sloping edges; compact tasks share a stable center. */
.node-copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.node .port{top:calc(50% - 6.5px)}
.node[data-type="強化"]{padding:10px 32px;gap:4px}
.node[data-type="強化"] .node-title{font-size:14px;white-space:normal;overflow:visible}
.node[data-type="強化"] .node-content{min-height:0;font-size:13px;line-height:18px}
.node[data-type="強化"] .node-bottom{margin-top:0}
.node[data-type="合成"]{padding:0;display:block}
.node[data-type="合成"] .task-shape{width:100%;height:100%}
.node[data-type="合成"] .node-meta{position:absolute;top:17%;left:50%;transform:translateX(-50%);width:auto;white-space:nowrap}
.node[data-type="合成"] .node-copy{position:absolute;left:19%;width:62%;top:50%;transform:translateY(-50%);gap:3px;text-align:center}
.node[data-type="合成"] .node-title{font-size:14px;line-height:21px;max-width:none;width:100%;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
.node[data-type="合成"] .node-content{font-size:13px;line-height:18px;max-width:none;width:100%;min-height:0;display:block;overflow:visible;overflow-wrap:anywhere}
.node[data-type="合成"] .node-bottom{position:absolute;bottom:21%;left:50%;transform:translateX(-50%);width:max-content;max-width:none;margin:0;font-size:12px;line-height:16px}

.node[data-type="強化"] .node-content{display:block;overflow:visible;overflow-wrap:anywhere}.node[data-type="強化"] .node-title{overflow-wrap:anywhere}

.node-duration{font-size:13px;line-height:18px;color:#536476}

.node[data-type="周回"] .node-content{display:block;white-space:pre-wrap;overflow:visible;overflow-wrap:anywhere;min-height:0;line-height:20px}.node[data-type="周回"]>.node-copy,.node[data-type="周回"]>.node-meta,.node[data-type="周回"]>.node-bottom{flex-shrink:0}

/* All types use one measured footprint and the same text columns. */
.node[data-type]{display:grid;grid-template-rows:16px 1fr 16px;align-items:stretch;padding:12px 56px;gap:4px}
.node[data-type] .node-meta{position:static;transform:none;justify-content:space-between;width:auto;max-width:none;white-space:pre;line-height:16px}
.node[data-type] .node-meta>span:first-child{display:block}
.node[data-type] .node-copy{position:static;transform:none;width:auto;min-width:0;justify-content:center;text-align:left;gap:3px}
.node[data-type] .node-title{font-size:14px;line-height:22px;width:auto;max-width:none;text-align:left;white-space:pre;overflow:visible;text-overflow:clip;overflow-wrap:normal}
.node[data-type] .node-content{font-size:14px;line-height:20px;display:block;min-height:0;max-width:none;width:auto;white-space:pre;overflow:visible;overflow-wrap:normal;text-align:left}
.node[data-type] .node-bottom{position:static;transform:none;width:auto;max-width:none;margin:0;justify-content:flex-start;white-space:nowrap;font-size:12px;line-height:16px;gap:8px}
.node[data-type="合成"] .task-shape{width:100%;height:100%}

/* High priority marker: separate from status fill and connection ports. */
.node .priority-label{position:absolute;left:24px;top:-1px;transform:none;width:14px;height:calc(100% + 2px);border-radius:0;background:rgb(255,0,0);pointer-events:none}

.synthesis-preparation{display:grid;gap:6px;margin:10px 0 14px}.synthesis-preparation strong{font-size:13px}

/* Fill the available card area with readable typography. */
.node[data-type] .node-title{font-size:22px;font-weight:700;line-height:28px}
.node[data-type] .node-content{font-size:16px;line-height:22px}
.node[data-type] .node-duration{font-size:15px;line-height:18px}
.node[data-type] .node-bottom{font-size:13px}

.carry-item-input{display:flex;min-width:0}.carry-item-input input{flex:1;min-width:0;border-radius:4px 0 0 4px}.carry-item-input .carry-item-options{flex:0 0 56px;width:56px;padding:6px 2px;border-left:0;border-radius:0 4px 4px 0}

#canvas{cursor:default}#canvas.panning,#canvas.panning *{cursor:grabbing!important}.selection-marquee{position:absolute;border:1px solid #3286b8;background:#3286b81c;pointer-events:none;z-index:3}

.node-title .review-label{color:#e00000}

.node[data-type="合成"][data-status="完了"].selected{--shape-stroke:#285777}

/* Compact vertical spacing; rectangles can use more of their inner width. */
.node[data-type]{padding-block:10px;grid-template-rows:18px 1fr 26px;gap:3px}
.node[data-type="周回"],.node[data-type="その他"]{padding-inline:24px}
.node[data-type] .node-title{line-height:32px}
.node[data-type] .node-content{line-height:24px}
.node[data-type] .node-duration{font-size:17px;line-height:22px}
.node[data-type] .node-bottom{font-size:14px;line-height:18px}
.node[data-type] .node-meta{line-height:18px}
.node[data-type="強化"] .node-meta,.node[data-type="合成"] .node-meta{margin-inline:12px}
.node[data-type="強化"] .node-bottom,.node[data-type="合成"] .node-bottom{margin-inline:12px}
.node[data-type="周回"] .priority-label,.node[data-type="その他"] .priority-label{left:8px}

.instance-card{border:1px solid #cad4df;border-radius:7px;padding:12px;margin:12px 0;background:#f7fafc}.instance-card strong{display:block;margin-bottom:10px}.instance-task{display:block;width:100%;text-align:left;white-space:normal;margin-top:7px;line-height:1.5}

/* Mobile viewing surface: only viewer switch, search and import. */
#viewer-toggle{display:none}
body.viewer-mode{height:100dvh;overflow:hidden;overscroll-behavior:none}
.viewer-mode .toolbar{flex:none}
.viewer-mode .bar-main{display:flex;flex-wrap:nowrap;gap:6px;padding:calc(4px + env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) 4px max(6px,env(safe-area-inset-left))}
.viewer-mode .bar-main>*{display:none!important}
.viewer-mode .bar-main>#viewer-toggle,.viewer-mode .bar-main>.search-wrap,.viewer-mode .bar-main>#import{display:block!important}
.viewer-mode #viewer-toggle{font-size:12px;white-space:nowrap;opacity:1;color:#245b73;background:#e5f0f6;border-color:#adc8d7;height:40px;flex:none}
.viewer-mode #viewer-toggle::before{content:'●';color:#257c65;margin-right:4px}
.viewer-mode .search-wrap{flex:1;min-width:0;max-width:none}
.viewer-mode #search{font-size:16px;height:40px}
.viewer-mode #import{height:40px;min-width:44px;flex:none}
.viewer-mode .bar-sub,.viewer-mode footer,.viewer-mode #panel,.viewer-mode .canvas-controls,.viewer-mode .port,.viewer-mode .hidden-parent,.viewer-mode #empty{display:none!important}
.viewer-mode #canvas{cursor:grab;touch-action:none;overscroll-behavior:none}
.viewer-mode .node{cursor:grab}
.viewer-mode .edge-hit{pointer-events:none}
.viewer-mode .search-results{position:fixed;left:6px;right:6px;top:calc(48px + env(safe-area-inset-top));width:auto;max-height:40dvh}
.viewer-mode #toast{bottom:max(10px,env(safe-area-inset-bottom))}

/* Priority bands meet the left edge; destination light follows each silhouette. */
.node[data-type] .priority-label{left:-1px;width:23px;background:var(--priority-color);z-index:0}
.node[data-priority="極高"]{--priority-color:#ff0000}
.node[data-priority="高"]{--priority-color:#ff9500}
.node[data-priority="中"]{--priority-color:#f2c200}
.node[data-priority="やや低"]{--priority-color:#b0bc3c}
.node[data-priority="低"]{--priority-color:#66a879}
.node[data-priority="極低"]{--priority-color:#62aaa5}
.node[data-priority="最低"]{--priority-color:#7ea9c4}
.node[data-priority="目的地"]:not([data-type="合成"]){box-shadow:0 0 5px 3px #ffe34b,0 0 18px 9px #ffe34b99,0 0 30px 12px #ffe34b44}
.node[data-priority="目的地"][data-type="合成"] .task-shape{filter:drop-shadow(0 0 4px #ffe34b) drop-shadow(0 0 10px #ffe34bcc)}

.node[data-type] .priority-label{left:0;top:0;width:100%;height:100%;background:none;fill:var(--priority-color);pointer-events:none}

footer label{flex-shrink:0;white-space:nowrap}footer .condition-display{margin-left:auto}footer .condition-display+label{margin-left:0}

.viewer-mode #panel:not([hidden]){display:block!important;position:absolute;top:auto;left:0;right:0;bottom:0;width:100%;max-height:55dvh;overflow:auto;border:1px solid var(--line);border-radius:12px 12px 0 0;padding:0 16px max(12px,env(safe-area-inset-bottom));box-shadow:0 -4px 20px #26374720}.viewer-mode #panel select{font-size:16px;min-height:44px}.viewer-mode #panel button{min-height:44px}.mobile-task-title{font-weight:650;overflow-wrap:anywhere}

footer .compact-display{margin-left:auto}footer .compact-display+.condition-display{margin-left:0}.compact-node-title{display:none}.node.compact-title .node-meta,.node.compact-title .node-copy,.node.compact-title .node-bottom{visibility:hidden}.node.compact-title .compact-node-title{display:block;position:absolute;top:50%;transform:translateY(-50%);font-weight:700;line-height:1.15;white-space:pre;text-align:center;pointer-events:none;z-index:1}

/* Prevent iOS text selection and callouts on the graph, while keeping form fields editable. */
#canvas,#canvas *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}

#mobile-display-options{display:none}.viewer-mode .bar-main>#mobile-display-options{display:flex!important;align-items:center;justify-content:center;flex:none;width:40px;height:40px;padding:8px}.mobile-display-settings .check-row{min-height:44px;align-items:center;font-size:16px}.mobile-display-settings input[type="checkbox"]{width:20px;height:20px;margin:0 4px 0 0;flex:none}
/* Theme preference is local to this browser, independent of shared task data. */
:root{color-scheme:light;--surface:#fff;--canvas-bg:#f6f8fa;--secondary-surface:#f7f9fb;}
:root[data-theme="dark"]{color-scheme:dark;color:#e6ecf3;background:#161c25;--ink:#e6ecf3;--muted:#adbbcc;--line:#465365;--accent:#376f99;--light:#2b3d50;--warn:#e4bc76;--surface:#202834;--canvas-bg:#161c25;--secondary-surface:#273240;}
html{background:var(--canvas-bg)}
[data-theme="dark"] :is(button,input,select,textarea,dialog,.toolbar,footer,#panel,.panel-heading,.search-results,.port){background:var(--surface);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] button:hover{background:#2d3b4c;border-color:#8ba3bf}
[data-theme="dark"] button.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
[data-theme="dark"] :is(button.danger,.form-error,#save-status.error){color:#ffaba5}
[data-theme="dark"] :is(input,select,textarea){border-color:#59697d}
[data-theme="dark"] #filters button[aria-pressed=true]{color:#c8e6ff;background:#2b3d50;border-color:#647e98}
[data-theme="dark"] #canvas{background-color:var(--canvas-bg);background-image:radial-gradient(#344052 .8px,transparent .8px)}
[data-theme="dark"] .field{color:#c6d2df}
[data-theme="dark"] :is(.source-link,a){color:#a1d4fa}
[data-theme="dark"] :is(.preview-text,.requirements,.dep-row button,.number-editor,.instance-card){background:var(--secondary-surface);color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(.series-editor,.synthesis-material,.dep-row){border-color:var(--line)}
[data-theme="dark"] .synthesis-result{background:#443426;border-color:#94714b}
[data-theme="dark"] .pill{background:#2b3d50;color:#c8e6ff}
[data-theme="dark"] .edge-line{stroke:#a2b4c9}
[data-theme="dark"] .edge-label{fill:#c3cede;stroke:var(--canvas-bg)}
[data-theme="dark"] .edge.satisfied .edge-line{stroke:#8bc9ad}
[data-theme="dark"] :is(.edge.selected,.edge.path) .edge-line{stroke:#a5d7ff}
[data-theme="dark"] #arrow path{fill:#a2b4c9}
[data-theme="dark"] .edge-draft{stroke:#a5d7ff}
[data-theme="dark"] .viewer-mode #viewer-toggle{background:#2b3d50;color:#c7e8ff;border-color:#6386a5}
[data-theme="dark"] .viewer-mode #viewer-toggle::before{color:#95d8b8}
[data-theme="dark"] dialog::backdrop{background:#080e18a8}
.node[data-type="合成"][data-status="未実装"] .task-shape polygon{stroke-width:2.5}
.node[data-status="未実装"]:not([data-type="合成"]){border-width:2px}
.node[data-status="未実装"] .state{font-weight:700}
.node[data-status="実装待ち"] .state{font-weight:650}
.edge.implementation-blocked:not(.selected):not(.path) .edge-line{opacity:.45}
.blocking-cause{white-space:normal;text-align:left;margin-block:4px}
/* Keep the stopping point legible when normal details are hidden by zoom. */
.node.compact-title:is([data-status="未実装"],[data-status="実装待ち"])::after{position:absolute;bottom:8px;left:0;width:100%;text-align:center;font-size:24px;font-weight:700;color:var(--muted);content:attr(data-status)}
.node.compact-title[data-status="実装待ち"]::after{color:var(--muted)}
.mobile-display-settings select{min-height:44px;font-size:16px}



/* Shared status palette: HTML cards and SVG silhouettes use the same colors in both themes. */
:root{
 --task-done:#ACD3B7;
 --task-ready:#F5F7FA;
 --task-unimplemented:#B7A9CB;
 --task-blocked:#9AA6B3;
 --task-running:#FFC9C9;
 --task-spare:#C7EAFC;
}
:root .node{color:#263747;--ink:#263747;--muted:#263747;--line:#dce3ea;--accent:#285777;--light:#ecf3f8;--warn:#684500;--surface:#fff;--node-fill:#fff;--node-border:#63788c;--shape-fill:var(--node-fill);--shape-stroke:var(--node-border)}
:root .node[data-color-state="done"]{--node-fill:var(--task-done)}
:root .node[data-color-state="ready"]{--node-fill:var(--task-ready)}
:root .node[data-color-state="unimplemented"]{--node-fill:var(--task-unimplemented)}
:root .node[data-color-state="blocked"]{--node-fill:var(--task-blocked)}
:root .node[data-color-state="running"]{--node-fill:var(--task-running)}
:root .node[data-color-state="spare"]{--node-fill:var(--task-spare)}
:root .node:not([data-type="合成"]){background:var(--node-fill);border-color:var(--node-border)}
:root .node :is(.node-content,.node-duration,.state){color:#263747}
:root .node .state:is(.active,.done){font-weight:700}
:root .node .port{background:#fff;border-color:#63788c}
:root .node .port:hover{background:#285777;border-color:#285777}
:root .node .hidden-parent{background:transparent;color:#263747;border-color:transparent}
:root .node .hidden-parent:hover{background:#ecf3f8}
:root .node:hover{--node-border:#285777}
:root .node.path{--node-border:#285777}
:root .node.selected{--node-border:#285777}
:root .node.selected:not([data-type="合成"]):not([data-priority="目的地"]){box-shadow:0 0 0 2px #28577755}
/* Preserve destination glow when selected; the outline indicates selection. */
:root .node.selected[data-priority="目的地"]:not([data-type="合成"]){outline:2px solid #285777;outline-offset:1px}



/* Retired tasks use a darker grey in both themes and all task shapes. */
:root .node[data-status="廃止"]{--node-fill:#59616b;--node-border:#414852;color:#fff;--ink:#fff;--muted:#f1f3f5}
:root .node[data-status="廃止"] :is(.node-content,.node-duration,.state,.hidden-parent){color:#f1f3f5}
:root .node[data-status="廃止"] .hidden-parent:hover{background:#414852}
:root .node[data-status="廃止"]:is(:hover,.selected,.path){--node-border:#285777}

.retired-mark{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}
.retired-mark line{stroke:#f1f3f5;stroke-width:3;stroke-linecap:round}
