/* Desktop work area: topology stays in place while the reading dock overlays it. */
:root{--summary-width:240px}
.research-layout,.code-layout>.code-workarea{grid-template-columns:minmax(0,1fr) var(--summary-width)}
.research-layout.summary-collapsed,.code-layout>.code-workarea.summary-collapsed{grid-template-columns:minmax(0,1fr)}
.research-layout>.evidence-tray.node-inspector,.code-workarea>.code-inspector{padding:12px}
.node-inspector .inspector-heading{margin-bottom:12px;padding-bottom:10px}
.node-inspector .inspector-heading h2{font-size:14px;line-height:1.55}
.node-inspector .inspector-section{margin:11px 0}
.node-inspector .inspector-section h3{margin-bottom:5px}
.node-inspector .inspector-prose{font-size:11px;line-height:1.75;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.node-inspector .inspector-actions{margin:10px 0;gap:7px}
.node-inspector .inspector-actions .button{flex:1 1 100%;text-align:left;min-height:34px}
.node-inspector .inspector-wide{display:block;width:100%;text-align:left}
.node-inspector .summary-commit{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:11px ui-monospace,SFMono-Regular,monospace}
.node-inspector .clear-selection{min-height:32px;width:100%;text-align:left;color:#8c7c9f}
.research-layout .evidence-tray .evidence-tiles{gap:7px;margin:11px 0}
.research-layout .evidence-tray .evidence-tile{min-height:57px;padding:8px}
.evidence-tile:disabled{opacity:.5;background:#f6f7fa;box-shadow:none;transform:none}
.region-header>.region-controls{flex-wrap:nowrap;gap:0}
.region-controls .region-action{min-width:36px;padding:4px}
.foundation-pane .foundation-column{padding:9px}
.foundation-pane .foundation-card{padding:9px;margin-bottom:8px;border-color:#e1e8ed;background:#fff}
.foundation-pane .foundation-label{gap:4px;align-items:center}
.foundation-pane .foundation-label>span{font-size:11px;color:#6f8496}
.foundation-pane .foundation-label .text-button{min-height:26px;font-size:10px;padding:3px}
.foundation-pane .foundation-card p{font-size:11px;line-height:1.65;margin:5px 0 0}
.foundation-pane .foundation-actions{gap:4px}
.foundation-pane .foundation-actions .button,.foundation-pane .foundation-actions .text-button{min-height:30px;font-size:11px}
.foundation-pane.is-collapsed .region-header{padding-left:9px;padding-right:9px}
.foundation-pane.is-collapsed .region-header h2{font-size:12px}
.foundation-pane.is-collapsed .foundation-compact-summary{padding:10px 9px;font-size:11px}
.foundation-pane.is-collapsed .foundation-compact-summary p{-webkit-line-clamp:4}
.research-group[data-empty=true] .research-group-body{height:176px!important}
.empty-region{margin:14px 10px;padding:14px 10px;border:1px dashed #cbd3e2;border-radius:8px;background:#ffffffa6;display:flex;flex-direction:column;align-items:flex-start;gap:8px;color:#8693a7}
.empty-region>.empty-region-mark{font-size:20px;line-height:20px;color:#9ba9be}
.empty-region>strong{font-size:12px;color:#71839c;font-weight:500}
.empty-region>p{font-size:11px;line-height:1.6;margin:0}
.empty-region .button{min-height:32px;padding:5px 8px;font-size:11px}
.empty-code-lane{display:flex;align-items:center;gap:14px;margin:4px 14px;padding:7px 11px;border:1px dashed #d5deea;border-radius:7px;max-width:350px;min-height:38px;color:#8b9bb1;font-size:11px;background:#ffffffa6}
.empty-code-lane .text-button{margin-left:auto;min-height:28px;font-size:11px}
.lane-board[data-density=compact] .lane .region-header{height:30px;min-height:30px;padding:0 4px}
.lane-board[data-density=compact] .lane .code-node{padding:6px 10px;gap:3px}
.lane-board[data-density=compact] .lane .code-node .node-summary{-webkit-line-clamp:1}
.research-node,.lane .code-node{transition:border-color .18s,box-shadow .18s,background-color .18s}
.research-node.selected{background:#fcfaff;box-shadow:0 0 0 2px #ab99dc36,0 5px 16px #77609b12}
.lane .code-node.selected{background:#f8fbff;box-shadow:0 0 0 2px #91b6dd35,0 5px 14px #507aa818}
.relation-svg>path{transition:stroke .18s,stroke-opacity .18s,stroke-width .18s}
.relation-svg>path.inherit.selected{stroke:#5d86b7;stroke-width:2.1}
#workspace>#reader{position:absolute;inset:auto 0 0 0;width:auto;max-width:none;height:var(--reader-height,320px);max-height:calc(100% - 44px);margin:0;padding:0;border:1px solid #cbd8e9;border-radius:13px 13px 0 0;box-shadow:0 -12px 35px #3248661e;color:var(--ink);background:#fff;overflow:hidden;z-index:20}
#workspace.has-summary>#reader{right:var(--summary-width)}
#workspace>#reader[open]{display:flex;flex-direction:column;animation:dock-enter .22s cubic-bezier(.22,1,.36,1)}
#workspace>#reader.is-maximized{inset:0;height:100%;max-height:100%;border-radius:13px}
#workspace>#reader.is-modal-reader{position:fixed;inset:6vh 7vw;width:auto;height:88vh;max-height:88vh;border-radius:13px;box-shadow:0 24px 90px #26385045}
#workspace>#reader.is-modal-reader.is-maximized{inset:2vh 2vw;height:96vh;max-height:96vh}
#reader.is-modal-reader>#reader-resize{display:none}
#reader-resize{height:9px;min-height:9px;cursor:row-resize;touch-action:none;display:flex;align-items:center;justify-content:center;background:#f8fbff}
#reader-resize::after{content:"";width:44px;height:3px;border-radius:3px;background:#bfcede;transition:background .18s,width .18s}
#reader-resize:hover::after,#reader-resize:focus-visible::after{width:60px;background:#7998be}
#reader-resize:focus-visible{outline:2px solid #86a4cb;outline-offset:-2px}
#reader .reader-header{position:relative;flex:0 0 auto;min-height:43px;padding:6px 14px;gap:10px;background:#f8fbff}
#reader .reader-header>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
#reader .reader-header>div{flex:none;gap:6px}
#reader .reader-header .button{min-height:30px;padding:5px 9px;font-size:11px}
#reader .reader-body{flex:1 1 auto;min-height:0;padding:16px 20px 22px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
#reader .reader-body:focus{outline:none}
#reader .reader-body>.code-selection-detail{display:block;padding:0;border:0;max-height:none;overflow:visible}
#reader .reader-body>.code-selection-detail>.inspector-heading h2,#reader .reader-body>h2{font-size:17px;margin:0 0 12px;line-height:1.55}
#reader .reader-body>.code-selection-detail .selected-executions{display:block;max-height:none;overflow:visible}
#reader .reader-body>.code-selection-detail .selected-executions .button{max-width:none;white-space:normal}
#reader .reader-body .inspector-record{max-width:100%}
#reader .reader-preview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;align-items:start}
#reader .reader-preview-grid .inspector-preview{margin:0}
#reader .reader-preview-grid .typed-image img{height:180px}
#reader .reader-preview-grid .typed-series svg{max-height:190px}
#reader .reader-preview-grid .typed-table{max-height:200px}
#reader .reader-body>.spec-library{padding:0;margin:0;background:transparent;max-height:none;overflow:visible;border:0}
#reader .spec-library-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(205px,1fr));overflow:visible}
#reader .spec-card{min-width:0;width:100%}
#reader .spec-card strong{white-space:normal;line-height:1.5}
#reader .inspector-credentials{margin-top:12px;padding-top:10px}
#reader .report-library button{padding:14px 16px}
#reader .report-library strong{font-size:15px}
@keyframes dock-enter{from{opacity:.5;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
@media(max-height:780px){.foundation-pane .foundation-card{padding:8px;margin-bottom:7px}.foundation-pane .foundation-card p{line-height:1.6}.node-inspector .inspector-heading{margin-bottom:10px}.node-inspector .inspector-section{margin:9px 0}.node-inspector .inspector-prose{-webkit-line-clamp:3}}
@media(prefers-reduced-motion:reduce){#workspace>#reader[open]{animation:none}.research-node,.lane .code-node,.relation-svg>path,#reader-resize::after{transition:none}}
.code-scope{display:flex;align-items:center;gap:3px;border-right:1px solid var(--line);padding-right:10px;margin-right:3px;flex-shrink:0}.code-scope>span{font-size:11px;color:var(--muted);margin-right:3px}.code-scope .text-button{white-space:nowrap}.relation-record{display:grid;gap:4px;text-align:left;width:100%}.relation-record strong{font-size:12px;line-height:1.5}.relation-record small{font-size:10px;color:var(--muted);font-weight:400;line-height:1.5}.research-code-links{display:grid;gap:7px;max-width:820px;margin:12px 0}.implementation-reference{margin:10px 0}.implementation-reference>span{display:block;font-size:12px;color:var(--muted);margin:5px 0}.research-implementations{border:1px solid var(--line);border-radius:9px;padding:14px;margin:14px 0}.research-implementations legend{font-weight:650;font-size:13px}.implementation-link-row{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:8px;padding:12px 0;border-bottom:1px solid var(--line);margin-bottom:10px}.implementation-link-row label{display:grid;gap:5px;font-size:11px;color:var(--muted);min-width:0}.implementation-link-row input,.implementation-link-row select{min-width:0;width:100%;padding:9px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink)}.implementation-note{grid-column:1}.implementation-link-row>.text-button{align-self:end;min-height:36px}.node-inspector .implementation-reference .evidence-link{max-width:100%}.node-inspector .inspector-section>.evidence-link{display:block;max-width:100%;white-space:normal;overflow-wrap:anywhere}
/* Association context stays visible while individual definitions are inspected. */
.code-layout>.view-tools{flex-wrap:nowrap;gap:8px;min-width:0}
.code-layout .code-scope{flex-shrink:0;gap:3px;padding-right:6px}
.code-layout .code-scope>span{display:none}
.code-layout>.view-tools>.text-button{flex-shrink:0}
.research-association-context{display:flex;align-items:center;gap:6px;min-width:60px;flex:1;margin-left:4px;font-size:11px;white-space:nowrap}
.research-association-context>span{color:#5e4d96;background:#eee9fc;border-radius:5px;padding:3px 5px;flex-shrink:0}
.research-association-context>strong{overflow:hidden;text-overflow:ellipsis;font-weight:600;min-width:0}
.research-association-context>small{font-size:10px;color:var(--muted);flex-shrink:0}
.association-toggle.active{color:#6647a1!important;background:#f1ebfc!important}
.code-node.research-related{background:#f4efff;border-color:#a993d1;box-shadow:0 0 0 1px #b5a1dc30,0 3px 10px #7560a70d}
.code-node.unrelated{opacity:.78}
.code-node.selected,.code-node.research-related.selected{opacity:1;outline:2px solid #236aaf;outline-offset:2px;box-shadow:0 3px 14px #236aaf26}
.code-node .code-meta{min-width:0;flex-wrap:nowrap;gap:6px}
.code-node .code-association{color:#65469c;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}
.code-node.definition-node{border-style:dashed}
.code-node.definition-node[data-kind=unavailable]{background:#fff7e9;border-color:#c59852}
.code-layout>.code-workarea{grid-template-columns:minmax(0,1fr) clamp(294px,25vw,356px)}
.code-layout>.code-workarea.summary-collapsed{grid-template-columns:minmax(0,1fr)}
.code-inspector.node-inspector{display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:12px 0 0}
.code-inspector[hidden]{display:none!important}
.code-inspector>.inspector-heading,.code-inspector>.inspector-association{margin-left:14px;margin-right:14px}
.code-inspector>.inspector-heading{position:relative;padding-right:23px;flex-shrink:0}
.inspector-close{position:absolute;right:0;top:-5px;min-width:28px;min-height:28px;font-size:20px}
.inspector-association{border-left:3px solid #a48acb;background:#f5f0fc;padding:7px 9px;margin:0 0 10px;font-size:11px;line-height:1.5;flex-shrink:0}
.inspector-association>span,.inspector-association>strong,.inspector-association>small{display:block}
.inspector-association>span,.inspector-association>small{color:#776294;font-size:10px}
.inspector-association.not-related{border-color:#a5adb6;background:#f4f5f7}
.inspector-association.not-related>span{color:#66717d}
.code-detail-tabs{display:flex;gap:3px;padding:0 12px 9px;flex-shrink:0;border-bottom:1px solid var(--line)}
.code-detail-tabs>.text-button{font-size:11px;padding:6px 8px;min-height:30px}
.code-detail-tabs>.active{background:#eaf1fa;color:#245f94}
.code-inspector-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:12px 14px 20px;font-size:12px;overflow-wrap:anywhere;scrollbar-gutter:stable}
.code-inspector-body h2{font-size:15px;line-height:1.5;margin:0 0 12px}
.code-inspector-body h3{font-size:12px;line-height:1.5}
.code-inspector-body .inspector-prose{-webkit-line-clamp:unset;display:block}
.code-inspector-body .evidence-record>header h2{font-size:14px}
.code-inspector-body pre{max-width:100%;white-space:pre-wrap;font-size:11px}
.code-inspector-body .reader-preview-grid{grid-template-columns:minmax(0,1fr)}
.code-inspector-body .evidence-actions,.code-inspector-body .review-actions{display:flex;flex-wrap:wrap;gap:6px}
.code-inspector-body .inspector-facts,.code-inspector-body .evidence-facts{grid-template-columns:minmax(60px,auto) minmax(0,1fr)}
.code-inspector-body table{font-size:10px;max-width:100%;table-layout:fixed}
.code-inspector-body td,.code-inspector-body th{overflow-wrap:anywhere}
.code-detail-back{margin-bottom:10px}
.snapshot-badge{display:inline-block;font-size:10px;color:#7b6548;background:#fff3dd;padding:3px 5px;border-radius:4px;margin-left:6px}
@media(min-width:1450px){.research-association-context>strong{font-size:12px}}

.code-node .definition-state{flex-shrink:0;font-size:9px;color:#836a40;white-space:nowrap}
.code-node .definition-state.has-implementation{color:#66717d}
