/* Only the existing notes surface expands. Writing workspace dimensions remain unchanged. */
.notes-tools{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 20px}.notes-tools .chip-row{margin:0}.notes-view-switch{display:flex;gap:3px;border:1px solid var(--line);padding:3px;border-radius:6px}.notes-view-switch button{padding:7px 12px;color:var(--sub)}.notes-view-switch button[aria-pressed=true]{background:var(--paper);color:var(--ink);box-shadow:0 1px 3px #302d2610}.notes-query-label{display:flex;gap:10px;align-items:center;margin-bottom:18px;color:var(--sub);font-size:13px}.notes-query-label input{max-width:310px;padding:9px 12px;border:1px solid var(--line);border-radius:5px;background:var(--paper);color:var(--ink)}
.story-map{--map-bg:#0f1c20;--map-fg:#e9ddc5;--map-muted:#b6b7aa;--map-line:#3b4540;background:var(--map-bg);color:var(--map-fg);border-radius:9px;overflow:hidden;isolation:isolate;scrollbar-color:#656952 #142126}.story-map ::selection{background:#dac299;color:#142126}.story-map :focus-visible{outline:2px solid #f1d19c;outline-offset:4px}.story-map :where(button){color:inherit;background:none;border:0;border-radius:0;box-shadow:none;font:inherit;cursor:pointer}.story-map button:disabled{opacity:.65}.map-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:24px 28px 18px;border-bottom:1px solid var(--map-line)}.map-heading h2{font-family:var(--serif);font-size:28px;line-height:1.25;font-weight:500;margin:0 0 8px;letter-spacing:.06em}.map-heading p{font-size:13px;color:var(--map-muted);margin:0}.map-motion{padding:9px 13px;border:1px solid #69705f;border-radius:4px;font-size:12px;white-space:nowrap}.map-motion:hover,.map-view-controls button:hover{background:#283831}.map-toolbar{display:flex;gap:24px;padding:16px 28px 8px;align-items:center;flex-wrap:wrap}.map-toolbar label{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--map-muted)}.map-toolbar input,.map-toolbar select{background:#18282c;color:var(--map-fg);border:1px solid #50605b;border-radius:4px;padding:8px 10px;font:inherit;max-width:240px;min-width:0}.map-toolbar input::placeholder{color:#b2b6ab}.map-layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;}.map-stage{position:relative;min-width:0;background:radial-gradient(ellipse at 45% 40%,#24373755,transparent 66%);overflow:hidden}.map-stage canvas{position:absolute;inset:0;width:100%;height:100%;display:block;cursor:crosshair}.map-node-labels{position:absolute;inset:0;pointer-events:none}.map-node{position:absolute;left:0;top:0;pointer-events:auto;font-family:var(--serif);font-size:13px;white-space:nowrap;padding:5px 8px;border-radius:3px;background:#101e21d9;color:#e9ddc5!important;line-height:1.4;border-bottom:1px solid transparent;transition:color .2s,background .2s}.map-node:hover,.map-node[aria-pressed=true]{background:#22322f;border-color:#bb9b65}.map-node-main{font-size:15px;letter-spacing:.04em}.map-stage-caption{position:absolute;left:28px;bottom:18px;margin:0;color:var(--map-muted);font-size:11px;letter-spacing:.08em;pointer-events:none}.map-view-controls{position:absolute;right:20px;bottom:16px;display:flex;gap:4px}.map-view-controls button{padding:7px 9px;font-size:12px;border:1px solid #53605a;border-radius:4px;background:#142327}.map-render-status{position:absolute;left:28px;right:28px;top:30%;font-size:14px;text-align:center}.map-render-status:empty{display:none}.map-detail{border-left:1px solid var(--map-line);padding:24px 22px;min-width:0;max-height:620px;overflow-y:auto}.map-kind{font-size:12px;color:#d3b883;margin:0 0 12px}.map-detail h3{font-family:var(--serif);font-weight:500;font-size:24px;line-height:1.45;overflow-wrap:anywhere;margin:0 0 16px}.map-note-body{font-size:13px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere;max-height:180px;overflow:auto;margin:0 0 18px;color:#d6d3c4}.map-note-actions{display:flex;gap:8px;flex-wrap:wrap}.map-note-actions button{font-size:12px;padding:7px 9px;border:1px solid #657261;border-radius:4px}.map-note-actions button:first-child{background:#d0b27f;color:#1e2925;border-color:#d0b27f}.map-source{font-size:12px;line-height:1.6;color:var(--map-muted);margin:14px 0 24px}.map-detail h4{font-size:13px;font-weight:500;margin:0 0 10px}.map-detail h4 span{color:var(--map-muted);margin-left:5px}.map-relations button{display:flex;width:100%;align-items:center;gap:10px;text-align:left;padding:9px 0;border-bottom:1px solid #31433f;font-size:13px;line-height:1.5}.map-relations button span{color:#bfc1ac;font-size:11px;flex-shrink:0}.map-relations button:hover{color:#ffdfad}.map-relations p,.map-unresolved{font-size:12px;line-height:1.6;color:var(--map-muted)}.map-footer{display:flex;justify-content:space-between;gap:16px;padding:14px 28px;border-top:1px solid var(--map-line);align-items:flex-start}.map-footer p{font-size:11px;color:var(--map-muted);line-height:1.7;margin:0;max-width:52ch}.map-footer .map-count{color:#d1b784;font-variant-numeric:tabular-nums}.map-index{padding:0 28px 18px}.map-index summary{font-size:12px;color:#d0c3aa;cursor:pointer;padding:8px 0}.map-index-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:0 18px}.map-index-items button{display:flex;justify-content:space-between;text-align:left;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #3b4540;font-size:13px}.map-index-items button span{color:var(--map-muted);font-size:11px}.map-index-items button[aria-pressed=true]{color:#f5d498}.map-index-items p{font-size:14px}
@media(min-width:1500px){.map-layout{grid-template-columns:minmax(0,1fr) 290px}.map-stage{}}
@media(max-width:1100px){.map-layout{grid-template-columns:minmax(0,1fr) 225px}.map-detail{padding:22px 16px}.map-stage{}.map-toolbar{gap:12px}.map-toolbar label{gap:8px}}
@media(max-width:760px){.map-layout{display:block}.map-stage{}.map-detail{border-left:0;border-top:1px solid var(--map-line);max-height:none;padding:22px}.map-note-body{max-height:160px}.map-heading{padding:22px}.map-heading h2{font-size:25px}.map-toolbar{padding:14px 22px;display:grid;gap:12px}.map-toolbar label{justify-content:space-between}.map-toolbar input,.map-toolbar select{width:180px}.map-footer{display:block;padding:16px 22px}.map-footer p+p{margin-top:6px}.map-stage-caption{bottom:56px;left:22px}.map-view-controls{left:22px;right:auto}.map-view-controls button{min-height:40px;padding:8px 15px}.map-index{padding:0 22px 18px}.map-node{font-size:12px}.map-note-actions button{min-height:40px}.notes-query-label{align-items:flex-start;flex-direction:column}.notes-query-label input{width:100%;max-width:none}.notes-tools{gap:15px}.notes-tools .chip-row{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){.map-node{transition:none}}

/* Keep dense connection lists inside the map instead of stretching the canvas. */
.map-layout{}.map-detail{min-height:0;max-height:none}.map-stage{}.map-motion{min-height:40px}
@media(min-width:1500px){.map-layout{}}
@media(max-width:760px){.map-layout{}.map-stage{}.map-detail{overflow:visible}}

/* Focused orbit: view navigation never changes the note's identity or stored content. */
.map-heading{padding:18px 24px 14px}.map-heading h2{font-size:25px}.map-heading p{font-size:14px;line-height:1.5}
.map-motion{min-height:44px;font-size:13px}.map-hubs{display:flex;gap:8px;flex-wrap:wrap;padding:14px 24px 0}.map-hubs:empty{display:none}
.map-hubs button{display:flex;gap:9px;align-items:center;min-height:44px;padding:8px 13px;background:#192a2d;border:1px solid #607065;border-radius:5px;font-size:14px}
.map-hubs button:hover,.map-hubs button[aria-pressed=true]{background:#34463c;border-color:#d0b27f;color:#ffe1b0}.map-hubs button:disabled{opacity:.5}
.map-hub-dot,.map-kind-dot{width:10px;height:10px;flex:0 0 10px;border-radius:50%;background:#d5b382;box-shadow:inset -2px -1px 2px #352a1c80}
.kind-人物{background:#83ada0}.kind-设定{background:#91b2c6}.kind-灵感{background:#c89477}.kind-阅读{background:#bdb7a0}.kind-改稿{background:#ba9cab}
.map-toolbar{padding:14px 24px 10px}.map-toolbar input,.map-toolbar select{min-height:44px;font-size:14px}
.map-breadcrumb{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:0 24px 12px;font-size:14px}
.map-breadcrumb button{min-height:44px;padding:8px 12px;background:#18292c;border:1px solid #637365;border-radius:4px;white-space:nowrap}
.map-breadcrumb button:disabled{border-color:transparent;background:transparent;opacity:1;padding-left:0}
.map-current-view{font-weight:600;color:#f0d3a5}.map-view-hint{font-size:13px;color:#bcc4b8;margin-left:auto}
.map-layout{grid-template-columns:minmax(0,1fr) 285px}.map-stage{background:radial-gradient(ellipse at 48% 42%,#31483e75,transparent 75%)}
.map-stage canvas{cursor:pointer}.map-node{min-height:44px;min-width:44px;max-width:142px;font-family:var(--sans,system-ui);font-size:13px;overflow:hidden;text-overflow:ellipsis;padding:9px 10px;border:1px solid #71816b;border-radius:5px;background:#132428f0;color:#f2e8d7!important;line-height:1.4;box-shadow:0 4px 12px #0002;transition:background-color .16s,border-color .16s}
.map-node-main{font-family:var(--serif);font-size:16px;border-color:#bca16b;background:#2a372af0}.map-node:hover,.map-node[aria-pressed=true]{border-color:#ffe3a8;background:#3a493b}
.map-stage-caption{font-size:12px;letter-spacing:0;left:20px;bottom:20px}.map-view-controls button{min-height:44px;font-size:13px}.map-view-controls{right:18px}
.map-detail{display:flex;flex-direction:column;padding:20px 18px;scroll-behavior:smooth}.map-detail h3{font-size:22px;margin:0 0 10px}.map-kind{font-size:12px;margin:0 0 8px;color:#dbc18f}
.map-help{font-size:13px;line-height:1.6;color:#bdc6b8;margin:0 0 12px}.map-related{order:1}.map-selected{order:0;margin-bottom:22px;padding-bottom:18px;border-bottom:1px solid #435348}
[data-map-mode=overview] .map-selected{display:none}.map-note-body{font-size:14px;line-height:1.75;max-height:110px;margin-bottom:12px;color:#e0ded1}
.map-note-actions{gap:6px}.map-note-actions button{font-size:12px;min-height:44px;padding:8px 9px}.map-source{margin:10px 0 0}
.map-related-list{display:grid;gap:7px}.map-neighbor{min-height:52px;display:flex;gap:10px;align-items:center;width:100%;padding:9px 10px;text-align:left;border:1px solid #52675c;border-radius:5px;background:#182b2d}
.map-neighbor>span:nth-child(2){min-width:0;flex:1}.map-neighbor strong{display:block;font-size:14px;font-weight:500;line-height:1.4;overflow-wrap:anywhere}.map-neighbor small{display:block;margin-top:3px;font-size:11px;color:#bcc5b7}
.map-neighbor:hover,.map-neighbor[aria-pressed=true]{border-color:#d5b382;background:#314339}.map-neighbor>span:last-child{color:#d5bd90}
.map-pagination{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;font-size:13px;color:#c1c7b7}.map-pagination button{min-height:44px;padding:8px;border:1px solid #62735f;border-radius:4px}
.map-footer{padding:14px 24px}.map-footer p{font-size:12px}.map-index{padding:0 24px 18px}.map-index summary{min-height:44px;line-height:28px}.map-index-items button{min-height:44px}
@media(min-width:1500px){.map-layout{grid-template-columns:minmax(0,1fr) 300px}}
@media(max-width:1050px){.map-layout{grid-template-columns:minmax(0,1fr) 255px}.map-hubs{gap:6px}.map-hubs button{font-size:13px;padding:8px 10px}.map-detail{padding:18px 14px}}
@media(max-width:760px){.map-heading{padding:18px}.map-heading h2{font-size:23px}.map-hubs{padding:12px 18px 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.map-hubs button{justify-content:flex-start;min-width:0;overflow-wrap:anywhere}
 .map-toolbar{padding:12px 18px;gap:10px}.map-toolbar label{font-size:13px}.map-toolbar input,.map-toolbar select{width:170px;max-width:60%}.map-breadcrumb{padding:0 18px 12px;gap:6px}.map-view-hint{flex-basis:100%;margin:0;font-size:12px}
 .map-layout{display:block}.map-stage{}.map-detail{padding:18px}.map-related-list{grid-template-columns:repeat(2,minmax(0,1fr))}.map-neighbor{padding:8px;gap:7px}.map-neighbor strong{font-size:13px}.map-neighbor>span:last-child{display:none}
 .map-node{font-size:12px;min-height:44px;padding:8px 6px}.map-node-main{font-size:14px}.map-stage-caption{bottom:18px;left:18px;max-width:52%;line-height:1.5}.map-view-controls{right:12px;left:auto;bottom:14px}.map-view-controls button{padding:8px 10px}.map-footer{padding:14px 18px}.map-index{padding:0 18px 16px}
 .map-selected{order:1;margin-top:18px;margin-bottom:0;padding-top:18px;padding-bottom:0;border-bottom:0;border-top:1px solid #435348}.map-related{order:0}}
@media(prefers-reduced-motion:reduce){.map-node{transition:none}.map-detail{scroll-behavior:auto}}
.story-map .map-node{max-width:164px}
.map-detail{overflow:hidden}.map-selected{flex:0 0 auto;margin-bottom:14px;padding-bottom:14px}.map-related{display:flex;flex-direction:column;min-height:0;flex:1}.map-related-list{overflow:auto;min-height:0}.map-related>h3,.map-related>.map-help,.map-related>.map-kind,.map-pagination{flex:0 0 auto}
[data-map-mode=focus] .map-related>h3{display:none}[data-map-mode=focus] .map-related>.map-kind{margin-bottom:5px}
.map-unresolved{max-height:52px;overflow:auto}.map-note-body{max-height:92px}
@media(max-width:760px){.map-detail{overflow:visible}.map-selected{order:0;margin-top:0;margin-bottom:18px;padding-top:0;padding-bottom:18px;border-top:0;border-bottom:1px solid #435348}.map-related{order:1;display:block}.map-related-list{overflow:visible}}
/* Direct manipulation is local presentation only; touch scroll remains available outside the canvas. */
.map-stage canvas{touch-action:none;cursor:default}
.map-node[data-planet]:hover{border-color:#ffe3a8}
.map-footer a{color:#dfc18e;text-underline-offset:3px;margin-left:6px}
.map-legend{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;padding:8px 24px 16px;color:#d8dfd0;font:12px var(--sans,system-ui)}.map-legend span{background:none;display:flex;gap:7px;align-items:center}.map-legend span:before{content:'';width:7px;height:7px;border-radius:50%;background:#d5b382}.map-legend .kind-人物:before{background:#83ada0}.map-legend .kind-设定:before{background:#91c3d2}.map-legend .kind-灵感:before{background:#dc9877}.map-legend .kind-阅读:before{background:#d5c6da}.map-legend .kind-改稿:before{background:#ba9cab}.map-legend small{font-size:12px;color:#bdc6b8;margin-left:auto}.map-stage{background:radial-gradient(ellipse at 28% 35%,#3f54452e,transparent 54%),radial-gradient(ellipse at 78% 72%,#4b3f5826,transparent 58%),#101d22}@media(max-width:760px){.map-legend{padding:8px 18px 16px;gap:10px 14px}.map-legend small{flex-basis:100%;margin:0}}

.map-detail[hidden]{display:none}.story-map:not(.map-info-open) .map-layout{grid-template-columns:minmax(0,1fr)}
.map-node-labels .map-node{pointer-events:none;display:block;min-height:0;min-width:0;max-width:176px;padding:0;border:0;border-radius:0;background:none;box-shadow:none;text-align:center;white-space:normal;overflow:visible;line-height:1.35;text-shadow:0 1px 4px #071317,0 0 8px #071317;user-select:none;transition:opacity .18s}
.map-node-labels .map-node[hidden]{display:none}.map-node-title{display:block;font:500 13px/1.5 var(--sans,system-ui);color:#e7dfce}.map-node-kind{display:block;font:11px/1.5 var(--sans,system-ui);color:#b9c4bc}.map-node-excerpt{display:none}.map-node-selected .map-node-title{color:#ffe1b0;font-size:15px}.map-node-selected .map-node-excerpt{display:block;font:12px/1.55 var(--sans,system-ui);color:#d6ddcf;margin-top:4px}.story-map.map-info-open .map-selected{display:block}
.map-node-compact:not(.map-node-selected) .map-node-kind{display:none}
.map-view-controls [data-map-information][aria-expanded=true]{border-color:#d0b27f;background:#34463c}
@media(max-width:760px){.map-stage-caption{bottom:68px;max-width:calc(100% - 36px)}.map-view-controls{left:18px;right:auto}}
@media(prefers-reduced-motion:reduce){.map-node-labels .map-node{transition:none}}

/* Canvas space follows the viewport; preview labels do not change the graph. */
.map-layout{height:clamp(360px,62dvh,760px);min-height:0}
.map-stage{height:100%;min-height:0}
.map-node-labels .map-node-selected{max-width:220px}
.map-node-preview .map-node-title{font-size:16px}
.map-node-preview .map-node-excerpt{font-size:13px;line-height:1.55}
.map-node-preview{z-index:3}
.map-heading>div,.map-toolbar label{min-width:0}
.map-note-actions button,.map-index-items button{overflow-wrap:anywhere}
.map-legend small{white-space:normal}
@media(max-width:760px){
 .map-layout{height:auto;min-height:0}
 .map-stage{height:clamp(330px,56dvh,500px);min-height:0}
 .map-index-items{grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr))}
 .map-node-preview .map-node-title{font-size:15px}
 .map-node-preview .map-node-excerpt{font-size:12px}
}

.map-options{margin:0;padding:0;border:0}.map-options>summary{display:none}.map-toolbar label{white-space:nowrap;margin:0;font-weight:400;width:auto}.map-toolbar input,.map-toolbar select{width:220px;margin:0}.map-toolbar select{width:240px}.map-legend{margin:0}.map-motion{background:transparent}.map-index summary{background:transparent;border:0}.map-index-items button{border-radius:0}.map-node-compact.map-node-selected .map-node-title{font-size:14px}.map-node-compact.map-node-selected .map-node-excerpt{display:block;font-size:12px}
@media(max-width:760px){.map-options>summary{display:list-item;cursor:pointer;min-height:44px;padding:12px 0;margin:4px 18px;color:var(--map-muted);font-size:13px}.map-toolbar label{width:100%;white-space:normal}.map-toolbar input,.map-toolbar select{width:170px;flex:0 1 62%;max-width:62%}.map-heading p{font-size:13px}.map-hubs button{font-size:13px}.map-breadcrumb{padding-bottom:6px}.map-view-hint{font-size:12px}}

/* Names stay within the orbit. Descriptions have their own non-overlapping space. */
.map-node-labels .map-node{max-width:164px;text-align:center}
.map-node-labels .map-node-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font:500 13px/1.5 var(--sans,system-ui)}
.map-node-labels .map-node-selected .map-node-title,.map-node-labels .map-node-preview .map-node-title{font-size:14px}
.map-preview{display:grid;grid-template-columns:minmax(160px,.32fr) minmax(0,1fr);gap:16px;min-height:104px;align-items:center;border-top:1px solid var(--map-line);padding:16px 24px;background:#142429;color:var(--map-fg)}
.map-preview-title{display:block;font:500 18px/1.45 var(--serif);overflow-wrap:anywhere;color:#f1d7ab}
.map-preview-kind{display:block;font:12px/1.6 var(--sans,system-ui);color:var(--map-muted);margin-top:5px}
.map-preview-body{font:13px/1.8 var(--sans,system-ui);color:#d6dfd2;margin:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
@media(max-width:760px){.map-preview{grid-template-columns:1fr;gap:8px;min-height:150px;padding:16px 18px}.map-preview-title{font-size:17px}.map-preview-kind{margin-top:2px}}
